<?php 
session_start();
include 'dbc.php';

date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");

$userid=$_SESSION["userid"];
$adm_no=$_POST["adm_no"];
$portal_id=$_POST["portal_id"];
$sess1=$_POST["sess1"];
$month=$_POST["month"];
$std_rollno=$_POST["std_rollno"];
$adm_date=$_POST["adm_date"];
$dob=$_POST["dob"];
$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$std_name=$_POST["std_name"];
$fname=$_POST["fname"];
$fnic=$_POST["fnic"];
$mnic=$_POST["mnic"];
$cell_1=$_POST["cell_1"];
$cell_2=$_POST["cell_2"];
$gender=$_POST["gender"];
$address=$_POST["address"];
$barcode=$_POST["barcode"];
$remarks=$_POST["remarks"];
$app_file=$_POST["app_file"];
$app_file1=$_POST["app_file1"];
$gname=$_POST["gname"];
$gnic=$_POST["gnic"];
$cell_3=$_POST["cell_3"];
$feestatus=$_POST["feestatus"];
$mfee=$_POST["mfee"];


$sql3="Select * from addclass where cname='$class_name' and user_id='$userid'";
$result1 = $conn->query($sql3);
$rows3=$result1 ->fetch_assoc();
//$mfee =$rows3['mfee'];
$feedisc1=$rows3['feedisc1'] ;
$feedisc2=$rows3['feedisc2'] ;
$feedisc3=$rows3['feedisc3'] ;
$feedisc4=$rows3['feedisc4'] ;
$feedisc5=$rows3['feedisc5'] ;
$feedisc6=$rows3['feedisc6'] ;

 /*if ($feestatus == 'Sibling')
{

$mper =$mfee * 25 / 100;
   $mfee=$mfee - $mper;
}
else
{
$mfee=$mfee;
}
*/


$img_name=$adm_no . "_" . $_FILES["app_file"]["name"];
move_uploaded_file($_FILES["app_file"]["tmp_name"],"app_images1/".$img_name);

$img_name1=$adm_no . "_" . $_FILES["app_file1"]["name"];
move_uploaded_file($_FILES["app_file1"]["tmp_name"],"app_images2/".$img_name1);


$sql = "Insert into admission (id,date,adm_no,portal_id,sess1,month,std_rollno,adm_date,dob,class_name,cls_sec,std_name,fname,fnic,mnic,cell_1,cell_2,gender,address,mfee,remarks,app_file,app_file1,user_id,feedisc1,feedisc2,feedisc3,feedisc4,feedisc5,feedisc6,status,barcode,gname,gnic,cell_3,feestatus) values (null,'$today','$adm_no','$portal_id','$sess1','$month','$std_rollno','$adm_date','$dob','$class_name','$cls_sec','$std_name','$fname','$fnic','$mnic','$cell_1','$cell_2','$gender','$address','$mfee','$remarks','$img_name','$img_name1','$userid','$feedisc1','$feedisc2','$feedisc3','$feedisc4','$feedisc5','$feedisc6','Active','$barcode','$gname','$gnic','$cell_3','$feestatus')";
$conn->query($sql);

header("location:Add_Student_Registration.php");

?>
