diff --git a/application/views/dailyBatchCardListing.php b/application/views/dailyBatchCardListing.php
index 5a4f3c93..ff283d78 100755
--- a/application/views/dailyBatchCardListing.php
+++ b/application/views/dailyBatchCardListing.php
@@ -279,7 +279,7 @@ td{ padding:3px;}
@@ -421,8 +421,6 @@ $('#rdate').datepicker({
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
-$('#maintenance_time_from').timeEntry({show24Hours: true});
-$('#maintenance_time_to').timeEntry({show24Hours: true});
$('#total_burner_running_time').timeEntry({show24Hours: true});
$('#total_feeding_hrs').timeEntry({show24Hours: true});
@@ -526,17 +524,67 @@ var start = $('#maintenance_time_from').val();
var stop = $('#maintenance_time_to').val();
+
//alert(start+'-'+stop);
if(start != '' && stop != '')
{
+
+ if(start.length != 5 || stop.length != 5)
+{
+ alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
+ document.getElementById('maintenance_time_from').value = '';
+ document.getElementById('maintenance_time_to').value = '';
+
+ setTimeout(function(){
+ $('#maintenance_time_from').focus();},0
+ );
+
+
+ return false;
+}
var atime = '';
start = start.split(":");
stop = stop.split(":");
- //console.log(stop);
+
+ if(isNaN(start[0]) || isNaN(start[1]) )
+ {
+ alert("please Enter Valid Time");
+ document.getElementById('maintenance_time_from').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_from').focus();},0
+ );
+ return false;
+
+ }
+
+ if(isNaN(stop[0]) || isNaN(stop[1]))
+ {
+ alert("please Enter Valid Time");
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
+ return false;
+
+ }
+
if((start[0] > stop[0]))
{
alert('Enter Valid Time');
- document.getElementById('maintenance_time_to').value = start;
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
+ return false;
+ }
+
+ if((start[1] > stop[1]))
+ {
+ alert('Enter Valid Time');
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
return false;
}
@@ -560,8 +608,8 @@ if(start != '' && stop != '')
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
-
-
+
+
}
diff --git a/application/views/editDailyData.php b/application/views/editDailyData.php
index 4d3760e2..030c988b 100755
--- a/application/views/editDailyData.php
+++ b/application/views/editDailyData.php
@@ -339,12 +339,12 @@ foreach($emplist as $r)
-
+
-
+
@@ -430,8 +430,6 @@ $('#rdate').datepicker({
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
-$('#maintenance_time_from').timeEntry({show24Hours: true});
-$('#maintenance_time_to').timeEntry({show24Hours: true});
$('#total_burner_running_time').timeEntry({show24Hours: true});
$('#total_feeding_hrs').timeEntry({show24Hours: true});
$('#approvedby').val('approvedby?>') ;
@@ -527,24 +525,74 @@ function keyValidate(e)
}
- function calculateTime()
+function calculateTime()
{
var start = $('#maintenance_time_from').val();
var stop = $('#maintenance_time_to').val();
+
//alert(start+'-'+stop);
if(start != '' && stop != '')
{
+
+ if(start.length != 5 || stop.length != 5)
+{
+ alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25');
+ document.getElementById('maintenance_time_from').value = '';
+ document.getElementById('maintenance_time_to').value = '';
+
+ setTimeout(function(){
+ $('#maintenance_time_from').focus();},0
+ );
+
+
+ return false;
+}
var atime = '';
start = start.split(":");
stop = stop.split(":");
- //console.log(stop);
+
+ if(isNaN(start[0]) || isNaN(start[1]) )
+ {
+ alert("please Enter Valid Time");
+ document.getElementById('maintenance_time_from').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_from').focus();},0
+ );
+ return false;
+
+ }
+
+ if(isNaN(stop[0]) || isNaN(stop[1]))
+ {
+ alert("please Enter Valid Time");
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
+ return false;
+
+ }
+
if((start[0] > stop[0]))
{
alert('Enter Valid Time');
- document.getElementById('maintenance_time_to').value = start;
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
+ return false;
+ }
+
+ if((start[1] > stop[1]))
+ {
+ alert('Enter Valid Time');
+ document.getElementById('maintenance_time_to').value = '';
+ setTimeout(function(){
+ $('#maintenance_time_to').focus();},0
+ );
return false;
}
@@ -568,8 +616,8 @@ if(start != '' && stop != '')
//console.log(atime);
$('#maintenance_total_hrs').val((atime));
}
-
-
+
+
}
diff --git a/application/views/edit_hourly_batch_card.php b/application/views/edit_hourly_batch_card.php
index fffa84ab..e0260dc0 100755
--- a/application/views/edit_hourly_batch_card.php
+++ b/application/views/edit_hourly_batch_card.php
@@ -77,12 +77,12 @@ foreach($emplist as $r)