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

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

$userid=$_SESSION["userid"];
$issue_date=$_POST["issue_date"];
$due_date=$_POST["due_date"];
$month_name=$_POST["month_name"];
$adm_no=$_POST["adm_no"];
$std_rollno=$_POST["std_rollno"];
$std_name=$_POST["std_name"];
$month_period=$_POST["month_period"];
$fname=$_POST["fname"];
$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$cell_1=$_POST["cell_1"];
$mfee=$_POST["mfee"];
$feestatus=$_POST["feestatus"];
$app_file1=$_POST["app_file1"];
$bal=$_POST["bal"];
$barcode=$_POST["barcode"];
$feedisc1=$_POST["feedisc1"];
$fee1=$_POST["fee1"];
$feedisc2=$_POST["feedisc2"];
$fee2=$_POST["fee2"];
$feedisc3=$_POST["feedisc3"];
$fee3=$_POST["fee3"];
$feedisc4=$_POST["feedisc4"];
$fee4=$_POST["fee4"];
$feedisc5=$_POST["feedisc5"];
$fee5=$_POST["fee5"];
$feedisc6=$_POST["feedisc6"];
$fee6=$_POST["fee6"];
$fine=0;
$feebal=$mfee;
$totalfee=$mfee + $fee1 + $fee2 + $fee3 + $fee4 + $fee5 + $fee6;

$sql = "Insert into issueslip (id,date,due_date,month_name,adm_no,portal_id,std_name,fname,class_name,cls_sec,cell_1,mfee,bal,feedisc1,fee1,feedisc2,fee2,feedisc3,fee3,feedisc4,fee4,feedisc5,fee5,feedisc6,fee6,fine,totalfee,status,user_id,month_period,feebal,fee1bal,fee2bal,fee3bal,fee4bal,fee5bal,fee6bal,totalfeebal,barcode,app_file1,status1,status2,status3,status4,status5,status6,feestatus) values (null,'$issue_date','$due_date','$month_name','$adm_no','$std_rollno','$std_name','$fname','$class_name','$cls_sec','$cell_1','$mfee','$bal','$feedisc1','$fee1','$feedisc2','$fee2','$feedisc3','$fee3','$feedisc4','$fee4','$feedisc5','$fee5','$feedisc6','$fee6','$fine','$totalfee','unpaid','$userid','$month_period','$mfee','$fee1','$fee2','$fee3','$fee4','$fee5','$fee6','$totalfee','$barcode','$app_file1','unpaid','unpaid','unpaid','unpaid','unpaid','unpaid','$feestatus')";
$conn->query($sql);

$sql1 = "update admission set 
bal='$feebal', feebal1='$fee1' , feebal2='$fee2', feebal3='$fee3', feebal4='$fee4', feebal5='$fee5', feebal6='$fee6' where adm_no='$adm_no'";
$conn->query($sql1);

echo "Challan Genrate Sucessfully";

?>
<a href="Open_Student_Admission_Challan.php">Back</a>