<?php 
session_start();
//mysql_connect("localhost","root","vertrigo") or die("Error Connecting Server");
//mysql_select_db("sm") or die("Error Opening Database");
include 'dbc.php';


$today=date("Y-m-d");

if($_POST['delete']) // from button name="delete"
	{
		$checkbox = $_POST['checkbox']; //from name="checkbox[]"
		$countCheck = count($_POST['checkbox']);
		
		for($i=0;$i<$countCheck;$i++)
		{
			$del_id  = $checkbox[$i];
			$userid=$_SESSION["userid"];
			$today=date("Y-m-d");
			$sqlp14 = "select * from admission where id='$del_id' and user_id='$userid'";
 							$finishstock=mysql_query($sqlp14) or die("Error : " . mysql_error());
   							$app1=mysql_fetch_array($finishstock);
   							$std_rollno=$app1["std_rollno"];
							$std_name=$app1["std_name"];
							$class_name=$app1["class_name"];
							$bal=$app1["bal"];
							$cell_1=$app1["cell_1"];
			
			
			$sql = "select * from notice3 where user_id='$userid'";
 							$finishstock1=mysql_query($sql) or die("Error : " . mysql_error());
   							$app11=mysql_fetch_array($finishstock1);
   							$notice=$app11["notice"];
							
							
							
			$sql2 = "Insert into add_notice_3 (id,date,std_rollno,std_name,class_name,bal,cell_1,notice,user_id)values (null,'$today','$std_rollno','$std_name','$class_name','$bal','$cell_1','$notice','$userid')";

			
			$result=mysql_query($sql2) or die ("Error:" . mysql_error());
			
		}
			if($result)
		{	
				header('Location: bal_receivable_notice_3.php');
			}
			else
			{
				echo "Record dos not add";
			}
	}
?>
