<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
 
  
			if(isset($_POST['submitF']))
			{     
			     
                    $stmt =  $conn->prepare("insert into UI__AddAccount (custId,accno,ifsc,Tdate,accName,apprvd) values(:custId,:accno,:ifsc,:Tdate,:accName,1)");            
                    $stmt->bindValue(':custId', $_POST['custId'] , PDO::PARAM_STR);
                    $stmt->bindValue(':accno', $_POST['accNo'], PDO::PARAM_STR);
                    $stmt->bindValue(':ifsc', $_POST['ifsc'], PDO::PARAM_STR);
                    $stmt->bindValue(':Tdate',date("d-M-Y"), PDO::PARAM_STR); 
                    $stmt->bindValue(':accName',$_POST['accName'], PDO::PARAM_STR); 
                    $stmt->execute();  
			        $_SESSION['AccntAdd'] = "Account Added Successfully!!";
				header("Location: addAccount.php");  
				die;
			}   
			
    
            $stmt=$conn->prepare("select  * from  UI__Rgst where id=:id    ");  
            $stmt->bindValue(':id', $_REQUEST['id'] , PDO::PARAM_STR);
            $stmt->execute(); 
            $AllUsers = $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>



<script> 
$(document).ready(function()
{   
  
	
	    var URL = "<?php echo ROOTPATH; ?>";    
        $( "#custId" ).change(function() 
        {      
                   
                     
          $.ajax({	
                type: "POST",
                url: URL+"/ajax/validation.php",
                data: {userDatacheck:1,Data:$("#custId").val()},
                beforeSend: function(){ 
                },
                success: function(data)
                    {     
                        $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                    }
                });   
        });
 
 
}); 

</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> Add Account Manual</h3>
								            <br>
								    <h5><?php echo $_SESSION['AccntAdd'];?></h5>
								</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">Acc Name</label>
								    <div class="col-sm-6">
								      <input name="accName" class="form-control"   placeholder="Acc Name"   required >
								    </div>
								 </div>
								 <hr>
								 
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Acc No</label>
								    <div class="col-sm-6">
								      <input name="accNo" class="form-control"   placeholder="Acc No"  type="number"  required    >
								    </div>
								 </div>
								 <hr>
								 
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">IFSC</label>
								    <div class="col-sm-6">
								      <input name="ifsc" class="form-control"   placeholder="IFSC"   required    >
								    </div>
								 </div>
								 <hr>
								 
								 	 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Id</label>
								    <div class="col-sm-6">
								      <input name="custId" class="form-control"  id="custId" placeholder="Id"   required     >
								        <span id="AvailbleId"></span>
								    </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="Add Account">
										   
										</div>
								  </div>   
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


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

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