<?php
require('db.php');
include "x.php";
?>
<!doctype html>
<html lang="en">
  <head>
    
     <?php include "include/meta.php"; ?>

     <?php include "include/css.php"; ?>

       <link rel="stylesheet" href="assets/css/bootstrap.css">

  </head>
  <body>
<?php include "include/header.php"; ?>


<section class="w3l-contact-breadcrum">
  <div class="breadcrum-bg py-sm-5 py-4">
    <div class="container py-lg-3">
      <h2>Online Application</h2>
      <p><a href="index.php">Home</a> &nbsp; / &nbsp; Online Application</p>
    </div>
  </div>
</section>


<div class="container">
  <div class="row">
        <div class="col-md-1">
      



    </div>
    <div class="col-md-10">
      <br>
<form class="well form-horizontal" action="" method="post"  id="contact_form">
      <fieldset>

      <!-- Form Name -->
      <legend><center><h2 class="title1"><b>Registration Form</b></h2></center></legend><br>

<div class="container">
<div class="row" >
<div class="col-md-6" >
  <label class="control-label" style="padding-top:10px; font-weight: bold;">Title</label>
  <select name="title" class="form-control">
    <option value="Mr">Mr</option>
    <option value="Mrs">Mrs</option>
  </select>

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">First Name</label>
  <input  name="fname" placeholder="Enter First Name" class="form-control"  type="text" required> 

</div>

<div class="col-md-6" style="padding-top:10px; font-weight: bold;" >
  <label class="control-label">Middle Name</label> 
  <input  name="mname" placeholder="Enter Middle Name" class="form-control"  type="text" required>

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Last Name</label> 
  <input  name="lname" placeholder="Enter Last Name" class="form-control"  type="text" required>

</div>

<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Gender</label>
  <select name="gender" class="form-control">
            <option value="Male">Male</option>
            <option value="Female">Female</option>
            <option value="Others">Others</option>
          </select> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Date Of Birth</label>
  <input  name="dob" placeholder="" class="form-control"  type="date" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Guardian Name</label>
  <input  name="gname" placeholder="Enter Guardian Name" class="form-control"  type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Catagory / Caste</label>
  <input  name="caste" placeholder="Enter Catagory / Caste" class="form-control"  type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Admission City</label>
  <select name="programme" class="form-control">
            <option value="Kolkata">Kolkata</option>
            <option value="Bangalore">Bangalore</option>
                   <option value="Hydrabad">Hydrabad</option>
                       <option value="Chenni">Chenni</option>
               <option value="Abroad ">Abroad </option>
                   
          </select> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Course</label>
  <select name="cat" class="form-control">
            <option value="B.Tech">B.Tech</option>
            <option value="Polytechnic">Polytechnic</option>
            <option value="M.Tech">M.Tech</option>
            <option value="GNM Nursing">GNM Nursing</option>
            <option value="B.Sc Nursing">B.Sc Nursing</option>
            <option value="D. Pharmacy">D. Pharmacy</option>
            <option value="B. Pharmacy">B. Pharmacy</option>
            <option value="Pharm D">Pharm D</option>
            <option value="MBBS">MBBS</option>
            <option value="BDS">BDS</option>
            <option value="MBS">MBA</option>
            <option value="MCA">MCA</option>
            <option value="BBA">BBA</option>
            <option value="BCA">BCA</option>
            <option value="Hotel Managenet">Hotel Management</option>
          </select>

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">E-Mail</label>
  <input name="email" placeholder="E-Mail Address" class="form-control"  type="text" required> 

</div>

<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Examination Passed / Pursuing (12th / Diploma)</label>
  <input name="exempass" placeholder="Examination Passed / Pursuing" class="form-control" type="text" required> 

</div>

<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Entrance Examination(If Any):</label>
  <input name="entrance" placeholder="Entrance Examination" class="form-control" type="text"> 

</div>

