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

$userid=$_SESSION["userid"];
$today=date("d-m-Y");
$month_name=$_POST["month_name"];
$due_date=$_POST["due_date"];
$hmmf=$_POST["hmmf"];
$months=$_POST["months"];
$sql = "select * from admission where user_id='$userid'";
$admission=mysql_query($sql) or die("Error : " . mysql_error());
    
while($ppp=mysql_fetch_array($admission))
{
$rollno=$ppp["std_rollno"];
$stdname=$ppp["std_name"];
$fname=$ppp["father_name"];
$cname=$ppp["class_name"];
$code=$ppp["code"];
$mfee=$ppp["monthly_fee"];
$gfee=$ppp["sec_fee"];
$bal=$ppp["bal"];
$camp=$ppp["camp"];

    
   $totalfee=$mfee + $gfee;
   $tbal=$bal + $totalfee ;
  
	$sql2="update admission set bal='$tbal' , fine='0' where std_rollno='$rollno' and class_name='$cname' and user_id='$userid';";
	mysql_query($sql2) or die("Error : " . mysql_error());
	
	

	 }
	echo "Slip Genrate Sucessfully";
?>
<a href="genrate_feeslip_del.php">Back</a>