<?php 	
            include_once('../../config.php');  
          	
			if(isset($_POST['submit']))
			{ 
                $rst = mysql_query("select MAX(priority)  from  live_result  "); 
                $rw =  mysql_fetch_row($rst); 
			    $pr = $rw[0]+1;
			    
                $type = $_SESSION['type'];
                $adminId = $_SESSION['adminId'];
              
				mysql_query("insert into live_result (name,value,tim,priority,type,UserId) values('$_POST[Lname]','$_POST[value]','$_POST[tim]',$pr,$type,$adminId)" ); 
				header("Location:  d-buber.php "); 
				$msg = "Product has been added successfully..";			
			}  
?>  
<?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"				 
			} 
		}
	});


	});
 


</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='d-buber.php';" />
								  
								</div>
							  
								 
							</div>
							
							
			  				<div class="panel-body">
							
							
								
								 
			  					<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="product_frm">
								
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Name</label>
								    <div class="col-sm-10">
								      <input name="Lname" class="form-control"   placeholder="Value" >
								    </div>
								 </div>
								 <hr>  
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Value</label>
								    <div class="col-sm-10">
								      <input name="value" class="form-control"   placeholder="Value" value="<?php echo $value->value;?>"  >
								    </div>
								 </div>
								 <hr>   

								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Time</label>
								    <div class="col-sm-10">
								      <input name="tim" class="form-control"   placeholder="Time" value="<?php echo $value->tim;?>"  >
								    </div>
								 </div>
								 
								   
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-10">
										  <input type="submit"    class="btn btn-primary"  name="submit" value="Add Result">
										</div>
								  </div>   
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


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

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