<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Student Contact No.</label>
  <input name="scontact_no" placeholder="Student Phone No." class="form-control" type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Guardian Contact No.</label>
  <input name="gcontact_no" placeholder="Guardian Phone No." class="form-control" type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Address</label>
  <input  name="address" placeholder="Address" class="form-control"  type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">City</label>
  <input name="city" placeholder="City" class="form-control"  type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">State</label>
  <input  name="state" placeholder="State" class="form-control"  type="text" required> 

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Pin No.</label>
  <input  name="pin" placeholder="Pin No." class="form-control"  type="text" required>

</div>
<div class="col-md-6" style="padding-top:10px; font-weight: bold;">
  <label class="control-label">Queries ??? &nbsp;(if any..)</label>
  <textarea name="comments" rows="3" cols="48"  placeholder=""></textarea> 

</div>


</div>
</div>
<br>
<legend><center><h2 class="title1"><b><button type="submit" class="btn btn-warning" name="submit" >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp SUBMIT &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</button></b></h2></center></legend><br>


      </fieldset>
      </form>

    </div>
    <div class="col-md-1">
      



    </div>
  </div>
</div>

<?php include "include/footer.php"; ?>
<?php include "include/js.php"; ?>

</body>

</html>
<!-- // grids block 5 -->
<?php

    date_default_timezone_set("Asia/Kolkata");
    $currentTime = date('M j, Y g:i a');
    
   if(isset($_POST['submit'])){
 

     $title = mysqli_real_escape_string($con, strip_tags($_POST['title']));
     $fname = mysqli_real_escape_string($con, strip_tags($_POST['fname']));
     $mname = mysqli_real_escape_string($con, strip_tags($_POST['mname']));
     $lname = mysqli_real_escape_string($con, strip_tags($_POST['lname']));
     $gender = mysqli_real_escape_string($con, strip_tags($_POST['gender']));
     $dob = mysqli_real_escape_string($con, strip_tags($_POST['dob']));
     $gname = mysqli_real_escape_string($con, strip_tags($_POST['gname']));
     $entrance = mysqli_real_escape_string($con, strip_tags($_POST['entrance']));

     $exempass = mysqli_real_escape_string($con, strip_tags($_POST['exempass']));
     $caste = mysqli_real_escape_string($con, strip_tags($_POST['caste']));

     $programme = mysqli_real_escape_string($con, strip_tags($_POST['programme']));
     $cat = mysqli_real_escape_string($con, strip_tags($_POST['cat']));
     $email = mysqli_real_escape_string($con, strip_tags($_POST['email']));
     $scontact_no = mysqli_real_escape_string($con, strip_tags($_POST['scontact_no']));
     $gcontact_no = mysqli_real_escape_string($con, strip_tags($_POST['gcontact_no']));
     $city = mysqli_real_escape_string($con, strip_tags($_POST['city']));
     $state = mysqli_real_escape_string($con, strip_tags($_POST['state']));
     $pin = mysqli_real_escape_string($con, strip_tags($_POST['pin']));
     $comments = mysqli_real_escape_string($con, strip_tags($_POST['comments']));
     $address = mysqli_real_escape_string($con, strip_tags($_POST['address']));

 echo $ins_sql = "INSERT INTO admission_form (adm_title,adm_fname,adm_mname,adm_lname,adm_gender,adm_dob, adm_Gname,adm_caste,adm_examPass,adm_entranceExam, adm_programme, adm_email, adm_ph, adm_Gph, adm_city, adm_state, adm_pin, adm_query, adm_by, adm_uploadDT,adm_category,adm_address) 
 VALUES ('$title','$fname','$mname','$lname','$gender','$dob','$gname','$caste','$exempass','$entrance','$programme','$email','$scontact_no','$gcontact_no','$city','$state','$pin','$comments','$x','$currentTime','$cat','$address')";
 if( mysqli_query($con, $ins_sql) ){
        ?>
        <script>
            alert("Details Sent Successfully");
            window.location = "online_application.php";
        </script>
        <?php
    }
    else{
        ?>
        <script>
            alert("Something's Wrong");
            window.location = "online_application.php";
        </script>
        <?php
    }
  
  
   }
?>