batch card new changes

This commit is contained in:
venbatechnologies@gmail.com 2018-02-15 17:17:24 +05:30
parent d70286a516
commit 6162323a31
9 changed files with 1254 additions and 154 deletions

View File

@ -225,9 +225,9 @@ class batchcard extends BaseController
$less_break_down_hrs = $this->input->post('less_break_down_hrs');
$total_burner_running_time = $this->input->post('total_burner_running_time');
$total_feeding_hrs = $this->input->post('total_feeding_hrs');
$gas_consumption_per_hour = $this->input->post('gas_consumption_per_hour');
$gas_consumption_per_ton = $this->input->post('gas_consumption_per_ton');
$total_gas_consumption = $this->input->post('total_gas_consumption');
// $gas_consumption_per_hour = $this->input->post('gas_consumption_per_hour');
// $gas_consumption_per_ton = $this->input->post('gas_consumption_per_ton');
// $total_gas_consumption = $this->input->post('total_gas_consumption');
$ed_running_hrs = $this->input->post('ed_running_hrs');
$ed_receipt = $this->input->post('ed_receipt');
$ed_issues = $this->input->post('ed_issues');
@ -252,21 +252,24 @@ class batchcard extends BaseController
$engineers = $this->input->post('engineers');
$operators = $this->input->post('operators');
$helpers = $this->input->post('helpers');
$breakdown = $this->input->post('breakdown');
$location = $this->input->post('location');
$maintenance_description = $this->input->post('maintenance_description');
$maintenance_reason = $this->input->post('maintenance_reason');
$maintenance_time_from = $this->input->post('maintenance_time_from');
$maintenance_time_to = $this->input->post('maintenance_time_to');
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
$cost_material = $this->input->post('cost_material');
$cost_labour = $this->input->post('cost_labour');
// $breakdown = $this->input->post('breakdown');
// $location = $this->input->post('location');
// $maintenance_description = $this->input->post('maintenance_description');
// $maintenance_reason = $this->input->post('maintenance_reason');
// $maintenance_time_from = $this->input->post('maintenance_time_from');
// $maintenance_time_to = $this->input->post('maintenance_time_to');
// $maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
// $cost_material = $this->input->post('cost_material');
// $cost_labour = $this->input->post('cost_labour');
$remarks = $this->input->post('remarks');
$createdby = $this->session->userdata ( 'userId' );
$createdtime = date('y-m-d');
$approvedby = $this->input->post('approvedby');
$datatostore = array('ddate'=>$ddate,'description'=>$description,'total_trp_running_hrs'=>$trp_running_hrs,'less_feeding_start'=>$feeding_start,'less_maintenance'=>$less_maintenance,'less_break_down_hrs'=>$less_break_down_hrs,'total_burner_running_time'=>$total_burner_running_time,'total_feeding_hrs'=>$total_feeding_hrs,'gas_consumption_hr'=>$gas_consumption_per_hour,'gas_consumption_ton'=>$gas_consumption_per_ton,'total_gas_consumption'=>$total_gas_consumption,'ed_running_hrs'=>$ed_running_hrs,'ed_receipt'=>$ed_receipt,'ed_issues'=>$ed_issues,'rotary_input'=>$rotatry_input,'rotary_output'=>$rotatry_output,'trp_roughsand_receipt'=>$roughsand_receipt,'trp_roughsand_issues'=>$roughsand_issues,'trp_finesand_receipt'=>$finesand_receipt,'trp_finesand_issues'=>$finesand_issues,'gas_for_trip_receipt'=>$gastrip_receipt,'gas_for_trip_consumption'=>$gastrip_consumption,'water_receipt'=>$water_receipt,'water_consumption'=>$water_consumpiton,'diesel_receipt'=>$diesel_receipt,'diesel_consumption'=>$diesel_consumption,'diesel_runninig_hrs'=>$diesel_running_hrs,'diesel_dryer_receipt'=>$diesel_rotary_receipt,'diesel_dryer_consumption'=>$diesel_rotary_consumption,'diesel_dryer_runninig_hrs'=>$diesel_rotary_running_hrs,'power_open_reading'=>$open_reading,'power_close_reading'=>$close_reading,'engineers'=>$engineers,'operators'=>$operators,'helpers'=>$helpers,'maintenance_breakdown'=>$breakdown,'maintenance_location'=>$location,'maintenance_description'=>$maintenance_description,'maintenance_reason'=>$maintenance_reason,'maintenance_from_hrs'=>$maintenance_time_from,'maintenance_to_hrs'=>$maintenance_time_to,'maintenance_total_hrs'=>$maintenance_total_hrs,'cost_material'=>$cost_material,'cost_labour'=>$cost_labour,'remarks'=>$remarks,'createdby'=>$createdby,'createdon'=>$createdtime,'approvedby'=>$approvedby);
$datatostore = array('ddate'=>$ddate,'description'=>$description,'total_trp_running_hrs'=>$trp_running_hrs,'less_feeding_start'=>$feeding_start,'less_maintenance'=>$less_maintenance,'less_break_down_hrs'=>$less_break_down_hrs,'total_burner_running_time'=>$total_burner_running_time,'total_feeding_hrs'=>$total_feeding_hrs,'ed_running_hrs'=>$ed_running_hrs,'ed_receipt'=>$ed_receipt,'ed_issues'=>$ed_issues,'rotary_input'=>$rotatry_input,'rotary_output'=>$rotatry_output,'trp_roughsand_receipt'=>$roughsand_receipt,'trp_roughsand_issues'=>$roughsand_issues,'trp_finesand_receipt'=>$finesand_receipt,'trp_finesand_issues'=>$finesand_issues,'water_receipt'=>$water_receipt,'water_consumption'=>$water_consumpiton,'diesel_receipt'=>$diesel_receipt,'diesel_consumption'=>$diesel_consumption,'diesel_runninig_hrs'=>$diesel_running_hrs,'diesel_dryer_receipt'=>$diesel_rotary_receipt,'diesel_dryer_consumption'=>$diesel_rotary_consumption,'diesel_dryer_runninig_hrs'=>$diesel_rotary_running_hrs,'power_open_reading'=>$open_reading,'power_close_reading'=>$close_reading,'engineers'=>$engineers,'operators'=>$operators,'helpers'=>$helpers,'gas_for_trip_receipt'=>$gastrip_receipt,'gas_for_trip_consumption'=>$gastrip_consumption,'remarks'=>$remarks,'createdby'=>$createdby,'createdon'=>$createdtime,'approvedby'=>$approvedby);
//'total_gas_consumption'=>$total_gas_consumption,'gas_consumption_hr'=>$gas_consumption_per_hour,'gas_consumption_ton'=>$gas_consumption_per_ton,'maintenance_breakdown'=>$breakdown,'maintenance_location'=>$location,'maintenance_description'=>$maintenance_description,'maintenance_reason'=>$maintenance_reason,'maintenance_from_hrs'=>$maintenance_time_from,'maintenance_to_hrs'=>$maintenance_time_to,'maintenance_total_hrs'=>$maintenance_total_hrs,'cost_material'=>$cost_material,'cost_labour'=>$cost_labour
//$datatostore = array('ddate'=>$ddate,'description'=>$description,'total_trp_running_hrs'=>$trp_running_hrs,'less_feeding_start'=>$feeding_start,'less_maintenance'=>$less_maintenance,'less_break_down_hrs'=>$less_break_down_hrs,'total_burner_running_time'=>$total_burner_running_time,'total_feeding_hrs'=>$total_feeding_hrs,'gas_consumption_hr'=>$gas_consumption_per_hour,'gas_consumption_ton'=>$gas_consumption_per_ton,'total_gas_consumption'=>$total_gas_consumption,'ed_running_hrs'=>$ed_running_hrs,'ed_receipt'=>$ed_receipt,'ed_issues'=>$ed_issues,'rotary_input'=>$rotatry_input,'rotary_output'=>$rotatry_output,'trp_roughsand_receipt'=>$roughsand_receipt,'trp_roughsand_issues'=>$roughsand_issues,'trp_finesand_receipt'=>$finesand_receipt,'trp_finesand_issues'=>$finesand_issues,'gas_for_trip_receipt'=>$gastrip_receipt,'gas_for_trip_consumption'=>$gastrip_consumption,'water_receipt'=>$water_receipt,'water_consumption'=>$water_consumpiton,'diesel_receipt'=>$diesel_receipt,'diesel_consumption'=>$diesel_consumption,'diesel_runninig_hrs'=>$diesel_running_hrs,'diesel_dryer_receipt'=>$diesel_rotary_receipt,'diesel_dryer_consumption'=>$diesel_rotary_consumption,'diesel_dryer_runninig_hrs'=>$diesel_rotary_running_hrs,'power_open_reading'=>$open_reading,'power_close_reading'=>$close_reading,'engineers'=>$engineers,'operators'=>$operators,'helpers'=>$helpers,'maintenance_breakdown'=>$breakdown,'maintenance_location'=>$location,'maintenance_description'=>$maintenance_description,'maintenance_reason'=>$maintenance_reason,'maintenance_from_hrs'=>$maintenance_time_from,'maintenance_to_hrs'=>$maintenance_time_to,'maintenance_total_hrs'=>$maintenance_total_hrs,'cost_material'=>$cost_material,'cost_labour'=>$cost_labour,'remarks'=>$remarks,'createdby'=>$createdby,'createdon'=>$createdtime,'approvedby'=>$approvedby);
//print_r($datatostore);
$res = $this->batchcard_model->saveDailyBatchCardData($datatostore);
if($res == 1)
@ -436,6 +439,10 @@ class batchcard extends BaseController
$did = $this->uri->segment(3);
$data['emplist'] = $this->batchcard_model->getEmplistforReport();
$data['dailydata'] = $this->batchcard_model->getIndividualDailyData($did);
$ddate = explode("-",$data['dailydata'][0]->ddate);
$dateval =$ddate[2].'-'.$ddate[1].'-'.$ddate[0];
$data['Maintenances'] = $this->batchcard_model->getmaint_dtl_MntDate($dateval);
//echo $dateval;print_r($data['Maintenances']);
$this->global['pageTitle'] = 'Siddharth : Daily Batch Card Edit';
$this->loadViews("editDailyData", $this->global,$data,NULL);
@ -454,9 +461,9 @@ class batchcard extends BaseController
$less_break_down_hrs = $this->input->post('less_break_down_hrs');
$total_burner_running_time = $this->input->post('total_burner_running_time');
$total_feeding_hrs = $this->input->post('total_feeding_hrs');
$gas_consumption_per_hour = $this->input->post('gas_consumption_per_hour');
$gas_consumption_per_ton = $this->input->post('gas_consumption_per_ton');
$total_gas_consumption = $this->input->post('total_gas_consumption');
// $gas_consumption_per_hour = $this->input->post('gas_consumption_per_hour');
// $gas_consumption_per_ton = $this->input->post('gas_consumption_per_ton');
// $total_gas_consumption = $this->input->post('total_gas_consumption');
$ed_running_hrs = $this->input->post('ed_running_hrs');
$ed_receipt = $this->input->post('ed_receipt');
$ed_issues = $this->input->post('ed_issues');
@ -481,21 +488,22 @@ class batchcard extends BaseController
$engineers = $this->input->post('engineers');
$operators = $this->input->post('operators');
$helpers = $this->input->post('helpers');
$breakdown = $this->input->post('breakdown');
$location = $this->input->post('location');
$maintenance_description = $this->input->post('maintenance_description');
$maintenance_reason = $this->input->post('maintenance_reason');
$maintenance_time_from = $this->input->post('maintenance_time_from');
$maintenance_time_to = $this->input->post('maintenance_time_to');
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
$cost_material = $this->input->post('cost_material');
$cost_labour = $this->input->post('cost_labour');
// $breakdown = $this->input->post('breakdown');
// $location = $this->input->post('location');
// $maintenance_description = $this->input->post('maintenance_description');
// $maintenance_reason = $this->input->post('maintenance_reason');
// $maintenance_time_from = $this->input->post('maintenance_time_from');
// $maintenance_time_to = $this->input->post('maintenance_time_to');
// $maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
// $cost_material = $this->input->post('cost_material');
// $cost_labour = $this->input->post('cost_labour');
$remarks = $this->input->post('remarks');
$createdby = $this->session->userdata ( 'userId' );
$createdtime = date('y-m-d');
$approvedby = $this->input->post('approvedby');
$datatostore = array('ddate'=>$ddate,'description'=>$description,'total_trp_running_hrs'=>$trp_running_hrs,'less_feeding_start'=>$feeding_start,'less_maintenance'=>$less_maintenance,'less_break_down_hrs'=>$less_break_down_hrs,'total_burner_running_time'=>$total_burner_running_time,'total_feeding_hrs'=>$total_feeding_hrs,'gas_consumption_hr'=>$gas_consumption_per_hour,'gas_consumption_ton'=>$gas_consumption_per_ton,'total_gas_consumption'=>$total_gas_consumption,'ed_running_hrs'=>$ed_running_hrs,'ed_receipt'=>$ed_receipt,'ed_issues'=>$ed_issues,'rotary_input'=>$rotatry_input,'rotary_output'=>$rotatry_output,'trp_roughsand_receipt'=>$roughsand_receipt,'trp_roughsand_issues'=>$roughsand_issues,'trp_finesand_receipt'=>$finesand_receipt,'trp_finesand_issues'=>$finesand_issues,'gas_for_trip_receipt'=>$gastrip_receipt,'gas_for_trip_consumption'=>$gastrip_consumption,'water_receipt'=>$water_receipt,'water_consumption'=>$water_consumpiton,'diesel_receipt'=>$diesel_receipt,'diesel_consumption'=>$diesel_consumption,'diesel_runninig_hrs'=>$diesel_running_hrs,'diesel_dryer_receipt'=>$diesel_rotary_receipt,'diesel_dryer_consumption'=>$diesel_rotary_consumption,'diesel_dryer_runninig_hrs'=>$diesel_rotary_running_hrs,'power_open_reading'=>$open_reading,'power_close_reading'=>$close_reading,'engineers'=>$engineers,'operators'=>$operators,'helpers'=>$helpers,'maintenance_breakdown'=>$breakdown,'maintenance_location'=>$location,'maintenance_description'=>$maintenance_description,'maintenance_reason'=>$maintenance_reason,'maintenance_from_hrs'=>$maintenance_time_from,'maintenance_to_hrs'=>$maintenance_time_to,'maintenance_total_hrs'=>$maintenance_total_hrs,'cost_material'=>$cost_material,'cost_labour'=>$cost_labour,'remarks'=>$remarks,'updatedby'=>$createdby,'approvedby'=>$approvedby);
$datatostore = array('ddate'=>$ddate,'description'=>$description,'total_trp_running_hrs'=>$trp_running_hrs,'less_feeding_start'=>$feeding_start,'less_maintenance'=>$less_maintenance,'less_break_down_hrs'=>$less_break_down_hrs,'total_burner_running_time'=>$total_burner_running_time,'total_feeding_hrs'=>$total_feeding_hrs,'ed_running_hrs'=>$ed_running_hrs,'ed_receipt'=>$ed_receipt,'ed_issues'=>$ed_issues,'rotary_input'=>$rotatry_input,'rotary_output'=>$rotatry_output,'trp_roughsand_receipt'=>$roughsand_receipt,'trp_roughsand_issues'=>$roughsand_issues,'trp_finesand_receipt'=>$finesand_receipt,'trp_finesand_issues'=>$finesand_issues,'gas_for_trip_receipt'=>$gastrip_receipt,'gas_for_trip_consumption'=>$gastrip_consumption,'water_receipt'=>$water_receipt,'water_consumption'=>$water_consumpiton,'diesel_receipt'=>$diesel_receipt,'diesel_consumption'=>$diesel_consumption,'diesel_runninig_hrs'=>$diesel_running_hrs,'diesel_dryer_receipt'=>$diesel_rotary_receipt,'diesel_dryer_consumption'=>$diesel_rotary_consumption,'diesel_dryer_runninig_hrs'=>$diesel_rotary_running_hrs,'power_open_reading'=>$open_reading,'power_close_reading'=>$close_reading,'engineers'=>$engineers,'operators'=>$operators,'helpers'=>$helpers,'remarks'=>$remarks,'updatedby'=>$createdby,'approvedby'=>$approvedby);
//'gas_consumption_hr'=>$gas_consumption_per_hour,'gas_consumption_ton'=>$gas_consumption_per_ton,'total_gas_consumption'=>$total_gas_consumption,'maintenance_breakdown'=>$breakdown,'maintenance_location'=>$location,'maintenance_description'=>$maintenance_description,'maintenance_reason'=>$maintenance_reason,'maintenance_from_hrs'=>$maintenance_time_from,'maintenance_to_hrs'=>$maintenance_time_to,'maintenance_total_hrs'=>$maintenance_total_hrs,'cost_material'=>$cost_material,'cost_labour'=>$cost_labour,
//print_r($datatostore);
$res = $this->batchcard_model->updateDailyBatchCardData($datatostore,$did);
if($res == 1)
@ -670,6 +678,94 @@ class batchcard extends BaseController
$this->global['pageTitle'] = 'Siddharth : Stock Details';
$this->loadViews("batchcard_stockdetails", $this->global,$data,NULL);
}
function getMaintenancesDetails(){
$date = $this->input->post('id1');
$arraydata = $this->batchcard_model->maintenancesdata($date,$Autostartstoptime);
if(count($arraydata) != 0){
echo json_encode($arraydata);}
}
function getMaintListing(){
$data['MaintListing'] = $this->batchcard_model->getmaint_dtl();
$this->global['pageTitle'] = 'Siddharth : Maintenance/Breakdown Listing';
$this->loadViews("BatchcardMaintListing", $this->global,$data,NULL);
}
function addMaint(){
$this->global['pageTitle'] = 'Siddharth : Add Maintenance/Breakdown';
$this->loadViews("BatchcardMaintAdd", $this->global,NULL,NULL);
}
function editMaint(){
$MntID = $_GET['MntID'];
//echo $MntID;
$data['MaintEdit'] = $this->batchcard_model->getmaint_dtl_MntID($MntID);
//print_r($data);
$this->global['pageTitle'] = 'Siddharth : Edit Maintenance/Breakdown';
$this->loadViews("BatchcardMaintEdit", $this->global,$data,NULL);
}
function addmntbr(){
$type = $this->input->post('radiobtn');
$maintenance_date = $this->input->post('maintenance_date');
$maintenance_time= $this->input->post('maintenance_time');
$location = $this->input->post('location');
$maintenance_description = $this->input->post('maintenance_description');
$maintenance_reason = $this->input->post('maintenance_reason');
$maintenance_time_from = $this->input->post('maintenance_time_from');
$maintenance_time_to = $this->input->post('maintenance_time_to');
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
$cost_material = $this->input->post('cost_material');
$cost_labour = $this->input->post('cost_labour');
$createdby = $this->session->userdata ( 'userId' );
$addmntbr = array('Type'=>$type,'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);
$added = $this->batchcard_model->addmaint_dtl($addmntbr);
if($added == 1)
{
echo "<script>alert('Saved Successfully!');window.location.href='getMaintListing';</script>";
}
//print_r($addmntbr);
}
function editmntbr(){
$type = $this->input->post('radiobtn');
$mntid = $this->input->post('mntid');
$maintenance_date = $this->input->post('maintenance_date');
$maintenance_time= $this->input->post('maintenance_time');
$location = $this->input->post('location');
$maintenance_description = $this->input->post('maintenance_description');
$maintenance_reason = $this->input->post('maintenance_reason');
$maintenance_time_from = $this->input->post('maintenance_time_from');
$maintenance_time_to = $this->input->post('maintenance_time_to');
$maintenance_total_hrs = $this->input->post('maintenance_total_hrs');
$cost_material = $this->input->post('cost_material');
$cost_labour = $this->input->post('cost_labour');
$updatedby = $this->session->userdata ( 'userId' );
// $date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
// $updatedon = $date->format('d-m-Y H:i:s');
$editmntbr = array('Type'=>$type,'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);
//print_r($editmntbr);
//die();
// echo $type;
// echo $mntid;
// die();
$updated = $this->batchcard_model->updatemaint_dtl($editmntbr,$mntid);
if($updated == 1)
{
echo "<script>alert('Saved Successfully!');window.location.href='getMaintListing';</script>";
}
}
}
?>

View File

@ -193,6 +193,58 @@ class batchcard_model extends CI_Model
//print_r($res->result());
return $res->result();
}
function addmaint_dtl($array)
{
$this->db->insert('T_Batchcard_MaintanceDetails',$array);
$bmd = $this->db->affected_rows();
return $bmd;
}
function getmaint_dtl()
{
$this->db->select('*');
$this->db->from('T_Batchcard_MaintanceDetails');
$bmd = $this->db->get();
return $bmd->result();
}
function getmaint_dtl_MntID($MntID)
{
$this->db->select('*');
$this->db->from('T_Batchcard_MaintanceDetails');
$this->db->where('Maint_ID',$MntID);
$bmd = $this->db->get();
return $bmd->result();
}
function getmaint_dtl_MntDate($dateval)
{
$this->db->select('*');
$this->db->from('T_Batchcard_MaintanceDetails');
$this->db->where('Maint_Date',$dateval);
$bmd = $this->db->get();
return $bmd->result();
}
function updatemaint_dtl($array,$MntID)
{
$this->db->where('Maint_ID',$MntID);
$this->db->update('T_Batchcard_MaintanceDetails',$array);
$bmd = $this->db->affected_rows();
return $bmd;
}
function maintenancesdata($date,$Autostartstoptime){
$sql = "SELECT * FROM T_Batchcard_MaintanceDetails
where Maint_Date = '".$date."'";
$res = $this->db->query($sql);
return $res->result();
}
}
?>

