batchcard changes(upload option and date changes)
This commit is contained in:
parent
a0dd0b2d82
commit
4765e693b1
@ -439,10 +439,9 @@ class batchcard extends BaseController
|
|||||||
$did = $this->uri->segment(3);
|
$did = $this->uri->segment(3);
|
||||||
$data['emplist'] = $this->batchcard_model->getEmplistforReport();
|
$data['emplist'] = $this->batchcard_model->getEmplistforReport();
|
||||||
$data['dailydata'] = $this->batchcard_model->getIndividualDailyData($did);
|
$data['dailydata'] = $this->batchcard_model->getIndividualDailyData($did);
|
||||||
$ddate = explode("-",$data['dailydata'][0]->ddate);
|
//$ddate = explode("-",$data['dailydata'][0]->ddate);
|
||||||
$dateval =$ddate[2].'-'.$ddate[1].'-'.$ddate[0];
|
//$dateval =$ddate[2].'-'.$ddate[1].'-'.$ddate[0];
|
||||||
$data['Maintenances'] = $this->batchcard_model->getmaint_dtl_MntDate($dateval);
|
$data['Maintenances'] = $this->batchcard_model->getmaint_dtl_MntDate($data['dailydata'][0]->ddate);
|
||||||
//echo $dateval;print_r($data['Maintenances']);
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Daily Batch Card Edit';
|
$this->global['pageTitle'] = 'Siddharth : Daily Batch Card Edit';
|
||||||
$this->loadViews("editDailyData", $this->global,$data,NULL);
|
$this->loadViews("editDailyData", $this->global,$data,NULL);
|
||||||
|
|
||||||
@ -682,7 +681,7 @@ class batchcard extends BaseController
|
|||||||
function getMaintenancesDetails(){
|
function getMaintenancesDetails(){
|
||||||
|
|
||||||
$date = $this->input->post('id1');
|
$date = $this->input->post('id1');
|
||||||
$arraydata = $this->batchcard_model->maintenancesdata($date);
|
$arraydata = $this->batchcard_model->getmaint_dtl_MntDate($date);
|
||||||
if(count($arraydata) != 0){
|
if(count($arraydata) != 0){
|
||||||
echo json_encode($arraydata);}
|
echo json_encode($arraydata);}
|
||||||
}
|
}
|
||||||
@ -700,11 +699,11 @@ class batchcard extends BaseController
|
|||||||
}
|
}
|
||||||
function editMaint(){
|
function editMaint(){
|
||||||
|
|
||||||
$MntID = $_GET['MntID'];
|
$MntID = base64_decode(urldecode($this->uri->segment(3)));
|
||||||
|
|
||||||
//echo $MntID;
|
|
||||||
$data['MachineList'] = $this->batchcard_model->getmachine_codename();
|
$data['MachineList'] = $this->batchcard_model->getmachine_codename();
|
||||||
$data['MaintEdit'] = $this->batchcard_model->getmaint_dtl_MntID($MntID);
|
$data['MaintEdit'] = $this->batchcard_model->getmaint_dtl_MntID($MntID);
|
||||||
|
$data['MaintFileEdit'] = $this->batchcard_model->getfiledetails($MntID);
|
||||||
//print_r($data);
|
//print_r($data);
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Edit Maintenance/Breakdown';
|
$this->global['pageTitle'] = 'Siddharth : Edit Maintenance/Breakdown';
|
||||||
@ -713,25 +712,81 @@ class batchcard extends BaseController
|
|||||||
function addmntbr(){
|
function addmntbr(){
|
||||||
|
|
||||||
$type = $this->input->post('radiobtn');
|
$type = $this->input->post('radiobtn');
|
||||||
$maintenance_date = $this->input->post('maintenance_date');
|
//$maintenance_date = $this->input->post('maintenance_date');
|
||||||
$machinecode = $this->input->post('machine');
|
$machinecode = $this->input->post('machine');
|
||||||
if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype');}
|
if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype');}
|
||||||
else{ $maintenance_subtype = NULL; }
|
else{ $maintenance_subtype = NULL; }
|
||||||
$maintenance_time= $this->input->post('maintenance_time');
|
//$maintenance_time= $this->input->post('maintenance_time');
|
||||||
$location = $this->input->post('location');
|
$location = $this->input->post('location');
|
||||||
$maintenance_description = $this->input->post('maintenance_description');
|
$maintenance_description = $this->input->post('maintenance_description');
|
||||||
$maintenance_reason = $this->input->post('maintenance_reason');
|
$maintenance_reason = $this->input->post('maintenance_reason');
|
||||||
$maintenance_time_from = $this->input->post('maintenance_time_from');
|
// $maintenance_time_from = $this->input->post('maintenance_time_from');
|
||||||
$maintenance_time_to = $this->input->post('maintenance_time_to');
|
// $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');
|
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
|
||||||
$cost_material = $this->input->post('cost_material');
|
$cost_material = $this->input->post('cost_material');
|
||||||
$cost_labour = $this->input->post('cost_labour');
|
$cost_labour = $this->input->post('cost_labour');
|
||||||
$createdby = $this->session->userdata ( 'userId' );
|
$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);
|
$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 "<script>alert('Saved Successfully!');window.location.href='getMaintListing';</script>";
|
echo "<script>alert('Saved Successfully!');window.location.href='getMaintListing';</script>";
|
||||||
}
|
}
|
||||||
@ -746,13 +801,17 @@ class batchcard extends BaseController
|
|||||||
$machinecode = $this->input->post('machine');
|
$machinecode = $this->input->post('machine');
|
||||||
if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype'); }
|
if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype'); }
|
||||||
else{ $maintenance_subtype = NULL; }
|
else{ $maintenance_subtype = NULL; }
|
||||||
$maintenance_date = $this->input->post('maintenance_date');
|
// $maintenance_date = $this->input->post('maintenance_date');
|
||||||
$maintenance_time= $this->input->post('maintenance_time');
|
// $maintenance_time= $this->input->post('maintenance_time');
|
||||||
$location = $this->input->post('location');
|
$location = $this->input->post('location');
|
||||||
$maintenance_description = $this->input->post('maintenance_description');
|
$maintenance_description = $this->input->post('maintenance_description');
|
||||||
$maintenance_reason = $this->input->post('maintenance_reason');
|
$maintenance_reason = $this->input->post('maintenance_reason');
|
||||||
$maintenance_time_from = $this->input->post('maintenance_time_from');
|
// $maintenance_time_from = $this->input->post('maintenance_time_from');
|
||||||
$maintenance_time_to = $this->input->post('maintenance_time_to');
|
// $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');
|
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
|
||||||
$cost_material = $this->input->post('cost_material');
|
$cost_material = $this->input->post('cost_material');
|
||||||
$cost_labour = $this->input->post('cost_labour');
|
$cost_labour = $this->input->post('cost_labour');
|
||||||
@ -760,7 +819,8 @@ class batchcard extends BaseController
|
|||||||
// $date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
// $date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
// $updatedon = $date->format('d-m-Y H:i:s');
|
// $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);
|
//print_r($editmntbr);
|
||||||
//die();
|
//die();
|
||||||
// echo $type;
|
// echo $type;
|
||||||
@ -768,7 +828,42 @@ class batchcard extends BaseController
|
|||||||
// die();
|
// die();
|
||||||
$updated = $this->batchcard_model->updatemaint_dtl($editmntbr,$mntid);
|
$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 "<script>alert('Saved Successfully!');window.location.href='HourlyListing';</script>";
|
echo "<script>alert('Saved Successfully!');window.location.href='HourlyListing';</script>";
|
||||||
}
|
}
|
||||||
@ -930,10 +1025,12 @@ class batchcard extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$addfilelist = array(
|
$addfilelist = array(
|
||||||
'Machine_code'=>$mach_code,
|
'Machine_code/Maint_id'=>$mach_code,
|
||||||
'Machine_filename'=>$filename
|
'File_name'=>$filename,
|
||||||
|
'Status'=>"0",
|
||||||
|
'Status_description'=>"Machine file"
|
||||||
);
|
);
|
||||||
$this->batchcard_model->addfilelist($addfilelist);
|
$this->batchcard_model->addfiledetails($addfilelist);
|
||||||
//print_r($addfilelist);
|
//print_r($addfilelist);
|
||||||
//die();
|
//die();
|
||||||
|
|
||||||
@ -969,12 +1066,13 @@ class batchcard extends BaseController
|
|||||||
|
|
||||||
function editHist(){
|
function editHist(){
|
||||||
//echo 'i am a edit function';
|
//echo 'i am a edit function';
|
||||||
$MachineCode = $_GET['Machcode'];
|
//$MachineCode = $_GET['Machcode'];
|
||||||
|
$MachineCode = base64_decode(urldecode($this->uri->segment(3)));
|
||||||
//echo $MachineCode;
|
//echo $MachineCode;
|
||||||
$data['TableDatas'] = $this->batchcard_model->getHist_tbls($MachineCode);
|
$data['TableDatas'] = $this->batchcard_model->getHist_tbls($MachineCode);
|
||||||
$data['HistMstrEdit'] = $this->batchcard_model->getHist_mstr($MachineCode);
|
$data['HistMstrEdit'] = $this->batchcard_model->getHist_mstr($MachineCode);
|
||||||
$data['HistDtlsEdit'] = $this->batchcard_model->getHist_dtls($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['HistDeptList'] = $this->batchcard_model->getdept_dtls();
|
||||||
$data['HistPONOList'] = $this->batchcard_model->getpono();
|
$data['HistPONOList'] = $this->batchcard_model->getpono();
|
||||||
//echo count($data['HistFileEdit']);
|
//echo count($data['HistFileEdit']);
|
||||||
@ -1097,10 +1195,12 @@ class batchcard extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
$addfilelist = array(
|
$addfilelist = array(
|
||||||
'Machine_code'=>$machinecode,
|
'Machine_code/Maint_id'=>$machinecode,
|
||||||
'Machine_filename'=>$filename
|
'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 ));
|
//$updatefilelist= array_filter(array_map('array_filter',$updatefilelist ));
|
||||||
}
|
}
|
||||||
echo "<script>alert('Saved Successfully!');window.location.href='getHistListing';</script>";
|
echo "<script>alert('Saved Successfully!');window.location.href='getHistListing';</script>";
|
||||||
|
|||||||
@ -196,9 +196,21 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
function addmaint_dtl($array)
|
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);
|
$this->db->insert('T_Batchcard_MaintanceDetails',$array);
|
||||||
$bmd = $this->db->affected_rows();
|
$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()
|
function getmaint_dtl()
|
||||||
{
|
{
|
||||||
@ -221,13 +233,25 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
function getmaint_dtl_MntDate($dateval)
|
function getmaint_dtl_MntDate($dateval)
|
||||||
{
|
{
|
||||||
$this->db->select('bm.*,mm.Machine_Name');
|
// $converted = date('Y-m-d H:i:s',$dateval);
|
||||||
$this->db->from('T_Batchcard_MaintanceDetails bm');
|
// $this->db->select('bm.*,mm.Machine_Name');
|
||||||
$this->db->join('T_Machine_Master mm', 'bm.Machine_Code = mm.Machine_Code', 'left');
|
// $this->db->from('T_Batchcard_MaintanceDetails bm');
|
||||||
$this->db->where('mm.Machines_Category = "TRP"');
|
// $this->db->join('T_Machine_Master mm', 'bm.Machine_Code = mm.Machine_Code', 'left');
|
||||||
$this->db->where('bm.Maint_Date',$dateval);
|
// $this->db->where('mm.Machines_Category = "TRP"');
|
||||||
$bmd = $this->db->get();
|
// $this->db->where('bm.CreatedOn',$converted);
|
||||||
return $bmd->result();
|
// $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)
|
function updatemaint_dtl($array,$MntID)
|
||||||
@ -239,15 +263,19 @@ class batchcard_model extends CI_Model
|
|||||||
return $bmd;
|
return $bmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
function maintenancesdata($date,$Autostartstoptime){
|
// function maintenancesdata($date,$Autostartstoptime){
|
||||||
$sql = "select bm.*,mm.Machine_Name
|
// $sql = "select bm.*,mm.Machine_Name,
|
||||||
from T_Batchcard_MaintanceDetails as bm
|
// DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') as date,
|
||||||
left join T_Machine_Master as mm on bm.Machine_Code = mm.Machine_Code
|
// DATE_FORMAT(bm.CreatedOn,'%l:%i %p') as time
|
||||||
where mm.Machines_Category = 'TRP'
|
// from T_Batchcard_MaintanceDetails as bm
|
||||||
and bm.Maint_Date = '".$date."'";
|
// left join T_Machine_Master as mm on bm.Machine_Code = mm.Machine_Code
|
||||||
$res = $this->db->query($sql);
|
// where mm.Machines_Category = 'TRP'
|
||||||
return $res->result();
|
// 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(){
|
function getmachine_codename(){
|
||||||
$this->db->select('Machine_Code,Machine_Name');
|
$this->db->select('Machine_Code,Machine_Name');
|
||||||
$this->db->from('T_Machine_Master');
|
$this->db->from('T_Machine_Master');
|
||||||
@ -320,8 +348,8 @@ class batchcard_model extends CI_Model
|
|||||||
return $child;
|
return $child;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//This function for multi file upload option (both machine and maint/br screen)
|
||||||
function addfilelist($array){
|
function addfiledetails($array){
|
||||||
|
|
||||||
$this->db->insert('T_Machines_file', $array);
|
$this->db->insert('T_Machines_file', $array);
|
||||||
$r = $this->db->affected_rows();
|
$r = $this->db->affected_rows();
|
||||||
@ -364,18 +392,21 @@ class batchcard_model extends CI_Model
|
|||||||
$bmd = $this->db->get();
|
$bmd = $this->db->get();
|
||||||
return $bmd->result();
|
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->select('*');
|
||||||
$this->db->from('T_Machines_file');
|
$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();
|
$bmd = $this->db->get();
|
||||||
return $bmd->result();
|
return $bmd->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHist_mstr($MachineCode = '')
|
function getHist_mstr($MachineCode = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -473,7 +504,7 @@ class batchcard_model extends CI_Model
|
|||||||
return $temp;
|
return $temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//This function for multi file upload option (both machine and maint/br screen)
|
||||||
function deletefiledetails($id,$name){
|
function deletefiledetails($id,$name){
|
||||||
$sql = "DELETE FROM T_Machines_file WHERE File_No =".$id;
|
$sql = "DELETE FROM T_Machines_file WHERE File_No =".$id;
|
||||||
unlink("uploads/images/".$name);//this deletes the file on particular folder too
|
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){
|
function getHist_tbls($MachineCode){
|
||||||
$this->db->select('T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,T_DepartmentDetails.DepartmentName');
|
$sql = "SELECT T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,
|
||||||
$this->db->from('T_Machine_Master');
|
T_DepartmentDetails.DepartmentName,
|
||||||
$this->db->join('T_Batchcard_MaintanceDetails','T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code');
|
DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%d-%m-%Y') as date,
|
||||||
$this->db->join('T_DepartmentDetails','T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept');
|
DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%l:%i %p') as time
|
||||||
$this->db->where('T_Machine_Master.Machine_Code',$MachineCode);
|
FROM T_Machine_Master
|
||||||
$res = $this->db->get();
|
LEFT JOIN T_Batchcard_MaintanceDetails ON T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code
|
||||||
return $res->result();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<style>
|
<style>
|
||||||
|
.left-margin { margin-left: 2px }
|
||||||
.autocomplete-suggestion{
|
.autocomplete-suggestion{
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
background-color:skyblue;
|
background-color:skyblue;
|
||||||
@ -306,10 +307,10 @@ var counterConstant = 0;
|
|||||||
|
|
||||||
$("#addmorebutton").click(function(){
|
$("#addmorebutton").click(function(){
|
||||||
|
|
||||||
//alert('sda');
|
//alert('sda');
|
||||||
|
|
||||||
// if(counter>4){
|
// if(counter>4){
|
||||||
// alert(" allow only 5");
|
// alert(" no more files to add");
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// else{
|
// else{
|
||||||
@ -349,24 +350,35 @@ function removeRow(input) {
|
|||||||
|
|
||||||
if(counter >= 1){
|
if(counter >= 1){
|
||||||
counter--;
|
counter--;
|
||||||
//var r = $('#Paymentaccode'+number).val();
|
|
||||||
$("#divid"+number).remove();
|
$("#divid"+number).remove();
|
||||||
$('#hidecounter').val(counter);
|
$('#hidecounter').val(counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function Copyfilename(id)
|
||||||
|
// {
|
||||||
|
// var number = id.replace(/[^0-9]+/ig,"");
|
||||||
|
|
||||||
|
// var name = $('input[name='+id+']')[0].files[0].name;
|
||||||
|
|
||||||
|
// $("#machs_filename"+number).val(name);
|
||||||
|
// }
|
||||||
function Copyfilename(id)
|
function Copyfilename(id)
|
||||||
{
|
{
|
||||||
var number = id.replace(/[^0-9]+/ig,"");
|
|
||||||
// alert(number);
|
|
||||||
//var name = $('input[type=file]').val();
|
|
||||||
var name = $('input[name='+id+']')[0].files[0].name;
|
|
||||||
//var namess = $('input[type=file]')[number].files[number].name;
|
|
||||||
// alert(name);
|
|
||||||
// alert(namess);
|
|
||||||
// alert(id);
|
|
||||||
$("#machs_filename"+number).val(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var size = $('input[name='+id+']')[0].files[0].size;
|
||||||
|
|
||||||
|
var number = id.replace(/[^0-9]+/ig,"");
|
||||||
|
|
||||||
|
if(size > 2100000){
|
||||||
|
|
||||||
|
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;
|
||||||
|
$("#machs_filename"+number).val(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
// $Machine_filename = '';
|
// $Machine_filename = '';
|
||||||
// $Machine_filepath = '';
|
// $Machine_filepath = '';
|
||||||
$filecount = '';
|
// $filecount = '';
|
||||||
|
|
||||||
if(!empty($HistMstrEdit)){
|
if(!empty($HistMstrEdit)){
|
||||||
foreach($HistMstrEdit as $Mstr)
|
foreach($HistMstrEdit as $Mstr)
|
||||||
@ -64,18 +64,19 @@
|
|||||||
// echo "<br>";
|
// echo "<br>";
|
||||||
// echo sizeof($HistFileEdit);
|
// echo sizeof($HistFileEdit);
|
||||||
// die();
|
// die();
|
||||||
if(!empty($HistFileEdit)){
|
// if(!empty($HistFileEdit)){
|
||||||
$filecount = count($HistFileEdit);
|
// $filecount = count($HistFileEdit);
|
||||||
// foreach($HistFileEdit as $File)
|
// // foreach($HistFileEdit as $File)
|
||||||
// {
|
// // {
|
||||||
// $Machine_filename = $File->Machine_filename;
|
// // $Machine_filename = $File->Machine_filename;
|
||||||
// $Machine_filepath = $File->Machine_filepath ;
|
// // $Machine_filepath = $File->Machine_filepath ;
|
||||||
// }
|
// // }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
|
.left-margin { margin-left: 10px }
|
||||||
.autocomplete-suggestion{
|
.autocomplete-suggestion{
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
background-color:skyblue;
|
background-color:skyblue;
|
||||||
@ -86,6 +87,9 @@
|
|||||||
/* text-transform: capitalize; */
|
/* text-transform: capitalize; */
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
#divid1{
|
||||||
|
margin-top:14px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
||||||
<div class="content-wrapper" style="min-height: 537px;">
|
<div class="content-wrapper" style="min-height: 537px;">
|
||||||
@ -342,11 +346,12 @@ $(function() {
|
|||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.id = "dbdivid"+index;
|
div.id = "dbdivid"+index;
|
||||||
div.className="row";
|
div.className="row form-group";
|
||||||
|
div.style="margin-top:14px";
|
||||||
div.innerHTML='<div class="col-md-12">'+
|
div.innerHTML='<div class="col-md-12">'+
|
||||||
'<div class="col-md-3">'+
|
'<div class="col-md-3">'+
|
||||||
'<label>File Name</label>'+
|
'<label>File Name</label>'+
|
||||||
'<input type="text" id="db_machs_filename'+index+'" name="dbfilename'+index+'" class="form-control" value="'+fa.Machine_filename+'" onkeypress="return false;" readonly/>'+
|
'<input type="text" id="db_machs_filename'+index+'" name="dbfilename'+index+'" class="form-control" value="'+fa.File_name+'" onkeypress="return false;" readonly/>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<div class="col-md-4">'+
|
'<div class="col-md-4">'+
|
||||||
'<label><br></label>'+
|
'<label><br></label>'+
|
||||||
@ -355,8 +360,8 @@ $(function() {
|
|||||||
'<div class="col-md-3">'+
|
'<div class="col-md-3">'+
|
||||||
'<label><br><br></label>'+
|
'<label><br><br></label>'+
|
||||||
'<input type="hidden" name="hidefileid'+index+'" id="hidefileid'+index+'" value="'+fa.File_No+'"/>'+
|
'<input type="hidden" name="hidefileid'+index+'" id="hidefileid'+index+'" value="'+fa.File_No+'"/>'+
|
||||||
'<a href="'+mybaseurl+'/'+fa.Machine_filename+'" class="btn btn-primary active" target="_blank" role="button"><i class="fa fa-download" ></i>Download</a>'+
|
'<a href="'+mybaseurl+'/'+fa.File_name+'" class="btn btn-primary active" target="_blank" role="button"><i class="fa fa-download" ></i>Download</a>'+
|
||||||
'<button class="btn btn-danger" id="delbtn'+index+'" onclick="deleted(this.id)"><i class="fa fa-trash"></i> Remove</button>'+
|
'<button class="btn btn-danger left-margin" id="delbtn'+index+'" onclick="deleted(this.id)"><i class="fa fa-trash"></i> Remove</button>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
@ -380,7 +385,7 @@ $(function() {
|
|||||||
html += '<td style="text-align:right;">'+ta.Machines_Dept+' - '+ta.DepartmentName+'</td>';
|
html += '<td style="text-align:right;">'+ta.Machines_Dept+' - '+ta.DepartmentName+'</td>';
|
||||||
html += '<td style="text-align:right;">'+ta.Machines_Category+'</td>';
|
html += '<td style="text-align:right;">'+ta.Machines_Category+'</td>';
|
||||||
html += '<td style="text-align:rignt;">'+Type+'</td>';
|
html += '<td style="text-align:rignt;">'+Type+'</td>';
|
||||||
html += '<td style="text-align:right;">'+ta.Maint_Date+' / '+ta.Maint_Time+' hrs '+'</td>';
|
html += '<td style="text-align:right;">'+ta.date+' / '+ta.time+'</td>';
|
||||||
html += '<td style="text-align:right;">'+ta.Maint_Location+'</td>';
|
html += '<td style="text-align:right;">'+ta.Maint_Location+'</td>';
|
||||||
html += '<td style="text-align:right;">'+ta.Maint_Description+'</td>';
|
html += '<td style="text-align:right;">'+ta.Maint_Description+'</td>';
|
||||||
html += '<td style="text-align:right;">'+ta.Maint_Reason+'</td>';
|
html += '<td style="text-align:right;">'+ta.Maint_Reason+'</td>';
|
||||||
@ -480,7 +485,7 @@ $("#addmorebutton").click(function(){
|
|||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.id = "divid"+counterConstant;
|
div.id = "divid"+counterConstant;
|
||||||
div.className="row";
|
div.className="row";
|
||||||
div.innerHTML='<div class="col-md-12">'+
|
div.innerHTML='<div class="col-md-12" >'+
|
||||||
'<div class="col-md-3">'+
|
'<div class="col-md-3">'+
|
||||||
'<label>File Name</label>'+
|
'<label>File Name</label>'+
|
||||||
// '<input type="text" id="machs_filename" name="filename'+counterConstant+'" class="form-control"/>'+
|
// '<input type="text" id="machs_filename" name="filename'+counterConstant+'" class="form-control"/>'+
|
||||||
@ -527,7 +532,7 @@ function deleted(deleteid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeRow(input) {
|
function removeRow(input) {
|
||||||
|
// alert(input);
|
||||||
var number = input.replace(/[^0-9]+/ig,"");
|
var number = input.replace(/[^0-9]+/ig,"");
|
||||||
|
|
||||||
//if(counter >= 1){
|
//if(counter >= 1){
|
||||||
@ -542,12 +547,20 @@ function removeRow(input) {
|
|||||||
|
|
||||||
function Copyfilename(id)
|
function Copyfilename(id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var size = $('input[name='+id+']')[0].files[0].size;
|
||||||
var number = id.replace(/[^0-9]+/ig,"");
|
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;
|
var name = $('input[name='+id+']')[0].files[0].name;
|
||||||
//alert(name);
|
//alert(name);
|
||||||
|
|
||||||
$("#machs_filename"+number).val(name);
|
$("#machs_filename"+number).val(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
<td><?php echo $hl->Machines_Lifetime ?></td>
|
<td><?php echo $hl->Machines_Lifetime ?></td>
|
||||||
<td><?php echo $hl->Commencement_Date; ?></td>
|
<td><?php echo $hl->Commencement_Date; ?></td>
|
||||||
<!-- <td><?php echo $hl->Machine_Code ?></td> -->
|
<!-- <td><?php echo $hl->Machine_Code ?></td> -->
|
||||||
<td><a href="<?php echo base_url().'batchcard/editHist?Machcode='.$hl->Machine_Code ?>" data-toggle="tooltip" title="Click here to Edit details"><i class="fa fa-edit" style="font-size:20px;"></i></a></td>
|
<td><a href="<?php echo base_url().'batchcard/editHist/'.urlencode(base64_encode($hl->Machine_Code)) ?>" data-toggle="tooltip" title="Click here to Edit details"><i class="fa fa-edit" style="font-size:20px;"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,19 @@
|
|||||||
<script src="<?php echo base_url().'assets/jquery.plugin.js'?>"></script>
|
<script src="<?php echo base_url().'assets/jquery.plugin.js'?>"></script>
|
||||||
<script src="<?php echo base_url().'assets/jquery.timeentry.js'?>"></script>
|
<script src="<?php echo base_url().'assets/jquery.timeentry.js'?>"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* .daterangepicker .ranges {
|
||||||
|
width: auto;
|
||||||
|
float: left;
|
||||||
|
display: none;
|
||||||
|
} */
|
||||||
|
</style>
|
||||||
<div class="content-wrapper" style="min-height: 537px;">
|
<div class="content-wrapper" style="min-height: 537px;">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
<center>Siddharth Industries - Add Maintenance And Breakdown </center>
|
<center>Siddharth Industries - Add Maintenance And Breakdown </center>
|
||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -37,7 +46,7 @@
|
|||||||
<select class="form-control select2" id="machine" name="machine">
|
<select class="form-control select2" id="machine" name="machine">
|
||||||
<option value=" ">Select Machine</option>
|
<option value=" ">Select Machine</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Select option:</label></br>
|
<label>Select option:</label></br>
|
||||||
@ -51,16 +60,16 @@
|
|||||||
<input type="radio" id="mainttype2" name="maintenance_subtype" value="1" >External
|
<input type="radio" id="mainttype2" name="maintenance_subtype" value="1" >External
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<!--<div class="col-md-3">
|
||||||
<label>Date</label>
|
<label>Date</label>
|
||||||
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;" onkeypress="return false;"/>
|
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;" onkeypress="return false;"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Time</label>
|
<label>Time</label>
|
||||||
<!-- <input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;"/> -->
|
<!- <input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;"/> ->
|
||||||
<input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format"/>
|
<input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format"/>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@ -80,25 +89,26 @@
|
|||||||
<div> </div>
|
<div> </div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<legend>Time Taken for Maintenance</legend>
|
<legend>Time Taken for Maintenance</legend>
|
||||||
<div class="col-md-3">
|
<div class="col-md-8">
|
||||||
<label>From</label>
|
<label>From Date and To Date </label>
|
||||||
<input type="text" id="maintenance_time_from" name="maintenance_time_from" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format"/>
|
<input type="text" id="maintenance_date_time" name="maintenance_date_time" class="form-control" placeholder="Date and time" />
|
||||||
</div>
|
<!-- <div class="input-group">
|
||||||
|
<div class="input-group-addon">
|
||||||
|
<i class="fa fa-clock-o"></i>
|
||||||
|
</div>
|
||||||
|
<input type="text" id="maintenance_date_time" name="maintenance_date_time" class="form-control pull-right">
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-4">
|
||||||
<label>To</label>
|
|
||||||
<input type="text" id="maintenance_time_to" name="maintenance_time_to" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-3">
|
|
||||||
<label>Total Hrs</label>
|
<label>Total Hrs</label>
|
||||||
<input type="text" id="maintenance_total_hrs" name="maintenance_total_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" readonly />
|
<input type="text" id="maintenance_total_hrs" name="maintenance_total_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" readonly />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
<legend>Cost</legend>
|
||||||
<legend>Cost</legend>
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Material</label>
|
<label>Material</label>
|
||||||
<input type="text" id="cost_material" name="cost_material" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
|
<input type="text" id="cost_material" name="cost_material" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
|
||||||
@ -108,10 +118,22 @@
|
|||||||
<label>Labour</label>
|
<label>Labour</label>
|
||||||
<input type="text" id="cost_labour" name="cost_labour" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
|
<input type="text" id="cost_labour" name="cost_labour" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div> </div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<legend>Multiple File</legend>
|
||||||
|
<div class="col-md-offset-10 col-md-1" >
|
||||||
|
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" + ADD FILES..">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="newdiv"></div><!-- this div for add more section-->
|
||||||
|
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||||||
|
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div><!-- row -->
|
</div><!-- row -->
|
||||||
</div><!--box body -->
|
</div><!--box body -->
|
||||||
<div class="box-footer" style="text-align:right">
|
<div class="box-footer" style="text-align:right">
|
||||||
@ -126,17 +148,80 @@
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
$('#maintenance_total_hrs').val('');
|
||||||
|
$('#maintenance_date_time').val('');
|
||||||
var mach_arr = [];
|
var mach_arr = [];
|
||||||
|
|
||||||
$("#machine").select2();
|
$("#machine").select2();
|
||||||
|
|
||||||
$('#maintenance_date').datepicker({
|
$('#maintenance_date').datepicker({
|
||||||
//minDate : 'year+16',
|
//minDate : 'year+16',
|
||||||
maxDate : 'now',
|
maxDate : 'now',
|
||||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
dateFormat: 'dd-mm-yy',
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
yearRange: '0:+10'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#maintenance_date_time').daterangepicker({
|
||||||
|
autoUpdateInput: false,
|
||||||
|
//autoUpdateInput: true,
|
||||||
|
timePicker: true,
|
||||||
|
//timePicker24Hour: true,
|
||||||
|
timePickerIncrement: 1,
|
||||||
|
locale: {
|
||||||
|
format: 'D/MMMM/YYYY hh:mm A',
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#maintenance_date_time').on('apply.daterangepicker', function(ev, picker) {
|
||||||
|
$(this).val(picker.startDate.format('D/MMMM/YYYY hh:mm A') + ' - ' + picker.endDate.format('D/MMMM/YYYY hh:mm A'));
|
||||||
|
var datetime = $(this).val();
|
||||||
|
//newcalculateTime(datetime);
|
||||||
|
//alert(datetime);
|
||||||
|
datetime = datetime.split(" - ");
|
||||||
|
var start_actual_time = datetime[0];
|
||||||
|
var end_actual_time = datetime[1];
|
||||||
|
//alert("start"+start_actual_time);
|
||||||
|
//alert("stop"+end_actual_time);
|
||||||
|
start_actual_time = new Date(start_actual_time);
|
||||||
|
end_actual_time = new Date(end_actual_time);
|
||||||
|
//alert("start converted"+start_actual_time);
|
||||||
|
//alert("stop converted"+end_actual_time);
|
||||||
|
var diff = end_actual_time - start_actual_time;
|
||||||
|
//alert(diff);
|
||||||
|
var sec = (diff/1000);
|
||||||
|
//alert('manual total sec'+(diff/1000));
|
||||||
|
//alert('current total sec'+sec);
|
||||||
|
var ttl_hrs = Math.floor(sec/3600);
|
||||||
|
//alert('curr total hour'+ttl_hrs);
|
||||||
|
var ttl_min = Math.floor(sec%3600)/60;
|
||||||
|
//alert('curr total min'+ttl_min);
|
||||||
|
var final_ttl = ((ttl_hrs < 10)?("0" + ttl_hrs):ttl_hrs) + ":" + ((ttl_min < 10)?("0" + ttl_min):ttl_min)
|
||||||
|
$('#maintenance_total_hrs').val(final_ttl);
|
||||||
|
//alert('curr final'+final_ttl);
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#maintenance_date_time').on('cancel.daterangepicker', function(ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#maintenance_total_hrs').val('');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// $('#maintenance_date_time').daterangepicker({
|
||||||
|
// timePicker: true,
|
||||||
|
// timePicker24Hour: true,
|
||||||
|
// timePickerIncrement: 1,
|
||||||
|
// locale: {
|
||||||
|
// format: 'DD/MM/YYYY HH:mm',
|
||||||
|
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
mach_arr = <?php echo json_encode($MachineList)?>;
|
mach_arr = <?php echo json_encode($MachineList)?>;
|
||||||
|
|
||||||
$.each(mach_arr,function(m,ma){
|
$.each(mach_arr,function(m,ma){
|
||||||
@ -159,127 +244,203 @@ else{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function calculateTime()
|
// function calculateTime()
|
||||||
{
|
// {
|
||||||
|
|
||||||
var start = $('#maintenance_time_from').val();
|
// var start = $('#maintenance_time_from').val();
|
||||||
var stop = $('#maintenance_time_to').val();
|
// var stop = $('#maintenance_time_to').val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//alert(start+'-'+stop);
|
// //alert(start+'-'+stop);
|
||||||
if(start != '' && stop != '')
|
// if(start != '' && stop != '')
|
||||||
{
|
// {
|
||||||
|
|
||||||
if(start.length != 5){
|
// if(start.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time_from').value="";
|
// document.getElementById('maintenance_time_from').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_from').focus();},0
|
// $('#maintenance_time_from').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
if(stop.length != 5){
|
// if(stop.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time_to').value="";
|
// document.getElementById('maintenance_time_to').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var atime = '';
|
// var atime = '';
|
||||||
start = start.split(":");
|
// start = start.split(":");
|
||||||
stop = stop.split(":");
|
// stop = stop.split(":");
|
||||||
|
|
||||||
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
|
// if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time_from').value = '';
|
// document.getElementById('maintenance_time_from').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_from').focus();},0
|
// $('#maintenance_time_from').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
|
// if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time_to').value = '';
|
// document.getElementById('maintenance_time_to').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if((start[0] > stop[0]))
|
// if((start[0] > stop[0]))
|
||||||
{
|
// {
|
||||||
alert('Enter Valid Time');
|
// alert('Enter Valid Time');
|
||||||
document.getElementById('maintenance_time_to').value = '';
|
// document.getElementById('maintenance_time_to').value = '';
|
||||||
|
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var h = parseFloat(stop[0]) - parseFloat(start[0]);
|
// var h = parseFloat(stop[0]) - parseFloat(start[0]);
|
||||||
var m = parseFloat(stop[1]) - parseFloat(start[1]);
|
// var m = parseFloat(stop[1]) - parseFloat(start[1]);
|
||||||
//console.log(h+'-'+m);
|
// //console.log(h+'-'+m);
|
||||||
if(parseFloat(m) > 60 )
|
// if(parseFloat(m) > 60 )
|
||||||
{
|
// {
|
||||||
h+=1;
|
// h+=1;
|
||||||
m -= 60;
|
// m -= 60;
|
||||||
}
|
// }
|
||||||
else if(parseFloat(m) < 0)
|
// else if(parseFloat(m) < 0)
|
||||||
{
|
// {
|
||||||
h-=1;
|
// h-=1;
|
||||||
if(h < 0){h=0;}
|
// if(h < 0){h=0;}
|
||||||
m+=60;
|
// m+=60;
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
atime = h+':'+m;
|
// atime = h+':'+m;
|
||||||
//console.log(atime);
|
// //console.log(atime);
|
||||||
$('#maintenance_total_hrs').val((atime));
|
// $('#maintenance_total_hrs').val((atime));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function ValidTime(){
|
// function ValidTime(){
|
||||||
|
|
||||||
var time = $('#maintenance_time').val();
|
// var time = $('#maintenance_time').val();
|
||||||
|
|
||||||
if(time.length != 5){
|
// if(time.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time').value="";
|
// document.getElementById('maintenance_time').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time').focus();},0
|
// $('#maintenance_time').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
time = time.split(":");
|
// time = time.split(":");
|
||||||
|
|
||||||
if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
|
// if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time').value = '';
|
// document.getElementById('maintenance_time').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time').focus();},0
|
// $('#maintenance_time').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var counter = 0;
|
||||||
|
var counterConstant = 0;
|
||||||
|
|
||||||
|
$("#addmorebutton").click(function(){
|
||||||
|
|
||||||
|
//alert('sda');
|
||||||
|
|
||||||
|
// if(counter>4){
|
||||||
|
// alert("No more files to add");//this allows only 5 files;
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
counterConstant++;
|
||||||
|
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.id = "divid"+counterConstant;
|
||||||
|
div.className="row";
|
||||||
|
div.innerHTML='<div class="col-md-12">'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label>File Name</label>'+
|
||||||
|
'<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-4">'+
|
||||||
|
'<label><br></label>'+
|
||||||
|
'<input type="file" name="browseFiles'+counterConstant+'" onchange="Copyfilename(this.name);"><br>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label><br><br></label>'+
|
||||||
|
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
$('#newdiv').append(div);
|
||||||
|
|
||||||
|
|
||||||
|
$('#hidecounter').val(counter);
|
||||||
|
$('#hideconstant').val(counterConstant);
|
||||||
|
|
||||||
|
//}
|
||||||
|
});
|
||||||
|
|
||||||
|
function removeRow(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
|
||||||
<?php
|
<?php
|
||||||
$Mnt_Id = '';
|
$Mnt_Id = '';
|
||||||
$Type = '';
|
$Type = '';
|
||||||
@ -10,9 +11,11 @@ $Mnt_Description = '';
|
|||||||
$Mnt_Reason = '';
|
$Mnt_Reason = '';
|
||||||
$Mnt_Time_from = '';
|
$Mnt_Time_from = '';
|
||||||
$Mnt_Time_to = '';
|
$Mnt_Time_to = '';
|
||||||
|
$Mnt_Date_Time = '';
|
||||||
$Mnt_Total_hrs = '';
|
$Mnt_Total_hrs = '';
|
||||||
$Cost_material = '';
|
$Cost_material = '';
|
||||||
$Cost_labour = '';
|
$Cost_labour = '';
|
||||||
|
// $filecount = '';
|
||||||
|
|
||||||
if(!empty($MaintEdit))
|
if(!empty($MaintEdit))
|
||||||
{
|
{
|
||||||
@ -29,13 +32,24 @@ if(!empty($MaintEdit))
|
|||||||
$Mnt_reason = $Me->Maint_Reason;
|
$Mnt_reason = $Me->Maint_Reason;
|
||||||
$Mnt_time_from = $Me->Maint_Time_from;
|
$Mnt_time_from = $Me->Maint_Time_from;
|
||||||
$Mnt_time_to = $Me->Maint_Time_to;
|
$Mnt_time_to = $Me->Maint_Time_to;
|
||||||
|
$Mnt_Date_Time = $Mnt_time_from.' - '.$Mnt_time_to ;
|
||||||
$Mnt_total_hrs = $Me->Maint_Total_hrs;
|
$Mnt_total_hrs = $Me->Maint_Total_hrs;
|
||||||
$Cost_material = $Me->Cost_Material;
|
$Cost_material = $Me->Cost_Material;
|
||||||
$Cost_labour = $Me->Cost_Labour;
|
$Cost_labour = $Me->Cost_Labour;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
|
// if(!empty($MaintFileEdit)){
|
||||||
|
// $filecount = count($MaintFileEdit);
|
||||||
|
// }
|
||||||
|
|
||||||
|
?>
|
||||||
|
<style>
|
||||||
|
.left-margin { margin-left: 10px; }
|
||||||
|
#divid1{
|
||||||
|
margin-top:14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="content-wrapper" style="min-height: 537px;">
|
<div class="content-wrapper" style="min-height: 537px;">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
@ -87,7 +101,7 @@ if(!empty($MaintEdit))
|
|||||||
<input type="radio" id="mainttype2" name="maintenance_subtype" value="1" >External
|
<input type="radio" id="mainttype2" name="maintenance_subtype" value="1" >External
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<!-- <div class="col-md-3">
|
||||||
<label>Date</label>
|
<label>Date</label>
|
||||||
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;" value="<?php echo $Mnt_Date ?>"/>
|
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;" value="<?php echo $Mnt_Date ?>"/>
|
||||||
</div>
|
</div>
|
||||||
@ -95,7 +109,7 @@ if(!empty($MaintEdit))
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Time</label>
|
<label>Time</label>
|
||||||
<input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_Time ?>" onchange="ValidTime()"/>
|
<input type="text" id="maintenance_time" name="maintenance_time" class="form-control" style="text-align:right;" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_Time ?>" onchange="ValidTime()"/>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Location</label>
|
<label>Location</label>
|
||||||
@ -115,7 +129,11 @@ if(!empty($MaintEdit))
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<legend>Time Taken for Maintenance</legend>
|
<legend>Time Taken for Maintenance</legend>
|
||||||
<div class="col-md-3">
|
<div class="col-md-9">
|
||||||
|
<label>From Date and To Date </label>
|
||||||
|
<input type="text" id="maintenance_date_time" name="maintenance_date_time" class="form-control" placeholder="Date and time" value="<?php echo $Mnt_Date_Time;?>"/>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="col-md-3">
|
||||||
<label>From</label>
|
<label>From</label>
|
||||||
<input type="text" id="maintenance_time_from" name="maintenance_time_from" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_time_from;?>" />
|
<input type="text" id="maintenance_time_from" name="maintenance_time_from" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_time_from;?>" />
|
||||||
</div>
|
</div>
|
||||||
@ -123,7 +141,7 @@ if(!empty($MaintEdit))
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>To</label>
|
<label>To</label>
|
||||||
<input type="text" id="maintenance_time_to" name="maintenance_time_to" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_time_to;?>"/>
|
<input type="text" id="maintenance_time_to" name="maintenance_time_to" class="form-control" style="text-align:right;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format" value="<?php echo $Mnt_time_to;?>"/>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Total Hrs</label>
|
<label>Total Hrs</label>
|
||||||
@ -142,10 +160,25 @@ if(!empty($MaintEdit))
|
|||||||
<label>Labour</label>
|
<label>Labour</label>
|
||||||
<input type="text" id="cost_labour" name="cost_labour" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $Cost_labour;?>"/>
|
<input type="text" id="cost_labour" name="cost_labour" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $Cost_labour;?>"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" id="mntid" name="mntid" class="readonly" value="<?php echo $Mnt_Id;?>"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div> </div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<legend>Multiple File</legend>
|
||||||
|
<div class="col-md-offset-10 col-md-1" >
|
||||||
|
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" + ADD FILES..">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="newdiv"></div><!-- this div for add more section-->
|
||||||
|
<input type="hidden" id="mntid" name="mntid" class="readonly" value="<?php echo $Mnt_Id;?>"/>
|
||||||
|
<input type="hidden" id="hidecounter" name="hidecounter" class="readonly" value="0" />
|
||||||
|
<input type="hidden" id="hideconstant" name="hideconstant" class="readonly" value="0" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div><!-- row -->
|
</div><!-- row -->
|
||||||
</div><!--box body -->
|
</div><!--box body -->
|
||||||
<div class="box-footer" style="text-align:right">
|
<div class="box-footer" style="text-align:right">
|
||||||
@ -160,9 +193,13 @@ if(!empty($MaintEdit))
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
var index = 0 ;
|
||||||
|
var counter = 0;
|
||||||
|
var counterConstant = 0;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var mach_arr = [];
|
var mach_arr = [];
|
||||||
|
var file_arr = [];
|
||||||
|
|
||||||
$("#machine").select2();
|
$("#machine").select2();
|
||||||
|
|
||||||
@ -172,13 +209,90 @@ $(function() {
|
|||||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'});
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'});
|
||||||
|
|
||||||
mach_arr = <?php echo json_encode($MachineList)?>;
|
mach_arr = <?php echo json_encode($MachineList)?>;
|
||||||
|
file_arr = <?php echo json_encode($MaintFileEdit)?>;
|
||||||
|
|
||||||
$.each(mach_arr,function(m,ma){
|
$.each(mach_arr,function(m,ma){
|
||||||
$("#machine").append( $('<option></option>').val(ma.Machine_Code).html(ma.Machine_Code+'-'+ma.Machine_Name));
|
$("#machine").append( $('<option></option>').val(ma.Machine_Code).html(ma.Machine_Code+'-'+ma.Machine_Name));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#machine option[value="<?php echo $Machinecode ?>"]').prop('selected', true);
|
$('#machine option[value="<?php echo $Machinecode ?>"]').prop('selected', true);
|
||||||
|
|
||||||
|
var mybaseurl='<?php echo base_url('uploads/images');?>';
|
||||||
|
$.each(file_arr,function(f,fa){
|
||||||
|
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.id = "dbdivid"+index;
|
||||||
|
div.className="row";
|
||||||
|
div.style="margin-top:14px";
|
||||||
|
div.innerHTML='<div class="col-md-12">'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label>File Name</label>'+
|
||||||
|
'<input type="text" id="db_machs_filename'+index+'" name="dbfilename'+index+'" class="form-control" value="'+fa.File_name+'" onkeypress="return false;" readonly/>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-4">'+
|
||||||
|
'<label><br></label>'+
|
||||||
|
// '<input type="file" id="filepath'+index+'" name="browseFiles'+index+'" onchange="readURL(this);" placeholder= "'+fa.Machine_filepath+'" ><br>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label><br><br></label>'+
|
||||||
|
'<input type="hidden" name="hidefileid'+index+'" id="hidefileid'+index+'" value="'+fa.File_No+'"/>'+
|
||||||
|
'<a href="'+mybaseurl+'/'+fa.File_name+'" class="btn btn-primary active" target="_blank" role="button"><i class="fa fa-download" ></i>Download</a>'+
|
||||||
|
'<button class="btn btn-danger left-margin" id="delbtn'+index+'" onclick="deleted(this.id)"><i class="fa fa-trash"></i> Remove</button>'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
$('#newdiv').append(div);
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#maintenance_date_time').daterangepicker({
|
||||||
|
autoUpdateInput: false,
|
||||||
|
//autoUpdateInput: true,
|
||||||
|
timePicker: true,
|
||||||
|
//timePicker24Hour: true,
|
||||||
|
timePickerIncrement: 1,
|
||||||
|
locale: {
|
||||||
|
format: 'D/MMMM/YYYY hh:mm A',
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#maintenance_date_time').on('apply.daterangepicker', function(ev, picker) {
|
||||||
|
$(this).val(picker.startDate.format('D/MMMM/YYYY hh:mm A') + ' - ' + picker.endDate.format('D/MMMM/YYYY hh:mm A'));
|
||||||
|
var datetime = $(this).val();
|
||||||
|
//newcalculateTime(datetime);
|
||||||
|
//alert(datetime);
|
||||||
|
datetime = datetime.split(" - ");
|
||||||
|
var start_actual_time = datetime[0];
|
||||||
|
var end_actual_time = datetime[1];
|
||||||
|
//alert("start"+start_actual_time);
|
||||||
|
//alert("stop"+end_actual_time);
|
||||||
|
start_actual_time = new Date(start_actual_time);
|
||||||
|
end_actual_time = new Date(end_actual_time);
|
||||||
|
//alert("start converted"+start_actual_time);
|
||||||
|
//alert("stop converted"+end_actual_time);
|
||||||
|
var diff = end_actual_time - start_actual_time;
|
||||||
|
//alert(diff);
|
||||||
|
var sec = (diff/1000);
|
||||||
|
//alert('manual total sec'+(diff/1000));
|
||||||
|
//alert('current total sec'+sec);
|
||||||
|
var ttl_hrs = Math.floor(sec/3600);
|
||||||
|
//alert('curr total hour'+ttl_hrs);
|
||||||
|
var ttl_min = Math.floor(sec%3600)/60;
|
||||||
|
//alert('curr total min'+ttl_min);
|
||||||
|
var final_ttl = ((ttl_hrs < 10)?("0" + ttl_hrs):ttl_hrs) + ":" + ((ttl_min < 10)?("0" + ttl_min):ttl_min)
|
||||||
|
$('#maintenance_total_hrs').val(final_ttl);
|
||||||
|
//alert('curr final'+final_ttl);
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#maintenance_date_time').on('cancel.daterangepicker', function(ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#maintenance_total_hrs').val('');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var type = "<?php echo $Type;?>";
|
var type = "<?php echo $Type;?>";
|
||||||
@ -229,125 +343,222 @@ $(function() {
|
|||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
function calculateTime()
|
// function calculateTime()
|
||||||
{
|
// {
|
||||||
|
|
||||||
var start = $('#maintenance_time_from').val();
|
// var start = $('#maintenance_time_from').val();
|
||||||
var stop = $('#maintenance_time_to').val();
|
// var stop = $('#maintenance_time_to').val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//alert(start+'-'+stop);
|
// //alert(start+'-'+stop);
|
||||||
if(start != '' && stop != '')
|
// if(start != '' && stop != '')
|
||||||
{
|
// {
|
||||||
|
|
||||||
if(start.length != 5){
|
// if(start.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time_from').value="";
|
// document.getElementById('maintenance_time_from').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_from').focus();},0
|
// $('#maintenance_time_from').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
if(stop.length != 5){
|
// if(stop.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time_to').value="";
|
// document.getElementById('maintenance_time_to').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var atime = '';
|
// var atime = '';
|
||||||
start = start.split(":");
|
// start = start.split(":");
|
||||||
stop = stop.split(":");
|
// stop = stop.split(":");
|
||||||
|
|
||||||
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
|
// if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time_from').value = '';
|
// document.getElementById('maintenance_time_from').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_from').focus();},0
|
// $('#maintenance_time_from').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
|
// if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time_to').value = '';
|
// document.getElementById('maintenance_time_to').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if((start[0] > stop[0]))
|
// if((start[0] > stop[0]))
|
||||||
{
|
// {
|
||||||
alert('Enter Valid Time');
|
// alert('Enter Valid Time');
|
||||||
document.getElementById('maintenance_time_to').value = '';
|
// document.getElementById('maintenance_time_to').value = '';
|
||||||
|
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time_to').focus();},0
|
// $('#maintenance_time_to').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var h = parseFloat(stop[0]) - parseFloat(start[0]);
|
// var h = parseFloat(stop[0]) - parseFloat(start[0]);
|
||||||
var m = parseFloat(stop[1]) - parseFloat(start[1]);
|
// var m = parseFloat(stop[1]) - parseFloat(start[1]);
|
||||||
//console.log(h+'-'+m);
|
// //console.log(h+'-'+m);
|
||||||
if(parseFloat(m) > 60 )
|
// if(parseFloat(m) > 60 )
|
||||||
{
|
// {
|
||||||
h+=1;
|
// h+=1;
|
||||||
m -= 60;
|
// m -= 60;
|
||||||
}
|
// }
|
||||||
else if(parseFloat(m) < 0)
|
// else if(parseFloat(m) < 0)
|
||||||
{
|
// {
|
||||||
h-=1;
|
// h-=1;
|
||||||
if(h < 0){h=0;}
|
// if(h < 0){h=0;}
|
||||||
m+=60;
|
// m+=60;
|
||||||
|
|
||||||
}
|
// }
|
||||||
atime = h+':'+m;
|
// atime = h+':'+m;
|
||||||
//console.log(atime);
|
// //console.log(atime);
|
||||||
$('#maintenance_total_hrs').val((atime));
|
// $('#maintenance_total_hrs').val((atime));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
function ValidTime(){
|
// function ValidTime(){
|
||||||
|
|
||||||
var time = $('#maintenance_time').val();
|
// var time = $('#maintenance_time').val();
|
||||||
|
|
||||||
if(time.length != 5){
|
// if(time.length != 5){
|
||||||
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
|
||||||
document.getElementById('maintenance_time').value="";
|
// document.getElementById('maintenance_time').value="";
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time').focus();},0
|
// $('#maintenance_time').focus();},0
|
||||||
);
|
// );
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
time = time.split(":");
|
// time = time.split(":");
|
||||||
|
|
||||||
if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
|
// if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
|
||||||
{
|
// {
|
||||||
alert("please Enter Valid Time");
|
// alert("please Enter Valid Time");
|
||||||
document.getElementById('maintenance_time').value = '';
|
// document.getElementById('maintenance_time').value = '';
|
||||||
setTimeout(function(){
|
// setTimeout(function(){
|
||||||
$('#maintenance_time').focus();},0
|
// $('#maintenance_time').focus();},0
|
||||||
);
|
// );
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
</script>
|
$("#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='<div class="col-md-12">'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label>File Name</label>'+
|
||||||
|
// '<input type="text" id="machs_filename" name="filename'+counterConstant+'" class="form-control"/>'+
|
||||||
|
'<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-4">'+
|
||||||
|
'<label><br></label>'+
|
||||||
|
'<input type="file" name="browseFiles'+counterConstant+'" onchange="Copyfilename(this.name);"><br>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="col-md-3">'+
|
||||||
|
'<label><br><br></label>'+
|
||||||
|
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button>'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
$('#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:"<?php echo base_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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -21,13 +21,13 @@
|
|||||||
<table id="mnttable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
<table id="mnttable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
||||||
<thead style="background-color:#ddf">
|
<thead style="background-color:#ddf">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="6"><center>Maintenance Details</center></th>
|
<th colspan="4"><center>Maintenance Details</center></th>
|
||||||
<th colspan="4"><center>Time Taken for Maintenance</center></th>
|
<th colspan="4"><center>Time Taken for Maintenance</center></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th >Nature of maintenance</th>
|
<th >Nature of maintenance</th>
|
||||||
<th >Date</th>
|
<!-- <th >Date</th>
|
||||||
<th >Time</th>
|
<th >Time</th> -->
|
||||||
<th > Location </th>
|
<th > Location </th>
|
||||||
<th > Description </th><th> Reason </th>
|
<th > Description </th><th> Reason </th>
|
||||||
<th >From</th>
|
<th >From</th>
|
||||||
@ -46,15 +46,15 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<td><?php if($ml->Type == 0){ echo "MAINTENANCES"; }else{echo "BREAKDOWN";} ?></td>
|
<td><?php if($ml->Type == 0){ echo "MAINTENANCES"; }else{echo "BREAKDOWN";} ?></td>
|
||||||
<td><?php echo $ml->Maint_Date ?></td>
|
<!-- <td><?php echo $ml->Maint_Date ?></td>
|
||||||
<td><?php echo $ml->Maint_Time ?></td>
|
<td><?php echo $ml->Maint_Time ?></td> -->
|
||||||
<td><?php echo $ml->Maint_Location ?></td>
|
<td><?php echo $ml->Maint_Location ?></td>
|
||||||
<td><?php echo $ml->Maint_Description ?></td>
|
<td><?php echo $ml->Maint_Description ?></td>
|
||||||
<td><?php echo $ml->Maint_Reason ?></td>
|
<td><?php echo $ml->Maint_Reason ?></td>
|
||||||
<td><?php echo $ml->Maint_Time_from ?></td>
|
<td><?php echo $ml->Maint_Time_from ?></td>
|
||||||
<td><?php echo $ml->Maint_Time_to ?></td>
|
<td><?php echo $ml->Maint_Time_to ?></td>
|
||||||
<td><?php echo $ml->Maint_Total_hrs ?></td>
|
<td><?php echo $ml->Maint_Total_hrs ?></td>
|
||||||
<td><u><a href="<?php echo base_url().'batchcard/editMaint/?MntID='.$ml->Maint_ID ?>" data-toggle="tooltip" title="Click here to Edit details"><i class="fa fa-edit" style="font-size:20px;"></i></a></u></td>
|
<td><u><a href="<?php echo base_url().'batchcard/editMaint/'.urlencode(base64_encode($ml->Maint_ID)) ?>" data-toggle="tooltip" title="Click here to Edit details"><i class="fa fa-edit" style="font-size:20px;"></i></a></u></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@ -639,8 +639,8 @@ function keyValidate(e)
|
|||||||
}
|
}
|
||||||
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
|
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Machine_Code+' - '+arr.Machine_Name+'</td>';
|
html += '<td style="text-align:left;">'+arr.Machine_Code+' - '+arr.Machine_Name+'</td>';
|
||||||
html += '<td style="text-align:right;">'+arr.Maint_Date+'</td>';
|
html += '<td style="text-align:right;">'+arr.date+'</td>';
|
||||||
html += '<td style="text-align:right;">'+arr.Maint_Time+'</td>';
|
html += '<td style="text-align:right;">'+arr.time+'</td>';
|
||||||
html += '<td style="text-align:left;">'+Type+'</td>';
|
html += '<td style="text-align:left;">'+Type+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Maint_Location+'</td>';
|
html += '<td style="text-align:left;">'+arr.Maint_Location+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Maint_Description+'</td>';
|
html += '<td style="text-align:left;">'+arr.Maint_Description+'</td>';
|
||||||
|
|||||||
@ -476,6 +476,11 @@ var Index = 1;
|
|||||||
mnt = <?php echo json_encode($Maintenances)?>;
|
mnt = <?php echo json_encode($Maintenances)?>;
|
||||||
//alert(mnt);
|
//alert(mnt);
|
||||||
$.each(mnt,function(i,arr){
|
$.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 = '';
|
var html = '';
|
||||||
|
|
||||||
@ -487,8 +492,8 @@ var Index = 1;
|
|||||||
}
|
}
|
||||||
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
|
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Machine_Code+' - '+arr.Machine_Name+'</td>';
|
html += '<td style="text-align:left;">'+arr.Machine_Code+' - '+arr.Machine_Name+'</td>';
|
||||||
html += '<td style="text-align:right;">'+arr.Maint_Date+'</td>';
|
html += '<td style="text-align:right;">'+arr.date+'</td>';
|
||||||
html += '<td style="text-align:right;">'+arr.Maint_Time+'</td>';
|
html += '<td style="text-align:right;">'+arr.time+'</td>';
|
||||||
html += '<td style="text-align:left;">'+Type+'</td>';
|
html += '<td style="text-align:left;">'+Type+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Maint_Location+'</td>';
|
html += '<td style="text-align:left;">'+arr.Maint_Location+'</td>';
|
||||||
html += '<td style="text-align:left;">'+arr.Maint_Description+'</td>';
|
html += '<td style="text-align:left;">'+arr.Maint_Description+'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user