From 6a29ca3ab47e532c13644e414b0a8a31f7aa5ed6 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 21 Feb 2018 13:39:48 +0530 Subject: [PATCH] batchcard issue fixed --- application/views/BatchcardMaintAdd.php | 5 +- application/views/BatchcardMaintEdit.php | 3 +- application/views/dailyBatchCardListing.php | 290 ++++++++++++++++---- application/views/dailybatchcard.php | 77 +++--- application/views/editDailyData.php | 37 ++- 5 files changed, 306 insertions(+), 106 deletions(-) diff --git a/application/views/BatchcardMaintAdd.php b/application/views/BatchcardMaintAdd.php index 1cc5a509..3cd1fcc4 100644 --- a/application/views/BatchcardMaintAdd.php +++ b/application/views/BatchcardMaintAdd.php @@ -10,7 +10,7 @@
- Back + Back

@@ -208,9 +208,6 @@ if(stop.length != 5){ m+=60; - } - if(m < 10){ - m = "0"+m; } atime = h+':'+m; //console.log(atime); diff --git a/application/views/BatchcardMaintEdit.php b/application/views/BatchcardMaintEdit.php index acde5258..0f01d22f 100644 --- a/application/views/BatchcardMaintEdit.php +++ b/application/views/BatchcardMaintEdit.php @@ -43,7 +43,7 @@ if(!empty($MaintEdit))
- Back + Back

