<?php 	
            include_once('../../config.php');    
			 
			
			if(isset($_POST['submit']))
			{   
                $old_date = $_POST['datepicker'];
                $old_date_timestamp = strtotime($old_date);
                $tDate =  date('Y-m-d', $old_date_timestamp);  
                
                
			 	mysql_query("insert into calcDigits (zero,one,two,three,four,five,six,seven,eight,nine,tDate) values($_POST[zero],$_POST[one],$_POST[two],$_POST[three],$_POST[four],$_POST[five],$_POST[six],$_POST[seven],$_POST[eight],$_POST[nine],'$tDate') ");				
			    header("Location:  record.php "); 
                die;
			}   
			
			
			        
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  


 <script>
	$(function() {
		$( "#datepicker" ).datepicker(); 
	}); 
  
	$(document).ready(function()
	{   

	
	$("#product_frm").validate({
		
		errorElement:'div',
		rules:{ 
			city:{
				required:true				 
			} 
			
			
			
		},
		messages:{				
			 
			 city:{
				required:"Enter city name"				 
			} 
		}
	});
	
	
    $( function() {
    $( "#datepicker" ).datepicker();
    } );


	});
 


</script>
		 
		 <div class="col-md-10">

	  			<div class="row">
	  				<div class="col-md-12">
	  					<div class="content-box-large">
							<div class="panel-heading">
								<div class="panel-title"> <h3> <?php //echo $val;?> </h3></div>    
								
								<div class="panel-options"> 

								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='record.php';" />
								  
								</div>
							</div>
							
			  				<div class="panel-body">
								
								 
			  					<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="product_frm" autocomplete="off">
								
							  

								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">0</label>
								    <div class="col-sm-3">
								      <input name="zero" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>  		
								 
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">1</label>
								    <div class="col-sm-3">
								      <input name="one" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>  
							 
								   
								  
								   
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">2</label>
								    <div class="col-sm-3">
								      <input name="two" class="form-control"   placeholder="Value" value=""  >
									  
								    </div>
								 </div>
								 <hr>   
								 
								    
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">3</label>
								    <div class="col-sm-3">
								      <input name="three" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>   
								   
								   
								      
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">4</label>
								    <div class="col-sm-3">
								      <input name="four" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>   
								   
								   
								      
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">5</label>
								    <div class="col-sm-3">
								      <input name="five" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>   
								   
								   
								      
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">6</label>
								    <div class="col-sm-3">
								      <input name="six" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>   
								   
								   
								      
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">7</label>
								    <div class="col-sm-3">
								      <input name="seven" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>   
								   
								   
								      
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">8</label>
								    <div class="col-sm-3">
								      <input name="eight" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>    
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">9</label>
								    <div class="col-sm-3">
								      <input name="nine" class="form-control"   placeholder="Value" value=""  >
									   
								    </div>
								 </div>
								 <hr>        
								 
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Date</label>
								    <div class="col-sm-3">
								      <input name="datepicker" class="form-control"   placeholder="Date"  id="datepicker"  >
									   
								    </div>
								 </div>
								 <hr>    
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Add</label>
										<div class="col-sm-10">
										  <input type="submit"    class="btn btn-primary"  name="submit" value="Add">  
										   
										</div>
								  </div>   
								  
								   
								  
								  
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


	  		<!--  Page content -->
		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	

 /*    
                    if($rw->spliFor==0)
                        mysql_query("update  splitCalc set splitAmt = $_POST[zero] where spliFor = 0 ");
                     
                    if($rw->spliFor==1)
                        mysql_query("update  splitCalc set splitAmt = $_POST[one] where spliFor = 1 ");
                    
                    if($rw->spliFor==2)
                        mysql_query("update  splitCalc set splitAmt = $_POST[two] where spliFor = 2 ");
                    
                    if($rw->spliFor==3)
                        mysql_query("update  splitCalc set splitAmt = $_POST[three] where spliFor = 3 ");
                    
                    if($rw->spliFor==4)
                        mysql_query("update  splitCalc set splitAmt = $_POST[four] where spliFor = 4 ");
                        
                    if($rw->spliFor==5)
                        mysql_query("update  splitCalc set splitAmt = $_POST[five] where spliFor = 5 ");
                    
                    if($rw->spliFor==6)
                        mysql_query("update  splitCalc set splitAmt = $_POST[six] where spliFor = 6 "); 
                    
                    if($rw->spliFor==7)
                        mysql_query("update  splitCalc set splitAmt = $_POST[seven] where spliFor = 7 ");
                    
                     if($rw->spliFor==8)
                        mysql_query("update  splitCalc set splitAmt = $_POST[eight] where spliFor = 8 ");
                        
                    
                     if($rw->spliFor==9)
                        mysql_query("update  splitCalc set splitAmt = $_POST[nine] where spliFor = 9 ");   
                        
                    */
                    
?>    