mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-22 16:24:41 -04:00
Add database backup feature in config
This commit is contained in:
1 parent
c7280e6018
commit
c04fa362b1
15 files changed
+105
-592
No files matched your search
@@ -12,4 +12,5 @@ git-svn-diff.py
|
||||
*.rej
|
||||
*.orig
|
||||
*~
|
||||
*.~
|
||||
uploads/
|
||||
@@ -125,5 +125,33 @@ class Config extends Secure_area
|
||||
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
|
||||
|
||||
}
|
||||
|
||||
function backup_db()
|
||||
{
|
||||
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
|
||||
if($this->Employee->has_module_grant('config',$employee_id))
|
||||
{
|
||||
$this->load->dbutil();
|
||||
$prefs = array(
|
||||
'format' => 'zip',
|
||||
'filename' => 'ospos.sql'
|
||||
);
|
||||
|
||||
$backup =& $this->dbutil->backup($prefs);
|
||||
|
||||
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip';
|
||||
$save = 'uploads/'.$file_name;
|
||||
|
||||
$this->load->helper('file');
|
||||
write_file($save, $backup);
|
||||
|
||||
$this->load->helper('download');
|
||||
force_download($file_name, $backup);
|
||||
}
|
||||
else
|
||||
{
|
||||
redirect('no_access/config');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Company Name";
|
||||
$lang["config_location_configuration"] = "Stock Locations";
|
||||
$lang["config_location_info"] = "Location Configuration Information";
|
||||
$lang["config_logout"] = "Don't you want to make a backup before logging out?";
|
||||
$lang["config_backup_database"] = "Backup Database";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Nombre del Comercio";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Nome de l\'Entreprise";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Nama Perusahaan";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Prijs";
|
||||
$lang["config_barcode_company"] = "Bedrijfsnaam";
|
||||
$lang["config_location_configuration"] = "Stock Locaties";
|
||||
$lang["config_location_info"] = "Instellingen Locatie";
|
||||
$lang["config_logout"] = "Wilt u een backup maken alvorens uit te loggen?";
|
||||
$lang["config_backup_database"] = "Backup Database";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Название Компании";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "ชื่อร้านค้า";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "Şirket Adı";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -83,3 +83,6 @@ $lang["config_barcode_price"] = "Price";
|
||||
$lang["config_barcode_company"] = "公司名稱";
|
||||
$lang["config_location_configuration"] = "";
|
||||
$lang["config_location_info"] = "";
|
||||
$lang["config_logout"] = "";
|
||||
$lang["config_backup_database"] = "";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
@@ -1,574 +0,0 @@
|
||||
<?php $this->load->view("partial/header"); ?>
|
||||
<div id="page_title"><?php echo $this->lang->line('module_config'); ?></div>
|
||||
<?php
|
||||
echo form_open('config/save/',array('id'=>'config_form'));
|
||||
?>
|
||||
<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="error_message_box"></ul>
|
||||
<legend><?php echo $this->lang->line("config_info"); ?></legend>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_company').':', 'company',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'company',
|
||||
'id'=>'company',
|
||||
'value'=>$this->config->item('company')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_address').':', 'address',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_textarea(array(
|
||||
'name'=>'address',
|
||||
'id'=>'address',
|
||||
'rows'=>4,
|
||||
'cols'=>17,
|
||||
'value'=>$this->config->item('address')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_phone').':', 'phone',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'phone',
|
||||
'id'=>'phone',
|
||||
'value'=>$this->config->item('phone')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_default_tax_rate_1').':', 'default_tax_1_rate',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'default_tax_1_name',
|
||||
'id'=>'default_tax_1_name',
|
||||
'size'=>'10',
|
||||
'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',
|
||||
'size'=>'4',
|
||||
'value'=>$this->config->item('default_tax_1_rate')));?>%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_default_tax_rate_2').':', 'default_tax_1_rate',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'default_tax_2_name',
|
||||
'id'=>'default_tax_2_name',
|
||||
'size'=>'10',
|
||||
'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',
|
||||
'size'=>'4',
|
||||
'value'=>$this->config->item('default_tax_2_rate')));?>%
|
||||
</div>
|
||||
</div>
|
||||
<!-- GARRISON MODIFIED 4/13/2013 -->
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_currency_symbol').':', 'currency_symbol',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'currency_symbol',
|
||||
'id'=>'currency_symbol',
|
||||
'value'=>$this->config->item('currency_symbol')));?>
|
||||
</div>
|
||||
|
||||
<?php echo form_label($this->lang->line('config_currency_side').':', 'currency_side',array('class'=>''));?>
|
||||
<div class='form_field'>
|
||||
<?php
|
||||
echo form_checkbox(array(
|
||||
'name'=>'currency_side',
|
||||
'id'=>'currency_side',
|
||||
'value'=>'currency_side',
|
||||
'checked'=>$this->config->item('currency_side')));?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END MODIFIED -->
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('common_email').':', 'email',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'email',
|
||||
'id'=>'email',
|
||||
'value'=>$this->config->item('email')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_fax').':', 'fax',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'fax',
|
||||
'id'=>'fax',
|
||||
'value'=>$this->config->item('fax')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_website').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'website',
|
||||
'id'=>'website',
|
||||
'value'=>$this->config->item('website')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('common_return_policy').':', 'return_policy',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_textarea(array(
|
||||
'name'=>'return_policy',
|
||||
'id'=>'return_policy',
|
||||
'rows'=>'4',
|
||||
'cols'=>'17',
|
||||
'value'=>$this->config->item('return_policy')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_language').':', 'language',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_dropdown('language', array(
|
||||
'en' => 'English',
|
||||
'es' => 'Spanish',
|
||||
'ru' => 'Russian',
|
||||
'nl-BE' => 'Dutch',
|
||||
'zh' => 'Chinese',
|
||||
'id' => 'Indonesian',
|
||||
'fr' => 'French',
|
||||
'th' => 'Thai',
|
||||
'tr' => 'Turkish'
|
||||
),
|
||||
$this->config->item('language'));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_timezone').':', 'timezone',array('class'=>'wide required')); ?>
|
||||
<div class='form_field'>
|
||||
<?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',/*GARRISON ADDED 4/20/2013*/
|
||||
'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());
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="stock_locations">
|
||||
<?php $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); ?>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_sales_invoice_format').':', 'sales_invoice_format',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'sales_invoice_format',
|
||||
'id'=>'sales_invoice_format',
|
||||
'value'=>$this->config->item('sales_invoice_format'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_recv_invoice_format').':', 'recv_invoice_format',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'recv_invoice_format',
|
||||
'id'=>'recv_invoice_format',
|
||||
'value'=>$this->config->item('recv_invoice_format'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_barcode_content').':', 'barcode_content',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_radio(array(
|
||||
'name'=>'barcode_content',
|
||||
'value'=>'id',
|
||||
'checked'=>$this->config->item('barcode_content') === "id")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_id'); ?>
|
||||
<?php echo form_radio(array(
|
||||
'name'=>'barcode_content',
|
||||
'value'=>'number',
|
||||
'checked'=>$this->config->item('barcode_content') === "number")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_number'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_barcode_labels').':', 'barcode_labels',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'barcode_label_company',
|
||||
'value'=>'barcode_label_company',
|
||||
'checked'=>strstr($this->config->item('barcode_labels'), 'company'))); ?>
|
||||
<?php echo $this->lang->line('config_barcode_company'); ?>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'barcode_label_name',
|
||||
'value'=>'barcode_label_name',
|
||||
'checked'=>strstr($this->config->item('barcode_labels'), 'name'))); ?>
|
||||
<?php echo $this->lang->line('config_barcode_name'); ?>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'barcode_label_price',
|
||||
'value'=>'barcode_label_price',
|
||||
'checked'=>strstr($this->config->item('barcode_labels'), 'price'))); ?>
|
||||
<?php echo $this->lang->line('config_barcode_price'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_print_after_sale').':', 'print_after_sale',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'print_after_sale',
|
||||
'id'=>'print_after_sale',
|
||||
'value'=>'print_after_sale',
|
||||
'checked'=>$this->config->item('print_after_sale')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_tax_included').':', 'tax_included',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'tax_included',
|
||||
'id'=>'tax_included',
|
||||
'value'=>'tax_included',
|
||||
'checked'=>$this->config->item('tax_included')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom1').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom1_name',
|
||||
'id'=>'custom1_name',
|
||||
'value'=>$this->config->item('custom1_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom2').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom2_name',
|
||||
'id'=>'custom2_name',
|
||||
'value'=>$this->config->item('custom2_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom3').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom3_name',
|
||||
'id'=>'custom3_name',
|
||||
'value'=>$this->config->item('custom3_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom4').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom4_name',
|
||||
'id'=>'custom4_name',
|
||||
'value'=>$this->config->item('custom4_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom5').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom5_name',
|
||||
'id'=>'custom5_name',
|
||||
'value'=>$this->config->item('custom5_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom6').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom6_name',
|
||||
'id'=>'custom6_name',
|
||||
'value'=>$this->config->item('custom6_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom7').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom7_name',
|
||||
'id'=>'custom7_name',
|
||||
'value'=>$this->config->item('custom7_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom8').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom8_name',
|
||||
'id'=>'custom8_name',
|
||||
'value'=>$this->config->item('custom8_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom9').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom9_name',
|
||||
'id'=>'custom9_name',
|
||||
'value'=>$this->config->item('custom9_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom10').':', 'website',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom10_name',
|
||||
'id'=>'custom10_name',
|
||||
'value'=>$this->config->item('custom10_name')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo form_submit(array(
|
||||
'name'=>'submit',
|
||||
'id'=>'submit',
|
||||
'value'=>$this->lang->line('common_submit'),
|
||||
'class'=>'submit_button float_right')
|
||||
);
|
||||
?>
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php
|
||||
echo form_close();
|
||||
?>
|
||||
<div id="feedback_bar"></div>
|
||||
<script type='text/javascript'>
|
||||
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
var location_count = <?php echo sizeof($stock_locations); ?>;
|
||||
|
||||
var hide_show_remove = function()
|
||||
{
|
||||
if ($("input[name*='stock_location']").length > 1)
|
||||
{
|
||||
$(".remove_stock_location").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".remove_stock_location").hide();
|
||||
}
|
||||
};
|
||||
|
||||
hide_show_remove();
|
||||
|
||||
var add_stock_location = function()
|
||||
{
|
||||
var id = $(this).parent().find('input').attr('id');
|
||||
id = id.replace(/.*?_(\d+)$/g, "$1");
|
||||
var block = $(this).parent().clone(true);
|
||||
var new_block = block.insertAfter($(this).parent());
|
||||
var new_block_id = 'stock_location_' + ++id;
|
||||
$(new_block).find('label').html("<?php echo $this->lang->line('config_stock_location'); ?> " + ++location_count + ": ").attr('for', new_block_id);
|
||||
$(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id).val('');
|
||||
$('.add_stock_location', new_block).click(add_stock_location);
|
||||
$('.remove_stock_location', new_block).click(remove_stock_location);
|
||||
hide_show_remove();
|
||||
};
|
||||
|
||||
var remove_stock_location = function()
|
||||
{
|
||||
$(this).parent().remove();
|
||||
hide_show_remove();
|
||||
};
|
||||
|
||||
var init_add_remove_locations = function()
|
||||
{
|
||||
$('.add_stock_location').click(add_stock_location);
|
||||
$('.remove_stock_location').click(remove_stock_location);
|
||||
};
|
||||
init_add_remove_locations();
|
||||
|
||||
var duplicate_found = false;
|
||||
// run validator once for all fields
|
||||
$.validator.addMethod('stock_location' , function(value, element)
|
||||
{
|
||||
var value_count = 0;
|
||||
$("input[name*='stock_location']").each(function() {
|
||||
value_count = $(this).val() == value ? value_count + 1 : value_count;
|
||||
});
|
||||
return value_count < 2;
|
||||
}, "<?php echo $this->lang->line('config_stock_location_duplicate'); ?>");
|
||||
|
||||
$('#config_form').validate({
|
||||
submitHandler:function(form)
|
||||
{
|
||||
$(form).ajaxSubmit({
|
||||
success:function(response)
|
||||
{
|
||||
if(response.success)
|
||||
{
|
||||
set_feedback(response.message,'success_message',false);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_feedback(response.message,'error_message',true);
|
||||
}
|
||||
$("#stock_locations").load('<?php echo site_url("config/stock_locations");?>', init_add_remove_locations);
|
||||
},
|
||||
dataType:'json'
|
||||
});
|
||||
|
||||
},
|
||||
errorLabelContainer: "#error_message_box",
|
||||
wrapper: "li",
|
||||
rules:
|
||||
{
|
||||
company: "required",
|
||||
address: "required",
|
||||
phone: "required",
|
||||
default_tax_rate:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
email:"email",
|
||||
return_policy: "required",
|
||||
stock_location: {
|
||||
required:true,
|
||||
stock_location: true
|
||||
}
|
||||
},
|
||||
messages:
|
||||
{
|
||||
company: "<?php echo $this->lang->line('config_company_required'); ?>",
|
||||
address: "<?php echo $this->lang->line('config_address_required'); ?>",
|
||||
phone: "<?php echo $this->lang->line('config_phone_required'); ?>",
|
||||
default_tax_rate:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_tax_rate_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_tax_rate_number'); ?>"
|
||||
},
|
||||
email: "<?php echo $this->lang->line('common_email_invalid_format'); ?>",
|
||||
return_policy:"<?php echo $this->lang->line('config_return_policy_required'); ?>",
|
||||
stock_location:"<?php echo $this->lang->line('config_stock_location_required'); ?>"
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php $this->load->view("partial/footer"); ?>
|
||||
@@ -270,7 +270,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom1').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom1').':', 'config_custom1',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom1_name',
|
||||
@@ -280,7 +280,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom2').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom2').':', 'config_custom2',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom2_name',
|
||||
@@ -290,7 +290,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom3').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom3').':', 'config_custom3',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom3_name',
|
||||
@@ -300,7 +300,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom4').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom4').':', 'config_custom4',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom4_name',
|
||||
@@ -310,7 +310,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom5').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom5').':', 'config_custom5',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom5_name',
|
||||
@@ -320,7 +320,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom6').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom6').':', 'config_custom6',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom6_name',
|
||||
@@ -330,7 +330,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom7').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom7').':', 'config_custom7',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom7_name',
|
||||
@@ -340,7 +340,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom8').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom8').':', 'config_custom8',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom8_name',
|
||||
@@ -350,7 +350,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom9').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom9').':', 'config_custom9',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom9_name',
|
||||
@@ -360,7 +360,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_custom10').':', 'website',array('class'=>'wide')); ?>
|
||||
<?php echo form_label($this->lang->line('config_custom10').':', 'config_custom10',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom10_name',
|
||||
@@ -369,6 +369,19 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_backup_database').':', 'config_backup_database',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_submit(array(
|
||||
'name'=>'config_backup_database',
|
||||
'id'=>'config_backup_database',
|
||||
'onClick'=>'javascript:window.location=\'' . site_url('config/backup_db'). '\';return false;',
|
||||
'class'=>'submit_button float_right',
|
||||
'value'=>$this->lang->line('config_backup_button')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
echo form_submit(array(
|
||||
'name'=>'submit',
|
||||
|
||||
@@ -19,19 +19,33 @@
|
||||
<script src="<?php echo base_url();?>js/jquery.validate.min.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/jquery.jkey-1.1.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/imgpreview.full.jquery.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/thickbox.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/thickbox.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/common.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/manage_tables.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/swfobject.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/date.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script src="<?php echo base_url();?>js/datepicker.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function logout(logout)
|
||||
{
|
||||
logout = logout && <?php $r=FALSE;foreach($allowed_modules->result_array()as$module){$r|=$module['module_id']==='config';}echo $r;?>;
|
||||
if (logout && confirm("<?php echo $this->lang->line('config_logout'); ?>"))
|
||||
{
|
||||
window.location = "<?php echo site_url('config/backup_db'); ?>";
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location = "<?php echo site_url('home/logout'); ?>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
html {
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="menubar">
|
||||
@@ -55,17 +69,18 @@ html {
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="menubar_footer">
|
||||
<?php echo $this->lang->line('common_welcome')." $user_info->first_name $user_info->last_name! | "; ?>
|
||||
<?php echo anchor("home/logout",$this->lang->line("common_logout")); ?>
|
||||
<?php echo $this->lang->line('common_welcome')." $user_info->first_name $user_info->last_name! | "; ?>
|
||||
<a href="javascript:logout(true);"><?php echo $this->lang->line("common_logout"); ?></a>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="menubar_date">
|
||||
<?php echo date('F d, Y h:i a') ?>
|
||||
<?php echo date('F d, Y h:i a') ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="content_area_wrapper">
|
||||
<div id="content_area">
|
||||
|
||||
@@ -82,3 +82,6 @@ config_barcode_price,Prijs,Price,Price,Price,Price,Price,Price,Price,Price
|
||||
config_barcode_company,Bedrijfsnaam,Nombre del Comercio,Company Name,Nome de l\'Entreprise,公司名稱,Название Компании,ชื่อร้านค้า,Şirket Adı,Nama Perusahaan
|
||||
config_location_configuration,Stock Locaties,,Stock Locations,,,,,,
|
||||
config_location_info,Instellingen Locatie,,Location Configuration Information,,,,,,
|
||||
config_logout,Wilt u een backup maken alvorens uit te loggen?,,Don't you want to make a backup before logging out?,,,,,,
|
||||
config_backup_database,Backup Database,,Backup Database,,,,,,
|
||||
config_backup_button,Backup,Backup,Backup,Backup,Backup,Backup,Backup,Backup,Backup
|
||||
|
Reference in new issue
Block a user