429 lines
12 KiB
PHP
Executable File
429 lines
12 KiB
PHP
Executable File
<!-- ************************************************************************* -->
|
|
<?php
|
|
|
|
$approvedby = array(-1=>'Select Approver Name');
|
|
foreach($emplist as $r)
|
|
{
|
|
$approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
|
|
}
|
|
//print_r($batchdata);
|
|
|
|
?>
|
|
|
|
<!-- <link rel="stylesheet" href="<?php echo base_url().'assets/wickedpicker.css'?>" > -->
|
|
<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">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1>
|
|
<center>Edit Hourly Batch Card Information</center>
|
|
</h1>
|
|
</section>
|
|
<section class="content">
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<!--<center><h3 class="box-title">-->
|
|
<div class="box-tools">
|
|
|
|
|
|
|
|
|
|
</div><!--</h3></center>-->
|
|
|
|
</div><!-- /.box-header -->
|
|
|
|
<form action="<?php echo base_url() ?>batchcard/updateHourlyBatchCard" method="POST" id="myForm">
|
|
<div class="box-body">
|
|
|
|
<div class="row">
|
|
<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();" 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="" readonly>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Opening TRP Reading</label>
|
|
<input type="text" id="open_trp_reading" value="<?php echo $batchdata[0]->opening_trp_reading?>" name="myData[open_trp_reading]" class="form-control" style="text-align:right;" onchange="calculateTotalTRP();">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Closing TRP Reading</label>
|
|
<input type="text" id="close_trp_reading" value="<?php echo $batchdata[0]->close_trp_reading?>" name="myData[close_trp_reading]" class="form-control"style="text-align:right;" onchange="calculateTotalTRP();">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Total TRP Reading</label>
|
|
<input type="text" id="total_trp_reading" value="<?php echo $batchdata[0]->total_trp_reading?>" name="myData[total_trp_reading]" class="form-control" style="text-align:right;" readonly>
|
|
</div>
|
|
|
|
|
|
</center>
|
|
</div>
|
|
|
|
<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;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format">
|
|
</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;" onchange="calculateTime();" placeholder="<?php echo date('H:i');?>" title="Enter 24 Hrs Format">
|
|
</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;" readonly>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Inlet Feeding (Qty for 30 Sec)</label>
|
|
<input type="text" id="feed30sec" name="myData[feed30sec]" value="<?php echo $batchdata[0]->feed30sec?>" class="form-control ;" style="text-align:right;" onchange="calculateFeeding1HR();">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Inlet Feeding (Qty for 1 Hr)</label>
|
|
<input type="text" id="feed1hr" name="myData[feed1hr]" value="<?php echo $batchdata[0]->feed1hr?>" class="form-control ;" style="text-align:right;" readonly>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-2">
|
|
<label>Inlet Temp</label>
|
|
<input type="text" id="inlet_temp" name="myData[inlet_temp]" value="<?php echo $batchdata[0]->inlet_temp?>" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Outlet Temp</label>
|
|
<input type="text" id="outlet_temp" name="myData[outlet_temp]" value="<?php echo $batchdata[0]->outlet_temp?>" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Output Feeding(Qty for 30 Sec)</label>
|
|
<input type="text" id="output_feed_30" name="myData[output_feed_30]" value="<?php echo $batchdata[0]->output_feed_30?>" class="form-control" style="text-align:right;" onchange="calculateOPR();">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Output Received (Qty for 1 Hr)</label>
|
|
<input type="text" id="output_feed_1" name="myData[output_feed_1]" value="<?php echo $batchdata[0]->output_feed_1?>" class="form-control ;" style="text-align:right;" readonly>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-2">
|
|
<label>Actual Weight Rough</label>
|
|
<input type="text" id="weight_rough" value="<?php echo $batchdata[0]->weight_rough?>" name="myData[weight_rough]" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Actual Weight Fine</label>
|
|
<input type="text" id="weight_fine" value="<?php echo $batchdata[0]->weight_fine?>" name="myData[weight_fine]" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Total</label>
|
|
<input type="text" id="total" name="myData[total]" value="<?php echo $batchdata[0]->total?>" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Multi Cyclone Sand </label>
|
|
<input type="text" id="cyclone" name="myData[cyclone]" value="<?php echo $batchdata[0]->cyclone?>" class="form-control" style="text-align:right;">
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Remarks</label>
|
|
<textarea id="remarks" name="myData[remarks]" class="form-control" ><?php echo $batchdata[0]->remarks?></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row"> </div>
|
|
<div class="row">
|
|
|
|
<div class="col-md-3">
|
|
<label>Created By :</label>
|
|
<input type="text" id="inspector" class="form-control" value="<?php echo $this->session->userdata ( 'name' );?>" readonly>
|
|
<input type="hidden" name="myData[cby]" value="<?php echo $this->session->userdata ( 'userId' );?>">
|
|
</div>
|
|
|
|
<div class="col-md-3 col-md-offset-6 ">
|
|
<label>Checked By :</label>
|
|
<?php echo form_dropdown('myData[approvedby]',$approvedby,set_value('approvedby',$approvedby[-1]),'id="approvedby"' ,'class="form-control select2', 'style="text-align:center;"');?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
<div class="row"> </div>
|
|
<div>
|
|
<div class="row"> </div>
|
|
<div class="row">
|
|
<div class="col-md-3" id="savebutton">
|
|
<input type="button" id="save" value ="Save" class="btn btn-primary" onclick="getAllData();">
|
|
</div>
|
|
</div>
|
|
</div><!-- /.box-body -->
|
|
<!-- <div class="box-footer clearfix">
|
|
|
|
</div> -->
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$('#usr_time').timeEntry({show24Hours: true});
|
|
|
|
|
|
$('#approvedby').val('<?php echo $batchdata[0]->approvedby;?>')
|
|
|
|
|
|
$('.edit').bind('keypress', function(e)
|
|
{
|
|
|
|
|
|
if(((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) == 46) || ((e.which || e.keyCode) == 37) || ((e.which || e.keyCode) == 39))
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
if(e.keyCode == 13)
|
|
{
|
|
|
|
return false;
|
|
}
|
|
if(((e.which || e.keyCode) < 48) || ((e.which || e.keyCode) > 57))
|
|
{
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}); // End of document on ready funciton
|
|
|
|
function calculateTotalTRP()
|
|
{
|
|
var open = parseFloat($('#open_trp_reading').val());
|
|
var close = parseFloat($('#close_trp_reading').val());
|
|
//alert(open+'-'+close);
|
|
if(open == '' && close == '' && isNaN(open) && isNaN(close))
|
|
{
|
|
alert("Enter OPen and Close TRP Reading Properly...!");
|
|
}
|
|
else if(close < open)
|
|
{
|
|
alert("Close TRP Reading is smaller than Open TRP Reading...!");
|
|
$('#close_trp_reading').val('0');
|
|
window.setTimeout(function ()
|
|
{
|
|
document.getElementById('close_trp_reading').focus();
|
|
}, 0);
|
|
|
|
}
|
|
else
|
|
{
|
|
var total = close - open;
|
|
if(total == '' || isNaN(total))
|
|
{
|
|
total = 0.00;
|
|
}
|
|
$("#total_trp_reading").val(total);
|
|
}
|
|
}
|
|
|
|
function calculateFeeding1HR()
|
|
{
|
|
var val = parseFloat($('#feed30sec').val());
|
|
if(isNaN(val))
|
|
{
|
|
alert("Enter Inlet Feeding Data Properly...!");
|
|
$('#feed30sec').val('');
|
|
window.setTimeout(function ()
|
|
{
|
|
document.getElementById('feed30sec').focus();
|
|
}, 0);
|
|
$('#feed1hr').val('');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
val = (val*2*60);
|
|
}
|
|
|
|
if(val == '' || isNaN(val))
|
|
{
|
|
val = 0.00;
|
|
}
|
|
$('#feed1hr').val(val);
|
|
}
|
|
|
|
function calculateOPR()
|
|
{
|
|
var val = parseFloat($('#output_feed_30').val());
|
|
if(isNaN(val))
|
|
{
|
|
alert("Enter Inlet Feeding Data Properly...!");
|
|
$('#output_feed_30').val('');
|
|
window.setTimeout(function ()
|
|
{
|
|
document.getElementById('output_feed_30').focus();
|
|
}, 0);
|
|
$('#feed1hr').val('');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
val = (val*2*60);
|
|
}
|
|
|
|
if(val == '' || isNaN(val))
|
|
{
|
|
val = 0.00;
|
|
}
|
|
$('#output_feed_1').val(val);
|
|
}
|
|
|
|
function getAllData()
|
|
{
|
|
|
|
$('#myForm').submit();
|
|
}
|
|
|
|
|
|
|
|
|
|
function calculateTime()
|
|
{
|
|
|
|
var start = $('#auto_start').val();
|
|
var stop = $('#auto_stop').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('auto_start').value="";
|
|
setTimeout(function(){
|
|
$('#auto_start').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('auto_stop').value="";
|
|
setTimeout(function(){
|
|
$('#auto_stop').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('auto_start').value = '';
|
|
setTimeout(function(){
|
|
$('#auto_start').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('auto_stop').value = '';
|
|
setTimeout(function(){
|
|
$('#auto_stop').focus();},0
|
|
);
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if((start[0] > stop[0]))
|
|
{
|
|
alert('Enter Valid Time');
|
|
document.getElementById('auto_stop').value = '';
|
|
|
|
setTimeout(function(){
|
|
$('#auto_stop').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);
|
|
$('#atime').val((atime));
|
|
}
|
|
|
|
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|