<form method="post" enctype="multipart/form-data">
	<div class="row">
		<div class="col-sm-6 col-md-6">
			<div class="form-group">
				<label>Student Name :</label>
        <?php if(isset($_POST['submit'])){ ?>
				<input type="text" name="stud_name" class="form-control" placeholder="Enter Student Name" value="<?php echo $_POST['stud_name']?>" oninput="this.value = this.value.replace(/[^a-zA-Z\s.]/g, '').replace(/(\..*)\./g, '$1');">
      <?php } else { ?>

        <input type="text" name="stud_name" class="form-control" placeholder="Enter Student Name" oninput="this.value = this.value.replace(/[^a-zA-Z\s.]/g, '').replace(/(\..*)\./g, '$1');">

      <?php } ?>
			</div>
		</div>
		<div class="col-sm-6 col-md-6">
			<div class="form-group">
				<label>Registration No :</label>
				<select name="reg_id" class="form-control custom-select2" id="reg_id" >
                  <option value="">Select Registration No</option>  
                   	<?php
                      $emp=mysqli_query($connect,"select * from tbl_student_reg where fld_stud_reg_delete='0' order by fld_stud_reg_id desc") or die(mysqli_error($connect));
                      while ($fetch=mysqli_fetch_assoc($emp))
                       {
                        extract($fetch);

                        if (isset($_POST['submit']))
                         { ?>
                         <option value="<?php echo $fetch['fld_reg_no'];?>" <?php if ($fetch['fld_reg_no']==$_POST['reg_id']){echo "selected";} ?>><?php echo $fetch['fld_reg_no'];?></option>
                       <?php } 
                       else { ?> 
                   
                    <option value="<?php echo $fetch['fld_reg_no']; ?>"><?php echo $fetch['fld_reg_no']; ?></option>
                  <?php } 
                    }
                  ?>      
        </select>
			</div>
		</div>
	</div>
  <div class="row">
    <div class="col-sm-6 col-md-6">
      <div class="form-group">
        <label>Invoice Number:</label>
        <select name="invoice_id" class="form-control custom-select2" id="invoice_id" >
                  <option value="">Select Invoice Number</option>  
                    <?php
                      $emp=mysqli_query($connect,"select * from tbl_invoice where fld_delete='0' order by fld_invoice_id desc") or die(mysqli_error($connect));
                      while ($fetch=mysqli_fetch_array($emp)) 
                      {
                        extract($fetch);

                        if (isset($_POST['submit']))
                         { ?>
                         <option value="<?php echo $fetch['fld_invoice_no'];?>" <?php if ($fetch['fld_invoice_no']==$_POST['invoice_id']){echo "selected";} ?>><?php echo $fetch['fld_invoice_no'];?></option>
                       <?php } 
                       else { ?> 
                    ?>
                    <option value="<?php echo $fetch['fld_invoice_no']; ?>"><?php echo $fetch['fld_invoice_no']; ?></option>
                  <?php } }?>      
        </select>
      </div>
    </div>
    
  </div>

	
    <div class="form-group row">				            
        <div class="col-sm-12 col-md-12">			              	
      		<center>
      			<input class="btn btn-success" value="Submit" type="submit" name="submit">
        		<input class="btn btn-danger" value="Reset" type="reset" name="cancle">
        	</center>
      	</div>
    </div>

</form>

