change file load widget in excel_import forms (#116)

used jasny-bootstrap
This commit is contained in:
FrancescoUK
2016-02-28 16:26:58 +00:00
parent c675a73fc6
commit 0cd7af7c4f
15 changed files with 67 additions and 44 deletions

View File

@@ -142,6 +142,7 @@ class Customers extends Person_controller
{
$msg = $this->lang->line('items_excel_import_failed');
echo json_encode( array('success'=>false,'message'=>$msg) );
return;
}
else
@@ -155,22 +156,22 @@ class Customers extends Person_controller
while (($data = fgetcsv($handle)) !== FALSE)
{
$person_data = array(
'first_name'=>$data[0],
'last_name'=>$data[1],
'gender'=>$data[2],
'email'=>$data[3],
'phone_number'=>$data[4],
'address_1'=>$data[5],
'address_2'=>$data[6],
'city'=>$data[7],
'state'=>$data[8],
'zip'=>$data[9],
'country'=>$data[10],
'comments'=>$data[11]
'first_name'=>$data[0],
'last_name'=>$data[1],
'gender'=>$data[2],
'email'=>$data[3],
'phone_number'=>$data[4],
'address_1'=>$data[5],
'address_2'=>$data[6],
'city'=>$data[7],
'state'=>$data[8],
'zip'=>$data[9],
'country'=>$data[10],
'comments'=>$data[11]
);
$customer_data=array(
'taxable'=>$data[13]=='' ? 0:1
'taxable'=>$data[13]=='' ? 0:1
);
$account_number = $data[12];
@@ -191,7 +192,8 @@ class Customers extends Person_controller
}
else
{
echo json_encode( array('success'=>false,'message'=>'Your upload file has no data or not in supported format.') );
echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') );
return;
}
}
@@ -207,8 +209,7 @@ class Customers extends Person_controller
$msg = "Import Customers successful";
}
echo json_encode( array('success'=>$success,'message'=>$msg) );
echo json_encode( array('success'=>$success, 'message'=>$msg) );
}
}
?>

View File

@@ -757,8 +757,9 @@ class Items extends Secure_area implements iData_controller
{
$failCodes[] = $i;
}
$i++;
}
$i++;
}
else
{
@@ -781,6 +782,5 @@ class Items extends Secure_area implements iData_controller
echo json_encode( array('success'=>$success, 'message'=>$msg) );
}
}
?>

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Sie verwenden Open Source Point Of Sales
$lang["common_zip"] = "PLZ";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Voralge (CSV)";
$lang["common_import_file_path"] = "Dateipfad";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Voller Dateipfad zum Excel File notwendig";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Erforderlich";
$lang["common_days_sunday"] = "Sonntag";
$lang["common_days_monday"] = "Montag";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "You are using Open Source Point Of Sale V
$lang["common_zip"] = "Zip";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "Select file";
$lang["common_import_change_file"] = "Change";
$lang["common_import_remove_file"] = "Remove";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "Sunday";
$lang["common_days_monday"] = "Monday";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Estás usando Open Source Point Of Sale V
$lang["common_zip"] = "Código Postal";
$lang["common_import"] = "Importar";
$lang["common_download_import_template"] = "Descargar Plantilla de Importación de Excel (CSV)";
$lang["common_import_file_path"] = "Ruta del archivo";
$lang["common_import_excel"] = "Importar Excel";
$lang["common_import_full_path"] = "Requerida la ruta completa del archivo";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Requerido";
$lang["common_days_sunday"] = "Domingo";
$lang["common_days_monday"] = "Lunes";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Vous utilisez Open Source Point Of Sale V
$lang["common_zip"] = "Zip";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "Dimanche";
$lang["common_days_monday"] = "Lundi";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Anda menggunakan Open Source Point Of Sal
$lang["common_zip"] = "Kode POS";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "";
$lang["common_days_monday"] = "";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "You are using Open Source Point Of Sale V
$lang["common_zip"] = "Postcode";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "Zondag";
$lang["common_days_monday"] = "Maandag";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Вы использоваете Open Sour
$lang["common_zip"] = "Почтовый индекс";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "";
$lang["common_days_monday"] = "";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "คุณกำลังใช้ Opensou
$lang["common_zip"] = "รหัสไปรษณีย์";
$lang["common_import"] = "นำเข้า";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "ต้องกรอก";
$lang["common_days_sunday"] = "";
$lang["common_days_monday"] = "";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "Kullandığınız sürüm";
$lang["common_zip"] = "Şehir Kodu";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "";
$lang["common_days_monday"] = "";

View File

@@ -51,9 +51,11 @@ $lang["common_you_are_using_ospos"] = "您正在使用 Open Source Point of Sale
$lang["common_zip"] = "郵遞區號";
$lang["common_import"] = "Import";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_import_select_file"] = "";
$lang["common_import_change_file"] = "";
$lang["common_import_remove_file"] = "";
$lang["common_required"] = "Required";
$lang["common_days_sunday"] = "";
$lang["common_days_monday"] = "";

View File

