<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 bodyitem">
    <div class="row no-padding">
        <?php echo form_open('gkpos/settings/save_locale/', array('id' => 'localeConfigForm', 'class' => 'form-horizontal')); ?>
        <fieldset id="config_info">
            <div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
            <ul id="locale_error_message_box" class="error_message_box"></ul>
            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_currency_symbol'), 'currency_symbol', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4 required')); ?>
                <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2'>
                    <?php
                    echo form_input(array(
                        'name' => 'currency_symbol',
                        'id' => 'currency_symbol',
                        'class' => 'form-control input-sm required',
                        'value' => $this->config->item('currency_symbol')));
                    ?>
                </div>
                <div class='checkbox col-lg-2 col-md-2 col-sm-2 col-xs-2'>
                    <label>
                        <?php
                        echo form_checkbox(array(
                            'name' => 'currency_side',
                            'id' => 'currency_side',
                            'value' => 'currency_side',
                            'checked' => $this->config->item('currency_side')));
                        ?>
                        <?php echo $this->lang->line('gkpos_currency_side'); ?>
                    </label>
                </div>
            </div>

            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_currency_decimals'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-3'>
                    <div class="stylish">
                        <span>
                            <input onclick="$(this).closest('div').find('select').slideToggle(110)" class="form-control customernambg" readonly="1" type="text" name="currency_decimals" id="currency_decimals"  value="<?php echo $this->config->item('currency_decimals') ?>" style="left: 0;"/>
                            <select size=15 onclick="$(this).hide().closest('div').find('input').val($(this).find('option:selected').val());" class="customernambg" style="min-height:150px; margin: 0 auto; left:0px; margin-top: -20px">
                                <option value="0" class="btn btn-default btn-lg btn-block text-lowercase">0</option>
                                <option value="1" class="btn btn-default btn-lg btn-block text-lowercase">1</option>
                                <option value="2" class="btn btn-default btn-lg btn-block text-lowercase">2</option>
                            </select>
                        </span>
                    </div>
                </div>
            </div>

            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_tax_decimals'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-3'>
                    <div class="stylish">
                        <span>
                            <input onclick="$(this).closest('div').find('select').slideToggle(110)" class="form-control customernambg" readonly="1" type="text" name="tax_decimals" id="tax_decimals"  value="<?php echo $this->config->item('tax_decimals') ?>" style="left: 0;"/>
                            <select size=15 onclick="$(this).hide().closest('div').find('input').val($(this).find('option:selected').val());" class="customernambg" style="min-height:150px; margin: 0 auto; left:0px; margin-top: -20px">
                                <option value="0" class="btn btn-default btn-lg btn-block text-lowercase">0</option>
                                <option value="1" class="btn btn-default btn-lg btn-block text-lowercase">1</option>
                                <option value="2" class="btn btn-default btn-lg btn-block text-lowercase">2</option>
                                <option value="3" class="btn btn-default btn-lg btn-block text-lowercase">3</option>
                            </select>
                        </span>
                    </div>
                </div>
            </div>

            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_decimal_point'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-3'>
                    <div class="stylish">
                        <span>
                            <input onclick="$(this).closest('div').find('select').slideToggle(110)" class="form-control customernambg" readonly="1" type="text" name="decimal_point" id="decimal_point"  value="<?php echo $this->config->item('decimal_point') ?>" style="left: 0;"/>
                            <select size=15 onclick="$(this).hide().closest('div').find('input').val($(this).find('option:selected').val());" class="customernambg" style="min-height:150px; margin: 0 auto; left:0px; margin-top: -20px">
                                <option value="." class="btn btn-default btn-lg btn-block text-lowercase">. (dot)</option>
                                <option value="," class="btn btn-default btn-lg btn-block text-lowercase">, (comma)</option>
                            </select>
                        </span>
                    </div>
                </div>
            </div>

            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_thousands_separator'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-3'>
                    <div class="stylish">
                        <span>
                            <input onclick="$(this).closest('div').find('select').slideToggle(110)" class="form-control customernambg" readonly="1" type="text" name="thousands_separator" id="thousands_separator"  value="<?php echo $this->config->item('thousands_separator') ?>" style="left: 0;"/>
                            <select size=15 onclick="$(this).hide().closest('div').find('input').val($(this).find('option:selected').val());" class="customernambg" style="min-height:150px; margin: 0 auto; left:0px; margin-top: -20px">
                                <option value="&apos;" class="btn btn-default btn-lg btn-block text-lowercase">&apos; (apostrophe)</option>
                                <option value="," class="btn btn-default btn-lg btn-block text-lowercase">, (comma)</option>
                                <option value="." class="btn btn-default btn-lg btn-block text-lowercase">. (dot)</option>
                                <option value="" class="btn btn-default btn-lg btn-block text-lowercase">none</option>
                            </select>
                        </span>
                    </div>
                </div>
            </div>
            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_quantity_decimals'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-3'>
                    <div class="stylish">
                        <span>
                            <input onclick="$(this).closest('div').find('select').slideToggle(110)" class="form-control customernambg" readonly="1" type="text" name="quantity_decimals" id="quantity_decimals"  value="<?php echo $this->config->item('quantity_decimals') ?>" style="left: 0;"/>
                            <select size=15 onclick="$(this).hide().closest('div').find('input').val($(this).find('option:selected').val());" class="customernambg" style="min-height:150px; margin: 0 auto; left:0px; margin-top: -20px">
                                <option value="0" class="btn btn-default btn-lg btn-block text-lowercase">0</option>
                                <option value="1" class="btn btn-default btn-lg btn-block text-lowercase">1</option>
                                <option value="2" class="btn btn-default btn-lg btn-block text-lowercase">2</option>
                                <option value="3" class="btn btn-default btn-lg btn-block text-lowercase">3</option>
                            </select>
                        </span>
                    </div>
                </div>
            </div>

            <div class="form-group form-group-sm">
                <?php echo form_label($this->lang->line('gkpos_language'), 'language', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-4'>
                    <?php
                    echo form_dropdown('language', array(
                        'en' => 'English',
                        'es' => 'Spanish',
                        'nl-BE' => 'Dutch (Belgium)',
                        'de-CH' => 'German (Swiss)',
                        'fr' => 'French',
                        'zh' => 'Chinese',
                        'id' => 'Indonesian',
                        'th' => 'Thai',
                        'tr' => 'Turkish',
                        'ru' => 'Russian',
                        'hu-HU' => 'Hungarian',
                        'pt-BR' => 'Portuguese (Brazil)',
                        'hr-HR' => 'Croatian (Croatia)'
                            ), $this->config->item('language'), array('class' => 'form-control input-sm'));
                    ?>
                </div>
            </div>

            <div class="form-group form-group-sm">	
                <?php echo form_label($this->lang->line('gkpos_timezone'), 'timezone', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-xs-4'>
                    <?php
                    echo form_dropdown('timezone', array(
                        'Pacific/Midway' => '(GMT-11:00) Midway Island, Samoa',
                        'America/Adak' => '(GMT-10:00) Hawaii-Aleutian',
                        'Etc/GMT+10' => '(GMT-10:00) Hawaii',
                        'Pacific/Marquesas' => '(GMT-09:30) Marquesas Islands',
                        'Pacific/Gambier' => '(GMT-09:00) Gambier Islands',
                        'America/Anchorage' => '(GMT-09:00) Alaska',
                        'America/Ensenada' => '(GMT-08:00) Tijuana, Baja California',
                        'Etc/GMT+8' => '(GMT-08:00) Pitcairn Islands',
                        'America/Los_Angeles' => '(GMT-08:00) Pacific Time (US & Canada)',
                        'America/Denver' => '(GMT-07:00) Mountain Time (US & Canada)',
                        'America/Chihuahua' => '(GMT-07:00) Chihuahua, La Paz, Mazatlan',
                        'America/Dawson_Creek' => '(GMT-07:00) Arizona',
                        'America/Belize' => '(GMT-06:00) Saskatchewan, Central America',
                        'America/Cancun' => '(GMT-06:00) Guadalajara, Mexico City, Monterrey',
                        'Chile/EasterIsland' => '(GMT-06:00) Easter Island',
                        'America/Chicago' => '(GMT-06:00) Central Time (US & Canada)',
                        'America/New_York' => '(GMT-05:00) Eastern Time (US & Canada)',
                        'America/Havana' => '(GMT-05:00) Cuba',
                        'America/Bogota' => '(GMT-05:00) Bogota, Lima, Quito, Rio Branco',
                        'America/Caracas' => '(GMT-04:30) Caracas',
                        'America/Santiago' => '(GMT-04:00) Santiago',
                        'America/La_Paz' => '(GMT-04:00) La Paz',
                        'Atlantic/Stanley' => '(GMT-04:00) Faukland Islands',
                        'America/Campo_Grande' => '(GMT-04:00) Brazil',
                        'America/Goose_Bay' => '(GMT-04:00) Atlantic Time (Goose Bay)',
                        'America/Glace_Bay' => '(GMT-04:00) Atlantic Time (Canada)',
                        'America/St_Johns' => '(GMT-03:30) Newfoundland',
                        'America/Araguaina' => '(GMT-03:00) UTC-3',
                        'America/Montevideo' => '(GMT-03:00) Montevideo',
                        'America/Miquelon' => '(GMT-03:00) Miquelon, St. Pierre',
                        'America/Godthab' => '(GMT-03:00) Greenland',
                        'America/Argentina/Buenos_Aires' => '(GMT-03:00) Buenos Aires',
                        'America/Sao_Paulo' => '(GMT-03:00) Brasilia',
                        'America/Noronha' => '(GMT-02:00) Mid-Atlantic',
                        'Atlantic/Cape_Verde' => '(GMT-01:00) Cape Verde Is.',
                        'Atlantic/Azores' => '(GMT-01:00) Azores',
                        'Europe/Belfast' => '(GMT) Greenwich Mean Time : Belfast',
                        'Europe/Dublin' => '(GMT) Greenwich Mean Time : Dublin',
                        'Europe/Lisbon' => '(GMT) Greenwich Mean Time : Lisbon',
                        'Europe/London' => '(GMT) Greenwich Mean Time : London',
                        'Africa/Abidjan' => '(GMT) Monrovia, Reykjavik',
                        'Europe/Amsterdam' => '(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna',
                        'Europe/Belgrade' => '(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague',
                        'Europe/Brussels' => '(GMT+01:00) Brussels, Copenhagen, Madrid, Paris',
                        'Africa/Algiers' => '(GMT+01:00) West Central Africa',
                        'Africa/Windhoek' => '(GMT+01:00) Windhoek',
                        'Asia/Beirut' => '(GMT+02:00) Beirut',
                        'Africa/Cairo' => '(GMT+02:00) Cairo',
                        'Asia/Gaza' => '(GMT+02:00) Gaza',
                        'Africa/Blantyre' => '(GMT+02:00) Harare, Pretoria',
                        'Asia/Jerusalem' => '(GMT+02:00) Jerusalem',
                        'Europe/Minsk' => '(GMT+02:00) Minsk',
                        'Asia/Damascus' => '(GMT+02:00) Syria',
                        'Europe/Moscow' => '(GMT+03:00) Moscow, St. Petersburg, Volgograd',
                        'Africa/Addis_Ababa' => '(GMT+03:00) Nairobi',
                        'Asia/Tehran' => '(GMT+03:30) Tehran',
                        'Asia/Dubai' => '(GMT+04:00) Abu Dhabi, Muscat',
                        'Asia/Yerevan' => '(GMT+04:00) Yerevan',
                        'Asia/Kabul' => '(GMT+04:30) Kabul',
                        'Asia/Baku' => '(GMT+05:00) Baku',
                        'Asia/Yekaterinburg' => '(GMT+05:00) Ekaterinburg',
                        'Asia/Tashkent' => '(GMT+05:00) Tashkent',
                        'Asia/Kolkata' => '(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi',
                        'Asia/Katmandu' => '(GMT+05:45) Kathmandu',
                        'Asia/Dhaka' => '(GMT+06:00) Astana, Dhaka',
                        'Asia/Novosibirsk' => '(GMT+06:00) Novosibirsk',
                        'Asia/Rangoon' => '(GMT+06:30) Yangon (Rangoon)',
                        'Asia/Bangkok' => '(GMT+07:00) Bangkok, Hanoi, Jakarta',
                        'Asia/Krasnoyarsk' => '(GMT+07:00) Krasnoyarsk',
                        'Asia/Hong_Kong' => '(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi',
                        'Asia/Irkutsk' => '(GMT+08:00) Irkutsk, Ulaan Bataar',
                        'Australia/Perth' => '(GMT+08:00) Perth',
                        'Australia/Eucla' => '(GMT+08:45) Eucla',
                        'Asia/Tokyo' => '(GMT+09:00) Osaka, Sapporo, Tokyo',
                        'Asia/Seoul' => '(GMT+09:00) Seoul',
                        'Asia/Yakutsk' => '(GMT+09:00) Yakutsk',
                        'Australia/Adelaide' => '(GMT+09:30) Adelaide',
                        'Australia/Darwin' => '(GMT+09:30) Darwin',
                        'Australia/Brisbane' => '(GMT+10:00) Brisbane',
                        'Australia/Hobart' => '(GMT+10:00) Hobart',
                        'Asia/Vladivostok' => '(GMT+10:00) Vladivostok',
                        'Australia/Lord_Howe' => '(GMT+10:30) Lord Howe Island',
                        'Etc/GMT-11' => '(GMT+11:00) Solomon Is., New Caledonia',
                        'Asia/Magadan' => '(GMT+11:00) Magadan',
                        'Pacific/Norfolk' => '(GMT+11:30) Norfolk Island',
                        'Asia/Anadyr' => '(GMT+12:00) Anadyr, Kamchatka',
                        'Pacific/Auckland' => '(GMT+12:00) Auckland, Wellington',
                        'Etc/GMT-12' => '(GMT+12:00) Fiji, Kamchatka, Marshall Is.',
                        'Pacific/Chatham' => '(GMT+12:45) Chatham Islands',
                        'Pacific/Tongatapu' => '(GMT+13:00) Nuku\'alofa',
                        'Pacific/Kiritimati' => '(GMT+14:00) Kiritimati'
                            ), $this->config->item('timezone') ? $this->config->item('timezone') : date_default_timezone_get(), array('class' => 'form-control input-sm'));
                    ?>
                </div>
            </div>

            <div class="form-group form-group-sm">	
                <?php echo form_label($this->lang->line('gkpos_datetimeformat'), 'datetimeformat', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-sm-2'>
                    <?php
                    echo form_dropdown('dateformat', array(
                        'd/m/Y' => 'dd/mm/yyyy',
                        'd.m.Y' => 'dd.mm.yyyy',
                        'm/d/Y' => 'mm/dd/yyyy',
                        'Y/m/d' => 'yyyy/mm/dd',
                        'd/m/y' => 'dd/mm/yy',
                        'm/d/y' => 'mm/dd/yy',
                        'y/m/d' => 'yy/mm/dd'
                            ), $this->config->item('dateformat'), array('class' => 'form-control input-sm'));
                    ?>
                </div>
                <div class='col-sm-2'>
                    <?php
                    echo form_dropdown('timeformat', array(
                        'H:i:s' => 'hh:mm:ss (24h)',
                        'h:i:s a' => 'hh:mm:ss am/pm',
                        'h:i:s A' => 'hh:mm:ss AM/PM'
                            ), $this->config->item('timeformat'), array('class' => 'form-control input-sm'));
                    ?>
                </div>
            </div>
            <div class="form-inline">	
                <?php echo form_label($this->lang->line('gkpos_week') . ' ' . $this->lang->line('gkpos_start') . ' / ' . $this->lang->line('gkpos_end'), 'week_start', array('class' => 'control-label col-lg-4 col-md-4 col-sm-4 col-xs-4')); ?>
                <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2'>
                    <?php
                    echo form_dropdown('gk_week_start', array(
                        'sun' => 'Sunday',
                        'mon' => 'Monday',
                        'tue' => 'Tuesday',
                        'wed' => 'Wednesday',
                        'thu' => 'Thursday',
                        'fri' => 'Friday',
                        'sat' => 'Saturday'
                            ), $this->config->item('gk_week_start'), array('class' => 'form-control input-sm'));
                    ?>
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
                    <?php
                    echo form_dropdown('gk_week_end', array(
                        'sun' => 'Sunday',
                        'mon' => 'Monday',
                        'tue' => 'Tuesday',
                        'wed' => 'Wednesday',
                        'thu' => 'Thursday',
                        'fri' => 'Friday',
                        'sat' => 'Saturday'
                            ), $this->config->item('gk_week_end'), array('class' => 'form-control input-sm'));
                    ?>
                </div>
            </div>

            <div class="form-group form-group-md">	
                <div class="col-md-offset-4 col-md-4">
                    <ul id="localeConfigFormMessageBox" class="error_message_box"></ul>
                    <input class="form-submit-button mainsystembg2 waiting-bg img-responsive delivery-info-submit-btn" type="submit" name="submit_form" value="<?php echo $this->lang->line('gkpos_numpad_key_enter') ?>" onclick="saveLocale()">
                </div>
            </div>
        </fieldset>
        <?php echo form_close(); ?>
        <script type='text/javascript'>
            function saveLocale() {
                $('#localeConfigForm').validate({
                    submitHandler: function () {
                        var myform = document.getElementById('localeConfigForm');
                        var formdata = new FormData(myform);
                        $.ajax({
                            url: $('#localeConfigForm').attr('action'),
                            data: formdata,
                            cache: false,
                            processData: false,
                            contentType: false,
                            type: 'POST',
                            dataType: 'json',
                            success: function (response) {
                                if (response.success) {
                                    ALERT_TITLE = "Success!";
                                    alert(response.message);

                                } else {
                                    ALERT_TITLE = "Error!";
                                    alert(response.message);
                                }
                            }
                        });
                    },
                    errorClass: "has-error",
                    errorLabelContainer: "#localeConfigFormMessageBox",
                    wrapper: "li",
                    highlight: function (e) {
                        $(e).closest('.form-group').addClass('has-error');
                    },
                    unhighlight: function (e) {
                        $(e).closest('.form-group').removeClass('has-error');
                    },
                    rules: {
                        currency_symbol: "required"
                    },
                    messages: {
                        currency_symbol: "<?php echo $this->lang->line('gkpos_currency_symbol_required'); ?>",
                    }
                });

            }
        </script>
    </div>
</div>

