<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
 
  
			if(isset($_POST['submitF']))
			{     
    			    
        			$stmt=$conn->prepare("update  UI__Crper set  per=:per  "); 
                    $stmt->bindValue(':per',$_POST['perVal'], PDO::PARAM_STR);  
                    $stmt->execute(); 
                    $_SESSION['Valset'] = "Value Updated to ".$_POST['perVal'];
    				header("Location: coinValue.php ");  
    				die;
			}    
            
            $stmt=$conn->prepare("select * from UI__Crper");    
            $stmt->execute(); 
            $Cper = $stmt->fetch(PDO::FETCH_OBJ);  
            $sr = 1;    
		 
?>  
<?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>Coin value in percentage </h3>
								        <h4 style="color:green;"> <?php echo $_SESSION['Valset'];?></h4> 
								
								</div>    
								
								<div class="panel-options"> 

								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='registered_users.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">Current coin value in %</label>
								    <div class="col-sm-6">
								      <input name="perVal" class="form-control"   placeholder="Coin value in %"   required  value="<?php echo $Cper->per; ?>"  >
								    </div>
								 </div>
								 <hr>
								   
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-6">
										  <input type="submit"    class="btn btn-primary"  name="submitF" value="Update New value">
										</div>
								  </div>   
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


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

<?php  include ABS_PATH.'/admin/footer.php';	
    unset($_SESSION['Valset']);
?>    