<section class="content-header">
    <h1><?= __('Account market plugin settings') ?></h1>
</section>

<section class="content">

    <div class="box box-default">
        <form data-ajax class="form-focus" action="<?= admin_url_to('/account-market/config') ?>" 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><?= __('Settings') ?></h5>
                        </div>

                        <div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label" for="remove-items"><?= __('Remove items') ?>?</label>
                                        <div>
                                            <input class="form-control toggle" type="checkbox"<?= config('account-market.remove_items', false) ? ' checked' : '' ?> id="remove-items" value="1" name="remove_items" />
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label" for="change-email"><?= __('Change e-mail') ?>?</label>
                                        <div>
                                            <input class="form-control toggle" type="checkbox"<?= config('account-market.change_email', false) ? ' checked' : '' ?> id="change-email" value="1" name="change_email" />
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label" for="minutes-expire"><?= __('Minutes expire') ?></label>
                                        <div>
                                            <input class="form-control" type="text" value="<?= config('account-market.minutes_expire', 60) ?>" id="minutes-expire" name="minutes_expire" />
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label" for="tax"><?= __('Tax') ?></label>
                                        <div>
                                            <input class="form-control" type="text" value="<?= config('account-market.tax') ?>" id="tax" name="tax" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="section">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
                            <h5><?= __('Gateways') ?></h5>
                        </div>

                        <div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
                            <?php foreach ($gateways as $gateway => $config): ?>
                                <?php if ($config['active']): ?>
                                    <div style="width:50%;margin-bottom:5px;float:left">
                                        <input<?= in_array($gateway, config('account-market.gateways', [])) ? ' checked' : '' ?> type="checkbox" name="gateways[]" id="gateway-<?= $gateway ?>" value="<?= $gateway ?>" /> <label for="gateway-<?= $gateway ?>"><?= $gateway ?></label>
                                    </div>
                                <?php endif ?>
                            <?php endforeach ?>
                        </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>