From 4765e693b1d2f99329dbe0df60ed90a935ab288e Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 12 Apr 2018 20:15:08 +0530 Subject: [PATCH] batchcard changes(upload option and date changes) --- application/controllers/batchcard.php | 156 ++++++-- application/models/batchcard_model.php | 104 +++-- application/views/BatchcardHistAdd.php | 38 +- application/views/BatchcardHistEdit.php | 49 ++- application/views/BatchcardHistListing.php | 2 +- application/views/BatchcardMaintAdd.php | 395 ++++++++++++------ application/views/BatchcardMaintEdit.php | 419 +++++++++++++++----- application/views/BatchcardMaintListing.php | 12 +- application/views/dailybatchcard.php | 4 +- application/views/editDailyData.php | 9 +- 10 files changed, 867 insertions(+), 321 deletions(-) diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php index 5244c949..393dcf98 100755 --- a/application/controllers/batchcard.php +++ b/application/controllers/batchcard.php @@ -439,10 +439,9 @@ class batchcard extends BaseController $did = $this->uri->segment(3); $data['emplist'] = $this->batchcard_model->getEmplistforReport(); $data['dailydata'] = $this->batchcard_model->getIndividualDailyData($did); - $ddate = explode("-",$data['dailydata'][0]->ddate); - $dateval =$ddate[2].'-'.$ddate[1].'-'.$ddate[0]; - $data['Maintenances'] = $this->batchcard_model->getmaint_dtl_MntDate($dateval); - //echo $dateval;print_r($data['Maintenances']); + //$ddate = explode("-",$data['dailydata'][0]->ddate); + //$dateval =$ddate[2].'-'.$ddate[1].'-'.$ddate[0]; + $data['Maintenances'] = $this->batchcard_model->getmaint_dtl_MntDate($data['dailydata'][0]->ddate); $this->global['pageTitle'] = 'Siddharth : Daily Batch Card Edit'; $this->loadViews("editDailyData", $this->global,$data,NULL); @@ -682,7 +681,7 @@ class batchcard extends BaseController function getMaintenancesDetails(){ $date = $this->input->post('id1'); - $arraydata = $this->batchcard_model->maintenancesdata($date); + $arraydata = $this->batchcard_model->getmaint_dtl_MntDate($date); if(count($arraydata) != 0){ echo json_encode($arraydata);} } @@ -700,11 +699,11 @@ class batchcard extends BaseController } function editMaint(){ - $MntID = $_GET['MntID']; - - //echo $MntID; + $MntID = base64_decode(urldecode($this->uri->segment(3))); + $data['MachineList'] = $this->batchcard_model->getmachine_codename(); $data['MaintEdit'] = $this->batchcard_model->getmaint_dtl_MntID($MntID); + $data['MaintFileEdit'] = $this->batchcard_model->getfiledetails($MntID); //print_r($data); $this->global['pageTitle'] = 'Siddharth : Edit Maintenance/Breakdown'; @@ -713,25 +712,81 @@ class batchcard extends BaseController function addmntbr(){ $type = $this->input->post('radiobtn'); - $maintenance_date = $this->input->post('maintenance_date'); + //$maintenance_date = $this->input->post('maintenance_date'); $machinecode = $this->input->post('machine'); if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype');} else{ $maintenance_subtype = NULL; } - $maintenance_time= $this->input->post('maintenance_time'); + //$maintenance_time= $this->input->post('maintenance_time'); $location = $this->input->post('location'); $maintenance_description = $this->input->post('maintenance_description'); $maintenance_reason = $this->input->post('maintenance_reason'); - $maintenance_time_from = $this->input->post('maintenance_time_from'); - $maintenance_time_to = $this->input->post('maintenance_time_to'); + // $maintenance_time_from = $this->input->post('maintenance_time_from'); + // $maintenance_time_to = $this->input->post('maintenance_time_to'); + $maintenance_date_time = $this->input->post('maintenance_date_time'); + $maintenance_date_time = explode(" - ",$maintenance_date_time); + $maintenance_time_from = $maintenance_date_time[0]; + $maintenance_time_to = $maintenance_date_time[1]; $maintenance_total_hrs = $this->input->post('maintenance_total_hrs'); $cost_material = $this->input->post('cost_material'); $cost_labour = $this->input->post('cost_labour'); $createdby = $this->session->userdata ( 'userId' ); - $addmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype,'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour, 'CreatedBy'=>$createdby); + $addmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour, 'CreatedBy'=>$createdby); + //'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, + //print_r($addmntbr); + //die(); $added = $this->batchcard_model->addmaint_dtl($addmntbr); - if($added == 1) + $maint_id = ''; + + if(count($added)>0) + { + foreach ($added as $key ) { + + $maint_id=$key->Maint_ID; + + } + } + + $count = $this->input->post('hidecounter'); + $constant = $this->input->post('hideconstant'); + + for($i=1;$i<=$constant;$i++){ + + $varname = 'filename'.$i; + $temp = $this->input->post($varname); + $pathname = 'browseFiles'.$i; + $Picture = $this->add($pathname); + $arr[] = array($temp,$Picture); + + } + + foreach($arr as $ma){ + + $index = 0; + foreach($ma as $key=>$value){ + $index++; + if($index == 1){ + $file_descrpition = $value; + } + if($index == 2){ + $filename = $value; + } + } + $addfilelist = array( + 'Machine_code/Maint_id'=>$maint_id, + 'File_name'=>$filename, + 'Status'=>"1", + 'Status_description'=>($type == '0') ? ('Maintenaces related files') : ('Breakdown related files') + ); + $this->batchcard_model->addfiledetails($addfilelist); + //print_r($addfilelist); + //die(); + + } + + + if(count($added)>0) { echo ""; } @@ -746,13 +801,17 @@ class batchcard extends BaseController $machinecode = $this->input->post('machine'); if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype'); } else{ $maintenance_subtype = NULL; } - $maintenance_date = $this->input->post('maintenance_date'); - $maintenance_time= $this->input->post('maintenance_time'); + // $maintenance_date = $this->input->post('maintenance_date'); + // $maintenance_time= $this->input->post('maintenance_time'); $location = $this->input->post('location'); $maintenance_description = $this->input->post('maintenance_description'); $maintenance_reason = $this->input->post('maintenance_reason'); - $maintenance_time_from = $this->input->post('maintenance_time_from'); - $maintenance_time_to = $this->input->post('maintenance_time_to'); + // $maintenance_time_from = $this->input->post('maintenance_time_from'); + // $maintenance_time_to = $this->input->post('maintenance_time_to'); + $maintenance_date_time = $this->input->post('maintenance_date_time'); + $maintenance_date_time = explode(" - ",$maintenance_date_time); + $maintenance_time_from = $maintenance_date_time[0]; + $maintenance_time_to = $maintenance_date_time[1]; $maintenance_total_hrs = $this->input->post('maintenance_total_hrs'); $cost_material = $this->input->post('cost_material'); $cost_labour = $this->input->post('cost_labour'); @@ -760,7 +819,8 @@ class batchcard extends BaseController // $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); // $updatedon = $date->format('d-m-Y H:i:s'); - $editmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype,'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour, 'UpdatedBy'=>$updatedby); + $editmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour, 'UpdatedBy'=>$updatedby); + //'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, //print_r($editmntbr); //die(); // echo $type; @@ -768,7 +828,42 @@ class batchcard extends BaseController // die(); $updated = $this->batchcard_model->updatemaint_dtl($editmntbr,$mntid); - if($updated == 1) + $count = $this->input->post('hidecounter'); + $constant = $this->input->post('hideconstant'); + for($i=1;$i<=$constant;$i++){ + + $varname = 'filename'.$i; + $temp = $this->input->post($varname); + $pathname = 'browseFiles'.$i; + $Picture = $this->add($pathname); + $arr[] = array($temp,$Picture); + + } + foreach($arr as $ma){ + + $index = 0; + foreach($ma as $key=>$value){ + $index++; + if($index == 1){ + $file_descrpition = $value; + } + if($index == 2){ + $filename = $value; + } + } + + + $addfilelist = array( + 'Machine_code/Maint_id'=>$mntid, + 'File_name'=>$filename, + 'Status'=>"1", + 'Status_description'=>($type == '0') ? ('Maintenaces files') : ('Breakdown files') + ); + $this->batchcard_model->addfiledetails($addfilelist); + //$updatefilelist= array_filter(array_map('array_filter',$updatefilelist )); + } + + if($updated >= 0) { echo ""; } @@ -930,10 +1025,12 @@ class batchcard extends BaseController } } $addfilelist = array( - 'Machine_code'=>$mach_code, - 'Machine_filename'=>$filename + 'Machine_code/Maint_id'=>$mach_code, + 'File_name'=>$filename, + 'Status'=>"0", + 'Status_description'=>"Machine file" ); - $this->batchcard_model->addfilelist($addfilelist); + $this->batchcard_model->addfiledetails($addfilelist); //print_r($addfilelist); //die(); @@ -969,12 +1066,13 @@ class batchcard extends BaseController function editHist(){ //echo 'i am a edit function'; - $MachineCode = $_GET['Machcode']; + //$MachineCode = $_GET['Machcode']; + $MachineCode = base64_decode(urldecode($this->uri->segment(3))); //echo $MachineCode; $data['TableDatas'] = $this->batchcard_model->getHist_tbls($MachineCode); $data['HistMstrEdit'] = $this->batchcard_model->getHist_mstr($MachineCode); $data['HistDtlsEdit'] = $this->batchcard_model->getHist_dtls($MachineCode); - $data['HistFileEdit'] = $this->batchcard_model->getHist_file($MachineCode); + $data['HistFileEdit'] = $this->batchcard_model->getfiledetails($MachineCode); $data['HistDeptList'] = $this->batchcard_model->getdept_dtls(); $data['HistPONOList'] = $this->batchcard_model->getpono(); //echo count($data['HistFileEdit']); @@ -1097,10 +1195,12 @@ class batchcard extends BaseController $addfilelist = array( - 'Machine_code'=>$machinecode, - 'Machine_filename'=>$filename + 'Machine_code/Maint_id'=>$machinecode, + 'File_name'=>$filename, + 'Status'=>"0", + 'Status_description'=>"Machine File" ); - $this->batchcard_model->addfilelist($addfilelist); + $this->batchcard_model->addfiledetails($addfilelist); //$updatefilelist= array_filter(array_map('array_filter',$updatefilelist )); } echo ""; diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index 67647fa8..1a580e40 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -196,9 +196,21 @@ class batchcard_model extends CI_Model function addmaint_dtl($array) { + // $this->db->insert('T_Batchcard_MaintanceDetails',$array); + // $bmd = $this->db->affected_rows(); + // return $bmd; + $this->db->insert('T_Batchcard_MaintanceDetails',$array); $bmd = $this->db->affected_rows(); - return $bmd; + + + if($bmd>0) + { + $this->db->select('max(Maint_ID) as Maint_ID'); + $this->db->from('T_Batchcard_MaintanceDetails'); + $res = $this->db->get(); + return $res->result(); + } } function getmaint_dtl() { @@ -221,13 +233,25 @@ class batchcard_model extends CI_Model function getmaint_dtl_MntDate($dateval) { - $this->db->select('bm.*,mm.Machine_Name'); - $this->db->from('T_Batchcard_MaintanceDetails bm'); - $this->db->join('T_Machine_Master mm', 'bm.Machine_Code = mm.Machine_Code', 'left'); - $this->db->where('mm.Machines_Category = "TRP"'); - $this->db->where('bm.Maint_Date',$dateval); - $bmd = $this->db->get(); - return $bmd->result(); + // $converted = date('Y-m-d H:i:s',$dateval); + // $this->db->select('bm.*,mm.Machine_Name'); + // $this->db->from('T_Batchcard_MaintanceDetails bm'); + // $this->db->join('T_Machine_Master mm', 'bm.Machine_Code = mm.Machine_Code', 'left'); + // $this->db->where('mm.Machines_Category = "TRP"'); + // $this->db->where('bm.CreatedOn',$converted); + // $bmd = $this->db->get(); + // return $bmd->result(); + + $sql = "select bm.*,mm.Machine_Name, + DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') as date, + DATE_FORMAT(bm.CreatedOn,'%l:%i %p') as time + from T_Batchcard_MaintanceDetails as bm + left join T_Machine_Master as mm on bm.Machine_Code = mm.Machine_Code + where mm.Machines_Category = 'TRP' + and DATE_FORMAT(bm.CreatedOn,'%Y-%m-%d') = '".$dateval."'"; + + $bmd = $this->db->query($sql); + return $bmd->result(); } function updatemaint_dtl($array,$MntID) @@ -239,15 +263,19 @@ class batchcard_model extends CI_Model return $bmd; } - function maintenancesdata($date,$Autostartstoptime){ - $sql = "select bm.*,mm.Machine_Name - from T_Batchcard_MaintanceDetails as bm - left join T_Machine_Master as mm on bm.Machine_Code = mm.Machine_Code - where mm.Machines_Category = 'TRP' - and bm.Maint_Date = '".$date."'"; - $res = $this->db->query($sql); - return $res->result(); - } + // function maintenancesdata($date,$Autostartstoptime){ + // $sql = "select bm.*,mm.Machine_Name, + // DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') as date, + // DATE_FORMAT(bm.CreatedOn,'%l:%i %p') as time + // from T_Batchcard_MaintanceDetails as bm + // left join T_Machine_Master as mm on bm.Machine_Code = mm.Machine_Code + // where mm.Machines_Category = 'TRP' + // and DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') = '".$date."'"; + // //'%Y-%m-%d' + // //DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') FROM + // $res = $this->db->query($sql); + // return $res->result(); + // } function getmachine_codename(){ $this->db->select('Machine_Code,Machine_Name'); $this->db->from('T_Machine_Master'); @@ -320,8 +348,8 @@ class batchcard_model extends CI_Model return $child; } - - function addfilelist($array){ + //This function for multi file upload option (both machine and maint/br screen) + function addfiledetails($array){ $this->db->insert('T_Machines_file', $array); $r = $this->db->affected_rows(); @@ -364,18 +392,21 @@ class batchcard_model extends CI_Model $bmd = $this->db->get(); return $bmd->result(); } - function getHist_file($MachineCode = '') + + //This function for multi file upload option (both machine and maint/br screen) + function getfiledetails($data = '') { $this->db->select('*'); $this->db->from('T_Machines_file'); - if($MachineCode != '') + if($data != '') { - $this->db->where('Machine_code',$MachineCode ); + $this->db->where('Machine_code/Maint_id',$data ); } $bmd = $this->db->get(); return $bmd->result(); } + function getHist_mstr($MachineCode = '') { @@ -473,7 +504,7 @@ class batchcard_model extends CI_Model return $temp; } - + //This function for multi file upload option (both machine and maint/br screen) function deletefiledetails($id,$name){ $sql = "DELETE FROM T_Machines_file WHERE File_No =".$id; unlink("uploads/images/".$name);//this deletes the file on particular folder too @@ -484,13 +515,26 @@ class batchcard_model extends CI_Model function getHist_tbls($MachineCode){ - $this->db->select('T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,T_DepartmentDetails.DepartmentName'); - $this->db->from('T_Machine_Master'); - $this->db->join('T_Batchcard_MaintanceDetails','T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code'); - $this->db->join('T_DepartmentDetails','T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept'); - $this->db->where('T_Machine_Master.Machine_Code',$MachineCode); - $res = $this->db->get(); - return $res->result(); + $sql = "SELECT T_Machine_Master.*,T_Batchcard_MaintanceDetails.*, + T_DepartmentDetails.DepartmentName, + DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%d-%m-%Y') as date, + DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%l:%i %p') as time + FROM T_Machine_Master + LEFT JOIN T_Batchcard_MaintanceDetails ON T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code + LEFT JOIN T_DepartmentDetails ON T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept + WHERE T_Machine_Master.Machine_Code = '".$MachineCode."'" ; + + $res = $this->db->query($sql); + return $res->result(); + + + // $this->db->select('T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,T_DepartmentDetails.DepartmentName'); + // $this->db->from('T_Machine_Master'); + // $this->db->join('T_Batchcard_MaintanceDetails','T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code'); + // $this->db->join('T_DepartmentDetails','T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept'); + // $this->db->where('T_Machine_Master.Machine_Code',$MachineCode); + // $res = $this->db->get(); + // return $res->result(); } } diff --git a/application/views/BatchcardHistAdd.php b/application/views/BatchcardHistAdd.php index 79a094e2..715eda0f 100755 --- a/application/views/BatchcardHistAdd.php +++ b/application/views/BatchcardHistAdd.php @@ -1,4 +1,5 @@
@@ -342,11 +346,12 @@ $(function() { var div = document.createElement('div'); div.id = "dbdivid"+index; - div.className="row"; + div.className="row form-group"; + div.style="margin-top:14px"; div.innerHTML='
'+ '
'+ ''+ - ''+ + ''+ '
'+ '
'+ ''+ @@ -355,8 +360,8 @@ $(function() { '
'+ ''+ ''+ - 'Download'+ - ''+ + 'Download'+ + ''+ '
'+ '
'; @@ -380,7 +385,7 @@ $(function() { html += ''+ta.Machines_Dept+' - '+ta.DepartmentName+''; html += ''+ta.Machines_Category+''; html += ''+Type+''; - html += ''+ta.Maint_Date+' / '+ta.Maint_Time+' hrs '+''; + html += ''+ta.date+' / '+ta.time+''; html += ''+ta.Maint_Location+''; html += ''+ta.Maint_Description+''; html += ''+ta.Maint_Reason+''; @@ -480,7 +485,7 @@ $("#addmorebutton").click(function(){ var div = document.createElement('div'); div.id = "divid"+counterConstant; div.className="row"; -div.innerHTML='
'+ +div.innerHTML='
'+ '
'+ ''+ // ''+ @@ -527,7 +532,7 @@ function deleted(deleteid) { } function removeRow(input) { - +// alert(input); var number = input.replace(/[^0-9]+/ig,""); //if(counter >= 1){ @@ -542,12 +547,20 @@ function removeRow(input) { function Copyfilename(id) { + + var size = $('input[name='+id+']')[0].files[0].size; var number = id.replace(/[^0-9]+/ig,""); - + + if(size > 2100000){ + //alert(id); + alert('Sorry Your File is Large To 2MB'); + removeRow(id); + //$('input[name = browseFiles'+number+']').val(' '); + }else { var name = $('input[name='+id+']')[0].files[0].name; //alert(name); - $("#machs_filename"+number).val(name); + } } \ No newline at end of file diff --git a/application/views/BatchcardHistListing.php b/application/views/BatchcardHistListing.php index 42a3fe51..2b3aa60e 100755 --- a/application/views/BatchcardHistListing.php +++ b/application/views/BatchcardHistListing.php @@ -53,7 +53,7 @@ Machines_Lifetime ?> Commencement_Date; ?> - + "> + + +

-
Siddharth Industries - Add Maintenance And Breakdown
+
Siddharth Industries - Add Maintenance And Breakdown

@@ -37,7 +46,7 @@ -
+

@@ -51,16 +60,16 @@ External
-
+ + -> -
+
-->
@@ -80,25 +89,26 @@
 
- Time Taken for Maintenance -
- - -
+ Time Taken for Maintenance +
+ + + +
-
- - -
- -
+
-
+
+
- - Cost + Cost
@@ -108,10 +118,22 @@
- -
+
 
+
+ + Multiple File +
+ +
+
+ +
+ + +
+
diff --git a/application/views/BatchcardMaintEdit.php b/application/views/BatchcardMaintEdit.php index dace4efe..e1537707 100755 --- a/application/views/BatchcardMaintEdit.php +++ b/application/views/BatchcardMaintEdit.php @@ -1,3 +1,4 @@ + Maint_Reason; $Mnt_time_from = $Me->Maint_Time_from; $Mnt_time_to = $Me->Maint_Time_to; + $Mnt_Date_Time = $Mnt_time_from.' - '.$Mnt_time_to ; $Mnt_total_hrs = $Me->Maint_Total_hrs; $Cost_material = $Me->Cost_Material; $Cost_labour = $Me->Cost_Labour; } } -?> +// if(!empty($MaintFileEdit)){ +// $filecount = count($MaintFileEdit); +// } + +?> +
@@ -87,7 +101,7 @@ if(!empty($MaintEdit)) External
-
+
@@ -115,7 +129,11 @@ if(!empty($MaintEdit))
Time Taken for Maintenance -
+
+ + +
+
@@ -142,10 +160,25 @@ if(!empty($MaintEdit))
- - +
-
+ +
 
