<section class="content-header">
    <h1><?= __('Add loot box') ?></h1>

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

<section class="content">
    <div class="box box-default">
        <form data-ajax data-upload class="form-focus" action="<?= admin_url_to('/lootboxes/add') ?>" 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><?= __('Loot Box') ?></h5>
                        </div>

                        <div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label" for="name"><?= __('Name') ?> <span class="required">*</span></label>
                                        <input class="form-control" type="text" name="name" id="name" />
                                    </div>
                                </div>

                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label class="control-label" for="open-type"><?= __('Open type') ?> <span class="required">*</span></label>
                                        <select class="form-control" name="open_type" id="open-type">
                                            <option value="wheel"><?= __('Wheel') ?></option>
                                            <option value="case"><?= __('Case') ?></option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label class="control-label" for="active"><?= __('Active') ?></label>

                                        <div>
                                            <input class="form-control toggle" type="checkbox" id="active" value="1" name="active" />
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="description"><?= __('Description') ?></label>
                                <textarea class="form-control" type="text" name="description" id="description"></textarea>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="image"><?= __('Image') ?></label>
                                <input data-upload-field class="form-control" id="image" type="file" name="image" />
                            </div>

                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label" for="coin"><?= __('Coin') ?> <span class="required">*</span></label>
                                        <select class="form-control" name="coin" id="coin">
                                            <option value=""></option>
                                            <?php foreach (config('coins', []) as $coin): ?>
                                                <option value="<?= $coin['id'] ?>"><?= $coin['name'] ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label" for="amount"><?= __('Amount') ?> <span class="required">*</span></label>
                                        <input class="form-control" type="text" name="amount" id="amount" />
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label" for="expire-date"><?= __('Expire date') ?></label>
                                        <input type="text" data-show-calendar class="form-control" name="expire_date" id="expire-date" />
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label" for="gift-register"><?= __('Gift when register') ?></label>
                                        <input class="form-control" type="text" name="gift_register" id="gift-register" />
                                    </div>
                                </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="<?= __('Save') ?>" />
                    </div>
                </div>
            </div>
        </form>
    </div>
</section>