<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
include 'dbc.php';

$username=$_SESSION["username"];
$current_file_name = basename($_SERVER['PHP_SELF']);
$sql = "SELECT * FROM adduser where feedisc2 = '$current_file_name' and uname = '$username'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$status=$row['feedisc3'] ;

if ($status =="")
{
echo "You are not Authorized This Page <a href='maindashboard.php'>Back </a> ";
}
else
{
include 'dbc.php';
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
$userid=$_SESSION["userid"];
$sql = "SELECT MAX( adm_no ) AS max FROM `admission`;" ;
$result = $conn->query($sql);
$row = $result ->fetch_assoc();
$largestNumber = $row['max'];
$largestNumber = $largestNumber +1;
$sql3="Select * from addclass where user_id='$userid'";
$result1 = $conn->query($sql3);
$sql9="Select * from addsection where user_id='$userid'";
$result9 = $conn->query($sql9);
$sql4="Select * from adddept where user_id='$userid'";
$result4 = $conn->query($sql4);
//$rows3=$result1 ->fetch_assoc();
$class_name=$_REQUEST["class_name"];
$cls_sec=$_REQUEST["cls_sec"];
$rollno=1;
$sqlchallan = "SELECT * FROM admission where class_name='$class_name' and user_id='$userid'";
$resultchallan=$conn->query($sqlchallan);
while($rowchallan = $resultchallan->fetch_assoc())
 
  {
  $rollno = $rollno + 1;
  }
  $rollno_std = $largestNumber . "-" . $rollno;
?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

    <?php include("includes/menu.php") ?><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

             <?php include("includes/headermenu.php") ?>

        </header><!-- /header -->
        <!-- Header-->

        <div class="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">

           


          <div class="col-lg-12">
                                                <div class="card">
                                                    <div class="card-header">
                                                        <strong>Student Registration</strong> Form
                                                    </div>
                                                    <div class="card-body card-block">
                                                        <form action="save_app.php" method="post" enctype="multipart/form-data" class="form-horizontal">
                                                            
                                                            <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Admission No</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="adm_no" name="adm_no" placeholder="Text" class="form-control" value="<? echo $largestNumber ?>" readonly><small class="form-text text-muted">This is a Software genrated no</small></div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">B-Form #</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="portal_id" name="portal_id" placeholder="B-Form" class="form-control" value="KM"><small class="form-text text-muted">This is School B-Form</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Session</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="sess1" name="sess1" placeholder="Year Session" class="form-control" value="<? echo $year ?>"><small class="form-text text-muted">This is School Year Session</small><input type="text" id="month" name="month" placeholder="Year Session" class="form-control" value="<? echo $my ?>"><small class="form-text text-muted">This is Session Month</small></div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Student Roll No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="std_rollno" name="std_rollno" placeholder="Student Roll No" class="form-control" value="<? echo $rollno_std ?>" required><small class="form-text text-muted">This is Student Rollno</small></div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Admission Date</label></div>
                                                                <div class="col-12 col-md-3"><input type="date" id="adm_date" name="adm_date" placeholder="Admission Date" class="form-control" value="<? echo $today ?>" required><small class="form-text text-muted">This is Admission Date of Student</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Date of Birth</label></div>
                                                                <div class="col-12 col-md-3"><input type="date" id="dob" name="dob" placeholder="date of Birh" class="form-control" value="<? echo $today ?>" required><small class="form-text text-muted">This is date of Birh of Student</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Class Name</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="class_name" name="class_name" placeholder="Class Name" class="form-control" value="<? echo $class_name ?>" required><small class="form-text text-muted">This is Clsss Student</small></div>
                                                            </div>
																
																
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Student Name</label></div>
                                                                <div class="col-12 col-md-6"><input type="text" id="std_name" name="std_name" placeholder="Student Name" class="form-control" required><small class="form-text text-muted">This is Student Name</small></div>
                                                            </div>
																
																
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Father Name</label></div>
                                                                <div class="col-12 col-md-6"><input type="text" id="fname" name="fname" placeholder="Father Name" class="form-control" required><small class="form-text text-muted">This is Father Name</small></div>
                                                            </div>
																
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Father Nic No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="fnic" name="fnic" placeholder="Father Nic No" class="form-control" ><small class="form-text text-muted">This is Father Nic No</small></div>
                                                            </div>
															
															
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Father Cell No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="cell_1" name="cell_1" placeholder="Father Cell No" class="form-control" value="92" required><small class="form-text text-muted">This is Father Cell No</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Whatsapp Cell No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="cell_2" name="cell_2" placeholder="Whatsapp cell No" class="form-control" value="92" ><small class="form-text text-muted">This is Whatsapp cell No</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Business / Job</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="job" name="job" placeholder="Business / Job" class="form-control" ><small class="form-text text-muted">This is Business / Job</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Income/Salary</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="income" name="income" placeholder="Income/Salary" class="form-control" ><small class="form-text text-muted">This is Income/Salary</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Father Qualification</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="qualification" name="qualification" placeholder="Qualification" class="form-control" ><small class="form-text text-muted">This is Qualification</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3">
                                                                  <label for="text-input" class=" form-control-label">Mother Name </label>
                                                                </div>
                                                                <div class="col-12 col-md-4"><input type="text" id="mnic" name="mnic" placeholder="Mother Name" class="form-control" >
                                                                <small class="form-text text-muted">This is Mother Name</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3">
                                                                  <label for="text-input" class=" form-control-label">Mother Nic </label>
                                                                </div>
                                                                <div class="col-12 col-md-4"><input type="text" id="gnic" name="gnic" placeholder="Mother Nic No" class="form-control"><small class="form-text text-muted">This is Guardian Nic No</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3">
                                                                  <label for="text-input" class=" form-control-label">Mother Cell No</label>
                                                                </div>
                                                                <div class="col-12 col-md-4"><input type="text" id="cell_3" name="cell_3" placeholder="Mother Cell No" class="form-control" value="92" ><small class="form-text text-muted">This is Mother Cell No</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Mother Qualification</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="gname" name="gname" placeholder="Mother Qualification" class="form-control"><small class="form-text text-muted">This is Mother Qualification</small></div>
                                                            </div>
															
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Religion</label></div>
                                                                <div class="col-12 col-md-4"><input name="religion" type="text" class="form-control" id="religion" value="Islam" placeholder="Religion">
                                                                <small class="form-text text-muted">This is Religion</small></div>
                                                            </div>
															
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Previous Class</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="pclass" name="pclass" placeholder="Previous Class" class="form-control"><small class="form-text text-muted">This is Previous Class</small></div>
                                                            </div>
															
															
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Previous School</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="pschool" name="pschool" placeholder="Previous School" class="form-control" ><small class="form-text text-muted">This is Previous School</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Caste</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="caste" name="caste" placeholder="Caste" class="form-control" ><small class="form-text text-muted">This is Caste</small></div>
                                                            </div>
															
															
															
															
															
															
															<div class="row form-group">
                                                                    <div class="col col-md-3"><label for="select" class=" form-control-label">Select Gender</label></div>
                                                                    <div class="col-12 col-md-4">
                                                                        <select name="gender" id="gender" class="form-control">
                                                                           
                                                                            <option value="MALE">MALE</option>
                                                                            <option value="FEMALE">FEMALE</option>
                                                                           
                                                                        </select>
                                                                    </div>
                                                                </div>
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Home/Service Address</label></div>
                                                                <div class="col-12 col-md-9"><input type="text" id="address" name="address" placeholder="Home Address" class="form-control" ><small class="form-text text-muted">This is Home Address</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Tution Fee</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="mfee" name="mfee" placeholder="Tution Fee" class="form-control" required><small class="form-text text-muted">This is Tution Fee</small></div>
                                                            </div>
															
															<div class="row form-group">
                                                                    <div class="col col-md-3"><label for="select" class=" form-control-label">Fee Consession Select Dept</label></div>
                                                                    <div class="col-12 col-md-4">
                                                                        <select name="feestatus" id="feestatus" class="form-control">
                                                                            <?php
  while($user_data4=$result4->fetch_assoc())
  {
  ?>
              <option value="<? echo $user_data4['dname']; ?>"><? echo $user_data4["dname"]; ?></option>
              <?php
  }
  ?>
                                                                        </select>
                                                                    </div>
                                                                </div>
															
															
                                                            <div class="row form-group">
                                                                <div class="col col-md-3"><label for="textarea-input" class=" form-control-label">Remarks</label></div>
                                                                <div class="col-12 col-md-9"><textarea name="remarks" id="remarks" rows="9" placeholder="Content..." class="form-control"></textarea></div>
                                                            </div>
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                <div class="row form-group">
                                                                    <div class="col col-md-3"><label for="file-input" class=" form-control-label">Select Student Image</label></div>
                                                                    <div class="col-12 col-md-9"><input type="file" id="app_file" name="app_file" class="form-control-file"></div>
                                                                </div>
																
																
																<div class="row form-group">
                                                                    <div class="col col-md-3"><label for="file-input" class=" form-control-label">Select Student Barcode</label></div>
                                                                    <div class="col-12 col-md-9"><input type="file" id="app_file1" name="app_file1" class="form-control-file"></div>
                                                                </div>
                                                                <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Barcode No</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="barcode" name="barcode" placeholder="Barcode No" class="form-control"><small class="form-text text-muted">Barcode No</small></div>
                                                            </div>
                                                       
                                                    </div>
                                                    <div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i> Submit
                                                        </button>
                                                        <button type="reset" class="btn btn-danger btn-sm">
                                                            <i class="fa fa-ban"></i> Reset
                                                        </button>
                                                    </div>
													 </form>
                                                </div>
                                                
                                            </div>

            


        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
}
?>