<section class="content-header">
    <h1><?= __('Import products') ?></h1>

    <div class="actions">
        <a data-ajax class="btn btn-default btn-sm" href="<?= admin_url_to('/webshop/products') ?>"><?= __('List') ?></a>
    </div>
</section>

<section class="content">
    <div class="box box-default">
        <form data-ajax data-upload class="form-focus" action="<?= admin_url_to('/webshop/products/import') ?>" method="post">
            <?= csrf_field() ?>

            <div class="box-body">
                <div class="section">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
                            <h5><?= __('Import') ?></h5>
                        </div>

                        <div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label class="control-label" for="product-shop"><?= __('Shop') ?> <span class="required">*</span></label>
                                        <select class="form-control" name="shop_id" id="product-shop">
                                            <option value=""></option>
                                            <?php foreach ($shops as $shop): ?>
                                                <option value="<?= $shop['id'] ?>"<?= isset($product['shop_id']) && $product['shop_id'] === $shop['id'] ? ' selected="selected"' : '' ?>><?= $shop['name'] ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="categories"><?= __('Categories') ?></span></label>

                                <div>
                                    <?php foreach (config('item.categories') as $code => $category): ?>
                                        <div style="width:33%;margin-bottom:5px;float:left">
                                            <input type="checkbox" name="categories[]" id="categories-<?= $code ?>" value="<?= $code ?>" /> <label for="categories-<?= $code ?>"><?= $category ?></label>
                                        </div>
                                    <?php endforeach ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-3" style="padding-left:15px">
                        <input type="submit" class="btn btn-primary" value="<?= __('Import') ?>" />
                    </div>
                </div>
            </div>
        </form>
    </div>
</section>