diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php index 17e4c0c3..5244c949 100755 --- a/application/controllers/batchcard.php +++ b/application/controllers/batchcard.php @@ -682,7 +682,7 @@ class batchcard extends BaseController function getMaintenancesDetails(){ $date = $this->input->post('id1'); - $arraydata = $this->batchcard_model->maintenancesdata($date,$Autostartstoptime); + $arraydata = $this->batchcard_model->maintenancesdata($date); if(count($arraydata) != 0){ echo json_encode($arraydata);} } @@ -850,7 +850,7 @@ class batchcard extends BaseController $machinename= $this->input->post('mach_name'); $make= $this->input->post('tomake'); $capacity= $this->input->post('machs_capacity'); - $category= $this->input->post('machs_category'); + $category= strtoupper($this->input->post('machs_category')); $categoryarray = $this->batchcard_model->getmachineCategory(); foreach($categoryarray as $mc){ @@ -931,9 +931,11 @@ class batchcard extends BaseController } $addfilelist = array( 'Machine_code'=>$mach_code, - 'Machile_filename'=>$filename + 'Machine_filename'=>$filename ); $this->batchcard_model->addfilelist($addfilelist); + //print_r($addfilelist); + //die(); } @@ -943,10 +945,10 @@ class batchcard extends BaseController $calibrationagency = $this->input->post('machs_calibration_agency'); $Calibrationon = $this->input->post('machs_calibration_on'); $Calibrationdue = $this->input->post('machs_calibration_due'); - $Acctcriteria = $this->input->post('machs_acceptence_criteria'); - + if($category == 'LAB'){ $Acctcriteria = $this->input->post('machs_acceptence_criteria'); } + else{ $Acctcriteria = NULL; } $addchild = array( - 'Machine_id' => $mach_code, + 'Machine_Code' => $mach_code, 'Machine_Name'=> $machinename, 'Range' => $range, 'Operating_Range' => $operatingrange, @@ -969,6 +971,7 @@ class batchcard extends BaseController //echo 'i am a edit function'; $MachineCode = $_GET['Machcode']; //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); @@ -994,11 +997,11 @@ class batchcard extends BaseController $code_and_name= $this->input->post('mach_name'); $machcn = explode("-",$code_and_name); - $machinename = $machcn[1]; + //$machinename = $machcn[1]; $machinecode = $machcn[0]; $make= $this->input->post('tomake'); $capacity= $this->input->post('machs_capacity'); - $category= $this->input->post('machs_category'); + $category= strtoupper($this->input->post('machs_category')); $categoryarray = $this->batchcard_model->getmachineCategory(); foreach($categoryarray as $mc){ @@ -1025,7 +1028,7 @@ class batchcard extends BaseController $updatedby = $this->session->userdata ('userId'); $update = array( - 'Machine_Name' => $machinename, + //'Machine_Name' => $machinename, 'Machines_Make' => $make, 'Machines_Capacity' => $capacity, 'Machines_Category' => $category, @@ -1039,7 +1042,7 @@ class batchcard extends BaseController 'Commencement_Date' => $commencementdate , 'UpdatedBy' => $updatedby); - //--$updatedmaster = $this->batchcard_model->edithist_mstr($update,$machinecode); + $updatedmaster = $this->batchcard_model->edithist_mstr($update,$machinecode); $range = $this->input->post('machs_range'); $operatingrange = $this->input->post('machs_operating_range'); @@ -1047,11 +1050,13 @@ class batchcard extends BaseController $calibrationagency = $this->input->post('machs_calibration_agency'); $Calibrationon = $this->input->post('machs_calibration_on'); $Calibrationdue = $this->input->post('machs_calibration_due'); - $Acctcriteria = $this->input->post('machs_acceptence_criteria'); + if($category == 'LAB'){ $Acctcriteria = $this->input->post('machs_acceptence_criteria'); } + else{ $Acctcriteria = NULL; } + $updatechild = array( - 'Machine_id' => $machinecode, - 'Machine_Name'=> $machinename, + //'Machine_Code' => $machinecode, + //'Machine_Name'=> $machinename, 'Range' => $range, 'Operating_Range' => $operatingrange, 'Least_Count' => $leastcount, @@ -1093,7 +1098,7 @@ class batchcard extends BaseController $addfilelist = array( 'Machine_code'=>$machinecode, - 'Machile_filename'=>$filename + 'Machine_filename'=>$filename ); $this->batchcard_model->addfilelist($addfilelist); //$updatefilelist= array_filter(array_map('array_filter',$updatefilelist )); diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index 96c91e0c..bf6700dd 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -194,7 +194,6 @@ class batchcard_model extends CI_Model return $res->result(); } - function addmaint_dtl($array) { $this->db->insert('T_Batchcard_MaintanceDetails',$array); @@ -221,8 +220,7 @@ class batchcard_model extends CI_Model } function getmaint_dtl_MntDate($dateval) - { - + { $this->db->select('*'); $this->db->from('T_Batchcard_MaintanceDetails'); $this->db->where('Maint_Date',$dateval); @@ -240,10 +238,13 @@ class batchcard_model extends CI_Model } function maintenancesdata($date,$Autostartstoptime){ - $sql = "SELECT * FROM T_Batchcard_MaintanceDetails - where Maint_Date = '".$date."'"; + $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(); + return $res->result(); } function getmachine_codename(){ $this->db->select('Machine_Code,Machine_Name'); @@ -251,7 +252,7 @@ class batchcard_model extends CI_Model $res = $this->db->get(); return $res->result(); } - + /** Machines History/Master */ function getdept_dtls() { @@ -356,7 +357,7 @@ class batchcard_model extends CI_Model $this->db->from('T_Machine_Details'); if($MachineCode != '') { - $this->db->where('Machine_id',$MachineCode ); + $this->db->where('Machine_Code',$MachineCode ); } $bmd = $this->db->get(); return $bmd->result(); @@ -368,7 +369,7 @@ class batchcard_model extends CI_Model $this->db->from('T_Machines_file'); if($MachineCode != '') { - $this->db->where('Machine_Code',$MachineCode ); + $this->db->where('Machine_code',$MachineCode ); } $bmd = $this->db->get(); return $bmd->result(); @@ -424,7 +425,7 @@ class batchcard_model extends CI_Model } function edithist_dtl($array,$machinecode){ - $this->db->where('Machine_id',$machinecode ); + $this->db->where('Machine_Code',$machinecode ); $this->db->update('T_Machine_Details',$array); $mdtl = $this->db->affected_rows(); return $mdtl; @@ -478,6 +479,17 @@ class batchcard_model extends CI_Model $ar = $this->db->affected_rows(); return $ar; } + + + 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(); + } } diff --git a/application/views/BatchcardHistAdd.php b/application/views/BatchcardHistAdd.php index 8ce1e0d0..79a094e2 100755 --- a/application/views/BatchcardHistAdd.php +++ b/application/views/BatchcardHistAdd.php @@ -5,6 +5,10 @@ /* background-color: darkgrey; */ outline: 1px solid slategrey; } +#machs_category { + /* text-transform: capitalize; */ + text-transform: uppercase; +}
@@ -174,7 +178,7 @@
@@ -197,7 +201,7 @@ // reader.readAsDataURL(input.files[0]); // } // } - +//$("#machs_pono").select2({ allowClear: true }); /** ready function */ $(function() { @@ -237,7 +241,7 @@ $(function() { var data = suggestion.ConfigValue; var selectedvalue = $('input[name=machs_category]').val(); - if(selectedvalue=='lab') + if(selectedvalue=='LAB') { $("#lab").show(); } @@ -256,25 +260,24 @@ $(function() { /** on change machines category */ $("#machs_category").change(function(){ - var machine_category = $(this).val(); - - if(machine_category == 'lab'){ - $("#lab").show(); - } - else { + var machine_category = $(this).val().toUpperCase(); - $("#lab").hide();} + // var machine_category = $(this).val().toLowerCase().replace(/\b[a-z]/g, function(letter) { + // return letter.toUpperCase(); + // }); + + if(machine_category == 'LAB'){ $("#lab").show(); } + else { $("#lab").hide(); } - // alert(machine_category); }); /**on change pono to set supplier and podate */ $("#machs_pono").change(function(){ - var machine_category = $(this).val(); - //alert(machine_category); + var machine_pono = $(this).val(); + //alert(machine_pono); $.ajax({ - data:{id:machine_category}, + data:{id:machine_pono}, type:"POST", url:"batchcard/getPODtls", success:function(data) { diff --git a/application/views/BatchcardHistEdit.php b/application/views/BatchcardHistEdit.php index 14df322b..bf688955 100755 --- a/application/views/BatchcardHistEdit.php +++ b/application/views/BatchcardHistEdit.php @@ -1,4 +1,5 @@ Machile_filename; - // $Machile_filepath = $File->Machile_filepath ; + // $Machine_filename = $File->Machine_filename; + // $Machine_filepath = $File->Machine_filepath ; // } } @@ -81,6 +82,10 @@ /* background-color: darkgrey; */ outline: 1px solid slategrey; } +#machs_category { + /* text-transform: capitalize; */ + text-transform: uppercase; +}
@@ -113,7 +118,7 @@
- +
@@ -230,6 +235,29 @@
+ +
+ History Detail + + + + + + + + + + + + + + + + + +
S.NoMachine DepartmentMachine CatagoriesMaintenances TypesMaintenances Date and Time Maintenances LocationMaintenances DescriptionMaintenances ReasonTotal hrs for Maintenances
+
+
Multiple File @@ -250,7 +278,7 @@
@@ -278,10 +306,13 @@ var index = 0 ; var counter = 0; var counterConstant = 0; +var sno = 1; $(function() { var pono_arr = []; var dept_arr = []; + var file_arr = []; + var tble_arr = []; $("#machs_dept").select2(); $("#machs_pono").select2(); @@ -315,25 +346,49 @@ $(function() { div.innerHTML='
'+ '
'+ ''+ - ''+ + ''+ '
'+ '
'+ ''+ - // '
'+ + // '
'+ '
'+ '
'+ ''+ ''+ - 'Download'+ + 'Download'+ ''+ '
'+ '
'; $('#newdiv').append(div); index++; - + }); + + tble_arr = ; + //,Type,Maint_Subtype,,Maint_Time_from,Maint_Time_to,Maint_Total_hrs,Cost_Material,Cost_Labour + $.each(tble_arr,function(t,ta){ - }) + + if(ta.Type == '0'){ + Type = 'Maintenance'; + } + else{ + Type = 'Breakdown'; + } + var html = ''; + html += ''+sno+''; + html += ''+ta.Machines_Dept+' - '+ta.DepartmentName+''; + html += ''+ta.Machines_Category+''; + html += ''+Type+''; + html += ''+ta.Maint_Date+' / '+ta.Maint_Time+' hrs '+''; + html += ''+ta.Maint_Location+''; + html += ''+ta.Maint_Description+''; + html += ''+ta.Maint_Reason+''; + html += ''+ta.Maint_Total_hrs+''; + $('#Hist_Append').append(html); + sno++; + + }); //foreach( as $File) @@ -350,51 +405,38 @@ $(function() { var data = suggestion.ConfigValue; var selectedvalue = $('input[name=machs_category]').val(); - if(selectedvalue=='lab') - { - $("#lab").show(); - } - else{ - // // alert('bad'); - $("#lab").hide(); - - } - - + if(selectedvalue=='LAB') { $("#lab").show(); } + else{ $("#lab").hide(); } } }); var lab = ""; - - if(lab=='lab') - { - $("#lab").show(); - } + if(lab == 'LAB') { $("#lab").show(); } } ); - - +// $("#resetbtn").click(function(){ +// alert('0'); +// $("#machs_dept").select2("val", ""); +// $("#machs_pono").select2("val", "Select PONO"); +// }); /** on change machines category */ $("#machs_category").change(function(){ - var machine_category = $(this).val(); - - if(machine_category == 'lab'){ - $("#lab").show(); - } - else { + var machine_category = $(this).val().toUpperCase(); + // var machine_category = $(this).val().toLowerCase().replace(/\b[a-z]/g, function(letter) { + // return letter.toUpperCase(); + // }); + if(machine_category == 'LAB'){ $("#lab").show(); } + else { $("#lab").hide(); } - $("#lab").hide();} - - // alert(machine_category); }); /**on change pono to set supplier and podate */ $("#machs_pono").change(function(){ - var machine_category = $(this).val(); - //alert(machine_category); + var machine_pono = $(this).val(); + //alert(machine_pono); $.ajax({ - data:{id:machine_category}, + data:{id:machine_pono}, type:"POST", url:"batchcard/getPODtls", success:function(data) { @@ -503,6 +545,7 @@ function Copyfilename(id) var number = id.replace(/[^0-9]+/ig,""); var name = $('input[name='+id+']')[0].files[0].name; + //alert(name); $("#machs_filename"+number).val(name); } diff --git a/application/views/BatchcardMaintAdd.php b/application/views/BatchcardMaintAdd.php index e54a52f2..33adc94e 100755 --- a/application/views/BatchcardMaintAdd.php +++ b/application/views/BatchcardMaintAdd.php @@ -116,7 +116,7 @@
diff --git a/application/views/BatchcardMaintEdit.php b/application/views/BatchcardMaintEdit.php index d6c7d8ac..dace4efe 100755 --- a/application/views/BatchcardMaintEdit.php +++ b/application/views/BatchcardMaintEdit.php @@ -150,7 +150,7 @@ if(!empty($MaintEdit)) diff --git a/application/views/dailybatchcard.php b/application/views/dailybatchcard.php index 099eb033..fa6559a3 100755 --- a/application/views/dailybatchcard.php +++ b/application/views/dailybatchcard.php @@ -368,12 +368,13 @@ foreach($emplist as $r) - + + @@ -637,6 +638,7 @@ function keyValidate(e) Type = 'Breakdown'; } html += ''; + html += ''; html += ''; html += ''; html += ''; diff --git a/application/views/editDailyData.php b/application/views/editDailyData.php index f26ec23b..ad9bb304 100755 --- a/application/views/editDailyData.php +++ b/application/views/editDailyData.php @@ -378,12 +378,13 @@ foreach($emplist as $r)
Maintenance Details
Maintenance Details
Time Taken for Maintenance
Cost Details
S.NoMachine Code and Name Date Time Type
'+Index+''+arr.Machine_Code+' - '+arr.Machine_Name+''+arr.Maint_Date+''+arr.Maint_Time+''+Type+'
- + + @@ -485,6 +486,7 @@ var Index = 1; Type = 'Breakdown'; } html += ''; + html += ''; html += ''; html += ''; html += '';
Maintenance Details
Maintenance Details
Time Taken for Maintenance
Cost Details
S.NoMachine Code and Name Date Time Type
'+Index+''+arr.Machine_Code+' - '+arr.Machine_Name+''+arr.Maint_Date+''+arr.Maint_Time+''+Type+'