BATCHCARD ISSUES FIXED
This commit is contained in:
parent
f800ce462b
commit
d1821f510c
@ -92,7 +92,10 @@ class batchcard_model extends CI_Model
|
||||
// $this->db->select('*');
|
||||
// $this->db->from('T_daily_batchcard_data');
|
||||
// $this->db->where('month(ddate)',$month);
|
||||
$sql = 'select * from T_daily_batchcard_data where month(ddate) = ?';
|
||||
$sql = 'select T_daily_batchcard_data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName from T_daily_batchcard_data
|
||||
join tbl_users on T_daily_batchcard_data.createdby = tbl_users.userId
|
||||
join T_Employee_Details on T_Employee_Details.EmpID = tbl_users.EmpID
|
||||
where month(ddate) = ?';
|
||||
$res = $this->db->query($sql,array($month));
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">
|
||||
|
||||
<?php
|
||||
// print_r($hourdata);
|
||||
//print_r($hourdata);
|
||||
// die();
|
||||
// echo "<br>";
|
||||
// echo count($attendance);
|
||||
@ -433,7 +433,7 @@ td{ padding:3px;}
|
||||
<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->createdby;?></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>
|
||||
@ -657,12 +657,12 @@ $(function(){
|
||||
//Rotary Details diesel
|
||||
var os2 = $('#OS2').text() == '' ? '0' : parseFloat($('#OS2').text());
|
||||
document.getElementById('RHRS2').textContent = parseFloat($('#total_diesel_rotary_bull_rh').text());
|
||||
document.getElementById('R2').textContent = parseFloat($('#total_rotary_output').text());
|
||||
document.getElementById('C2').textContent = parseFloat($('#total_rotary_input').text());
|
||||
var PH2 = (parseFloat($('#total_diesel_rotary_bull_r').text()) / parseFloat($('#total_diesel_rotary_bull_rh').text())).toFixed(3);
|
||||
document.getElementById('R2').textContent = parseFloat($('#total_rotary_input').text());
|
||||
document.getElementById('C2').textContent = parseFloat($('#total_rotary_output').text());
|
||||
var PH2 = (parseFloat($('#total_rotary_input').text()) / parseFloat($('#total_diesel_rotary_bull_rh').text())).toFixed(3);
|
||||
if(isNaN(PH2)){PH2 = '0';}
|
||||
document.getElementById('PH2').textContent = PH2;
|
||||
document.getElementById('T2').textContent = (parseFloat($('#total_ed_receipt').text()) + parseFloat(os2));
|
||||
document.getElementById('T2').textContent = (parseFloat($('#total_rotary_input').text()) + parseFloat(os2));
|
||||
document.getElementById('CS2').textContent = parseFloat($('#T2').text()) - parseFloat($('#C2').text());
|
||||
|
||||
//Rotary Details diesel/ton
|
||||
@ -670,7 +670,7 @@ $(function(){
|
||||
document.getElementById('RHRS3').textContent = parseFloat($('#RHRS2').text());
|
||||
document.getElementById('R3').textContent = parseFloat($('#total_diesel_rotary_bull_r').text());
|
||||
document.getElementById('C3').textContent = parseFloat($('#total_diesel_rotary_bull_c').text());
|
||||
var PH3 = (parseFloat($('#total_diesel_rotary_bull_c').text()) / (parseFloat($('#total_rotary_input').text())/1000)).toFixed(3);
|
||||
var PH3 = (parseFloat($('#total_diesel_rotary_bull_c').text()) / (parseFloat($('#total_rotary_output').text())/1000)).toFixed(3);
|
||||
if(isNaN(PH3)){PH3 = '0';}
|
||||
document.getElementById('PH3').textContent = PH3;
|
||||
document.getElementById('T3').textContent = (parseFloat($('#total_diesel_rotary_bull_r').text()) + parseFloat(os3));
|
||||
@ -693,7 +693,7 @@ $(function(){
|
||||
document.getElementById('RHRS5').textContent = parseFloat($('#total_feeding_hrs').text());
|
||||
document.getElementById('R5').textContent = parseFloat($('#total_rough_sand_r').text());
|
||||
document.getElementById('C5').textContent = parseFloat($('#total_rough_sand_i').text());
|
||||
var PH5 = (parseFloat($('#total_rough_sand_i').text()) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
var PH5 = ((parseFloat($('#total_rough_sand_r').text()) + parseFloat($('#total_fine_sand_r').text())) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
if(isNaN(PH5)){PH5 = '0';}
|
||||
document.getElementById('PH5').textContent = PH5;
|
||||
document.getElementById('T5').textContent = (parseFloat($('#total_rough_sand_r').text()) + parseFloat(os5));
|
||||
@ -705,7 +705,7 @@ $(function(){
|
||||
document.getElementById('RHRS6').textContent = parseFloat($('#total_feeding_hrs').text());
|
||||
document.getElementById('R6').textContent = parseFloat($('#total_fine_sand_r').text());
|
||||
document.getElementById('C6').textContent = parseFloat($('#total_fine_sand_i').text());
|
||||
var PH6 = (parseFloat($('#total_rough_sand_i').text()) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
var PH6 = ((parseFloat($('#total_rough_sand_r').text()) + parseFloat($('#total_fine_sand_r').text())) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
if(isNaN(PH6)){PH6 = '0';}
|
||||
document.getElementById('PH6').textContent = PH6;
|
||||
document.getElementById('T6').textContent = (parseFloat($('#total_fine_sand_r').text()) + parseFloat(os6));
|
||||
@ -717,7 +717,7 @@ $(function(){
|
||||
document.getElementById('RHRS7').textContent = parseFloat($('#total_feeding_hrs').text());
|
||||
document.getElementById('R7').textContent = parseFloat($('#R5').text()) + parseFloat($('#R6').text());
|
||||
document.getElementById('C7').textContent = parseFloat($('#C5').text()) + parseFloat($('#C6').text());
|
||||
var PH7 = (parseFloat($('#total_rough_sand_i').text()) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
var PH7 = ((parseFloat($('#total_rough_sand_r').text()) + parseFloat($('#total_fine_sand_r').text())) / (parseFloat($('#total_feeding_hrs').text()))).toFixed(3);
|
||||
if(isNaN(PH7)){PH7 = '0';}
|
||||
document.getElementById('PH7').textContent = PH7;
|
||||
document.getElementById('T7').textContent = parseFloat($('#T5').text()) + parseFloat($('#T6').text());
|
||||
@ -800,7 +800,7 @@ $(function(){
|
||||
//if(index != 7){
|
||||
var id = 'OS'+index;
|
||||
|
||||
document.getElementById(id).textContent = value.close_stock;
|
||||
//document.getElementById(id).textContent = value.close_stock;
|
||||
//}
|
||||
}
|
||||
});
|
||||
@ -847,7 +847,7 @@ $(function(){
|
||||
var ps5 = $('#PS5').text() == ''?'0':parseFloat($('#PS5').text());
|
||||
var ps6 = $('#PS6').text() == ''?'0':parseFloat($('#PS6').text());
|
||||
document.getElementById('PS7').textContent = parseFloat(ps5) + parseFloat(ps6);
|
||||
document.getElementById('D7').textContent = parseFloat($('#PS7').text()) + parseFloat($('#CS7').text());
|
||||
document.getElementById('D7').textContent = parseFloat($('#PS7').text()) - parseFloat($('#CS7').text());
|
||||
|
||||
|
||||
}
|
||||
@ -868,7 +868,7 @@ $(function(){
|
||||
var cs = '';var ps = '';
|
||||
if($('#CS'+ num).text() != ''){ cs = parseFloat($('#CS'+ num).text());}else {cs = '0';}
|
||||
if($('#PS'+ num).text() != ''){ ps = parseFloat($('#PS'+ num).text());}else {ps = '0';}
|
||||
document.getElementById('D'+num).textContent = parseFloat(cs) - parseFloat(ps);
|
||||
document.getElementById('D'+num).textContent = parseFloat(ps) - parseFloat(cs);
|
||||
}
|
||||
|
||||
var os7 = $('#OS7').text() == ''?'0':parseFloat($('#OS7').text());
|
||||
|
||||
@ -45,14 +45,14 @@ foreach($emplist as $r)
|
||||
<center>
|
||||
<div class="col-md-2">
|
||||
<label>Batch Date</label>
|
||||
<input type="text" id="curdate" name="myData[curdate]" class="form-control" style="text-align:right;" value="<?php echo date_format(date_create($batchdata[0]->report_date),'d-m-Y');?>" onchange="checkExist();">
|
||||
<input type="text" id="curdate" name="myData[curdate]" class="form-control" style="text-align:right;" value="<?php echo date_format(date_create($batchdata[0]->report_date),'d-m-Y');?>" onchange="checkExist();" readonly>
|
||||
<input type="hidden" id="hid" name="myData[hid]" value="<?php echo $batchdata[0]->hourlyid;?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
||||
<label>Batch Time</label></br>
|
||||
<input type="text" name="myData[usr_time]" id="usr_time" class="form-control" style="text-align:right;" value="<?php echo $batchdata[0]->report_time?>"" onblur="checkExist();">
|
||||
<input type="text" name="myData[usr_time]" id="usr_time" class="form-control" style="text-align:right;" value="<?php echo $batchdata[0]->report_time?>" onblur="" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
@ -77,17 +77,17 @@ foreach($emplist as $r)
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Auto Start</label>
|
||||
<input type="text" id="auto_start" value="<?php echo $batchdata[0]->auto_start?>" name="myData[auto_start]" class="form-control" style="text-align:right;">
|
||||
<input type="text" id="auto_start" value="<?php echo $batchdata[0]->auto_start?>" name="myData[auto_start]" class="form-control" style="text-align:right;" onchange="calculateTime();">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Auto Stop</label>
|
||||
<input type="text" id="auto_stop" value="<?php echo $batchdata[0]->auto_stop?>" name="myData[auto_stop]" class="form-control" style="text-align:right;">
|
||||
<input type="text" id="auto_stop" value="<?php echo $batchdata[0]->auto_stop?>" name="myData[auto_stop]" class="form-control" style="text-align:right;" onchange="calculateTime();">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Time</label>
|
||||
<input type="text" id="atime" value="<?php echo $batchdata[0]->time?>" name="myData[atime]" class="form-control" style="text-align:right;">
|
||||
<input type="text" id="atime" value="<?php echo $batchdata[0]->time?>" name="myData[atime]" class="form-control" style="text-align:right;" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
@ -220,6 +220,9 @@ $(document).ready(function(){
|
||||
// });
|
||||
|
||||
$('#usr_time').timeEntry({show24Hours: true});
|
||||
$('#auto_start').timeEntry({show24Hours: true});
|
||||
$('#auto_stop').timeEntry({show24Hours: true});
|
||||
|
||||
|
||||
$('#approvedby').val('<?php echo $batchdata[0]->approvedby;?>')
|
||||
|
||||
@ -284,7 +287,7 @@ function calculateTotalTRP()
|
||||
function calculateFeeding1HR()
|
||||
{
|
||||
var val = parseFloat($('#feed30sec').val());
|
||||
if(val == '' || isNaN(val) )
|
||||
if(isNaN(val))
|
||||
{
|
||||
alert("Enter Inlet Feeding Data Properly...!");
|
||||
$('#feed30sec').val('');
|
||||
@ -310,7 +313,7 @@ function calculateFeeding1HR()
|
||||
function calculateOPR()
|
||||
{
|
||||
var val = parseFloat($('#output_feed_30').val());
|
||||
if(val == '' || isNaN(val) )
|
||||
if(isNaN(val))
|
||||
{
|
||||
alert("Enter Inlet Feeding Data Properly...!");
|
||||
$('#output_feed_30').val('');
|
||||
@ -368,6 +371,52 @@ function checkExist()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function calculateTime()
|
||||
{
|
||||
|
||||
var start = $('#auto_start').val();
|
||||
var stop = $('#auto_stop').val();
|
||||
|
||||
|
||||
//alert(start+'-'+stop);
|
||||
if(start != '' && stop != '')
|
||||
{
|
||||
var atime = '';
|
||||
start = start.split(":");
|
||||
stop = stop.split(":");
|
||||
//console.log(stop);
|
||||
if((start[0] > stop[0]))
|
||||
{
|
||||
alert('Enter Valid Time');
|
||||
document.getElementById('auto_stop').value = start;
|
||||
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);
|
||||
$('#atime').val((atime));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -265,7 +265,7 @@ function calculateTotalTRP()
|
||||
function calculateFeeding1HR()
|
||||
{
|
||||
var val = parseFloat($('#feed30sec').val());
|
||||
if(val == '' || isNaN(val) )
|
||||
if(isNaN(val) )
|
||||
{
|
||||
alert("Enter Inlet Feeding Data Properly...!");
|
||||
$('#feed30sec').val('');
|
||||
@ -291,7 +291,7 @@ function calculateFeeding1HR()
|
||||
function calculateOPR()
|
||||
{
|
||||
var val = parseFloat($('#output_feed_30').val());
|
||||
if(val == '' || isNaN(val) )
|
||||
if(isNaN(val) )
|
||||
{
|
||||
alert("Enter Inlet Feeding Data Properly...!");
|
||||
$('#output_feed_30').val('');
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
</style>
|
||||
<?php
|
||||
|
||||
//print_r($allhourdata);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@ -239,7 +239,7 @@
|
||||
<td class="celda_normal"><?php echo $data->total?></td>
|
||||
<td class="celda_normal"><?php echo $data->cyclone?></td>
|
||||
<td class="celda_normal"><?php echo $data->remarks?></td>
|
||||
<td class="celda_normal"><?php echo $data->F.'-'.$data->L;?></td>
|
||||
<td class="celda_normal"><?php echo $data->approvedby?></td>
|
||||
<td class="celda_normal"><a type="button" href="<?php echo base_url().'batchcard/editHourly/'.$data->hourlyid; ?> "><i class="fa fa-pencil"></i></a></td>
|
||||
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user