File: /home/cafsindia/groups_cafsindia_com/application/views/configs/general_config.php
<?php echo form_open('config/save_general/', array('id' => 'general_config_form', 'enctype' => 'multipart/form-data', 'class' => 'form-inline')); ?>
<div id="config_wrapper">
<fieldset id="config_info">
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
<ul id="general_error_message_box" class="error_message_box"></ul>
<div class="form-group hide">
<?php echo form_label($this->lang->line('config_default_tax_rate_1'), 'default_tax_1_rate', array('class' => ' required')); ?>
<?php
echo form_input(array(
'name' => 'default_tax_1_name',
'id' => 'default_tax_1_name',
'class' => 'form-control input-sm alpha required',
'value' => $this->config->item('default_tax_1_name') !== FALSE ? $this->config->item('default_tax_1_name') : $this->lang->line('items_sales_tax_1')));
?>
<?php
echo form_input(array(
'name' => 'default_tax_1_rate',
'id' => 'default_tax_1_rate',
'class' => 'form-control input-sm number required',
'value' => to_tax_decimals($this->config->item('default_tax_1_rate'))));
?>
<span class="input-group-addon input-sm">%</span>
</div>
<div class="form-group hide">
<?php echo form_label($this->lang->line('config_default_tax_rate_2'), 'default_tax_2_rate', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'default_tax_2_name',
'id' => 'default_tax_2_name',
'class' => 'form-control alpha input-sm',
'value' => $this->config->item('default_tax_2_name') !== FALSE ? $this->config->item('default_tax_2_name') : $this->lang->line('items_sales_tax_2')));
?>
<?php
echo form_input(array(
'name' => 'default_tax_2_rate',
'id' => 'default_tax_2_rate',
'class' => 'form-control number input-sm',
'value' => to_tax_decimals($this->config->item('default_tax_2_rate'))));
?>
<span class="input-group-addon input-sm">%</span>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_tax_included'), 'tax_included', array('class' => '')); ?>
<?php
echo form_checkbox(array(
'name' => 'tax_included',
'id' => 'tax_included',
'value' => 'tax_included',
'checked' => $this->config->item('tax_included')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_auto_reorder'), 'auto_reorder', array('class' => '')); ?>
<?php
echo form_checkbox(array(
'name' => 'auto_reorder',
'id' => 'auto_reorder',
'value' => 'auto_reorder',
'checked' => $this->config->item('auto_reorder')));
?>
</div>
<!-- ============================= -->
<!-- ============================= -->
<div class="form-group">
<?php echo form_label($this->lang->line('config_sale_item'), 'config_sale_item', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyitem',
'value' => '0',
'checked' => $this->config->item('salebyitem') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyitem',
'value' => '1',
'checked' => $this->config->item('salebyitem') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyitem',
'value' => '2',
'checked' => $this->config->item('salebyitem') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_sale_categories'), 'config_sale_categories', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebycategories',
'value' => '0',
'checked' => $this->config->item('salebyitem') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebycategories',
'value' => '1',
'checked' => $this->config->item('salebycategories') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebycategories',
'value' => '2',
'checked' => $this->config->item('salebycategories') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_sale_employee'), 'config_sale_employee', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyemployee',
'value' => '0',
'checked' => $this->config->item('salebyemployee') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyemployee',
'value' => '1',
'checked' => $this->config->item('salebyemployee') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyemployee',
'value' => '2',
'checked' => $this->config->item('salebyemployee') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_sale_payments'), 'config_sale_payments', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebypayments',
'value' => '0',
'checked' => $this->config->item('salebypayments') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebypayments',
'value' => '1',
'checked' => $this->config->item('salebypayments') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebypayments',
'value' => '2',
'checked' => $this->config->item('salebypayments') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<div class="form-group hide">
<?php echo form_label($this->lang->line('config_sale_receipt'), 'config_sale_receipt', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyreceipt',
'value' => '0',
'checked' => $this->config->item('salebyreceipt') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyreceipt',
'value' => '1',
'checked' => $this->config->item('salebyreceipt') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebyreceipt',
'value' => '2',
'checked' => $this->config->item('salebyreceipt') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_sale_date'), 'config_sale_date', array('class' => '')); ?>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebydate',
'value' => '0',
'checked' => $this->config->item('salebydate') === '0'));
?>
<?php echo $this->lang->line('config_line'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebydate',
'value' => '1',
'checked' => $this->config->item('salebydate') === '1'));
?>
<?php echo $this->lang->line('config_pie'); ?>
</label>
<label class="radio-inline">
<?php
echo form_radio(array(
'name' => 'salebydate',
'value' => '2',
'checked' => $this->config->item('salebydate') === '2'));
?>
<?php echo $this->lang->line('config_bar'); ?>
</label>
</div>
<!-- ============================= -->
<!-- ============================= -->
<div class="form-group">
<?php echo form_label($this->lang->line('config_default_sales_discount'), 'default_sales_discount', array('class' => ' required')); ?>
<div class="input-group">
<?php
echo form_input(array(
'name' => 'default_sales_discount',
'id' => 'default_sales_discount',
'class' => 'form-control input-sm number required',
'type' => 'number',
'min' => 0,
'max' => 100,
'value' => $this->config->item('default_sales_discount')));
?>
<span class="input-group-addon input-sm">%</span>
</div>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_receiving_calculate_average_price'), 'receiving_calculate_average_price', array('class' => '')); ?>
<?php
echo form_checkbox(array(
'name' => 'receiving_calculate_average_price',
'id' => 'receiving_calculate_average_price',
'value' => 'receiving_calculate_average_price',
'checked' => $this->config->item('receiving_calculate_average_price')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_lines_per_page'), 'lines_per_page', array('class' => ' required')); ?>
<?php
echo form_input(array(
'name' => 'lines_per_page',
'id' => 'lines_per_page',
'class' => 'form-control input-sm number required',
'type' => 'number',
'min' => 10,
'max' => 1000,
'value' => $this->config->item('lines_per_page')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_notify_alignment'), 'notify_horizontal_position', array('class' => '')); ?>
<div class="row">
<div class="col-md-6">
<?php
echo form_dropdown('notify_vertical_position', array(
'top' => $this->lang->line('config_top'),
'bottom' => $this->lang->line('config_bottom')
), $this->config->item('notify_vertical_position'), array('class' => 'form-control input-sm'));
?>
</div>
<div class="col-md-6">
<?php
echo form_dropdown('notify_horizontal_position', array(
'left' => $this->lang->line('config_left'),
'center' => $this->lang->line('config_center'),
'right' => $this->lang->line('config_right')
), $this->config->item('notify_horizontal_position'), array('class' => 'form-control input-sm'));
?>
</div>
</div>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom1'), 'config_custom1', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom1_name',
'id' => 'custom1_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom1_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom2'), 'config_custom2', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom2_name',
'id' => 'custom2_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom2_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom3'), 'config_custom3', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom3_name',
'id' => 'custom3_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom3_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom4'), 'config_custom4', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom4_name',
'id' => 'custom4_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom4_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom5'), 'config_custom5', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom5_name',
'id' => 'custom5_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom5_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom6'), 'config_custom6', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom6_name',
'id' => 'custom6_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom6_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom7'), 'config_custom7', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom7_name',
'id' => 'custom7_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom7_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom8'), 'config_custom8', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom8_name',
'id' => 'custom8_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom8_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom9'), 'config_custom9', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom9_name',
'id' => 'custom9_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom9_name')));
?>
</div>
<div class="form-group">
<?php echo form_label($this->lang->line('config_custom10'), 'config_custom10', array('class' => '')); ?>
<?php
echo form_input(array(
'name' => 'custom10_name',
'id' => 'custom10_name',
'class' => 'form-control input-sm',
'value' => $this->config->item('custom10_name')));
?>
</div>
<div class="form-group hide">
<?php echo form_label($this->lang->line('config_backup_database'), 'config_backup_database', array('class' => '')); ?>
<div id="backup_db" class="btn btn-default btn-sm">
<span style="top:22%;"><?php echo $this->lang->line('config_backup_button'); ?></span>
</div>
</div>
<div class="form-group submit">
<?php
echo form_submit(array(
'name' => 'submit_form',
'id' => 'submit_form',
'value' => $this->lang->line('common_submit'),
'class' => 'btn btn-primary btn-sm pull-right'));
?>
</div>
</fieldset>
</div>
<?php echo form_close(); ?>
<script type="text/javascript">
//validation and submit handling
$(document).ready(function ()
{
$("#backup_db").click(function () {
window.location = '<?php echo site_url('config/backup_db') ?>';
});
$('#general_config_form').validate($.extend(form_support.handler, {
errorLabelContainer: "#general_error_message_box",
rules:
{
default_tax_1_rate:
{
required: true,
number: true
},
default_tax_1_name: "required",
lines_per_page:
{
required: true,
number: true
},
default_sales_discount:
{
required: true,
number: true
}
},
messages:
{
default_tax_1_rate:
{
required: "<?php echo $this->lang->line('config_default_tax_rate_required'); ?>",
number: "<?php echo $this->lang->line('config_default_tax_rate_number'); ?>"
},
default_tax_1_name:
{
required: "<?php echo $this->lang->line('config_default_tax_name_required'); ?>",
number: "<?php echo $this->lang->line('config_default_tax_name_number'); ?>"
},
default_sales_discount:
{
required: "<?php echo $this->lang->line('config_default_sales_discount_required'); ?>",
number: "<?php echo $this->lang->line('config_default_sales_discount_number'); ?>"
},
lines_per_page:
{
required: "<?php echo $this->lang->line('config_lines_per_page_required'); ?>",
number: "<?php echo $this->lang->line('config_lines_per_page_number'); ?>"
}
}
}));
});
</script>