<?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"];
$portal_id=$_POST["portal_id"];
$std_name=$_POST["std_name"];
$fname=$_POST["fname"];
$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$cell_1=$_POST["cell_1"];
$mfee=$_POST["mfee"];
$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 + $bal;
$totalfee=$mfee + $bal + $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) values (null,'$issue_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','Yes','$userid','$month_name','$mfee','$fee1','$fee2','$fee3','$fee4','$fee5','$fee6','$totalfee','$barcode')";
$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);

header("location:Open_Student_Admission_Challan.php");

?>