View File

@ -0,0 +1,250 @@
<script src="<?php echo base_url().'assets/jquery.plugin.js'?>"></script>
<script src="<?php echo base_url().'assets/jquery.timeentry.js'?>"></script>
<div class="content-wrapper" style="min-height: 537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Add Maintenance And Breakdown </center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php base_url() ?>batchcard/getMaintListing" class="btn btn-primary" value="Back"/>Back</a>
</div>
<br>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<div class="box box-primary">
<!-- form start -->
<form role="form" id="addMnt" action="<?php echo base_url() ?>batchcard/addmntbr" enctype="multipart/form-data" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-12">
<legend>Maintenance Details</legend>
<!-- <div class="col-md-3">
<label>Breakdown/Prevention</label>
<input type="text" id="breakdown" name="breakdown" class="form-control" style="text-align:right;"/>
</div> -->
<div class="col-md-3">
<label>Select option:</label></br>
<input type="radio" id="radiobtn1" name="radiobtn" value="0" checked>Maintenance &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn2" name="radiobtn" value="1" >Breakdown
</div>
<div class="col-md-3">
<label>Date</label>
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;"/>
</div>
<div class="col-md-3">
<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;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format"/>
</div>
<div class="col-md-3">
<label>Location</label>
<input type="text" id="location" name="location" class="form-control" style="text-align:right;"/>
</div>
<div class="col-md-3">
<label>Description</label>
<textarea id="maintenance_description" name="maintenance_description" class="form-control" col="100"></textarea>
</div>
<div class="col-md-3">
<label>Reason for Maintenance</label>
<textarea id="maintenance_reason" name="maintenance_reason" class="form-control" col="100"></textarea>
</div>
</div>
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<legend>Time Taken for Maintenance</legend>
<div class="col-md-3">
<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"/>
</div>
<div class="col-md-3">
<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>
<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 class="col-md-6">
<legend>Cost</legend>
<div class="col-md-3">
<label>Material</label>
<input type="text" id="cost_material" name="cost_material" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
</div>
<div class="col-md-3">
<label>Labour</label>
<input type="text" id="cost_labour" name="cost_labour" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
</div>
</div>
</div>
</div><!-- row -->
</div><!--box body -->
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-primary" value="Submit" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
</form>
</div><!--box body primary-->
</div>
</div>
</section>
</div>
<script>
$(function() {
$('#maintenance_date').datepicker({
//minDate : 'year+16',
maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
} );
function calculateTime()
{
var start = $('#maintenance_time_from').val();
var stop = $('#maintenance_time_to').val();
//alert(start+'-'+stop);
if(start != '' && stop != '')
{
if(start.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_from').value="";
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
return false;
}
if(stop.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_to').value="";
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
var atime = '';
start = start.split(":");
stop = stop.split(":");
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_from').value = '';
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
return false;
}
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
if((start[0] > stop[0]))
{
alert('Enter Valid Time');
document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
var h = parseFloat(stop[0]) - parseFloat(start[0]);
var m = parseFloat(stop[1]) - parseFloat(start[1]);
//console.log(h+'-'+m);
if(parseFloat(m) > 60 )
{
h+=1;
m -= 60;
}
else if(parseFloat(m) < 0)
{
h-=1;
if(h < 0){h=0;}
m+=60;
}
if(m < 10){
m = "0"+m;
}
atime = h+':'+m;
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
}
function ValidTime(){
var time = $('#maintenance_time').val();
if(time.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time').value="";
setTimeout(function(){
$('#maintenance_time').focus();},0
);
return false;
}
time = time.split(":");
if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time').value = '';
setTimeout(function(){
$('#maintenance_time').focus();},0
);
return false;
}
}
</script>

View File

@ -0,0 +1,290 @@
<?php
$Mnt_Id = '';
$Type = '';
$Location = '';
$Mnt_Date ='';
$Mnt_Time = '';
$Mnt_Description = '';
$Mnt_Reason = '';
$Mnt_Time_from = '';
$Mnt_Time_to = '';
$Mnt_Total_hrs = '';
$Cost_material = '';
$Cost_labour = '';
if(!empty($MaintEdit))
{
foreach($MaintEdit as $Me)
{
$Mnt_Id = $Me->Maint_ID;
$Mnt_Date = $Me->Maint_Date;
$Mnt_Time = $Me->Maint_Time;
$Type = $Me->Type;
$Location = $Me->Maint_Location;
$Mnt_description = $Me->Maint_Description;
$Mnt_reason = $Me->Maint_Reason;
$Mnt_time_from = $Me->Maint_Time_from;
$Mnt_time_to = $Me->Maint_Time_to;
$Mnt_total_hrs = $Me->Maint_Total_hrs;
$Cost_material = $Me->Cost_Material;
$Cost_labour = $Me->Cost_Labour;
}
}
?>
<div class="content-wrapper" style="min-height: 537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Edit Maintenance And Breakdown </center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php base_url() ?>batchcard/getMaintListing" class="btn btn-primary" value="Back"/>Back</a>
</div>
<br>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<div class="box box-primary">
<!-- form start -->
<form role="form" id="editMnt" action="<?php echo base_url() ?>batchcard/editmntbr" enctype="multipart/form-data" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-12">
<legend>Maintenance Details</legend>
<!-- <div class="col-md-3">
<label>Breakdown/Prevention</label>
<input type="text" id="breakdown" name="breakdown" class="form-control" style="text-align:right;"/>
</div> -->
<div class="col-md-3">
<label>Select option:</label></br>
<input type="radio" id="radiobtn1" name="radiobtn" value="0" >Maintenance &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn2" name="radiobtn" value="1" >Breakdown
</div>
<div class="col-md-3">
<label>Date</label>
<input type="text" id="maintenance_date" name="maintenance_date" class="form-control" style="text-align:right;" value="<?php echo $Mnt_Date ?>"/>
</div>
<div class="col-md-3">
<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()"/>
</div>
<div class="col-md-3">
<label>Location</label>
<input type="text" id="location" name="location" class="form-control" style="text-align:right;" value="<?php echo $Location; ?>"/>
</div>
<div class="col-md-3">
<label>Description</label>
<textarea id="maintenance_description" name="maintenance_description" class="form-control" col="100"><?php echo $Mnt_description; ?></textarea>
</div>
<div class="col-md-3">
<label>Reason for Maintenance</label>
<textarea id="maintenance_reason" name="maintenance_reason" class="form-control" col="100"><?php echo $Mnt_reason;?></textarea>
</div>
</div>
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<legend>Time Taken for Maintenance</legend>
<div class="col-md-3">
<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;?>" />
</div>
<div class="col-md-3">
<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;?>"/>
</div>
<div class="col-md-3">
<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 value="<?php echo $Mnt_total_hrs;?>" />
</div>
</div>
<div class="col-md-6">
<legend>Cost</legend>
<div class="col-md-3">
<label>Material</label>
<input type="text" id="cost_material" name="cost_material" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $Cost_material;?>"/>
</div>
<div class="col-md-3">
<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;?>"/>
</div>
<input type="hidden" id="mntid" name="mntid" class="readonly" value="<?php echo $Mnt_Id;?>"/>
</div>
</div>
</div><!-- row -->
</div><!--box body -->
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-primary" value="Update" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
</form>
</div><!--box body primary-->
</div>
</div>
</section>
</div>
<script>
$(function() {
var type = "<?php echo $Type;?>";
if(type == "0")
{
$('#radiobtn1').attr('checked','true');
}
else
{
$('#radiobtn2').attr('checked','true');
}
$('#rdate').datepicker({
//minDate : 'year+16',
maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
} );
function calculateTime()
{
var start = $('#maintenance_time_from').val();
var stop = $('#maintenance_time_to').val();
//alert(start+'-'+stop);
if(start != '' && stop != '')
{
if(start.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_from').value="";
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
return false;
}
if(stop.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_to').value="";
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
var atime = '';
start = start.split(":");
stop = stop.split(":");
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_from').value = '';
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
return false;
}
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
if((start[0] > stop[0]))
{
alert('Enter Valid Time');
document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
var h = parseFloat(stop[0]) - parseFloat(start[0]);
var m = parseFloat(stop[1]) - parseFloat(start[1]);
//console.log(h+'-'+m);
if(parseFloat(m) > 60 )
{
h+=1;
m -= 60;
}
else if(parseFloat(m) < 0)
{
h-=1;
if(h < 0){h=0;}
m+=60;
}
atime = h+':'+m;
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
}
function ValidTime(){
var time = $('#maintenance_time').val();
if(time.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time').value="";
setTimeout(function(){
$('#maintenance_time').focus();},0
);
return false;
}
time = time.split(":");
if(isNaN(time[0]) || isNaN(time[1]) || parseFloat(time[0]) > 24 || parseFloat(time[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time').value = '';
setTimeout(function(){
$('#maintenance_time').focus();},0
);
return false;
}
}
</script>

View File

@ -0,0 +1,91 @@
<div class="content-wrapper">
<section class="content" id="loadingcontent">
<div>
<CENTER><h3>Siddharth Industries -Maintenance/Breakdown Listing</h3></CENTER>
</div>
<div class="box">
<div class="box-header">
<div align="right" style="padding-right:10px">
<a class="btn btn-Primary" style="padding-right:10px" align="right" href="<?php echo base_url(); ?>batchcard/addMaint">Add New</a>
</div>
</div>
<form role="form" id="" action="<?php echo base_url()?>" method="post" enctype="multipart/form-data">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-12">
<table id="mnttable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<thead style="background-color:#ddf">
<tr>
<th colspan="6"><center>Maintenance Details</center></th>
<th colspan="4"><center>Time Taken for Maintenance</center></th>
</tr>
<tr>
<th >Nature of maintenance</th>
<th >Date</th>
<th >Time</th>
<th >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reason&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th >From</th>
<th >To</th>
<th >Total Hrs</th>
<th >Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($MaintListing))
{
foreach($MaintListing as $ml)
{
//, Type, , , , , , ,
?>
<td><?php if($ml->Type == 0){ echo "MAINTENANCES"; }else{echo "BREAKDOWN";} ?></td>
<td><?php echo $ml->Maint_Date ?></td>
<td><?php echo $ml->Maint_Time ?></td>
<td><?php echo $ml->Maint_Location ?></td>
<td><?php echo $ml->Maint_Description ?></td>
<td><?php echo $ml->Maint_Reason ?></td>
<td><?php echo $ml->Maint_Time_from ?></td>
<td><?php echo $ml->Maint_Time_to ?></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>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</form>
</div>
</section>
</div>
<script type="text/javascript">
$(function () {
$('#mnttable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>

View File

@ -259,7 +259,6 @@ td{ padding:3px;}
<tr>
<th rowspan="2" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th rowspan="2">Auto Start</th>
<th rowspan="2">Auto Stop</th>
<th rowspan="2">Total Hrs</th>
@ -269,7 +268,7 @@ td{ padding:3px;}
<th rowspan="2">Less Break down hours</th>
<th rowspan="2">Total burner running time</th>
<th rowspan="2">Total Feeding Hours</th>
<th rowspan="2">Total gas consumption</th>
<th colspan="3">ED Details</th>
<th colspan="2">Rotary Dryer</th>
<th colspan="2">TRP Rough Sand</th>
@ -280,18 +279,42 @@ td{ padding:3px;}
<th colspan="3">Diesel for Rotary Dryer</th>
<th colspan="3">Power Consumption</th>
<th colspan="3">No Of Person Worked</th>
<th colspan="4">Maintenance Details</th>
<th colspan="3">Time Taken for Maintenance</th>
<th rowspan="2">Worked Done By</th>
<th style="width:25px;!important" rowspan="2">Approved By</th>
<th colspan="2">Cost</th>
<th rowspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remarks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
</tr>
<tr><th >Running Hrs</th><th >Receipt</th><th >Issues</th><th >Input</th><th >Output</th><th >Receipt</th><th >Issues</th><th >Receipt</th><th >Issues</th><th >Receipt</th><th >Consumption</th><th >Receipt</th><th >Consumption</th><th >Receipt</th><th >Consumption</th><th >Running Hrs</th><th >Receipt</th><th >Consumption</th><th >Running Hrs</th><th >Opening Reading</th><th >Close Reading</th><th >Total</th><th >Engineers</th><th >Operators</th><th >Helpers</th><th >Nature of maintenance</th><th >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reason&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th >From</th><th >To</th><th >Total Hrs</th><th >Material</th><th >Labour</th></tr>
<tr> <th >Running Hrs</th>
<th >Receipt</th>
<th >Issues</th>
<th >Input</th>
<th >Output</th>
<th >Receipt</th>
<th >Issues</th>
<th >Receipt</th>
<th >Issues</th>
<th >Receipt</th>
<th >Consumption</th>
<th >Receipt</th>
<th >Consumption</th>
<th >Receipt</th>
<th >Consumption</th>
<th >Running Hrs</th>
<th >Receipt</th>
<th >Consumption</th>
<th >Running Hrs</th>
<th >Opening Reading</th>
<th >Close Reading</th>
<th >Total</th>
<th >Engineers</th>
<th >Operators</th>
<th >Helpers</th></tr>
@ -351,8 +374,8 @@ td{ padding:3px;}
$dailydate = date_format(date_create($hdata->ddate),'d-m-Y');
$id=$hdata->dailyid;
?>
<tr title="<?php echo $dailydate;?>"> <td><a class="test" href="<?php echo base_url()?>batchcard/editDailyData/<?php echo $id;?>" ><?php echo $dailydate;?></a></td>
<tr title="<?php echo $dailydate;?>">
<td><a class="test" href="<?php echo base_url()?>batchcard/editDailyData/<?php echo $id;?>" ><?php echo $dailydate;?></a></td>
<?php
@ -376,6 +399,8 @@ td{ padding:3px;}
$m+=60;
}
//$less_mnt = explode('.',$hdata->less_maintenance);
$total_running_hrs_hrs = $total_running_hrs_hrs + $h;
$total_running_hrs_min = $total_running_hrs_min + $m;
@ -384,22 +409,20 @@ td{ padding:3px;}
//echo $hdata->description;
?>
<td><?php
echo $auto[0];
?></td>
<td ><?php echo $auto[0];?></td>
<td ><?php echo $auto[1];?></td>
<td ><?php $tthrs = $h.':'.$m;echo $tthrs;?></td>
<td ><?php echo $hdata->less_feeding_start; $total_feeding_start += $hdata->less_feeding_start;?></td>
<td ><?php echo $hdata->less_maintenance; $total_less_maintenance+= $hdata->less_maintenance;?></td>
<td ><?php echo $hdata->less_break_down_hrs;$total_less_break_down_hrs+=$hdata->less_break_down_hrs;?></td>
<td ><a class="test" href="<?php echo base_url()?>batchcard/editDailyData/<?php echo $id;?>#Mnt_div" >
<?php echo $hdata->less_maintenance;
$total_less_maintenance+= $hdata->less_maintenance;?></a></td>
<td ><a class="test" href="<?php echo base_url()?>batchcard/editDailyData/<?php echo $id;?>#Mnt_div" >
<?php echo $hdata->less_break_down_hrs;$total_less_break_down_hrs+=$hdata->less_break_down_hrs;?></a></td>
<td ><?php echo $hdata->total_burner_running_time;$total_burner_running_time+=$hdata->total_burner_running_time;?></td>
<td ><?php echo $hdata->total_feeding_hrs;$total_feeding_hrs+=$hdata->total_feeding_hrs;?></td>
<td ><?php echo $hdata->total_gas_consumption;$total_gas_consumption+=$hdata->total_gas_consumption;?></td>
<td ><?php echo $hdata->ed_running_hrs;$total_ed_rhrs+=$hdata->ed_running_hrs;?></td>
<td ><?php echo $hdata->ed_receipt;$total_ed_receipt+=$hdata->ed_receipt;?></td>
<td ><?php echo $hdata->ed_issues;$total_ed_issues+=$hdata->ed_issues;?></td>
@ -425,18 +448,8 @@ td{ padding:3px;}
<td ><?php echo $hdata->engineers;$total_engineers+=$hdata->engineers;?></td>
<td ><?php echo $hdata->operators;$total_operators+=$hdata->operators;?></td>
<td ><?php echo $hdata->helpers;$total_helpers+=$hdata->helpers;?></td>
<td ><?php echo $hdata->maintenance_breakdown;?></td>
<td ><?php echo $hdata->maintenance_location;?></td>
<td ><?php echo $hdata->maintenance_description;?></td>
<td ><?php echo $hdata->maintenance_reason;?></td>
<td ><?php echo $hdata->maintenance_from_hrs;?></td>
<td ><?php echo $hdata->maintenance_to_hrs;?></td>
<td ><?php echo $hdata->maintenance_total_hrs;$total_maintenance_thrs+=$hdata->maintenance_total_hrs;?></td>
<td ><?php echo $hdata->FirstName.'-'.$hdata->LastName;?></td>
<td style="width:25px;!important"><?php echo $hdata->approvedby;?></td>
<td ><?php echo $hdata->cost_material;$total_cost_material+=$hdata->cost_material;?></td>
<td ><?php echo $hdata->cost_labour;$total_cost_labour+=$hdata->cost_labour;?></td>
<td ><?php echo $hdata->remarks;?></td>
<?php
@ -453,7 +466,11 @@ td{ padding:3px;}
</tbody>
<tr> <td>Total</td> <td>&nbsp;</td><td>&nbsp;</td><td id="total_running_hrs"><?php
<tr>
<td>Total</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="total_running_hrs"><?php
if($total_running_hrs_min >= 60)
{
$lh = $total_running_hrs_min / 60;
@ -467,7 +484,67 @@ td{ padding:3px;}
$total_running_hrs = $total_running_hrs_hrs.'.'.$total_running_hrs_min;
echo $total_running_hrs;?></td><td id="total_feeding_start"><?php echo $total_feeding_start;?></td><td id="total_less_maintenance"><?php echo $total_less_maintenance;?></td><td id="total_less_break_down_hrs"><?php echo $total_less_break_down_hrs;?></td><td id="total_burner_running_time"><?php echo $total_burner_running_time;?></td><td id="total_feeding_hrs"><?php echo $total_feeding_hrs;?></td><td id="total_gas_consumption"><?php echo $total_gas_consumption;?></td><td id="total_ed_rhrs"><?php echo $total_ed_rhrs;?></td><td id="total_ed_receipt"><?php echo $total_ed_receipt;?></td><td id="total_ed_issues"><?php echo $total_ed_issues;?></td><td id="total_rotary_input"><?php echo $total_rotary_input;?></td><td id="total_rotary_output"><?php echo $total_rotary_output;?></td><td id="total_rough_sand_r"><?php echo $total_rough_sand_r;?></td><td id="total_rough_sand_i"><?php echo $total_rough_sand_i;?></td><td id="total_fine_sand_r"><?php echo $total_fine_sand_r;?></td><td id="total_fine_sand_i"><?php echo $total_fine_sand_i;?></td><td id="total_gas_r"><?php echo $total_gas_r;?></td><td id="total_gas_c"><?php echo $total_gas_c;?></td><td id="total_water_r"><?php echo $total_water_r;?></td><td id="total_water_c"><?php echo $total_water_c;?></td><td id="total_diesel_bull_r"><?php echo $total_diesel_bull_r;?></td><td id="total_diesel_bull_c"><?php echo $total_diesel_bull_c;?></td><td id="total_diesel_bull_rh"><?php echo $total_diesel_bull_rh;?></td><td id="total_diesel_rotary_bull_r"><?php echo $total_diesel_rotary_bull_r;?></td><td id="total_diesel_rotary_bull_c"><?php echo $total_diesel_rotary_bull_c;?></td><td id="total_diesel_rotary_bull_rh"><?php echo $total_diesel_rotary_bull_rh;?></td><td>&nbsp;</td><td>&nbsp;</td><td id="total_power_total"><?php echo $total_power_total;?></td><td id="total_engineers"><?php echo $total_engineers;?></td><td id="total_operators"><?php echo $total_operators;?></td><td id="total_helpers"><?php echo $total_helpers;?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td id="total_maintenance_thrs"><?php echo $total_maintenance_thrs;?></td><td>&nbsp;</td><td>&nbsp;</td><td id="total_cost_material"><?php echo $total_cost_material;?></td><td id="total_cost_labour"><?php echo $total_cost_labour;?></td><td>&nbsp;</td></tr>
echo $total_running_hrs;?></td>
<td id="total_feeding_start"><?php echo $total_feeding_start;?></td>
<td id="total_less_maintenance"><?php
$less_mnt = explode('.', $total_less_maintenance);
if($less_mnt[1] >= 60 ){
$less_mnt_hr = $less_mnt[0]+1;
$less_mnt_min = $less_mnt[1]-60;
}
else{
$less_mnt_hr = $less_mnt[0];
$less_mnt_min = $less_mnt[1];
}
echo $less_mnt_hr .'.'. $less_mnt_min;
?>
</td>
<td id="total_less_break_down_hrs">
<?php
$less_br = explode('.', $total_less_break_down_hrs);
if($less_br[1] >= 60 ){
$less_br_hr = $less_br[0]+1;
$less_br_min = $less_br[1]-60;
}
else{
$less_br_hr = $less_br[0];
$less_br_min = $less_br[1];
}
echo $less_br_hr .'.'. $less_br_min;
?>
</td>
<td id="total_burner_running_time"><?php echo $total_burner_running_time;?></td>
<td id="total_feeding_hrs"><?php echo $total_feeding_hrs;?></td>
<td id="total_ed_rhrs"><?php echo $total_ed_rhrs;?></td>
<td id="total_ed_receipt"><?php echo $total_ed_receipt;?></td>
<td id="total_ed_issues"><?php echo $total_ed_issues;?></td>
<td id="total_rotary_input"><?php echo $total_rotary_input;?></td>
<td id="total_rotary_output"><?php echo $total_rotary_output;?></td>
<td id="total_rough_sand_r"><?php echo $total_rough_sand_r;?></td>
<td id="total_rough_sand_i"><?php echo $total_rough_sand_i;?></td>
<td id="total_fine_sand_r"><?php echo $total_fine_sand_r;?></td>
<td id="total_fine_sand_i"><?php echo $total_fine_sand_i;?></td>
<td id="total_gas_r"><?php echo $total_gas_r;?></td>
<td id="total_gas_c"><?php echo $total_gas_c;?></td>
<td id="total_water_r"><?php echo $total_water_r;?></td>
<td id="total_water_c"><?php echo $total_water_c;?></td>
<td id="total_diesel_bull_r"><?php echo $total_diesel_bull_r;?></td>
<td id="total_diesel_bull_c"><?php echo $total_diesel_bull_c;?></td>
<td id="total_diesel_bull_rh"><?php echo $total_diesel_bull_rh;?></td>
<td id="total_diesel_rotary_bull_r"><?php echo $total_diesel_rotary_bull_r;?></td>
<td id="total_diesel_rotary_bull_c"><?php echo $total_diesel_rotary_bull_c;?></td>
<td id="total_diesel_rotary_bull_rh"><?php echo $total_diesel_rotary_bull_rh;?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="total_power_total"><?php echo $total_power_total;?></td>
<td id="total_engineers"><?php echo $total_engineers;?></td>
<td id="total_operators"><?php echo $total_operators;?></td>
<td id="total_helpers"><?php echo $total_helpers;?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td></tr>
</table>
<!-- </div>

View File

@ -71,12 +71,12 @@ foreach($emplist as $r)
<div class="col-md-12">
<div class="col-md-3">
<label>Less Maintenance</label>
<input type="text" id="less_maintenance" name="less_maintenance" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
<input type="text" id="less_maintenance" name="less_maintenance" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" readonly/>
</div>
<div class="col-md-3">
<label>Less Break down hours</label>
<input type="text" id="less_break_down_hrs" name="less_break_down_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" title="Enter 24 Hrs Format"/>
<input type="text" id="less_break_down_hrs" name="less_break_down_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" title="Enter 24 Hrs Format" readonly/>
</div>
<div class="col-md-3">
@ -90,7 +90,7 @@ foreach($emplist as $r)
</div>
</div>
<div>&nbsp;</div>
<!-- <div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-3">
<label>Gas Consumption Per Hour</label>
@ -108,7 +108,7 @@ foreach($emplist as $r)
</div>
</div>
</div> -->
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6" >
@ -180,7 +180,7 @@ foreach($emplist as $r)
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<legend>Gas for Trip</legend>
<legend>Gas for TRP</legend>
<div class="col-md-3">
<label>Receipt</label>
<input type="text" id="gastrip_receipt" name="gastrip_receipt" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);"/>
@ -290,11 +290,11 @@ foreach($emplist as $r)
</div>
</div>
<div>&nbsp;</div>
<!--<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-12">
<legend>Maintenance Details</legend>
<legend>Maintenance Details</legend>
<div class="col-md-3">
<label>Breakdown/Prevention</label>
<input type="text" id="breakdown" name="breakdown" class="form-control" style="text-align:right;"/>
@ -319,11 +319,11 @@ foreach($emplist as $r)
</div>
</div>
</div>-->
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<!-- <div class="col-md-6">
@ -360,6 +360,36 @@ foreach($emplist as $r)
</div>
</div> -->
<div>&nbsp;</div>
<legend>Maintenance Details</legend>
<div class="col-md-12">
<table id="Maint_table" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;" >
<thead>
<tr>
<th colspan="7"><center>Maintenance Details</center></th>
<th colspan="3"><center>Time Taken for Maintenance</center></th>
<th colspan="2"><center>Cost Details</center></th>
</tr>
<tr>
<th>S.No</th>
<th>Date</th>
<th>Time</th>
<th>Type</th>
<th>Location</th>
<th>Description</th>
<th>Reason</th>
<th>Time Taken From</th>
<th>Time Taken To</th>
<th>Total hours</th>
<th>Material</th>
<th>Labour</th>
</tr>
</thead>
<tbody id="Maint_Append">
</tbody>
</table>
</div>
<div class="col-md-6">
@ -449,7 +479,11 @@ function keyValidate(e)
var d = $('#rdate').val();
var a = $('#approvedby').val();
var autostartstoptime = $('#description').val();
var openreading = $('#open_reading').val();
var closereading = $('#close_reading').val();
var lessbreakdown = $('#less_maintenance').val();
var lessmaintenances = $('#less_break_down_hrs').val();
if(d == '' || a == -1)
{
alert('Please Enter Date and Approved by');
@ -457,10 +491,34 @@ function keyValidate(e)
}
else
{
if(autostartstoptime == '0-0'){
confirm("autostarttime and autostoptime is '0-0' Do yo want to proceed?");
}
if(openreading == 0){
confirm("openreading is '0-0' Do yo want to proceed?");
}
if(closereading == 0){
confirm("closereading is '0' Do yo want to proceed?");
}
if(lessbreakdown == 0){
confirm("less breakdown hr is '0' Do yo want to proceed?");
}
if(lessmaintenances == 0){
confirm("less maintenances is 0 Do yo want to proceed?");
}
$('#dailyform').submit();
}
}
var maint_hr = 0;
var maint_min = 0;
var breakdown_hr = 0;
var breakdown_min = 0;
var Type = '';
var Index = 1 ;
var totalhr = '';
function getReading(v)
{
$('#save').show();
@ -486,9 +544,19 @@ function keyValidate(e)
if(data)
{
var data = JSON.parse(data);
$('#open_reading').val(data.open);
if(data.open == '' || data.open == null){
$('#open_reading').val(0);
}
else{$('#open_reading').val(data.open);}
if(data.close != '' ){
$('#close_reading').val(data.close);
}
else{$('#close_reading').val(0);}
if(data.start != '' && data.stop != ''){
$('#description').val(data.start+'-'+data.stop);
}
else{$('#description').val('0'+'-'+'0');}
$('.content').loader('hide');
}
else
@ -512,12 +580,105 @@ function keyValidate(e)
}
});
$.ajax({
data:{id1:rd},
method:"POST",
url:"<?php echo base_url().'batchcard/getMaintenancesDetails'; ?>",
success:function(data){
if(data)
{
var data = JSON.parse(data);
//alert(data.length);
$.each(data,function(i,arr){
if(arr.Type == '0'){
totalhr = arr.Maint_Total_hrs
totalhr = totalhr.split(":");
maint_hr += parseFloat(totalhr[0]);
maint_min += parseFloat(totalhr[1]);
if(maint_min > 60 ){
maint_hr = maint_hr+1;
maint_min = maint_min-60;
if(maint_min < 10){
maint_min = "0"+maint_min;
}
}
$('#less_maintenance').val(maint_hr+'.'+maint_min);
//alert(parseFloat(maint_hr)+'.'+parseFloat(maint_min));
}
else{
totalhr = arr.Maint_Total_hrs
totalhr = totalhr.split(":");
breakdown_hr += parseFloat(totalhr[0]);
breakdown_min += parseFloat(totalhr[1]);
if(breakdown_min > 60 ){
breakdown_hr = breakdown_hr+1;
breakdown_min = breakdown_min-60;
if(breakdown_min < 10){
breakdown_min = "0"+breakdown_min;
}
}
// if(breakdown_min < 10){
// breakdown_min = "0"+breakdown_min;
// }
$('#less_break_down_hrs').val(parseFloat(breakdown_hr)+'.'+parseFloat(breakdown_min));
}
var html = '';
if(arr.Type == '0'){
Type = 'Maintenance';
}
else{
Type = 'Breakdown';
}
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Date+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time+'</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_Description+'</td>';
html += '<td style="text-align:left;">'+arr.Maint_Reason+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time_from+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time_to+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Total_hrs+'</td>';
html += '<td style="text-align:left;">'+arr.Cost_Material+'</td>';
html += '<td style="text-align:rignt;">'+arr.Cost_Labour+'</td></tr>';
$('#Maint_Append').append(html);
Index++;
});
}
else
{
alert('There is no data in Maintenances Table');
$('#less_break_down_hrs').val(0);
$('#less_maintenance').val(0);
}
}
});
}
}
function calculateTime()
/**function calculateTime()
{
var start = $('#maintenance_time_from').val();
@ -609,7 +770,7 @@ if(stop.length != 5){
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
}
}**/
</script>

View File

@ -10,6 +10,7 @@ input.text{
</style>
<?php
//print_r($dailydata);
print_r($Maintenances);
$approvedby = array(-1=>'Select Approver Name');
foreach($emplist as $r)
@ -78,12 +79,12 @@ foreach($emplist as $r)
</div>
<div class="col-md-3">
<label>Less Maintenance</label>
<input type="text" id="less_maintenance" name="less_maintenance" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->less_maintenance;?>"/>
<input type="text" id="less_maintenance" name="less_maintenance" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->less_maintenance;?>" readonly/>
</div>
<div class="col-md-3">
<label>Less Break down hours</label>
<input type="text" id="less_break_down_hrs" name="less_break_down_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->less_break_down_hrs;?>"/>
<input type="text" id="less_break_down_hrs" name="less_break_down_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->less_break_down_hrs;?>" readonly/>
</div>
<div class="col-md-3">
@ -101,7 +102,7 @@ foreach($emplist as $r)
<input type="text" id="total_feeding_hrs" name="total_feeding_hrs" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->total_feeding_hrs;?>"/>
</div>
<div class="col-md-3">
<!-- <div class="col-md-3">
<label>Gas Consumption Per Hour</label>
<input type="text" id="gas_consumption_per_hour" name="gas_consumption_per_hour" class="form-control" style="text-align:right;"onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->gas_consumption_hr;?>"/>
</div>
@ -114,7 +115,7 @@ foreach($emplist as $r)
<div class="col-md-3">
<label>Total Gas Consumption</label>
<input type="text" id="total_gas_consumption" name="total_gas_consumption" class="form-control" style="text-align:right;"onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->total_gas_consumption;?>"/>
</div>
</div> -->
</div>
@ -189,7 +190,7 @@ foreach($emplist as $r)
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<legend>Gas for Trip</legend>
<legend>Gas for TRP</legend>
<div class="col-md-3">
<label>Receipt</label>
<input type="text" id="gastrip_receipt" name="gastrip_receipt" class="form-control" style="text-align:right;" onkeypress="return keyValidate(event);" value="<?php echo $dailydata[0]->gas_for_trip_receipt;?>"/>
@ -299,7 +300,7 @@ foreach($emplist as $r)
</div>
</div>
<div>&nbsp;</div>
<!-- <div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-12">
@ -328,11 +329,11 @@ foreach($emplist as $r)
</div>
</div>
</div> -->
<div>&nbsp;</div>
<div class="col-md-12">
<div class="col-md-6">
<!-- <div class="col-md-6">
@ -369,7 +370,39 @@ foreach($emplist as $r)
</div>
</div> -->
<div id="Mnt_div">&nbsp;</div>
<legend>Maintenance Details</legend>
<div class="col-md-12">
<table id="Maint_table" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;" >
<thead>
<tr>
<th colspan="7"><center>Maintenance Details</center></th>
<th colspan="3"><center>Time Taken for Maintenance</center></th>
<th colspan="2"><center>Cost Details</center></th>
</tr>
<tr>
<th>S.No</th>
<th>Date</th>
<th>Time</th>
<th>Type</th>
<th>Location</th>
<th>Description</th>
<th>Reason</th>
<th>Time Taken From</th>
<th>Time Taken To</th>
<th>Total hours</th>
<th>Material</th>
<th>Labour</th>
</tr>
</thead>
<tbody id="Maint_Append">
</tbody>
</table>
</div>
<div class="col-md-6">
@ -433,9 +466,44 @@ $('#rdate').datepicker({
//$('#total_burner_running_time').timeEntry({show24Hours: true});
//$('#total_feeding_hrs').timeEntry({show24Hours: true});
$('#approvedby').val('<?php echo $dailydata[0]->approvedby?>') ;
});
var Type='';
var Index = 1;
$(function() {
//alert('kl');
var mnt =[];
mnt = <?php echo json_encode($Maintenances)?>;
//alert(mnt);
$.each(mnt,function(i,arr){
var html = '';
if(arr.Type == '0'){
Type = 'Maintenance';
}
else{
Type = 'Breakdown';
}
html += '<tr><td style="text-align:rignt;">'+Index+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Date+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time+'</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_Description+'</td>';
html += '<td style="text-align:left;">'+arr.Maint_Reason+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time_from+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Time_to+'</td>';
html += '<td style="text-align:right;">'+arr.Maint_Total_hrs+'</td>';
html += '<td style="text-align:left;">'+arr.Cost_Material+'</td>';
html += '<td style="text-align:rignt;">'+arr.Cost_Labour+'</td></tr>';
$('#Maint_Append').append(html);
Index++;
});
});
function keyValidate(e)
{
@ -494,9 +562,19 @@ function keyValidate(e)
if(data)
{
var data = JSON.parse(data);
$('#open_reading').val(data.open);
if(data.open == '' || data.open == null){
$('#open_reading').val(0);
}
else{$('#open_reading').val(data.open);}
if(data.close != '' ){
$('#close_reading').val(data.close);
}
else{$('#close_reading').val(0);}
if(data.start != '' && data.stop != ''){
$('#description').val(data.start+'-'+data.stop);
}
else{$('#description').val('0'+'-'+'0');}
$('.content').loader('hide');
}
else
@ -524,99 +602,100 @@ function keyValidate(e)
}
}
function calculateTime()
{
// function calculateTime()
// {
var start = $('#maintenance_time_from').val();
var stop = $('#maintenance_time_to').val();
// var start = $('#maintenance_time_from').val();
// var stop = $('#maintenance_time_to').val();
//alert(start+'-'+stop);
if(start != '' && stop != '')
{
// //alert(start+'-'+stop);
// if(start != '' && stop != '')
// {
if(start.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_from').value="";
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
// if(start.length != 5){
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
// document.getElementById('maintenance_time_from').value="";
// setTimeout(function(){
// $('#maintenance_time_from').focus();},0
// );
return false;
}
// return false;
// }
if(stop.length != 5){
alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
document.getElementById('maintenance_time_to').value="";
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
// if(stop.length != 5){
// alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
// document.getElementById('maintenance_time_to').value="";
// setTimeout(function(){
// $('#maintenance_time_to').focus();},0
// );
return false;
}
// return false;
// }
var atime = '';
start = start.split(":");
stop = stop.split(":");
// var atime = '';
// start = start.split(":");
// stop = stop.split(":");
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_from').value = '';
setTimeout(function(){
$('#maintenance_time_from').focus();},0
);
return false;
// if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
// {
// alert("please Enter Valid Time");
// document.getElementById('maintenance_time_from').value = '';
// setTimeout(function(){
// $('#maintenance_time_from').focus();},0
// );
// return false;
}
// }
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
// if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
// {
// alert("please Enter Valid Time");
// document.getElementById('maintenance_time_to').value = '';
// setTimeout(function(){
// $('#maintenance_time_to').focus();},0
// );
// return false;
}
// }
if((start[0] > stop[0]))
{
alert('Enter Valid Time');
document.getElementById('maintenance_time_to').value = '';
// if((start[0] > stop[0]))
// {
// alert('Enter Valid Time');
// document.getElementById('maintenance_time_to').value = '';
setTimeout(function(){
$('#maintenance_time_to').focus();},0
);
return false;
}
// setTimeout(function(){
// $('#maintenance_time_to').focus();},0
// );
// return false;
// }
var h = parseFloat(stop[0]) - parseFloat(start[0]);
var m = parseFloat(stop[1]) - parseFloat(start[1]);
//console.log(h+'-'+m);
if(parseFloat(m) > 60 )
{
h+=1;
m -= 60;
}
else if(parseFloat(m) < 0)
{
h-=1;
if(h < 0){h=0;}
m+=60;
// var h = parseFloat(stop[0]) - parseFloat(start[0]);
// var m = parseFloat(stop[1]) - parseFloat(start[1]);
// //console.log(h+'-'+m);
// if(parseFloat(m) > 60 )
// {
// h+=1;
// m -= 60;
// }
// else if(parseFloat(m) < 0)
// {
// h-=1;
// if(h < 0){h=0;}
// m+=60;
}
atime = h+':'+m;
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
}
// }
// atime = h+':'+m;
// //console.log(atime);
// $('#maintenance_total_hrs').val((atime));
// }
// }
</script>

View File

@ -285,6 +285,10 @@ $(function() {
<span>Batchcard - StockDetails</span>
</a>
</li>
<a href="<?php echo base_url(); ?>batchcard/getMaintListing">
<i class="fa fa-upload"></i>
<span>Batchcard - Maintenance/Breakdown</span>
</a>
<?php if($DEPCode == STORE){?>
<li class="treeview">
<a href="<?php echo base_url(); ?>storerequisitionlisting">