<div class="salesloo-file-upload-box">
    <?php if ($files) : ?>
        <?php foreach ((array)$files as $file) : ?>
            <div class="salesloo-file-upload">
                <div class="salesloo-file-upload-column">
                    <span class="dashicons dashicons-menu-alt2" style="cursor:pointer"></span>
                </div>
                <div class="salesloo-file-upload-column">
                    <input type="text" class="regular-text" placeholder="File name" name="file[filename][]" value="<?php echo $file['name']; ?>">
                </div>
                <div class="salesloo-file-upload-column" style="flex:1">
                    <input type="text" class="large-text" placeholder="http://" name="file[fileurl][]" value="<?php echo $file['file']; ?>">
                </div>
                <div class=" salesloo-file-upload-column">
                    <a href="#" class="button salesloo-file-upload-button" data-choose="Choose file" data-update="Insert file URL">Choose
                        file</a>
                </div>
                <div class="salesloo-file-upload-column">
                    <span class="dashicons dashicons-no-alt salesloo-file-upload-remove" style="cursor:pointer" onclick="let el=this.parentNode.parentNode; el.parentNode.removeChild(el);"></span>
                </div>
            </div>
        <?php endforeach; ?>
    <?php endif; ?>
</div>

<button type="button" class="button salesloo-file-upload-add" data-row="
<div class=&quot;salesloo-file-upload&quot;>
    <div class=&quot;salesloo-file-upload-column&quot;>
        <span class=&quot;dashicons dashicons-menu-alt2&quot; style=&quot;cursor:pointer&quot;></span>
    </div>
    <div class=&quot;salesloo-file-upload-column&quot;>
        <input type=&quot;text&quot; class=&quot;regular-text&quot; placeholder=&quot;File name&quot; name=&quot;file[filename][]&quot;>
    </div>
    <div class=&quot;salesloo-file-upload-column&quot; style=&quot;flex:1&quot;>
        <input type=&quot;text&quot; class=&quot;large-text&quot; placeholder=&quot;http://&quot; name=&quot;file[fileurl][]&quot;>
    </div>
    <div class=&quot; salesloo-file-upload-column&quot;>
        <a href=&quot;#&quot; class=&quot;button salesloo-file-upload-button&quot; data-choose=&quot;Choose file&quot; data-update=&quot;Insert file URL&quot;>Choose
            file</a>
    </div>
    <div class=&quot;salesloo-file-upload-column&quot;>
        <span class=&quot;dashicons dashicons-no-alt salesloo-file-upload-remove&quot; style=&quot;cursor:pointer&quot; onclick=&quot;let el = this.parentNode.parentNode; el.parentNode.removeChild(el);&quot;></span>
    </div>
</div>">Add File</button>