<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3><?= __('Add hour package') ?></h3>
</div>

<form data-ajax action="<?= admin_url_to('/exchange/hour-packages/add') ?>" method="post">
    <?= csrf_field() ?>

    <div class="modal-body">
        <div class="row">
            <div class="col-md-10">
                <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-2">
                <div class="form-group">
                    <label class="control-label" for="active"><?= __('Active') ?>?</label>

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

        <div class="form-group">
            <label class="control-label" for="desc"><?= __('Description') ?></label>
            <textarea class="form-control" name="desc" id="desc"></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="form-group">
            <label class="control-label" for="hours"><?= __('Hours') ?> <span class="required">*</span></label>
            <input class="form-control" type="text" name="hours" id="hours" />
        </div>

        <fieldset>
            <legend>VIP</legend>

            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label" for="viptype"><?= __('Type') ?></label>
                        <select class="form-control" id="viptype" name="viptype">
                            <option value=""></option>
                            <?php foreach (config('vip.types', []) as $key => $value): ?>
                                <option value="<?= $key ?>"><?= $value ?></option>
                            <?php endforeach ?>
                        </select>
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label" for="vipdays"><?= __('Days') ?></label>
                        <input class="form-control" type="text" id="vipdays" name="vipdays" />
                    </div>
                </div>
            </div>
        </fieldset>

        <?php if (!empty($coins)): ?>
            <fieldset>
                <legend><?= __('Coins') ?></legend>
                <div class="row">
                    <?php foreach ($coins as $coin): ?>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label" for="coin-<?= $coin['column'] ?>"><?= $coin['name'] ?></label>
                                <input class="form-control" type="text" id="coin-<?= $coin['column'] ?>" name="coins[<?= $coin['id'] ?>]" />
                            </div>
                        </div>
                    <?php endforeach ?>
                </div>
            </fieldset>
        <?php endif ?>

        <fieldset>
            <legend><?= __('Custom') ?></legend>

            <div class="form-group">
                <label class="control-label" for="sql"><?= __('SQL') ?></label>
                <textarea id="sql" name="sql" class="form-control"></textarea>
            </div>
        </fieldset>
    </div>

    <div class="modal-footer" style="margin-top:0">
        <input type="submit" class="btn btn-primary" value="<?= __('Add') ?>" />
    </div>
</form>