@@ -257,7 +257,6 @@ if(stop.length != 5){ if(h < 0){h=0;} m+=60; - } atime = h+':'+m; //console.log(atime); diff --git a/application/views/dailyBatchCardListing.php b/application/views/dailyBatchCardListing.php index 44b87ef7..417e65ca 100755 --- a/application/views/dailyBatchCardListing.php +++ b/application/views/dailyBatchCardListing.php @@ -201,7 +201,7 @@ td{ padding:3px;} border-color:#ebebe0; }--> - + /**/
@@ -261,65 +261,70 @@ td{ padding:3px;}        Date            Auto Start Auto Stop - Total Hrs - + Total Hrs less up to feeding start + less maintenance Less Break down hours Total burner running time Total Feeding Hours - ED Details + Rotary Dryer TRP Rough Sand TRP Fine Sand Gas for Trip Water + Diesel for Bull Diesel for Rotary Dryer Power Consumption No Of Person Worked - - Worked Done By + Approved By -             Remarks             - - - Running Hrs + + Running Hrs Receipt Issues + Input Output Receipt + Issues Receipt + Issues Receipt Consumption + Receipt Consumption + Receipt Consumption Running Hrs + Receipt Consumption Running Hrs + Opening Reading Close Reading + Total Engineers Operators - Helpers - - + Helpers + - + @@ -374,12 +379,10 @@ td{ padding:3px;} $dailydate = date_format(date_create($hdata->ddate),'d-m-Y'); $id=$hdata->dailyid; ?> - - + + description); $start = explode(':',$auto[0]); @@ -416,45 +419,215 @@ td{ padding:3px;} less_feeding_start; $total_feeding_start += $hdata->less_feeding_start;?> less_maintenance; - $total_less_maintenance+= $hdata->less_maintenance;?> + //$total_less_maintenance+= $hdata->less_maintenance; + + $lm_time = explode('.',$hdata->less_maintenance); + $lm_hrs += $lm_time[0]; + $lm_min += $lm_time[1]; + + if ($lm_min >= 60) + { + $lm_hours = floor($lm_min/60); + $lm_minutes = $lm_min % 60; + } + if($lm_minutes != ''){ + $final_lm_hrs = $lm_hrs+$lm_hours; + $final_lm_mins = round($lm_minutes); + } + else{ + $final_lm_hrs = $lm_hrs+$lm_hours; + $final_lm_mins = $lm_min; + } + + $total_less_maintenance = $final_lm_hrs .'.'. $final_lm_mins; + + ?> + - less_break_down_hrs;$total_less_break_down_hrs+=$hdata->less_break_down_hrs;?> + less_break_down_hrs; + //$total_less_break_down_hrs+=$hdata->less_break_down_hrs; + + $lb_time = explode('.',$hdata->less_break_down_hrs); + $lb_hrs += $lb_time[0]; + $lb_min += $lb_time[1]; - total_burner_running_time;$total_burner_running_time+=$hdata->total_burner_running_time;?> - total_feeding_hrs;$total_feeding_hrs+=$hdata->total_feeding_hrs;?> + if ($lb_min >= 60) + { + $lb_hours = floor($lb_min/60); + $lb_minutes = $lb_min % 60; + } + if($lb_minutes != ''){ + $final_lb_hrs = $lb_hrs+$lb_hours; + $final_lb_mins = round($lb_minutes); + } + else{ + $final_lb_hrs = $lb_hrs+$lb_hours; + $final_lb_mins = $lb_min; + } - ed_running_hrs;$total_ed_rhrs+=$hdata->ed_running_hrs;?> + $total_less_break_down_hrs = $final_lb_hrs .'.'. $final_lb_mins; + + ?> + + total_burner_running_time; + + + $tbr_time = explode('.',$hdata->total_burner_running_time); + $tbr_hrs += $tbr_time[0]; + $tbr_min += $tbr_time[1]; + + if ($tbr_min >= 60) + { + $tbr_hours = floor($tbr_min/60); + $tbr_minutes = $tbr_min % 60; + } + if($tbr_minutes != ''){ + $final_tbr_hrs = $tbr_hrs+$tbr_hours; + $final_tbr_mins = round($tbr_minutes); + } + else{ + $final_tbr_hrs = $tbr_hrs+$tbr_hours; + $final_tbr_mins = $tbr_min; + } + + $total_burner_running_time = $final_tbr_hrs .'.'. $final_tbr_mins; + //$total_burner_running_time+=$hdata->total_burner_running_time; + + ?> + + total_feeding_hrs; + + $tfh_time = explode('.',$hdata->total_feeding_hrs); + $tfh_hrs += $tfh_time[0]; + $tfh_min += $tfh_time[1]; + + if ($tfh_min >= 60) + { + $tfh_hours = floor($tfh_min/60); + $tfh_minutes = $tfh_min % 60; + } + if($tfh_minutes != ''){ + $final_tfh_hrs = $tfh_hrs+$tfh_hours; + $final_tfh_mins = round($tfh_minutes); + } + else{ + $final_tfh_hrs = $tfh_hrs+$tfh_hours; + $final_tfh_mins = $tfh_min; + } + + $total_feeding_hrs = $final_tfh_hrs .'.'. $final_tfh_mins; + //$total_feeding_hrs+=$hdata->total_feeding_hrs; + + ?> + + ed_running_hrs; + + $edrh_time = explode('.',$hdata->ed_running_hrs); + $edrh_hrs += $edrh_time[0]; + $edrh_min += $edrh_time[1]; + + if ($edrh_min >= 60) + { + $edrh_hours = floor($edrh_min/60); + $edrh_minutes = $edrh_min % 60; + } + if($edrh_minutes != ''){ + $final_edrh_hrs = $edrh_hrs+$edrh_hours; + $final_edrh_mins = round($edrh_minutes); + } + else{ + $final_edrh_hrs = $edrh_hrs+$edrh_hours; + $final_edrh_mins = $edrh_min; + } + + $total_ed_rhrs = $final_edrh_hrs .'.'. $final_edrh_mins; + //$total_ed_rhrs+=$hdata->ed_running_hrs; + + ?> ed_receipt;$total_ed_receipt+=$hdata->ed_receipt;?> + ed_issues;$total_ed_issues+=$hdata->ed_issues;?> rotary_input;$total_rotary_input+=$hdata->rotary_input;?> rotary_output;$total_rotary_output+=$hdata->rotary_output;?> trp_roughsand_receipt;$total_rough_sand_r+=$hdata->trp_roughsand_receipt;?> trp_roughsand_issues;$total_rough_sand_i+=$hdata->trp_roughsand_issues;?> + trp_finesand_receipt;$total_fine_sand_r+=$hdata->trp_finesand_receipt;?> trp_finesand_issues;$total_fine_sand_i+=$hdata->trp_finesand_issues;?> gas_for_trip_receipt;$total_gas_r+=$hdata->gas_for_trip_receipt;?> gas_for_trip_consumption;$total_gas_c+=$hdata->gas_for_trip_consumption;?> water_receipt;$total_water_r+=$hdata->water_receipt;?> + water_consumption;$total_water_c+=$hdata->water_consumption;?> diesel_receipt;$total_diesel_bull_r+=$hdata->diesel_receipt;?> diesel_consumption;$total_diesel_bull_c+=$hdata->diesel_consumption;?> - diesel_runninig_hrs;$total_diesel_bull_rh+=$hdata->diesel_runninig_hrs;?> + + diesel_runninig_hrs; + + $drh_time = explode('.',$hdata->diesel_runninig_hrs); + $drh_hrs += $drh_time[0]; + $drh_min += $drh_time[1]; + + if ($drh_min >= 60) + { + $drh_hours = floor($drh_min/60); + $drh_minutes = $drh_min % 60; + } + if($drh_minutes != ''){ + $final_drh_hrs = $drh_hrs+$drh_hours; + $final_drh_mins = round($drh_minutes); + } + else{ + $final_drh_hrs = $drh_hrs+$drh_hours; + $final_drh_mins = $drh_min; + } + + $total_diesel_bull_rh = $final_drh_hrs .'.'. $final_drh_mins; + //$total_diesel_bull_rh+=$hdata->diesel_runninig_hrs; + + ?> diesel_dryer_receipt;$total_diesel_rotary_bull_r+=$hdata->diesel_dryer_receipt;?> + diesel_dryer_consumption;$total_diesel_rotary_bull_c+=$hdata->diesel_dryer_consumption;?> - diesel_dryer_runninig_hrs;$total_diesel_rotary_bull_rh+=$hdata->diesel_dryer_runninig_hrs;?> + diesel_dryer_runninig_hrs; + + $ddrh_time = explode('.',$hdata->diesel_dryer_runninig_hrs); + $ddrh_hrs += $ddrh_time[0]; + $ddrh_min += $ddrh_time[1]; + + if ($ddrh_min >= 60) + { + $ddrh_hours = floor($ddrh_min/60); + $ddrh_minutes = $ddrh_min % 60; + } + if($ddrh_minutes != ''){ + $final_ddrh_hrs = $ddrh_hrs+$ddrh_hours; + $final_ddrh_mins = round($ddrh_minutes); + } + else{ + $final_ddrh_hrs = $ddrh_hrs+$ddrh_hours; + $final_ddrh_mins = $ddrh_min; + } + + $total_diesel_rotary_bull_rh = $final_ddrh_hrs .'.'. $final_ddrh_mins; + + // $total_diesel_rotary_bull_rh = $drr_hr .'.'. $drr_min; + + ?> power_open_reading;?> power_close_reading;?> power_close_reading - $hdata->power_open_reading);echo $treading;$total_power_total+=$treading;?> + engineers;$total_engineers+=$hdata->engineers;?> operators;$total_operators+=$hdata->operators;?> helpers;$total_helpers+=$hdata->helpers;?> FirstName.'-'.$hdata->LastName;?> approvedby;?> + remarks;?> + @@ -465,7 +638,7 @@ td{ padding:3px;} - + Total   @@ -486,38 +659,11 @@ td{ padding:3px;} echo $total_running_hrs;?> - = 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; - ?> - - - = 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; - - ?> - + + - + @@ -533,6 +679,32 @@ td{ padding:3px;} + + diff --git a/application/views/dailybatchcard.php b/application/views/dailybatchcard.php index 06eb3822..ea7ec7db 100755 --- a/application/views/dailybatchcard.php +++ b/application/views/dailybatchcard.php @@ -58,12 +58,12 @@ foreach($emplist as $r)
- +
- +
@@ -81,12 +81,12 @@ foreach($emplist as $r)
- +
- +
@@ -115,7 +115,7 @@ foreach($emplist as $r) Ed Details
- +
@@ -226,7 +226,7 @@ foreach($emplist as $r)
- +
@@ -246,7 +246,7 @@ foreach($emplist as $r)
- +
@@ -512,12 +512,7 @@ function keyValidate(e) } } - 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) { @@ -579,17 +574,23 @@ function keyValidate(e) } } }); - + $('#Maint_Append').empty(); + var Index = 1 ; $.ajax({ data:{id1:rd}, method:"POST", url:"", success:function(data){ - + //alert(data); if(data) { var data = JSON.parse(data); //alert(data.length); + var maint_hr = 0; + var maint_min = 0; + var breakdown_hr = 0; + var breakdown_min = 0; + $.each(data,function(i,arr){ @@ -598,40 +599,32 @@ function keyValidate(e) totalhr = totalhr.split(":"); maint_hr += parseFloat(totalhr[0]); maint_min += parseFloat(totalhr[1]); - if(maint_min > 60 ){ + + 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{ - + //alert('alert in else part '); totalhr = arr.Maint_Total_hrs totalhr = totalhr.split(":"); breakdown_hr += parseFloat(totalhr[0]); breakdown_min += parseFloat(totalhr[1]); - if(breakdown_min > 60 ){ + //alert(breakdown_min); + 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)); + + $('#less_break_down_hrs').val(breakdown_hr+'.'+breakdown_min); + //$('#less_break_down_hrs').val(parseFloat(breakdown_hr)+'.'+parseFloat(breakdown_min)); } @@ -677,7 +670,25 @@ function keyValidate(e) } } - + function hour_validation(value,id){ + + var getvalue = value.split("."); + + if(parseFloat(getvalue[0]) > 24 || parseFloat(getvalue[1]) > 60) + { + alert("please Enter Valid Time"); + + document.getElementById(id).value=""; + setTimeout(function(){ + + $('#' + id).focus()},0 + ); + + return false; + + } + + } /**function calculateTime() { diff --git a/application/views/editDailyData.php b/application/views/editDailyData.php index 9d77027a..33ceec53 100755 --- a/application/views/editDailyData.php +++ b/application/views/editDailyData.php @@ -1,4 +1,3 @@ -