CHANGE in drier machine : GWM
This commit is contained in:
parent
081bc3830f
commit
8b6ea09efb
@ -426,6 +426,7 @@ $routes->post('updateCoatingMachineDetails','StockController::updateCoatingMachi
|
||||
$routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMachineDetails');
|
||||
|
||||
|
||||
$routes->get('drierMachineDetails' , 'StockController::drierMachineDetails');
|
||||
|
||||
$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'drierMachineDetails', 'StockController::drierMachineDetails');
|
||||
$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'addOrEditdrierMachineDetails', 'StockController::addOrEditdrierMachineDetails');
|
||||
|
||||
|
||||
@ -123,4 +123,155 @@ class StockController extends BaseController
|
||||
|
||||
|
||||
// --------------------------------------------gwm----------------------------------------------
|
||||
|
||||
|
||||
function getMonthDatesFromInput($monthYear) {
|
||||
|
||||
$date = DateTime::createFromFormat('M-Y', $monthYear);
|
||||
|
||||
if (!$date) {
|
||||
return "Invalid date format. Use 'M-yyyy' format.";
|
||||
}
|
||||
|
||||
$year = $date->format('Y');
|
||||
$month = $date->format('m');
|
||||
|
||||
$totalDays = cal_days_in_month(CAL_GREGORIAN, $month, $year);
|
||||
|
||||
$dates = [];
|
||||
for ($day = 1; $day <= $totalDays; $day++) {
|
||||
|
||||
$currentDate = DateTime::createFromFormat('Y-m-d', "$year-$month-$day");
|
||||
|
||||
$dates[] = [
|
||||
'readable' => $currentDate->format('d-m-Y'),
|
||||
'database' => $currentDate->format('Y-m-d')
|
||||
];
|
||||
}
|
||||
|
||||
return $dates;
|
||||
}
|
||||
|
||||
function fillMissingDates($monthData, $drierDetails) {
|
||||
|
||||
$filledDetails = [];
|
||||
|
||||
$drierDetailsByDate = [];
|
||||
foreach ($drierDetails as $detail) {
|
||||
$drierDetailsByDate[$detail['date']] = $detail;
|
||||
}
|
||||
|
||||
foreach ($monthData as $day) {
|
||||
$date = $day['database'];
|
||||
|
||||
if (isset($drierDetailsByDate[$date])) {
|
||||
$filledDetails[] = $drierDetailsByDate[$date];
|
||||
} else {
|
||||
$filledDetails[] = [
|
||||
'id' => null,
|
||||
'date' => $date,
|
||||
'drier_on_time' => null,
|
||||
'drier_off_time' => null,
|
||||
'drier_running_hours' => '0.00',
|
||||
'supplier_name' => null,
|
||||
'input_sand_moisture' => '0.00',
|
||||
'total_gas_consumption' => '0.00',
|
||||
'gas_per_ton' => '0.00',
|
||||
'input_sand_qty' => '0.00',
|
||||
'moisture_loss_qty' => '0.00',
|
||||
'sand_dried_qty' => '0.00',
|
||||
'qty_per_hours' => '0.00',
|
||||
'dust_qty' => '0.00',
|
||||
'customer_name' => null,
|
||||
'created_at' => null,
|
||||
'updated_at' => null
|
||||
];
|
||||
}
|
||||
}
|
||||
return $filledDetails;
|
||||
}
|
||||
|
||||
function generateTimeOptions() {
|
||||
$times = [];
|
||||
$start = strtotime('00:00'); // Start at midnight (12:00 AM)
|
||||
$end = strtotime('23:45'); // End at 11:45 PM
|
||||
|
||||
while ($start <= $end) {
|
||||
$timeValue = date('H:i', $start); // 24-hour format for value
|
||||
$timeLabel = date('h:i A', $start); // 12-hour format with AM/PM for display
|
||||
$times[$timeValue] = $timeLabel; // Store time in associative array
|
||||
$start = strtotime('+15 minutes', $start); // Increment by 15 minutes
|
||||
}
|
||||
|
||||
return $times;
|
||||
}
|
||||
|
||||
function drierMachineDetails()
|
||||
{
|
||||
|
||||
|
||||
$currentMonth = $this->request->getPost('month') ? $this->request->getPost('month') : date('M-Y');
|
||||
|
||||
$monthData = $this->getMonthDatesFromInput($currentMonth);
|
||||
|
||||
$data['startDate'] = $monthData[0]['database'];
|
||||
$data['endDate'] = $monthData[count($monthData)-1]['database'];
|
||||
$data['timeDropdown'] = $this->generateTimeOptions();
|
||||
|
||||
$data['drierDetails'] = $this->drierMachineDetails_model
|
||||
->where('date >=', $data['startDate'])
|
||||
->where('date <=', $data['endDate'])
|
||||
->findAll();
|
||||
$data['datefordropdown'] = $currentMonth;
|
||||
|
||||
$data['data'] = $this->fillMissingDates($monthData, $data['drierDetails']);
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Drier Details';
|
||||
$this->loadViews("drierMachineDetails", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
public function addOrEditdrierMachineDetails()
|
||||
{
|
||||
$drierData = json_decode($this->request->getPost('drierData'), true);
|
||||
|
||||
if (empty($drierData)) {
|
||||
echo "No data received.";
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($drierData as $row) {
|
||||
$data = [
|
||||
'date' => DateTime::createFromFormat('d-m-Y', $row['Date'])->format('Y-m-d'),
|
||||
'drier_on_time' => $row['Drier On Time'],
|
||||
'drier_off_time' => $row['Drier Off Time'],
|
||||
'drier_running_hours' => $row['Running Hrs'],
|
||||
'supplier_name' => $row['Supplier Name'],
|
||||
'input_sand_moisture' => $row['i/p Sand Moisture(%)'],
|
||||
'total_gas_consumption'=> $row['Tot Gas Consumption'],
|
||||
'gas_per_ton' => $row['Gas Pre Ton'],
|
||||
'input_sand_qty' => $row['i/p Sand Qty'],
|
||||
'moisture_loss_qty' => $row['Moisture Loss Qty'],
|
||||
'sand_dried_qty' => $row['Sand Dried Qty'],
|
||||
'qty_per_hours' => $row['Qty Per Hrs'],
|
||||
'dust_qty' => $row['Dust Qty'],
|
||||
'customer_name' => $row['Customer Name']
|
||||
];
|
||||
|
||||
// Check if a row with the same date already exists
|
||||
$existingRow = $this->drierMachineDetails_model->where('date', $data['date'])->first();
|
||||
|
||||
|
||||
if ($existingRow) {
|
||||
// If exists, update the row
|
||||
$this->drierMachineDetails_model->update($existingRow['id'], $data);
|
||||
} else {
|
||||
// If not, insert a new row
|
||||
$this->drierMachineDetails_model->insert($data);
|
||||
}
|
||||
}
|
||||
|
||||
echo "Data successfully saved.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
535
app/Views/drierMachineDetails.php
Normal file
535
app/Views/drierMachineDetails.php
Normal file
@ -0,0 +1,535 @@
|
||||
|
||||
|
||||
<?php
|
||||
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
?>
|
||||
<style type="text/css">
|
||||
.num {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.fht-table,
|
||||
.fht-table thead,
|
||||
.fht-table tfoot,
|
||||
.fht-table tbody,
|
||||
.fht-table tr,
|
||||
.fht-table th,
|
||||
.fht-table td {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.fht-table td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fht-table td:hover {
|
||||
background-color: #00a65a;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.fht-table {
|
||||
border: 0 none;
|
||||
height: auto;
|
||||
width: auto;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
/*table-layout: fixed; Algoritmo de distribucion fijo */
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.fht-table th,
|
||||
.fht-table td {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fht-table-wrapper,
|
||||
.fht-table-wrapper .fht-thead,
|
||||
.fht-table-wrapper .fht-tfoot,
|
||||
.fht-table-wrapper .fht-fixed-column .fht-tbody,
|
||||
.fht-table-wrapper .fht-fixed-body .fht-tbody,
|
||||
.fht-table-wrapper .fht-tbody {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fht-table-wrapper .fht-fixed-body .fht-tbody,
|
||||
.fht-table-wrapper .fht-tbody {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.fht-table-wrapper .fht-table .fht-cell {
|
||||
overflow: hidden;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.fht-table-wrapper .fht-fixed-column,
|
||||
.fht-table-wrapper .fht-fixed-body {
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.fht-table-wrapper .fht-fixed-column {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.fht-fixed-body .fht-thead table {
|
||||
margin-right: 20px;
|
||||
border: 0 none;
|
||||
}
|
||||
|
||||
/*For Examples*/
|
||||
|
||||
.ContenedorTabla {
|
||||
height: 500px;
|
||||
margin: 0 auto;
|
||||
overflow: auto;
|
||||
width: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header,
|
||||
.main {
|
||||
display: inline-block;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.titulosHeader {
|
||||
border-bottom: 1px solid #e8bb25;
|
||||
height: auto;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 8px;
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.celda_encabezado_general {
|
||||
background-color: #00a65a;
|
||||
border: 1px solid #ccc;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
padding: 2px 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
._Separador {
|
||||
background-color: #fff;
|
||||
height: 12px;
|
||||
border-left: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
._Separador div {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.celda_normal {
|
||||
/*background-color: #fff;*/
|
||||
/* <!-- ad9271 into ffffff brown-light to green-light --> */
|
||||
border: 1px solid #ccc;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
/*style excel*/
|
||||
.excel_cell {
|
||||
border: 1px solid #CCC;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
padding: 4px;
|
||||
white-space: pre-line;
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
._cell_header {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
._cell_Default {
|
||||
background-color: #FFF;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.excel_cell div {
|
||||
width: 30px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.modal {
|
||||
padding-right: 30% ! important;
|
||||
}
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Stocks</a></li>
|
||||
<li class="breadcrumb-item active">
|
||||
<h4 class="page-title">10 Ton Drier Details </h4>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<!-- Right-aligned buttons or links can be added here -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form action="<?= base_url('drierMachineDetails'); ?>" method="post">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-3">
|
||||
<?php $today = date('M-Y'); ?>
|
||||
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<input type="submit" value="Change Month" class="btn btn-success" style="margin-top:0px;">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<!-- Add table-responsive for horizontal scroll -->
|
||||
<div class="table-responsive">
|
||||
<table id="drierTable" class="fht-table table-striped" style="font-size: small;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">S.NO</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Date</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Drier On Time</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Drier Off Time</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Running Hrs</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Supplier Name</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Moisture(%)</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Tot Gas Consumption</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Gas Pre Ton</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Moisture Loss Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Sand Dried Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Qty Per Hrs</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Dust Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Customer Name</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody style="background-color: #fff;">
|
||||
|
||||
<?php $index = 0;
|
||||
$row = 0;
|
||||
foreach ($data as $a) {
|
||||
$row++;
|
||||
$index++; ?>
|
||||
|
||||
<tr id="<?php echo $row; ?>">
|
||||
<td width="45" height="45" class="celda_normal"><?php echo $index; ?></td>
|
||||
<td width="79" height="45" class="celda_normal"><?php echo DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?></td>
|
||||
<td class="celda_normal" >
|
||||
<select class="timeDropdown drier_on_time" style="width: 100px;" ">
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||
<option value="<?= $time; ?>" <?php if($a['drier_on_time'] == $time){ echo 'selected'; } ?> ><?= $time; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="celda_normal" >
|
||||
<select class="timeDropdown drier_off_time" style="width: 100px;">
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||
<option value="<?= $time; ?>" <?php if($a['drier_off_time'] == $time){ echo 'selected'; } ?> ><?= $time; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="celda_normal">
|
||||
<?php echo $a['drier_running_hours']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" contenteditable="true">
|
||||
<?php echo $a['supplier_name']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" contenteditable="true" >
|
||||
<?php echo $a['input_sand_moisture']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" onkeyup="gasPerTon(this.parentNode.id,this.textContent);" contenteditable="true" >
|
||||
<?php echo $a['total_gas_consumption']; ?>
|
||||
</td>
|
||||
<td class="celda_normal">
|
||||
<?php echo $a['gas_per_ton']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" onkeyup="moistureLossQty(this.parentNode.id,this.textContent);" contenteditable="true" >
|
||||
<?php echo $a['input_sand_qty']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" >
|
||||
<?php echo $a['moisture_loss_qty']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" onkeyup="gasPerTon(this.parentNode.id, this.textContent); moistureLossQty(this.parentNode.id, this.textContent); qtyPerHrs(this.parentNode.id, this.textContent)" contenteditable="true" >
|
||||
<?php echo $a['sand_dried_qty']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" >
|
||||
<?php echo $a['qty_per_hours']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" contenteditable="true" >
|
||||
<?php echo $a['dust_qty']; ?>
|
||||
</td>
|
||||
<td class="celda_normal" contenteditable="true">
|
||||
<?php echo $a['customer_name']; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!-- End table-responsive -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<input type="button" class="btn btn-success" id="save" value="save">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- End card-body -->
|
||||
</div> <!-- End card -->
|
||||
</div> <!-- End col -->
|
||||
</div> <!-- End row -->
|
||||
</div>
|
||||
</div> <!-- End container-fluid -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$('.timeDropdown').select2({
|
||||
placeholder: "Select a time",
|
||||
});
|
||||
|
||||
$('#save').click(function() {
|
||||
|
||||
var alldata = $("#drierTable").tableToJSON();
|
||||
|
||||
$('#drierTable tbody tr').each(function (index) {
|
||||
|
||||
let row = alldata[index];
|
||||
|
||||
// Get the selected values from dropdowns
|
||||
row['Drier On Time'] = $(this).find('.drier_on_time').val();
|
||||
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
|
||||
});
|
||||
|
||||
|
||||
|
||||
alldata = JSON.stringify(alldata);
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: {
|
||||
drierData: alldata,
|
||||
},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>addOrEditdrierMachineDetails",
|
||||
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// time diff finding script start
|
||||
$('.drier_on_time').change(function() {
|
||||
|
||||
var tr = $(this).closest('tr');
|
||||
|
||||
var drierOnTime = $(this).val();
|
||||
var drierOffTime = tr.find('.drier_off_time').val();
|
||||
|
||||
if(drierOnTime != '' && drierOffTime != ''){
|
||||
|
||||
|
||||
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
||||
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
||||
|
||||
// Handle the case where end time is on the next day
|
||||
if (endDate < startDate) {
|
||||
endDate.setDate(endDate.getDate() + 1);
|
||||
}
|
||||
|
||||
// Calculate the difference in milliseconds
|
||||
const diffInMs = endDate - startDate;
|
||||
|
||||
// Convert milliseconds to hours and minutes
|
||||
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
const totalHours = hours + (minutes / 60);
|
||||
|
||||
tr.find('td:eq(4)').text(totalHours);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
$('.drier_off_time').change(function() {
|
||||
|
||||
var tr = $(this).closest('tr');
|
||||
|
||||
var drierOffTime = $(this).val();
|
||||
var drierOnTime = tr.find('.drier_on_time').val();
|
||||
|
||||
if(drierOnTime != '' && drierOffTime != ''){
|
||||
|
||||
|
||||
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
||||
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
||||
|
||||
// Handle the case where end time is on the next day
|
||||
if (endDate < startDate) {
|
||||
endDate.setDate(endDate.getDate() + 1);
|
||||
}
|
||||
|
||||
// Calculate the difference in milliseconds
|
||||
const diffInMs = endDate - startDate;
|
||||
|
||||
// Convert milliseconds to hours and minutes
|
||||
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
const totalHours = hours + (minutes / 60);
|
||||
|
||||
tr.find('td:eq(4)').text(totalHours);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
function convertTo24Hour(time)
|
||||
{
|
||||
const [timePart, modifier] = time.split(" ");
|
||||
let [hours, minutes] = timePart.split(":");
|
||||
|
||||
// Convert hours to a number
|
||||
hours = parseInt(hours, 10);
|
||||
|
||||
// Adjust hours based on AM/PM
|
||||
if (modifier === "PM" && hours < 12) {
|
||||
hours += 12;
|
||||
} else if (modifier === "AM" && hours === 12) {
|
||||
hours = 0;
|
||||
}
|
||||
|
||||
return `${String(hours).padStart(2, '0')}:${minutes}`;
|
||||
}
|
||||
// time diff finding script end
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function gasPerTon(parentId , textContent) {
|
||||
var tr = $('#' + parentId);
|
||||
var totalGasConsumption = tr.find('td:eq(7)').text();
|
||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
||||
if(totalGasConsumption != '' && sandDriedQty != '')
|
||||
{
|
||||
var gasPerTon = totalGasConsumption / sandDriedQty;
|
||||
|
||||
if(gasPerTon != NaN && gasPerTon != Infinity)
|
||||
tr.find('td:eq(8)').text(gasPerTon.toFixed(1));
|
||||
|
||||
}else{
|
||||
tr.find('td:eq(8)').text(0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function moistureLossQty(parentId , textContent) {
|
||||
var tr = $('#' + parentId);
|
||||
var inputSandQty = tr.find('td:eq(9)').text();
|
||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
||||
if(inputSandQty != '' && sandDriedQty != '')
|
||||
{
|
||||
var moistureLossQty = inputSandQty - sandDriedQty;
|
||||
|
||||
if(moistureLossQty != NaN && moistureLossQty != Infinity)
|
||||
tr.find('td:eq(10)').text(moistureLossQty.toFixed(1));
|
||||
|
||||
}else{
|
||||
tr.find('td:eq(10)').text(0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function qtyPerHrs(parentId , textContent) {
|
||||
var tr = $('#' + parentId);
|
||||
var drierRunninhHrs = tr.find('td:eq(4)').text();
|
||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
||||
if(drierRunninhHrs != '' && sandDriedQty != '')
|
||||
{
|
||||
var qtyPerHrs = sandDriedQty / drierRunninhHrs;
|
||||
|
||||
if(qtyPerHrs != NaN && qtyPerHrs != Infinity)
|
||||
tr.find('td:eq(12)').text(qtyPerHrs.toFixed(3));
|
||||
|
||||
}else{
|
||||
tr.find('td:eq(12)').text(0.000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user