+
+ + Multiple File +
+ +
+
+ +
+ + + + +
+
+$("#addmorebutton").click(function(){ + +// alert('sda'); +// alert(index); +// alert(counter); +// alert(counterConstant); +// var removenum = counterConstant+index; + +// if(counter>4){ +// alert("allow only 5 files"); +// return false; +// } +// else{ + + counter++; + counterConstant++; + +var div = document.createElement('div'); +div.id = "divid"+counterConstant; +div.className="row"; +div.innerHTML='
'+ + '
'+ + ''+ + // ''+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'; + $('#newdiv').append(div); + + + $('#hidecounter').val(counter); + $('#hideconstant').val(counterConstant); + +//} +}); + +function deleted(deleteid) { + + var number = deleteid.replace(/[^0-9]+/ig,""); + + var fileid = $("#hidefileid"+number).val(); + + var filename = $("#machs_filename"+number).val(); + + $.ajax({ + data:{id:fileid,name:filename}, + type:"POST", + url:"batchcard/Removefiledetails", + success:function(data) { + } + }); + + $("#dbdivid"+number).remove(); + +} + +function removeRow(input) { + //alert(input); + var number = input.replace(/[^0-9]+/ig,""); + + //if(counter >= 1){ + counter--; + $("#divid"+number).remove(); + $('#hidecounter').val(counter); + //} + +} + + + +function Copyfilename(id) +{ + + var size = $('input[name='+id+']')[0].files[0].size; + + var number = id.replace(/[^0-9]+/ig,""); + + if(size > 2100000){ + //alert(id); + alert('Sorry Your File is Large To 2MB'); + removeRow(id); + //$('input[name = browseFiles'+number+']').val(' '); + }else { + var name = $('input[name='+id+']')[0].files[0].name; + //alert(name); + $("#maint_filename"+number).val(name); + } +} + + \ No newline at end of file diff --git a/application/views/BatchcardMaintListing.php b/application/views/BatchcardMaintListing.php index 840ab5e7..3979b650 100755 --- a/application/views/BatchcardMaintListing.php +++ b/application/views/BatchcardMaintListing.php @@ -21,13 +21,13 @@ - + - - + @@ -46,15 +46,15 @@ ?> - - + - + '; html += ''; - html += ''; - html += ''; + html += ''; + html += ''; html += ''; html += ''; html += ''; diff --git a/application/views/editDailyData.php b/application/views/editDailyData.php index ad9bb304..7987d23c 100755 --- a/application/views/editDailyData.php +++ b/application/views/editDailyData.php @@ -476,6 +476,11 @@ var Index = 1; mnt = ; //alert(mnt); $.each(mnt,function(i,arr){ + //var dbdate = new Date(arr.CreatedOn); + //var newDate = dbdate.toString('dd-MM-yyyy'); + // alert(arr.CreatedOn); + // alert(arr.date); + // alert(arr.time); var html = ''; @@ -487,8 +492,8 @@ var Index = 1; } html += ''; html += ''; - html += ''; - html += ''; + html += ''; + html += ''; html += ''; html += ''; html += '';
Maintenance Details
Maintenance Details
Time Taken for Maintenance
Nature of maintenanceDateTime             Location                         Description                        Reason             FromType == 0){ echo "MAINTENANCES"; }else{echo "BREAKDOWN";} ?>Maint_Date ?>Maint_Time ?> Maint_Location ?> Maint_Description ?> Maint_Reason ?> Maint_Time_from ?> Maint_Time_to ?> Maint_Total_hrs ?>
'+Index+''+arr.Machine_Code+' - '+arr.Machine_Name+''+arr.Maint_Date+''+arr.Maint_Time+''+arr.date+''+arr.time+''+Type+''+arr.Maint_Location+''+arr.Maint_Description+'
'+Index+''+arr.Machine_Code+' - '+arr.Machine_Name+''+arr.Maint_Date+''+arr.Maint_Time+''+arr.date+''+arr.time+''+Type+''+arr.Maint_Location+''+arr.Maint_Description+'