<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!-- 
created by kowshiga -->
<script>
    $(document).ready(function () {
        $('#skrill_form').bootstrapValidator({
            message: 'Please enter/select a value',
            submitButtons: 'input[type="submit"]'
        });
        $('#active').change(function () {
            var v = $(this).val();
            if (v == 1) {
                $('#account_email').attr('required', 'required');
                $('#skrill_form').bootstrapValidator('addField', 'account_email');
            } else {
                $('#account_email').removeAttr('required');
                $('#skrill_form').bootstrapValidator('removeField', 'account_email');
            }
        });
        var v = <?=$gateway->active;?>;
        if (v == 1) {
            $('#account_email').attr('required', 'required');
            $('#skrill_form').bootstrapValidator('addField', 'account_email');
        } else {
            $('#account_email').removeAttr('required');
            $('#skrill_form').bootstrapValidator('removeField', 'account_email');
        }
    });
</script>
<div class="box">
    <div class="box-header">
        <h2 class="blue"><i class="fa-fw fa fa-cog"></i><?= lang('SMS'); ?></h2>

        <div class="box-icon">
            <ul class="btn-tasks">
                <li class="dropdown"><a href="<?= admin_url('system_settings/paypal') ?>" class="toggle_up"><i
                            class="icon fa fa-paypal"></i><span
                            class="padding-right-10"><?= lang('paypal'); ?></span></a></li>
                <li class="dropdown"><a href="<?= admin_url('system_settings/skrill') ?>" class="toggle_down"><i
                            class="icon fa fa-bank"></i><span class="padding-right-10"><?= lang('skrill'); ?></span></a>
                </li>
                <li class="dropdown"><a href="<?= admin_url('system_settings/gateway') ?>" class="toggle_down"><i
                            class="icon fa fa-envelope"></i><span class="padding-right-10"><?= lang('SMS'); ?></span></a>
                </li>
            </ul>
        </div>
    </div>
    <div class="box-content">
        <div class="row">
            <div class="col-lg-12">

                <p class="introtext"><?= lang('update_info'); ?></p>

                <?php $attrib = ['role' => 'form', 'id="skrill_form"'];
                echo admin_form_open('system_settings/gateway', $attrib);
                ?>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <?= lang('activate','active'); ?>
                            <?php
                            $yn = ['1' => 'Yes', '0' => 'No'];
                            echo form_dropdown('active', $yn, $gateway->active, 'class="form-control tip" required="required" id="active"');
                            ?>
                        </div>

                        <div class="form-group">
                            <?= lang('Authkey', 'active'); ?>
                            <?php echo form_input('authkey', $gateway->authkey, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('authkey_tip'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Url', 'active'); ?>
                            <?php echo form_input('url', $gateway->url, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('url_tip'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Text', 'active'); ?>
                            <?php echo form_input('text', $gateway->text, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Text'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Sender', 'active'); ?>
                            <?php echo form_input('sender', $gateway->authkey, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Sender'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Schedule_Date_Time', 'Schedule_Date_Time'); ?>
                            <?php echo form_input('schedule', $gateway->schedule, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Schedule_Date_Time'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Flash', 'Flash'); ?>
                            <?php echo form_input('flash', $gateway->flash, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Flash'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Unicode', 'Unicode'); ?>
                            <?php echo form_input('unicode', $gateway->unicode, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Unicode'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Route', 'Route'); ?>
                            <?php echo form_input('route', $gateway->route, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Route'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Campaign', 'Campaign'); ?>
                            <?php echo form_input('campaign', $gateway->campaign, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Campaign'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Base_url', 'Base_url'); ?>
                            <?php echo form_input('base_url', $gateway->base_url, 'class="form-control tip" id="account_email"'); ?>
                            <small class="help-block"><?= lang('Please Type Your Base url'); ?></small>
                        </div>
                         <div class="form-group">
                            <?= lang('Country_Code','Country_Code'); ?>
                            <?php
                            $yn = ['0' => 'International(0)', '91' => 'India(91)', '1' => 'USA(1)'];
                            echo form_dropdown('country', $yn, $gateway->country, 'class="form-control tip" required="required"');
                            ?>
                        </div>

                        

                    </div>
                </div>
                <div style="clear: both; height: 10px;"></div>
                <div class="form-group">
                    <?php echo form_submit('update_settings', lang('update_settings'), 'class="btn btn-primary"'); ?>
                </div>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<!-- <div class="box">
    <div class="box-header">
        <h2 class="blue"><i class="fa-fw fa fa-print"></i><?= lang('Gateway'); ?></h2>
    </div>
    <div class="box-content">
        <div class="row">
            <div class="col-lg-12">
                <p><?= lang('enter_info'); ?></p>
                <?php echo admin_form_open('system_settings/gateway');?>

                <div class="col-md-6">
                    
                   
                    <div class="path" style="display:none;">
                        <div class="form-group">
                        <?= lang('url', 'url'); ?> <strong>*</strong>
                            <?= form_input('url', set_value('url'), 'class="form-control" id="path"'); ?>
                            
                        </div>
                    </div>
                    <div class="path" style="display:none;">
                        <div class="form-group">
                        <?= lang('username', 'username'); ?> <strong>*</strong>
                            <?= form_input('username', set_value('username'), 'class="form-control" id="username"'); ?>
                            
                        </div>
                    </div>
                    <div class="path" style="display:none;">
                        <div class="form-group">
                        <?= lang('password', 'password'); ?> <strong>*</strong>
                            <?= form_input('password', set_value('password'), 'class="form-control" id="password"'); ?>
                           
                        </div>
                    </div>

                    <div class="form-group">
                        <?php echo form_submit('gateway', $this->lang->line('submit'), 'class="btn btn-primary"');?>
                    </div>
                </div>
                <?php echo form_close();?>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function() {
        $('#type').change(function () {
            var type = $(this).val();
            if (type == 'network') {
                $('.network').slideDown();
                $('.path').slideUp();
            } else {
                $('.network').slideUp();
                $('.path').slideDown();
            }
        });
        var type = $('#type').val();
        if (type == 'network') {
            $('.network').slideDown();
            $('.path').slideUp();
        } else {
            $('.network').slideUp();
            $('.path').slideDown();
        }
    });
</script>
 -->