@@ -5,18 +5,18 @@
<?php echo form_open_multipart('customers/do_excel_import/', array('id'=>'item_form', 'class'=>'form-horizontal')); ?>
<fieldset id="item_basic_info">
<div class="form-group form-group-sm">
<div class="col-xs-6">
<div class="col-xs-12">
<a href="<?php echo site_url('customers/excel'); ?>"><?php echo $this->lang->line('common_download_import_template'); ?></a>
</div>
</div>
<div class="form-group form-group-sm">
<?php echo form_label($this->lang->line('common_import_file_path'), 'name', array('class'=>'control-label col-xs-3')); ?>
<div class='col-xs-6'>
<label class="file">
<input type="file" id="file_input" name="file_input">
<span class="file-custom"></span>
</label>
<div class='col-xs-12'>
<div class="fileinput fileinput-new input-group" data-provides="fileinput">
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i><span class="fileinput-filename"></span></div>
<span class="input-group-addon input-sm btn btn-default btn-file"><span class="fileinput-new"><?php echo $this->lang->line("common_import_select_file"); ?></span><span class="fileinput-exists"><?php echo $this->lang->line("common_import_change_file"); ?></span><input type="file" id="file_path" name="file_path"></span>
<a href="#" class="input-group-addon input-sm btn btn-default fileinput-exists" data-dismiss="fileinput"><?php echo $this->lang->line("common_import_remove_file"); ?></a>
</div>
</div>
</div>
</fieldset>

View File

@@ -2,21 +2,21 @@
<ul id="error_message_box" class="error_message_box"></ul>
<?php echo form_open_multipart('items/do_excel_import/', array('id'=>'item_form', 'class' => 'form-horizontal')); ?>
<?php echo form_open_multipart('items/do_excel_import/', array('id'=>'item_form', 'class'=>'form-horizontal')); ?>
<fieldset id="item_basic_info">
<div class="form-group form-group-sm">
<div class="col-xs-6">
<div class="col-xs-12">
<a href="<?php echo site_url('items/excel'); ?>"><?php echo $this->lang->line('common_download_import_template'); ?></a>
</div>
</div>
<div class="form-group form-group-sm">
<?php echo form_label($this->lang->line('common_import_file_path'), 'name', array('class'=>'control-label col-xs-3')); ?>
<div class='col-xs-6'>
<label class="file">
<input type="file" id="item_image" name="file_path">
<span class="file-custom"></span>
</label>
<div class='col-xs-12'>
<div class="fileinput fileinput-new input-group" data-provides="fileinput">
<div class="form-control" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i><span class="fileinput-filename"></span></div>
<span class="input-group-addon input-sm btn btn-default btn-file"><span class="fileinput-new"><?php echo $this->lang->line("common_import_select_file"); ?></span><span class="fileinput-exists"><?php echo $this->lang->line("common_import_change_file"); ?></span><input type="file" id="file_path" name="file_path"></span>
<a href="#" class="input-group-addon input-sm btn btn-default fileinput-exists" data-dismiss="fileinput"><?php echo $this->lang->line("common_import_remove_file"); ?></a>
</div>
</div>
</div>
</fieldset>

View File

@@ -50,9 +50,11 @@ common_you_are_using_ospos,Sie verwenden Open Source Point Of Sales Version,You
common_zip,PLZ,Postcode,Código Postal,Zip,Zip,郵遞區號,Почтовый индекс,รหัสไปรษณีย์,Şehir Kodu,Kode POS
common_import,Import,Import,Importar,Import,Import,Import,Import,นำเข้า,Import,Import
common_download_import_template,Download Import Excel Voralge (CSV),Download Import Excel Template (CSV),Descargar Plantilla de Importación de Excel (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV)
common_import_file_path,Dateipfad,file path,Ruta del archivo,file path,file path,file path,file path,file path,file path,file path
common_import_excel,Excel Import,Excel Import,Importar Excel,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import
common_import_full_path,Voller Dateipfad zum Excel File notwendig,Full path to excel file required,Requerida la ruta completa del archivo,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required
common_import_select_file,,,,Select file,,,,,,
common_import_change_file,,,,Change,,,,,,
common_import_remove_file,,,,Remove,,,,,,
common_required,Erforderlich,Required,Requerido,Required,Required,Required,Required,ต้องกรอก,Required,Required
common_days_sunday,Sonntag,Zondag,Domingo,Sunday,Dimanche,,,,,
common_days_monday,Montag,Maandag,Lunes,Monday,Lundi,,,,,
1 label de-CH nl-BE es en fr zh ru th tr id
50 common_zip PLZ Postcode Código Postal Zip Zip 郵遞區號 Почтовый индекс รหัสไปรษณีย์ Şehir Kodu Kode POS
51 common_import Import Import Importar Import Import Import Import นำเข้า Import Import
52 common_download_import_template Download Import Excel Voralge (CSV) Download Import Excel Template (CSV) Descargar Plantilla de Importación de Excel (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV) Download Import Excel Template (CSV)
common_import_file_path Dateipfad file path Ruta del archivo file path file path file path file path file path file path file path
53 common_import_excel Excel Import Excel Import Importar Excel Excel Import Excel Import Excel Import Excel Import Excel Import Excel Import Excel Import
54 common_import_full_path Voller Dateipfad zum Excel File notwendig Full path to excel file required Requerida la ruta completa del archivo Full path to excel file required Full path to excel file required Full path to excel file required Full path to excel file required Full path to excel file required Full path to excel file required Full path to excel file required
55 common_import_select_file Select file
56 common_import_change_file Change
57 common_import_remove_file Remove
58 common_required Erforderlich Required Requerido Required Required Required Required ต้องกรอก Required Required
59 common_days_sunday Sonntag Zondag Domingo Sunday Dimanche
60 common_days_monday Montag Maandag Lunes Monday Lundi