From d1821f510c27c26d22138aaecb585c40cb1310c5 Mon Sep 17 00:00:00 2001 From: velz2020 Date: Thu, 1 Feb 2018 18:35:36 +0530 Subject: [PATCH] BATCHCARD ISSUES FIXED --- application/models/batchcard_model.php | 5 +- application/views/dailyBatchCardListing.php | 26 ++++---- application/views/edit_hourly_batch_card.php | 63 +++++++++++++++++--- application/views/hourly_batch_card.php | 4 +- application/views/hourlybatchcardlisting.php | 4 +- 5 files changed, 77 insertions(+), 25 deletions(-) diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index 9497b3cb..3d8c49c8 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -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(); } diff --git a/application/views/dailyBatchCardListing.php b/application/views/dailyBatchCardListing.php index 7b783df8..5a4f3c93 100755 --- a/application/views/dailyBatchCardListing.php +++ b/application/views/dailyBatchCardListing.php @@ -5,7 +5,7 @@ "; // echo count($attendance); @@ -433,7 +433,7 @@ td{ padding:3px;} maintenance_to_hrs;?> maintenance_total_hrs;$total_maintenance_thrs+=$hdata->maintenance_total_hrs;?> - createdby;?> + FirstName.'-'.$hdata->LastName;?> approvedby;?> cost_material;$total_cost_material+=$hdata->cost_material;?> cost_labour;$total_cost_labour+=$hdata->cost_labour;?> @@ -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()); diff --git a/application/views/edit_hourly_batch_card.php b/application/views/edit_hourly_batch_card.php index 0e41791f..fffa84ab 100755 --- a/application/views/edit_hourly_batch_card.php +++ b/application/views/edit_hourly_batch_card.php @@ -45,14 +45,14 @@ foreach($emplist as $r)
- +

- +
@@ -77,17 +77,17 @@ foreach($emplist as $r)
- +
- +
- +
@@ -220,6 +220,9 @@ $(document).ready(function(){ // }); $('#usr_time').timeEntry({show24Hours: true}); +$('#auto_start').timeEntry({show24Hours: true}); +$('#auto_stop').timeEntry({show24Hours: true}); + $('#approvedby').val('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)); +} + + } diff --git a/application/views/hourly_batch_card.php b/application/views/hourly_batch_card.php index df561364..118a09c2 100755 --- a/application/views/hourly_batch_card.php +++ b/application/views/hourly_batch_card.php @@ -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(''); diff --git a/application/views/hourlybatchcardlisting.php b/application/views/hourlybatchcardlisting.php index ccadbf21..f6c54467 100755 --- a/application/views/hourlybatchcardlisting.php +++ b/application/views/hourlybatchcardlisting.php @@ -151,7 +151,7 @@ @@ -239,7 +239,7 @@ total?> cyclone?> remarks?> - F.'-'.$data->L;?> + approvedby?>