MMCT TEAM
Server IP : 2a02:4780:11:1359:0:1d43:a566:2  /  Your IP : 216.73.216.142
Web Server : LiteSpeed
System : Linux in-mum-web1259.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u490972518 ( 490972518)
PHP Version : 5.6.40
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u490972518/domains/ppschool.org.in/public_html/code/img/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u490972518/domains/ppschool.org.in/public_html/code/img/../student_detailscode.php
<?php 
include("../link/databaseconnection.php");
$flag=$_REQUEST['flag'];
  session_start();
			$email=$_SESSION['admin'];
			$sel785="select * from admin_login where  email='$email'  and status=''";
$res785=mysqli_query($conn,$sel785);
$row785=mysqli_fetch_array($res785,MYSQLI_BOTH);

$user_login=$row785['area'];
if(!$flag)
			{
				header("location:http://ppschool.ayweb.in/admin/main.php");
			}
			if(!$email)
			{
				header("location:http://ppschool.ayweb.in/admin/main.php");
			}
	
switch($flag)
{
    case 1999:
	$year1=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
	$area=$_POST['area'];
  $sel1="select * from  registration where session ='$year1' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

 <script>
	

$(document).ready(function() {
    $('#example').DataTable( {
        fixedHeader: true,
		dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: ['excel',
            'pageLength',
			{ extend: 'pdf', footer: true,
				
                orientation: 'landscape',
                pageSize: 'LEGAL'
			}
			
        ]
		
    } );
} );

</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Rank</th><th  style="text-align:center">Tot</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </thead>
<tfoot>
          <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Rank</th><th  style="text-align:center">App</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  if($area==1)
  {
      $sel="select * from  registration where session ='$year1' and subject='$class' and status='' and section='$section' and status=''   order by all_m desc";
  }
  else
  {
      $sel="select * from  registration where session ='$year1' and status=''";
  }
  
	$res=mysqli_query($conn,$sel);
	$s=22;
	$m='';
	$m1='';
	$mark=array();
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$m1=$row['all_m'];
	if($m1==$m)
	{
	      
	  echo '<br/>';
	}
	else
	{
	  
	}
	$d=$a." ".$c;
	$application=$row['application'];
	
		  // $up="update registration set rank='$s' where session='$year1' and application='$application'" ;
//mysqli_query($conn,$up);
		 array_push($mark,$m1);
		 
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['rank'];?></td><td><?php echo $row['all_m'];?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['dob'];?></td><td><?php echo $row['adhar'];?></td><td><?php echo $row['subject'];?> <?php echo $row['section'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['session'];?></td><td><?php echo $row['village'];?>,<?php echo $row['postoffice'];?>,<?php echo $row['dist'];?></td>
	
	</tr>
	<?php
	$s++;
	}
//	print_r($mark);
//$mark1=	array_filter($mark);
//$mark1=array_unique($mark);
//	print_r($mark1);
	$t=1;
	foreach($mark1 as $val_left)
				 {
				  // echo $t. 'Mark-'. $val_left;
				  //   $t++;
				   //  echo '<br/>';
			     }
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	 case 199990:
//	$old_session=$_POST['old_session'];
	$new_session=$_POST['new_session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
	$area=$_POST['area'];
  $sel1="select * from  registration where session ='$new_session' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

 <script>
	

$(document).ready(function() {
    $('#example').DataTable( {
        fixedHeader: true,
		dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: ['excel',
            'pageLength',
			{ extend: 'pdf', footer: true,
				
                orientation: 'landscape',
                pageSize: 'LEGAL'
			}
			
        ]
		
    } );
} );

</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  if($class!='All')
  {
      $sel="select * from  registration where session ='$new_session' and subject='$class' and status='' and section='$section' and status=''";
  }
  else
  {
      $sel="select * from  registration where session ='$new_session' and status=''";
  }
  
  
  $sel1246="select * from  session where session ='$new_session' ";
	 $res1246=mysqli_query($conn,$sel1246);
	$row1246=mysqli_fetch_array($res1246,MYSQLI_BOTH);
	$s_id=$row1246['id'];
	$o_id=$s_id-1;
	
	$sel12463="select * from  session where id ='$o_id' ";
	 $res12463=mysqli_query($conn,$sel12463);
	$row12463=mysqli_fetch_array($res12463,MYSQLI_BOTH);
	$old_session=$row12463['session'];
	
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	$app=$row['application'];
	 $sel124="select * from  registration where session ='$old_session' and application='$app' and status=''  ";
	 $res124=mysqli_query($conn,$sel124);
	$row124=mysqli_fetch_array($res124,MYSQLI_BOTH);
	if(!$row124)
	{
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['dob'];?></td><td><?php echo $row['adhar'];?></td><td><?php echo $row['subject'];?> <?php echo $row['section'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['session'];?></td><td><?php echo $row['village'];?>,<?php echo $row['postoffice'];?>,<?php echo $row['dist'];?></td>
	
	</tr>
	<?php
	$s++;
	}
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	
	 case 19999090:
	$year1=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
	$area=$_POST['area'];
  $sel1="select * from  registration where session ='$year1' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

 <script>
	

$(document).ready(function() {
    $('#example').DataTable( {
        fixedHeader: true,
		dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: ['excel',
            'pageLength',
			{ extend: 'pdf', footer: true,
				
                orientation: 'landscape',
                pageSize: 'LEGAL'
			}
			
        ]
		
    } );
} );

</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">DOB</th><th  style="text-align:center">Aadhar</th><th  style="text-align:center">Class</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">session</th><th  style="text-align:center">Add</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  if($class!='All')
  {
      $sel="select * from  registration where session ='$year1' and subject='$class' and status='' and section='$section' and status=''";
  }
  else
  {
      $sel="select * from  registration where session ='$year1' and status=''";
  }
  
  $sel12="select * from  session  order by id desc limit 1,1 ";
	$res12=mysqli_query($conn,$sel12);
	$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
	  $session_o=$row12['session'];
	
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	$app=$row['application'];
	 $sel124="select * from  registration where session ='$session_o' and application='$app' and status=''  ";
	 $res124=mysqli_query($conn,$sel124);
	$row124=mysqli_fetch_array($res124,MYSQLI_BOTH);
	if($row124)
	{
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['dob'];?></td><td><?php echo $row['adhar'];?></td><td><?php echo $row['subject'];?> <?php echo $row['section'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['session'];?></td><td><?php echo $row['village'];?>,<?php echo $row['postoffice'];?>,<?php echo $row['dist'];?></td>
	
	</tr>
	<?php
	$s++;
	}
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	
	 case 2009999:
	$year1=$_POST['session'];
		$session=$_POST['session'];
	$class=$_POST['class'];
		$section=$_POST['section'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and status=''";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','copy','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    <caption id='pr' style='font-size:20px;font-weight:bold'>Class =  <?php echo $class;?>/<?php echo $section;?></caption>
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Vill</th><th  style="text-align:center">Apr</th><th  style="text-align:center">May</th><th  style="text-align:center">Jun</th><th  style="text-align:center">Jul</th><th  style="text-align:center">Aug</th><th  style="text-align:center">Sep</th><th  style="text-align:center">Oct</th><th  style="text-align:center">Nov</th><th  style="text-align:center">Dec</th><th  style="text-align:center">Jan</th><th  style="text-align:center">Feb</th><th  style="text-align:center">Mar</th><th  style="text-align:center">Paid</th>
            </tr>
        </thead>

<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and section='$section' and status='' ";
	$res=mysqli_query($conn,$sel);
	$s=1;
		$p=0;
		$al_paid=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $application=$row['application'];
	    $selcm3="select * from  fees where  session='$session' and class='$class' order by id desc ";
	$rescm3=mysqli_query($conn,$selcm3);
	$row3=mysqli_fetch_array($rescm3,MYSQLI_BOTH);
	
	     $selca="select * from  studentfees where  month like '%April%' and year='$session' and search='$application' and status=''  order by id desc ";
	$resca=mysqli_query($conn,$selca);
	$a='';
	if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH))
	{
		$a=$rowca['paid'];
		$p++;
	}
	else
	{
	    $a=0;
	}
	//////may
	$selcm="select * from  studentfees where  month like '%May%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescm=mysqli_query($conn,$selcm);
	$b='';
	if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH))
{
		$b=$rowcm['paid'];
		$p++;
	}
	else
	{
	    $b=0;
	}
	//////Jun
	$selcj="select * from  studentfees where  month like '%Jun%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescj=mysqli_query($conn,$selcj);
	$c='';
	if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH))
	{
		$c=$rowcj['paid'];
		$p++;
	}
	else
	{
	    $c=0;
	}
	//////july
	$selcmj="select * from  studentfees where  month like '%July%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmj=mysqli_query($conn,$selcmj);
	$d='';
	if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH))
	{
		$d=$rowcmj['paid'];
		$p++;
	}
	else
	{
	    $d=0;
	}
	//////August
	$selcmja="select * from  studentfees where  month like '%August%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmja=mysqli_query($conn,$selcmja);
	$e='';
	if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH))
	{
		$e=$rowcmja['paid'];
		$p++;
	}
	else
	{
	    $e=0;
	}
	//////sep
	$selcms="select * from  studentfees where  month like '%September%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescms=mysqli_query($conn,$selcms);
	$f='';
	if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH))
	{
		$f=$rowcms['paid'];
		$p++;
	}
	else
	{
	    $f=0;
	}
	//////oct
	$selcmjo="select * from  studentfees where  month like '%October%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjo=mysqli_query($conn,$selcmjo);
	$g='';
	if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH))
	{
		$g=$rowcmjo['paid'];
		$p++;
	}
	else
	{
	    $g=0;
	}
	//////Nov
	$selcmjn="select * from  studentfees where  month like '%November%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjn=mysqli_query($conn,$selcmjn);
	$h='';
	if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH))
	{
		$h=$rowcmjn['paid'];
		$p++;
	}
	else
	{
	    $h=0;
	}
	//////Dec
	$selcmjd="select * from  studentfees where  month like '%December%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjd=mysqli_query($conn,$selcmjd);
	$i='';
	if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH))
{
		$i=$rowcmjd['paid'];
		$p++;
	}
	else
	{
	    $i=0;
	}
	//////Jan
	$selcmjdj="select * from  studentfees where  month like '%January%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjdj=mysqli_query($conn,$selcmjdj);
	$j='';
	if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH))
	{
		$j=$rowcmjdj['paid'];
		$p++;
	}
	else
	{
	    $j=0;
	}
	//////Jan
	$selcmf="select * from  studentfees where  month like '%February%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmf=mysqli_query($conn,$selcmf);
	$k='';
	if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH))
{
		$k=$rowcmf['paid'];
		$p++;
	}
	else
	{
	    $k=0;
	}
	//////mar
	$selcmm="select * from  studentfees where  month like '%March%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmm=mysqli_query($conn,$selcmm);
	$l='';
	if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH))
	{
		$l=$rowcmm['paid'];
		$p++;
	}
	else
	{
	    $l=0;
	}
	$al=$a+$b+$c+$d+$e+$f+$g+$h+$i+$j+$k+$l;
	$al_paid=$al_paid+$al;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['village'];?></td><td><?php echo $a;?></td><td><?php echo $b;?></td><td><?php echo $c;?></td><td><?php echo $d;?></td><td><?php echo $e;?></td><td><?php echo $f;?></td><td><?php echo $g;?></td><td><?php echo $h;?></td><td><?php echo $i;?></td><td><?php echo $j;?></td><td><?php echo $k;?></td><td><?php echo $l;?></td><td><?php echo $al;?></td>
	
	</tr>
	<?php
	$p=0;
	$s++;
	}
	?>
	 </tbody>
	 <tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Vill</th><th  style="text-align:center">Apr</th><th  style="text-align:center">May</th><th  style="text-align:center">Jun</th><th  style="text-align:center">Jul</th><th  style="text-align:center">Aug</th><th  style="text-align:center">Sep</th><th  style="text-align:center">Oct</th><th  style="text-align:center">Nov</th><th  style="text-align:center">Dec</th><th  style="text-align:center">Jan</th><th  style="text-align:center">Feb</th><th  style="text-align:center">Mar</th><th  style="text-align:center"><?php echo $al_paid;?></th>
            </tr>
        </tfoot>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	 case 20099:
	$year1=$_POST['session'];
		$session=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and code>0 and status=''";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','copy','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    <caption id='pr' style='font-size:20px;font-weight:bold'>Class =  <?php echo $class;?></caption>
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Vill</th><th  style="text-align:center">Charge</th><th  style="text-align:center">Apr</th><th  style="text-align:center">May</th><th  style="text-align:center">Jun</th><th  style="text-align:center">Jul</th><th  style="text-align:center">Aug</th><th  style="text-align:center">Sep</th><th  style="text-align:center">Oct</th><th  style="text-align:center">Nov</th><th  style="text-align:center">Dec</th><th  style="text-align:center">Jan</th><th  style="text-align:center">Feb</th><th  style="text-align:center">Mar</th><th  style="text-align:center">Paid</th>
            </tr>
        </thead>

<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and status='' and section='$section'  and code>0 ";
	$res=mysqli_query($conn,$sel);
	$s=1;
		$p=0;
		$al_paid=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $application=$row['application'];
	     $selca="select * from  studentfees where  month like '%April%' and year='$session' and search='$application' and status='' order by id desc ";
	$resca=mysqli_query($conn,$selca);
	$a='';
	if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH))
	{
		$a='Paid';
		$p++;
	}
	else
	{
	    $a='-';
	}
	//////may
	$selcm="select * from  studentfees where  month like '%May%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescm=mysqli_query($conn,$selcm);
	$b='';
	if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH))
{
		$b='Paid';
		$p++;
	}
	else
	{
	    $b='-';
	}
	//////Jun
	$selcj="select * from  studentfees where  month like '%Jun%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescj=mysqli_query($conn,$selcj);
	$c='';
	if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH))
	{
		$c='Paid';
		$p++;
	}
	else
	{
	    $c='-';
	}
	//////july
	$selcmj="select * from  studentfees where  month like '%July%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescmj=mysqli_query($conn,$selcmj);
	$d='';
	if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH))
	{
		$d='Paid';
		$p++;
	}
	else
	{
	    $d='-';
	}
	//////August
	$selcmja="select * from  studentfees where  month like '%August%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescmja=mysqli_query($conn,$selcmja);
	$e='';
	if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH))
	{
		$e='Paid';
		$p++;
	}
	else
	{
	    $e='-';
	}
	//////sep
	$selcms="select * from  studentfees where  month like '%September%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescms=mysqli_query($conn,$selcms);
	$f='';
	if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH))
	{
		$f='Paid';
		$p++;
	}
	else
	{
	    $f='-';
	}
	//////oct
	$selcmjo="select * from  studentfees where  month like '%October%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescmjo=mysqli_query($conn,$selcmjo);
	$g='';
	if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH))
	{
		$g='Paid';
		$p++;
	}
	else
	{
	    $g='-';
	}
	//////Nov
	$selcmjn="select * from  studentfees where  month like '%November%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescmjn=mysqli_query($conn,$selcmjn);
	$h='';
	if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH))
	{
		$h='Paid';
		$p++;
	}
	else
	{
	    $h='-';
	}
	//////Dec
	$selcmjd="select * from  studentfees where  month like '%December%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjd=mysqli_query($conn,$selcmjd);
	$i='';
	if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH))
{
		$i='Paid';
		$p++;
	}
	else
	{
	    $i='-';
	}
	//////Jan
	$selcmjdj="select * from  studentfees where  month like '%January%' and year='$session' and search='$application' and status=''  order by id desc ";
	$rescmjdj=mysqli_query($conn,$selcmjdj);
	$j='';
	if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH))
	{
		$j='Paid';
		$p++;
	}
	else
	{
	    $j='-';
	}
	//////Jan
	$selcmf="select * from  studentfees where  month like '%February%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmf=mysqli_query($conn,$selcmf);
	$k='';
	if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH))
{
		$k='Paid';
		$p++;
	}
	else
	{
	    $k='-';
	}
	//////mar
	$selcmm="select * from  studentfees where  month like '%March%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmm=mysqli_query($conn,$selcmm);
	$l='';
	if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH))
	{
		$l='Paid';
		$p++;
	}
	else
	{
	    $l='-';
	}
	$al=$p*$row['code'];
	$al_paid=$al_paid+$al;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['village'];?></td><td><?php echo $row['code'];?></td><td><?php echo $a;?></td><td><?php echo $b;?></td><td><?php echo $c;?></td><td><?php echo $d;?></td><td><?php echo $e;?></td><td><?php echo $f;?></td><td><?php echo $g;?></td><td><?php echo $h;?></td><td><?php echo $i;?></td><td><?php echo $j;?></td><td><?php echo $k;?></td><td><?php echo $l;?></td><td><?php echo $al;?></td>
	
	</tr>
	<?php
	$p=0;
	$s++;
	}
	?>
	 </tbody>
	 <tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Vill</th><th  style="text-align:center">Charge</th><th  style="text-align:center">Apr</th><th  style="text-align:center">May</th><th  style="text-align:center">Jun</th><th  style="text-align:center">Jul</th><th  style="text-align:center">Aug</th><th  style="text-align:center">Sep</th><th  style="text-align:center">Oct</th><th  style="text-align:center">Nov</th><th  style="text-align:center">Dec</th><th  style="text-align:center">Jan</th><th  style="text-align:center">Feb</th><th  style="text-align:center">Mar</th><th  style="text-align:center"><?php echo $al_paid;?></th>
            </tr>
        </tfoot>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 199921:
	$year1=$_POST['session'];
	$class=$_POST['class'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and trans='' and status='' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','copy','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    <caption id='pr' style='font-size:20px;font-weight:bold'>Class =  <?php echo $class;?></caption>
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Village</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Village</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and trans='' and status=''";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['id'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['village'];?></td>
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
		case 19992121:
	$year1=$_POST['session'];
	$class=$_POST['class'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and trans!='' and status='' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','copy','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
    <caption id='pr' style='font-size:20px;font-weight:bold'>Class =  <?php echo $class;?></caption>
        <thead> 
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Village</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mobile</th><th  style="text-align:center">Village</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and trans!='' and status=''";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['id'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mobile'];?></td><td><?php echo $row['village'];?></td>
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 1:
	$year1=$_POST['session'];
  $sel1="select * from  registration where session ='$year1' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and status=''  order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $ap=$row['application'];
	    $id=$row['id'];
	    // $sel1="update studentfees set search='$ap' where reg_id='$id'";
	//$res1=mysqli_query($conn,$sel1);
//	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject'].' '.$row['section']."<br/>"."<font color=red size=2pt>".$row['trans'].'</font>';?></td><td style=''><textarea><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></textarea></td>
	
	
	<td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a>
	
	&emsp;<a href="javascript:;" onclick="messagerow(<?php echo $row['id'];?>)"> <span class="glyphicon glyphicon-envelope"></span></a>
	
	<br/><br/>&emsp;<a href="registration_print.php?flag=<?php echo $row['id'];?>" target="_blank"><span class="fa fa-print"></span></a>
	<br/><br/>&emsp;<a href="bonafide.php?flag=<?php echo $row['id'];?>" target="_blank"><span class="fa fa-print">bonafide</span></a>
		<br/><br/>&emsp;<a href="fee_status_govt.php?flag=<?php echo $row['id'];?>" target="_blank"><span class="fa fa-print">Fee Report</span></a>
	&emsp;<a href="javascript:;" onclick="transferrow(<?php echo $row['id'];?>)"> <span class=""></span>Trans</a>
	

	
	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 1009:
	$year1=$_POST['session'];
		$class=$_POST['class'];
		$section=$_POST['section'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and section='$section' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1'and subject='$class' and section='$section' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['2']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject']."<br/>"."<font color=red size=2pt>".$row['trans'].'</font>';?></td><td style=''><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></td>
	
	
	<br/><br/>&emsp;<a href="registration_print.php?flag=<?php echo $row['id'];?>" target="_blank"><span class="fa fa-print"></span></a>

	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	
		case 1111:
	$year1=$_POST['session'];
  $sel1="select * from  registration where session ='$year1' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red">/Trans.</span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject']."<br/>"."<font color=red size=2pt>".$row['trans'].'</font>';?></td><td style=''><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></td>
	
	
<td>
	<a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	
	case 51:
	$year1='2018-2019';
  $sel1="select * from  registration where session ='$year1' order by id asc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Address</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Address</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year='2018-2019';
  $sel="select * from  registration where session ='$year' and status='' order by application asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['2']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject'];?></td><td><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	
	
	case 2:
	$id=$_POST['rowid'];
	$sel="select * from  registration where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$photo=$row['picture'];
	$location="../code/img/".$photo;
	$application=$row['application'];
	$del="update registration  set status='Delete' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
	//	unlink($location);
	
	}
	else
	{
		echo"Not Deleted";
	}
	break;
	
	case 3:
	
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$application=$row['application'];
	
	?>
	
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				

<script>
$(document).ready(function(){
	
	$("#myform").submit(function(e){
		
		e.preventDefault();	
		$("#btn").prop("disabled",true);
		$.ajax({
					url:"../code/registrationcode.php?flag=1",
					type:"POST",
					data:new FormData(this),
					contentType:false,
					processData:false,
					success:function(res){
						alert(res);
						if(res=="Submit")
						{
						window.location.href="student_print.php";
						$("#myform").trigger("reset");
						}
					},
					error:function(){
						alert("error");
					}
				
				});
	});
	
	
});
</script>
		
<script>
$(document).ready(function(){
	
	$("#check").change(function(){
		var c=$("#city").val();
		var v=$("#village").val();
		var po=$("#postoffice").val();
		var d=$("#dist").val();
		var s=$("#state").val();
		var m=$("#mobile").val();
		var pi=$("#pincode").val();
		if($(this).prop("checked")==true)
		{
			$("#city1").val(c);
			$("#village1").val(v);
			$("#postoffice1").val(po);
			$("#dist1").val(d);
			$("#state1").val(s);
			$("#mobile1").val(m);
			$("#pincode1").val(pi);
		}
		else
		{
			$("#city1").val("");
			$("#village1").val("");
			$("#postoffice1").val("");
			$("#dist1").val("");
			$("#state1").val("");
			$("#mobile1").val("");
			$("#pincode1").val("");
		}
		
	});
	
	
	
	
});
$(document).ready(function(){
	$("#chek").change(function(){
		
		if($(this).prop("checked")==true)
		{
			$("#show").css("display","none");
		    $("#btn").prop("disabled",false);
		
		}
		else
		{
			$("#show").css("display","inline-block");
			$("#btn").prop("disabled",true);
		
		}
	
	});

		
	});
	$(document).ready(function(){
		$("#per").focus(function(){
			
			var o=$("#omark").val();
			var t=$("#tmark").val();
			var result1=o/t*100;
			var result=parseInt(result1);
			$("#per").val(result);
		});
		
		
		
	});
	$(document).ready(function(){
		
		$("#select").change(function(){
			var a=$("#select").val();
			if(a=="high")
			{
				$("#inter1").attr("disabled","true");
				$("#high1").removeAttr("disabled");
			}
			else if(a=="inter")
			{
				$("#high1").attr("disabled","true");
				$("#inter1").removeAttr("disabled");
				
			}
			else if(a=="L.K.G"||a=="U.K.G"||a=="1"||a=="2"||a=="3"||a=="4"||a=="5"||a=="6"||a=="7"||a=="8")
			{
				$("#high1").attr("disabled","true");
				$("#inter1").attr("disabled","true");
				
			}
			
			else
			{
				$("#high1").removeAttr("disabled");
				$("#inter1").removeAttr("disabled");
			}
		});
		
		
		
	});
	
	$(document).ready(function(){
		$("#select").change(function(){
			var classc =$(this).val();
		$.ajax({
			url:"../code/registrationcode.php?flag=4",
			type:"POST",
			data: {class12:classc},
			success:function(res){
				//alert(res);
				$("#sel12").html(res);
			},
			error:function(){
				alert("error");
			}
		});
		});
	});
</script>


		



	<!-- header -->
	
	<!-- //header -->
		<!-- gallery -->
		<div >
	<div id="lab" class="">
		<div class="container-fluid">
		<MARQUEE>जो जो लडके गाड़ी से आ रहे है  उनका  Conv Code एंट्री कर दीजिये | या जो लड़के  गाड़ी से नहीं आ रहे है  उनका conv  Code  " 0" Entry करें |</MARQUEE>
			<div class="row">
			<div class="panel-group">
    <div class="panel panel-primary">
      
      <div class="panel-body">
	 <form class="form-horizontal" onsubmit="return updaterow(this)">
	 <!--phli row open--->
	  <div class="col-sm-6">
	   
  <div class="form-group">
    <label  class="col-sm-4 control-label">Your Name<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="name" value="<?php echo $row['name'];?>" name="name" style="color:black" data-validation="custom" data-validation-regexp="^([a-zA-Z\s]+)$" data-validation-error-msg="Use Only Alphabet" />
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Mother Name<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="mother" value="<?php echo $row['mname'];?>" name="mother" data-validation="custom" data-validation-regexp="^([a-zA-Z\s]+)$" data-validation-error-msg="Use Only Alphabet" >
    </div>
  </div>
	  
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Gender<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="radio" value="male" <?php if($row['gender']=='male'){echo'checked';}?> name="gnd">&nbsp;Male&nbsp;
     <input type="radio" value="female" <?php if($row['gender']=='female'){echo'checked';}?> name="gnd">&nbsp;Female
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Adhar card<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="mother" value="<?php echo $row['adhar'];?>" name="adhar"  >
    </div>
  </div>
	  <div class="form-group">
  
    <label  class="col-sm-4 control-label">Category<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="caste" required>
	<option value="">---select---</option>
	<option <?php if($row['caste']=='GEN'){echo'selected';}?>>GEN</option>
	<option <?php if($row['caste']=='OBC'){echo'selected';}?>>OBC</option>
	<option <?php if($row['caste']=='ST'){echo'selected';}?>>ST</option>
	<option <?php if($row['caste']=='SC'){echo'selected';}?>>SC</option>
			
	
	
	
	</select>
	</div>
	</div>
	<div class="form-group">
    <label  class="col-sm-4 control-label">Conv Code<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="code" value="<?php echo $row['code'];?>" name="code" title="Van Rent" >
    </div>
  </div>
	  </div>
	  <!--phli row close--->
	  <!--dusri row open--->
	  <div class="col-sm-6">
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Father Name<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="father" value="<?php echo $row['fname'];?>" name="father" data-validation="custom" data-validation-regexp="^([a-zA-Z\s]+)$" data-validation-error-msg="Use Only Alphabet">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Date Of Birth<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="dob" value="<?php echo $row['dob']?>" name="dob"> <span><p style="color:blue">DD-MM-YYYY</p></span>
    </div>
  </div>
  
  <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="session" data-validation="required">
	<option value="">---select---</option>
				<option <?php if($row['session']=='2018-2019'){echo'selected';}?>>2018-2019</option>
				<option <?php if($row['session']=='2019-2020'){echo'selected';}?>>2019-2020</option>
				<option <?php if($row['session']=='2020-2021'){echo'selected';}?>>2020-2021</option>
				<option <?php if($row['session']=='2021-2022'){echo'selected';}?>>2021-2022</option>
				<option <?php if($row['session']=='2022-2023'){echo'selected';}?>>2022-2023</option>
					<option <?php if($row['session']=='2023-2024'){echo'selected';}?>>2023-2024</option>
	</select>
	</div>
	</div>
	<div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Minority<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="minority" data-validation="required">
	<option value="">---select---</option>

				<option <?php if($row['minority']=='HINDU'){echo'selected';}?>>HINDU</option>
				<option <?php if($row['minority']=='MUSLIM'){echo'selected';}?>>MUSLIM</option>
				<option <?php if($row['OTHER']=='OTHER'){echo'selected';}?>>OTHER</option>
			
	</select>
	</div>
	</div>
  <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Sch. No.<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<input type="text" class="form-control" value="<?php echo $application;?>"  name="app" required />
	<input type="hidden" class="form-control" value="<?php echo $eid;?>"  name="id1234" required />
	
	</div>
	</div>
	  <!--dusri row close--->
	  
	<input type="hidden" value="<?php echo strtoupper(substr(md5(uniqid()),0,10));?>" name="app1">
			
			</div>
			
	  <div class="form-group">
  
    <label  class="col-sm-4 control-label"> <span style="color:red"></span></label>
    <div class="col-sm-6">
	
	
	
	
	</div>
	</div>
	  <hr/>
	  <!-- one div-subject open--->
	  <!-- one div-subject close--->
	  
	  <!-- second div-subject open--->
	    <div class="col-sm-4">
	  
  <div class="form-group">
  
    <label  class="col-sm-4 control-label">Board <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="mediam" data-validation="required">
	<option value="">---select---</option>

	<option <?php if($row['mediam']=='CBSE BOARD'){echo'selected';}?>>CBSE BOARD</option>
	
	
	</select>
	</div>
	</div>
	
	  
	  </div>
	
	  <div class="col-sm-4">
	
  <div class="form-group">
 
    <label  class="col-sm-4 control-label">Class <span style="color:red">*</span></label>
      
	<div class="col-sm-8">
	
<select class="form-control"  name="subject" required>
	<option value="">---select---</option>
	<option <?php if($row['subject']=='NURSERY'){echo'selected';}?>>NURSERY</option>
	<option <?php if($row['subject']=='LKG'){echo'selected';}?>>LKG</option>
	<option <?php if($row['subject']=='UKG'){echo'selected';}?>>UKG</option>
	<option <?php if($row['subject']=='PLAY GROUP'){echo'selected';}?>>PLAY GROUP</option>
	<option <?php if($row['subject']=='FIRST'){echo'selected';}?>>FIRST</option>
	<option <?php if($row['subject']=='SECOND'){echo'selected';}?>>SECOND</option>
	<option <?php if($row['subject']=='THIRD'){echo'selected';}?>>THIRD</option>
	<option <?php if($row['subject']=='FOURTH'){echo'selected';}?>>FOURTH</option>
	<option <?php if($row['subject']=='FIFTH'){echo'selected';}?>>FIFTH</option>
	<option <?php if($row['subject']=='SIXTH'){echo'selected';}?>>SIXTH</option>
	<option <?php if($row['subject']=='SEVENTH'){echo'selected';}?>>SEVENTH</option>
	<option <?php if($row['subject']=='EIGHTH'){echo'selected';}?>>EIGHTH</option>
	<option <?php if($row['subject']=='NINTH'){echo'selected';}?>>NINTH</option>
	<option <?php if($row['subject']=='NINTH CBSE'){echo'selected';}?>>NINTH CBSE</option>
	<option <?php if($row['subject']=='TENTH'){echo'selected';}?>>TENTH</option>
	<option <?php if($row['subject']=='ELEVENTH'){echo'selected';}?>>ELEVENTH</option>
		<option <?php if($row['subject']=='TWELFTH'){echo'selected';}?>>TWELFTH</option>
		
		</select>	
	</div>
	</div>
	
	 
	  </div>
	  <div class="row">
	  
	 <center> <h4 style="color:black"></h4></center>
	 <div class="table table-responsive">
	 <table class="table" border="1px">
	 <tr class="text-center">
	 <th>Previous Eligibility<span style="color:red">*</span></th><th>Board/Uni/Inst.<span style="color:red">*</span></th><th>Year<span style="color:red">*</span></th><th>Total Marks<span style="color:red">*</span></th><th>Obtain Marks<span style="color:red">*</span></th><th>Per</th><th>Grade</th>
	 </tr>
	 <tr>
	 <td><input type="text" class="form-control" value="<?php echo $row['ele'];?>"name="ele"/></td><td><input type="text" value="<?php echo $row['board'];?>"class="form-control" name="board" required="required" maxlength="8"/></td><td><input type="number" value="<?php echo $row['year'];?>" class="form-control" name="year"/></td><td><input type="number" value="<?php echo $row['total'];?>"class="form-control"name="tmark" id="tmark"/></td><td><input type="number" class="form-control" value="<?php echo $row['obtain'];?>" name="omark" id="omark"/></td><td><input type="number" class="form-control" value="<?php echo $row['per'];?>" name="per" id="per"/></td><td><input type="text"class="form-control" value="<?php echo $row['grade'];?>"name="grade"></td>
	 </tr>
	 </table>
	 </div>
	   <hr/>
	  
	  </div>
	  <!-- second div-subject close--->
	  <input type="hidden" value="<?php echo rand(10000,99999);?>">
	  
	  <div class="col-sm-6">
	  <h4 class="text-center" style="color:black">Corresponding Address</h4>
	  <hr/>
  <div class="form-group">
    <label  class="col-sm-4 control-label">City<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="city" value="<?php echo $row['city'];?>" name="city">
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Village<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="village" value="<?php echo $row['village'];?>" name="village" data-validation="custom" data-validation-regexp="^([a-zA-Z\s]+)$" data-validation-error-msg="Use Only Alphabet">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Post Office<span style="color:red"></span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="postoffice" value="<?php echo $row['postoffice'];?>" name="postoffice">
    </div>
  </div>
	  
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Dist<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="dist" value="<?php echo $row['dist'];?>" name="dist" data-validation="custom" data-validation-regexp="^([a-zA-Z\s]+)$" data-validation-error-msg="Use Only Alphabet">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">State<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="state" value="<?php echo $row['state'];?>" name="state" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Mobile<span style="color:red"  >*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="mobile" value="<?php echo $row['mobile'];?>" data-validation="number"required="required" maxlength="10" name="mobile" data-validation-error-msg="Only Use Number" />
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Pincode</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="pincode" value="<?php echo $row['pincode'];?>" name="pincode"  data-validation="number"required="required" maxlength="7"  data-validation-error-msg="Only Use Number" required>
    </div>
  </div>
   <img src="../code/img/<?php echo $row['picture'];?>" style="height:70px;width:70px"/><span>Old Image</span>
	  <script>
  function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();
    
    reader.onload = function(e) {
      $('#blah').attr('src', e.target.result);
    }
    
    reader.readAsDataURL(input.files[0]);
  }
}

$("#imgInp").change(function() {
  readURL(this);
});</script>

	 <div class="form-group">
    <label  class="col-sm-4 control-label">Picture<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <img id="blah" alt="your image" width="100" height="100" />

<input type="file" name="picture"  onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0])">
    </div>
  </div>
	  
	  </div>
	  
	   <div class="col-sm-6">
	  <h4 class="text-center" style="color:black">Personally Address</h4>
	  <hr/>
  <div class="form-group">
    <label  class="col-sm-4 control-label"><span><input type="checkbox" id="check">&nbsp;Same address&emsp;</span>City</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" value="<?php echo $row['city1'];?>"id="city1"  name="city1">
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Village</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="village1" value="<?php echo $row['village1'];?>" name="village1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Post Office</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="postoffice1" value="<?php echo $row['postoffice1'];?>" name="postoffice1">
    </div>
  </div>
	  
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Dist</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="dist1" value="<?php echo $row['dist1'];?>" name="dist1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">State</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="state1" value="<?php echo $row['state1'];?>" name="state1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Mobile</label>
    <div class="col-sm-8">
     <input type="number" class="form-control" id="mobile1" value="<?php echo $row['mobile'];?>" name="mobile1" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Pincode</label>
    <div class="col-sm-8">
     <input type="number" class="form-control" id="pincode1" value="<?php echo $row['pincode1'];?>" name="pincode1">
    </div>
  </div>
  
 
  </div><br/><br/>
  <span style="margin-left:100px;font-size:17px"><input type="checkbox" id="chek"/>&emsp;I have read and agree to the <a href="#">terms and conditions.</a></span><br/>
	  <center>
	
	 <button class="btn btn-success"  id="btn" disabled id="sub" >Submit</button>&emsp;&emsp;
	 
	  </form>
	  </center>
			
			
			</div>
			
		</div>
	</div>
	<!-- //gallery -->

	<!-- footer
	<!-- //footer -->

	
</div>
</div>
</div>
</div>
	


	</div>
	</div>
	
	
	
	
	
	
	
	
	
	
	<?php
	break;
	
	case 5:
	$eid=$_REQUEST['id'];
//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$application=$row['application'];
	?>
<form class="form-horizontal" onsubmit="return updaterow(this)">
	    <div class="row">
	        <div class="col-sm-6">
	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Student Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name" ></div>
	
	</div>
	
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Father Name</label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>" name="fname" ></div>
	
	</div>
	
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Mother Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['mname'];?>" name="mname" ></div>
	
	</div>
	 <div class="form-group">
    <label  class="col-sm-4 control-label">Gender<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="radio" value="male" <?php if($row['gender']=='male'){echo'checked';}?> name="gnd">&nbsp;Male&nbsp;
     <input type="radio" value="female" <?php if($row['gender']=='female'){echo'checked';}?> name="gnd">&nbsp;Female
    </div>
  </div>
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">class </label>
		<div class="col-sm-8">
		    <?php 
	$selc="select * from subclass";
	$resc=mysqli_query($conn,$selc);
	?>
	<select class="form-control" style="font-weight:bold" id="select" name="subject" required>
	
	 
	  <?php 
	  
	  while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option <?php if($row['subject']==$rowc['subclass']){echo'selected';}?>><?php echo $rowc['subclass'];?></option>
	  <?php
	  }
	  
	  ?>
	  </select>
		    
		    </div>
	
	</div>
	 <div class="form-group">
  
    <label  class="col-sm-4 control-label">Section <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="section" >
	
	<option <?php if($row['section']=='A'){echo'selected';}?>>A</option>
		<option <?php if($row['section']=='B'){echo'selected';}?>>B</option>
			<option <?php if($row['section']=='C'){echo'selected';}?>>C</option>
				<option <?php if($row['section']=='D'){echo'selected';}?>>D</option>
	
	
	</select>
	</div>
	</div>
	 <div class="form-group">
  
    <label  class="col-sm-4 control-label">Board <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="mediam" >
	
	<option <?php if($row['mediam']=='CBSE BOARD'){echo'selected';}?>>CBSE BOARD</option>
	
	
	</select>
	</div>
	</div>
	  <div class="form-group">
	      <h4 class="text-center" style="color:black">Corresponding Address</h4>
    <label  class="col-sm-4 control-label">City<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="city" value="<?php echo $row['city'];?>" name="city">
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Village<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="village" value="<?php echo $row['village'];?>" name="village" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Post Office<span style="color:red"></span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="postoffice" value="<?php echo $row['postoffice'];?>" name="postoffice">
    </div>
  </div>
	  
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Dist<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="dist" value="<?php echo $row['dist'];?>" name="dist" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">State<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="state" value="<?php echo $row['state'];?>" name="state" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Mobile<span style="color:red"  >*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="mobile" value="<?php echo $row['mobile'];?>"  name='mobile'>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Whatsapp No.<span style="color:red"  ></span></label>
    <div class="col-sm-8">
     <input type="number" class="form-control"  value="<?php if($row['whatsapp']=='') {echo $row['mobile'];} else{echo $row['whatsapp'];}?>"  name='whatsapp'>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Pincode</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="pincode" value="<?php echo $row['pincode'];?>" name="pincode"  >
    </div>
  </div>
  
	  <div class="form-group">
	  <img src="../code/img/<?php echo $row['picture'];?>" style="height:70px;width:70px"/>
    <label  class="col-sm-4 control-label">Picture<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="file" class="form-control" id="pic"  name="picture" >
    </div>
  </div>
	</div>

	<div class="col-sm-6">
 <div class="form-group">
    <label  class="col-sm-4 control-label">Adhar card<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="mother" value="<?php echo $row['adhar'];?>" name="adhar"  >
    </div>
  </div>
	
	 <div class="form-group">
  
    <label  class="col-sm-4 control-label">Category<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="caste" required>
	<option value="">---select---</option>
	<option <?php if($row['caste']=='GEN'){echo'selected';}?>>GEN</option>
	<option <?php if($row['caste']=='OBC'){echo'selected';}?>>OBC</option>
	<option <?php if($row['caste']=='ST'){echo'selected';}?>>ST</option>
	<option <?php if($row['caste']=='SC'){echo'selected';}?>>SC</option>
			
	
	
	
	</select>
	</div>
	</div>
	 <div class="form-group">
    <label  class="col-sm-4 control-label">Date Of Birth<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="dob" value="<?php echo $row['dob']?>" name="dob"> <span><p style="color:blue">DD-MM-YYYY</p></span>
    </div>
  </div>
	
	<div class="form-group">
    <label  class="col-sm-4 control-label">Conv Charge<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="code" value="<?php echo $row['code'];?>" name="code" title="Van Rent" >
    </div>
  </div>
	 <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	<?php 
	$selc="select * from session";
	$resc=mysqli_query($conn,$selc);
	?>
	<select class="form-control" style="font-weight:bold" id="select" name="session" required>
	
	  <option value=''>--Select--</option>
	  <?php 
	  
	  while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option <?php if($row['session']==$rowc['session']){echo'selected';}?>><?php echo $rowc['session'];?></option>
	  <?php
	  }
	  
	  ?>
	  </select>
	
	
	</div>
	</div>
	 <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Sch. No.<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<input type="text" class="form-control" value="<?php echo $application;?>"  name="app"  readonly required />
	<input type="hidden" class="form-control" value="<?php echo $eid;?>"  name="id1234" required />
	
	</div>
	</div>
	<div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Sr. No.<span style="color:red"></span></label>
    <div class="col-sm-8">
	
	<input type="text" class="form-control" value="<?php echo $row['sr'];?>"  name="sr"    />

	</div>
	</div>
	 <h4 class="text-center" style="color:black">Personally Address</h4>
	  <hr/>
  <div class="form-group">
    <label  class="col-sm-4 control-label">City</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" value="<?php echo $row['city1'];?>"id="city1"  name="city1">
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Village</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="village1" value="<?php echo $row['village1'];?>" name="village1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Post Office</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="postoffice1" value="<?php echo $row['postoffice1'];?>" name="postoffice1">
    </div>
  </div>
	  
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Dist</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="dist1" value="<?php echo $row['dist1'];?>" name="dist1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">State</label>
    <div class="col-sm-8">
     <input type="text" class="form-control" id="state1" value="<?php echo $row['state1'];?>" name="state1">
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Mobile</label>
    <div class="col-sm-8">
     <input type="number" class="form-control" id="mobile1" value="<?php echo $row['mobile'];?>" name="mobile1" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Pincode</label>
    <div class="col-sm-8">
     <input type="number" class="form-control" id="pincode1" value="<?php echo $row['pincode1'];?>" name="pincode1">
    </div>
  </div>
	</div>
	
	</div>
	 <button class="btn btn-success" >Update</button>&emsp;&emsp;
	</form>
	
<?php 
	break;
		case 4:
	$name=$_POST['name'];
$code=$_POST['code'];
$adhar=$_POST['adhar'];
$mediam=$_POST['mediam'];
$caste=$_POST['caste'];
$minority=$_POST['minority'];
//echo"$name";
//echo"<br/>";
$father=$_POST['fname'];
//echo"$father";
$mother=$_POST['mname'];
//echo"$mother";
//echo"<br/>";
$app=$_POST['app'];
$id=$_POST['id1234'];
//echo"$app";
//echo"<br/>";
$whatsapp=$_POST['whatsapp'];
$gender=$_POST['gnd'];
$session=$_POST['session'];
$section=$_POST['section'];
$sr=$_POST['sr'];
//echo"$gender";
$dob1=$_POST['dob'];
//echo"$dob";
$dob=date("d-m-Y",strtotime($dob1));

//echo"$class";



//echo"$high1";


$subject=$_POST['subject'];
//echo"$inter1";

$city=$_POST['city'];
//echo"$city";
$city1=$_POST['city1'];
//echo"$city";
$village=$_POST['village'];
//echo"$village";
$village1=$_POST['village1'];
//echo"$village1";
$postoffice=$_POST['postoffice'];
//echo"$postoffice";
$postoffice1=$_POST['postoffice1'];
//echo"$postoffice1";
$dist=$_POST['dist'];
//echo"$dist";
$dist1=$_POST['dist1'];
//echo"$dist1";
$state=$_POST['state'];
//echo"$state";
$state1=$_POST['state1'];
//echo"$state1";
$mobile=$_POST['mobile'];
//echo"$mobile";
$mobile1=$_POST['mobile1'];
//echo"$mobile1";
$pincode=$_POST['pincode'];
//echo"$pincode";
$pincode1=$_POST['pincode1'];
//echo"$pincode1";
$imgname=$_FILES['picture']['name'];
//echo"$imgname";
$size=$_FILES['picture']['size'];
//echo"$size";
$type=$_FILES['picture']['type'];
//echo"$type";
$tempname=$_FILES['picture']['tmp_name'];
//echo"$tempname";
$pathinfo=pathinfo($imgname,PATHINFO_EXTENSION);
  //echo"$pathinfo";
  if($pathinfo!=""|| $pathinfo!=null)
  {
	  $newimgname=time()."_".$name.".".$pathinfo;
	  //echo$newimgname;
  }
  else
  {
	  $newimgname="";
  }
//echo $newimgname;
$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$location="img/";
$location1="img/";
$size=$size/1024;


			
//--------------------------------------------------------------------
				$sel12="select * from registration where id='$id'";
				$res12=mysqli_query($conn,$sel12);
				$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
				$app12=$row12['application'];
				//echo "<br/>";
			//	echo $app12;
				$pic=$row12['picture'];
	$location1="../code/img/".$pic;
	$location="../code/img/";
				
				// for updation and image 
				
				
	if($imgname=="" || $imgname==null)
	{
	$up="update registration set application='$app',name='$name',fname='$father',mname='$mother',dob='$dob1',gender='$gender',subject='$subject',city='$city',village='$village',postoffice='$postoffice',dist='$dist',state='$state',mobile='$mobile',pincode='$pincode',city1='$city1',village1='$village1',postoffice1='$postoffice1',dist1='$dist1', state1='$state1',mobile1='mobile1',pincode1='$pincode1',session='$session',mediam='$mediam',adhar='$adhar',datetime='$datetime',caste='$caste',code='$code',whatsapp='$whatsapp',sr='$sr',section='$section' where id='$id' ";
	if(mysqli_query($conn,$up))
	{
	
	 echo"Update";
	}
	else
	{
		echo"not update";
	}
	}
	else
	{
		$up1="update registration set application='$app',name='$name',picture='$newimgname',fname='$father',mname='$mother',dob='$dob1',gender='$gender',subject='$subject',city='$city',village='$village',postoffice='$postoffice',dist='$dist',state='$state',mobile='$mobile',pincode='$pincode',city1='$city1',village1='$village1',postoffice1='$postoffice1',dist1='$dist1', state1='$state1',mobile1='mobile1',pincode1='$pincode1',session='$session',mediam='$mediam',adhar='$adhar',datetime='$datetime',caste='$caste',sr='$sr',code='$code',whatsapp='$whatsapp' ,section='$section' where id='$id'  ";
	if(mysqli_query($conn,$up1))
	{
		//unlink($location1);
		move_uploaded_file($tempname,$location.$newimgname);
		
		echo"Update";
	}
	else
	{
		echo"not update";
	}
	}
				// for updation and image 
				//
			
//-------------------------------------------------------------
	break;
	
	case 6:
	
	$name=$_POST['name'];
	$fname=$_POST['fname'];
	$mname=$_POST['mname'];
	$dob=$_POST['dob'];
	
	$mark1=$_POST['mark1'];
	$mark2=$_POST['mark2'];
	$mark3=$_POST['mark3'];
	$mark4=$_POST['mark4'];
	$mark5=$_POST['mark5'];
	$mark6=$_POST['mark6'];
	$mark7=$_POST['mark7'];
	$mark8=$_POST['mark8'];
	$class=$_POST['class'];
	$session=$_POST['session'];
	$ins1="insert into result(name,fname,mname,dob,sub1,sub2,sub3,sub4,sub5,sub6,sub7,sub8,mark1,mark2,mark3,mark4,mark5,mark6,mark7,mark8,session,class) values('$name','$fname','$mname','$dob','HINDI','ENGLISH','MATHEMATICS','SCIENCE','SOCIAL SCIENCE','AGRICULTURE','SANSKRIT','ART','$mark1','$mark2','$mark3','$mark4','$mark5','$mark6','$mark7','$mark8','$session','$class')";
	if(mysqli_query($conn,$ins1))
	{
		echo"ok";
	}
	else
	{
		echo"not ok";
	}
	
	
	break;
	
	
	case 7:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	
	?>
	
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform21" action="../code/student_detailscode.php?flag=8" method="post" >
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
					<input type="hidden" value="<?php echo $row['session'];?>" name="session"/>
				<label class="col-sm-3 control-label">Name</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name"/></div>
				</div>
				<br/>
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Mobile</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['mobile'];?>" name="mobile"/></div>
				<br/>
				</div>
				
				
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Message</label>
				<div class="col-sm-8"><textarea class="form-control"  name="message"/ required></textarea></div>
				<br/>
				</div>
				<center><button class="btn btn-primary">Send</button>
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	
	<?php
	break;
	
	case 8:
	
	
	
	$number=$_POST['mobile'];
//	$session=$_POST['session'];
//echo"$number";

$message=$_POST['message'];
//echo"$message";
$date=date("d-m-Y");
$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";
$to=$number;
$msg=urlencode($message);


$api="http://login.jupitersms.com/index.php/smsapi/httpapi/?secret=Uduu74eDcCfceOkOaH8M&sender=MDSSCH&tempid=1207160343673026792&receiver=$to&route=TA&msgtype=1&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count,session) value('$message','1','$session')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,date,session) value('$message','$date','$session')";
	$resme=mysqli_query($conn,$insme);
	echo"<script>alert('sms send');window.location.href='../admin/student_details.php';</script>";
}
else
{
	echo"<script>alert('sms not send');window.location.href='../admin/student_details.php';</script>";
}
	break;
	
	case 88:
	
	
	
	$number=$_POST['mobile'];
//echo"$number";

$message=$_POST['message'];
//echo"$message";
$date=date("d-m-Y");
$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";
$to=$number;
$msg=urlencode($message);


//$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSNIZ&receiver=$to&route=TA&msgtype=3&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count) value('$message','1')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,date) value('$message','$date')";
	$resme=mysqli_query($conn,$insme);
	echo"Sms Send";
}
else
{
	echo"sms not send";
}
	break;
	
	
	
	case 9:
	?>
<script>

    $("#con").focus(function(){
        $("#remark").toggle('show');
    });
	$(document).ready(function(){
		$("#remark").toggle("hide");
});
</script>
<script>

    
	$(document).ready(function(){
		
		$("#con").change(function(){
        var co=$("#con").val();
		
        var re=$("#remark").val();
		if(co!='0')
		{
			$("#remark").attr("required", "true");
		}
		else
		{
			$("#remark").removeAttr('required');
		}
    });
		
});
</script>
<script>

	$(document).ready(function(){
		
		$("#con").keyup(function(){
			$con1=$("#con").val();
			if($con1=="0")
		{
			
			$("#con").css("border-color","green");
			
		}
		
		
        
    });
		$("#paid").keyup(function(){
			$con1=$("#con").val();
			$rem12=$("#remark").val();
			if($con1!="0")
		{
			if($rem12=="")
			{
			$("#con").css("border-color","red");
			}
			else
			{
				$("#con").css("border-color","green");
			}
		}
		else
		{
			$("#con").css("border-color","green");
			
		}
		
        
    });
		
});
//////////////////////////////////////////////////////////////////////for remark required
</script>

	
	
	<script>
	

	
		$("document").ready(function(){
		$("#btn").prop("disabled",true);
		$("#con").keyup(function(){
			
		
				var total12=$("#total").val();
				
		var paidd=$("#paid").val();
			var con12=$("#con").val();
			
			var total121= parseInt(total12) - parseInt(con12) ;
			
			
			
			$("#paid").val(total121);
			
		});
		
		
	});
	// fo sep exam fee
	$("document").ready(function(){
		
		$("#sep").change(function(){
			
		
			//	alert("ok");
				
				if($("#sep").prop("checked")==true)
				{
				    
				var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
					var febc=parseInt(200);
					}
					if(sess=='2019-2020')
					{
					var febc=parseInt(300);
					}
					
					
					var d=$("#exam").val(febc);
					var sep1=$("#exam").val();
					var feb1=$("#exam").val();
				}
				else
				{
					var d=$("#exam").val('0');
					
				}
		});
		
		
		
	});
	//for feb exam fee
		// fo sep exam fee
	$("document").ready(function(){
		
		$("#feb").change(function(){
			
		
			//	alert("ok");
				
				if($("#feb").prop("checked")==true)
				{
				    
					var de=$("#exam").val();
					var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
					var febc=parseInt(de)+200;
					}
					if(sess=='2019-2020')
					{
					var febc=parseInt(de)+300;
					}
					var feb2=$("#exam").val(febc);
					
				}
				else
				{
					var d=$("#exam").val('0');
					
				}
		});
		
		
	});
	//for feb exam fee
	////for jul
	$("document").ready(function(){
		
		$("#jul").change(function(){
			
		
				//alert("ok");
				
				if($("#jul").prop("checked")==true)
				{
				    
					var class1=$("#class").val();
					var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
						
					var jul1=parseInt(0);
					}
					if(sess=='2019-2020')
					{
						if(class1=='NINTH CBSE')
						{
					var jul1=parseInt(1500);
						}
						else
						{
							var jul1=parseInt(0);
						}
					}
					var feb213=$("#reg12").val(jul1);
					//alert("ok");
				}
				else
				{
					var d8=$("#reg12").val('0');
					
				}
		});
		
		
	});
	////for jul
	
	$("document").ready(function(){
		
		$("#paid").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#con").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	$("document").ready(function(){
		
		$("#con").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
		$("document").ready(function(){
		
		$("#ndew").focus(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	// for check box coding (JAN)/////
	$("document").ready(function(){
		var totalm=0;
		
		var fees123=$("#fee").val();
		var conv123=$("#conv").val();
		var comp123=$("#comp").val();
		$(".option").change(function(){
			
			 var m=$(":checkbox").filter(':checked').length;
			 var lem=0;
			 
			 for(i=0;i< m;i++)
			 {
				 lem++;
				 //alert(lem);
			 }
			 if(lem>0)
				{
					//alert();
					$("#btn").prop("disabled",false);
				}
				else
				{
					$("#btn").prop("disabled",true);
				}
	 //for jun conv
	$("document").ready(function(){
		
		$("#jun1").change(function(){
			
		
			
				if($("#jun1").prop("checked")==true)
				{	//alert("ok");
				    var con12=$("#convcons1").val();
				    var con13=$('#convcons').val(con12);
					 var con14=$("#convcons").val();
				    var fees1=$("#fee").val();
				//	alert(con14);
		var conv1=$("#conv").val();
	//alert(conv1);
			var add1=$("#add").val();
			//alert(add1);
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
		//	alert(gen1);
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg1").val();
			//alert(reg12);
			var comp1=$("#comp").val();
			//alert(comp1);
			var ann1=$("#ann").val();
			//alert(ann1);
			var other1=$("#other").val();
			//alert(other1);
			var exam1=$("#exam").val();
			//alert(exam1);
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg1) - parseInt(con14);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg1)+ parseInt(dew1) - parseInt(con14);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
				}
				else{
				    
				     $('#convcons').val('0');
					
					 var con14=$("#convcons").val();
				    var fees1=$("#fee").val();
				//	alert(con13);
		var conv1=$("#conv").val();
	//alert(conv1);
			var add1=$("#add").val();
			//alert(add1);
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
		//	alert(gen1);
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg1").val();
		//	alert(reg12);
			var comp1=$("#comp").val();
			//alert(comp1);
			var ann1=$("#ann").val();
			//alert(ann1);
			var other1=$("#other").val();
			//alert(other1);
			var exam1=$("#exam").val();
			//alert(exam1);
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1) - parseInt(con14);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1) - parseInt(con14);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
				}
				
			
		});
		
		
	});
	//for jun conv
			 ////for consession reason
var con1=$("#con1").val();
var con1267=lem*con1;		
			////for consession reason 
		var fees1=$("#fee").val();
		//var comp1=$("#feess").val();
		
		var fees12=lem*fees123;
		var comp1=lem*comp123;
	//	alert(comp1);
		var conv12=lem*conv123;
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg12").val();
		//	var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) + parseInt(reg1) - parseInt(convcons1);
			var totalg= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1) + parseInt(reg1) + parseInt(reg12) - parseInt(convcons1);
		
			
			if($(this).prop("checked")==true)
		{
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#comp").val(comp1);
			$("#conv").val(conv12);
			$("#con").val(con1267);
		}
		else
		{
			var checkbox = document.getElementsByName('choice[]');
			 var n = checkbox.length;
			 var lem=0;
			
			 for(j=0;j< n;j++)
			 {
				 lem++;
				 //alert(lem1);
			 }
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#conv").val(conv12);
			$("#comp").val(comp1);
			$("#con").val(con1267);
		}
		});
		
		
	});
	
	///for other
	$("document").ready(function(){
		
			$("#other").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		//	var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
		$("document").ready(function(){
		
			$("#reg12").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		var reg123=$("#reg12").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12)+ parseInt(reg123) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12)+ parseInt(reg123) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
		$("document").ready(function(){
		
			$("#exam").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		//	var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	$("document").ready(function(){
		
		$("#convence").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var reg12=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	

	$("document").ready(function(){
		
		$("#add").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
			var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
	
	$("document").ready(function(){
		
		$("#oct").change(function(){
		//	alert("ok");
		
			
		
			
				if($("#oct").prop("checked")==true)
				{
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
			var cl=$("#class").val();
			if(cl=='SECOND')
			{
			    $("#other").val(30);
			}
				if(cl=='THIRD')
			{
			    $("#other").val(90);
			}
				if(cl=='FOURTH')
			{
			    $("#other").val(75);
			}
				if(cl=='FIFTH')
			{
			    $("#other").val(75);
			}
				if(cl=='SIXTH')
			{
			    $("#other").val(75);
			}
				if(cl=='SEVENTH')
			{
			    $("#other").val(75);
			}
				if(cl=='EIGHTH')
			{
			    $("#other").val(75);
			}
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
			var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
				}
		});
		
		
	});
	
	/////payble
	$("document").ready(function(){
		
		$(".option").change(function(){
		//	alert("ok");
		
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
	
	$("document").ready(function(){
		
		$("#ann").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
			var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	//for other
	
	// for check box coding/////
	</script>
	
	
	<?php
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	
	$sel4="select * from  session order by id desc limit 1,1";
	$res4=mysqli_query($conn,$sel4);
	$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
	$o_s=$row4['session'];
	$board=$row['mediam'];
	$class=$row['subject'];
	$village=$row['village'];
	$code=$row['code'];
	$application=$row['application'];
	$session=$row['session'];
	/// for transfer value set//
	$selt="select * from  registration where session='$o_s' and application='$application' and status='' order by id desc";
	$rest=mysqli_query($conn,$selt);
	$rowt=mysqli_fetch_array($rest,MYSQLI_BOTH);
	$trans=$rowt['trans'];
		$selt1="select * from  registration where session='$session' and application='$application' and status='' order by id desc";
	$rest1=mysqli_query($conn,$selt1);
	$rowt1=mysqli_fetch_array($rest1,MYSQLI_BOTH);
	$tra=$rowt1['tra'];
	////////for set transfer////
	//////for consession 
	$selc="select * from  fix where sch='$application' and session='$session' ";
	$resc=mysqli_query($conn,$selc);
	$rowc=mysqli_fetch_array($resc,MYSQLI_BOTH);
	$fix=$rowc['fees'];
	
	$reason=$rowc['reason'];
	//echo $fix;
	//echo $reason;
	/// for consession
	///////////////fees
	
		$sel1="select * from fees where class='$class' and session='$session' ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$class1=$row1['class'];
	$fees=$row1['fees'];
	$reg=$row1['reg'];
		$reg1=$row1['reg'];
	$add=$row1['addm'];
	$ann=$row1['ann'];
	$comp13=$row1['comp'];
	$gen12=$row1['gen'];
	////for free fee
	$sel1f="select * from free where sch='$application' and session='$session' ";
	$res1f=mysqli_query($conn,$sel1f);
	$row1f=mysqli_fetch_array($res1f,MYSQLI_BOTH);
	$feef=$row1f['fee'];
	if($feef=='YES')
	{
		$F=$fees;
		
	}
	else
	{
		$F='0';
	}
	
	////for free fee
	
	///////////////convence
	$sel2="select * from convence where code='$code' and session='$session'";
	$res2=mysqli_query($conn,$sel2);
	$row2=mysqli_fetch_array($res2,MYSQLI_BOTH);
	$vill=$row2['vill'];
	$conv=$row2['conv'];
	/////for free conv
	
	$sel2c="select * from free where sch='$application' and session='$session'";
	$res2c=mysqli_query($conn,$sel2c);
	$row2c=mysqli_fetch_array($res2c,MYSQLI_BOTH);
	$convc=$row2c['conv'];
	if($convc=='YES')
	{
		$G=$code;
		//echo $G;
	}
	else
	{
		$G='0';
	}
	/////for free conv
	
	
	///// for fix free
	$sel2cf="select * from free where sch='$application' and session='$session'";
	$res2cf=mysqli_query($conn,$sel2cf);
	$row2cf=mysqli_fetch_array($res2cf,MYSQLI_BOTH);
	$H=$row2cf['fix'];
	$note=$row2cf['reason'];
	
	$fixf=$F+$G+$H;
//	echo $fixf;
	///// for fix free
	///////////////studentfees
	$sel3="select * from studentfees where search='$application' and year='$session' and status=''";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
	$regs=$row3['reg'];
		$regs1=$row3['reg1'];
	$adms=$row3['addm'];
	$comp14=$row3['comp'];
	$anns=$row3['ann'];
		$gen12=$row3['gen'];
		
	///////////////studentfees1
	$sel41="select * from studentfees where search='$application' and year='$session' and status='' ";
	$res41=mysqli_query($conn,$sel41);
	$row41=mysqli_fetch_array($res41,MYSQLI_BOTH);
	
	$sel4="select * from studentfees where search='$application' and year='$session' and status='' order by id desc";
	$res4=mysqli_query($conn,$sel4);
	$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
	$remain=$row4['remain'];
	$search=$row4['search'];
	$gen12=$row4['gen'];
		$regc=$row4['reg'];
	$hob=explode(",",$row4['month']);
		//echo $hob;
		$sel42="select * from studentfees where search='$application' and status=''  order by id desc";
	$res42=mysqli_query($conn,$sel42);
	$row42=mysqli_fetch_array($res42,MYSQLI_BOTH);
	//$search=$row42['search'];
	
	$remain42=$row42['remain'];
	
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
		<?php
	
			$conc='';
			$datec='';
	  $selc="select * from studentfees where search='$application' and year='$session' and con!='0' and status=''   order by id desc";
	$resc=mysqli_query($conn,$selc);
	while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	{
		$dates=$rowc['date'];
		$concs=$rowc['con'];
		$conc=$concs.",";
			$datec=$dates.",";
			echo "<font color=red size=2pt> Cons-".$conc."</font>";
		
	}
	
	
	  //echo $conc;
	  	  $selca="select * from  studentfees where  month like '%April%' and year='$session' and search='$application' and status='' order by id asc ";
	$resca=mysqli_query($conn,$selca);
	if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH))
	{
		//echo "SHOW1";
	}
	//////may
	$selcm="select * from  studentfees where  month like '%May%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescm=mysqli_query($conn,$selcm);
	if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH))
	{
		//echo "SHOW2";
	}
	//////Jun
	$selcj="select * from  studentfees where  month like '%Jun%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescj=mysqli_query($conn,$selcj);
	if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH))
	{
		//echo "SHOW3";
	}
	//////july
	$selcmj="select * from  studentfees where  month like '%July%' and year='$session' and search='$application' and status=''  order by id asc ";
	$rescmj=mysqli_query($conn,$selcmj);
	if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH))
	{
		//echo "SHOW4";
	}
	//////August
	$selcmja="select * from  studentfees where  month like '%August%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmja=mysqli_query($conn,$selcmja);
	if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH))
	{
		//echo "SHOW5";
	}
	//////sep
	$selcms="select * from  studentfees where  month like '%September%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescms=mysqli_query($conn,$selcms);
	if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH))
	{
		//echo "SHOW6";
	}
	//////oct
	$selcmjo="select * from  studentfees where  month like '%October%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmjo=mysqli_query($conn,$selcmjo);
	if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	//////Nov
	$selcmjn="select * from  studentfees where  month like '%November%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmjn=mysqli_query($conn,$selcmjn);
	if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	//////Dec
	$selcmjd="select * from  studentfees where  month like '%December%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmjd=mysqli_query($conn,$selcmjd);
	if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	//////Jan
	$selcmjdj="select * from  studentfees where  month like '%January%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmjdj=mysqli_query($conn,$selcmjdj);
	if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	//////Jan
	$selcmf="select * from  studentfees where  month like '%February%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmf=mysqli_query($conn,$selcmf);
	if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	//////mar
	$selcmm="select * from  studentfees where  month like '%March%' and year='$session' and search='$application' and status='' order by id asc ";
	$rescmm=mysqli_query($conn,$selcmm);
	if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH))
	{
		//echo "SHOW7";
	}
	  
	  ?>
		
	
				<div class="panel-body">
				<center><h2 class="modal-title" style="color:green;background-color:yellow"> CASH RECEIPT (<?php echo $session;?>) </h2> </center>
				<div style="background-color:yellow">
			
			<?php
			$mon='';
	  $selm="select * from studentfees where search='$application' and year='$session' and status='' order by id asc";
	$resm=mysqli_query($conn,$selm);
	while($rowm=mysqli_fetch_array($resm,MYSQLI_BOTH))
	{
		$monthm=$rowm['month'];
		$mon=$monthm.",";
		echo "<font color=red size=2pt>".$mon."</font>";
	}
	  
	  
	  
	  	  $selm5="select * from session order by id desc";
	$resm5=mysqli_query($conn,$selm5);
	$rowm5=mysqli_fetch_array($resm5,MYSQLI_BOTH);
	
		$s1=$rowm5['session'];
		
	
	
	  ?>
			
			</div>
				<form class="form-horizontal" onsubmit="return feesdata(this)" >
				
				 <?php if($s1==$session)
	            {?>
			<center>	<input type="checkbox" name="choice[]" class="option" value="April"
				<?php if($rowca){echo 'disabled';}?>>Apr&emsp;
				<input type="checkbox" name="choice[]" class="option" value="May"
				<?php if($rowcm){echo 'disabled';}?>>May&emsp;
				<input type="checkbox" name="choice[]"   class="option" value="Jun"
		    	<?php if($rowcj){echo 'disabled';}?>>Jun&emsp;
				<input type="checkbox" name="choice[]"  class="option" value="July"
				<?php if($rowcmj){echo 'disabled';}?>>Jul&emsp;
				<input type="checkbox" name="choice[]" class="option" value="August"
				<?php if($rowcmja){echo 'disabled';}?>>Aug&emsp;
				<input type="checkbox" name="choice[]"  class="option" value="September"
			    <?php if($rowcms){echo 'disabled';}?>>Sep&emsp;
				<input type="checkbox" name="choice[]" class="option" id='oct' value="October"
		    	<?php if($rowcmjo){echo 'disabled';}?>>Oct&emsp;
				<input type="checkbox" name="choice[]" class="option" value="November"
				<?php if($rowcmjn){echo 'disabled';}?>>Nov&emsp;
				<input type="checkbox" name="choice[]" class="option" value="December"
				<?php if($rowcmjd){echo 'disabled';}?>>Dec&emsp;
				<input type="checkbox" name="choice[]" class="option" value="January" 
				  <?php if($rowcmjdj){echo 'disabled';}?> >Jan &emsp;
				<input type="checkbox" name="choice[]" class="option"  value="February"
				<?php if($rowcmf){echo 'disabled';}?>>Feb&emsp;
				<input type="checkbox" name="choice[]" class="option" value="March"
				<?php if($rowcmm){echo 'disabled';}?>>Mar</center>
				 <!----phli row-->
				 <?php }?>
				<div class="col-sm-6">
				    <br/>
				    <div class="form-group">
    <label  class="col-sm-4 control-label">Scho.-</label>
    <div class="col-sm-8">
      <input type="number" class="form-control"  value="<?php echo $application;?>" style="background-color:green;color:yellow"readonly >
    </div>
  </div>
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['application'];?>" name="app" id="app"/>
					<input type="hidden" value="<?php echo rand(10000,500000);?>" name="pr" id="pr"/>
					<input type="hidden" value="<?php echo $row['mobile'];?>" name="mobile1" />
					<input type="hidden" value="<?php echo $session;?>" name="" id="session1"/>
					<input type="hidden" value="<?php echo $email;?>" name="email" id="session1"/>
				<input type="hidden" value="<?php echo $board ;?>" name="board"/>
				<label class="col-sm-2 control-label">Name</label>
				<div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name" readonly style="background-color:pink;color:black" /></div>
				</div>
				<div class="form-group">
				<label class="col-sm-4 control-label">Father Name</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>"  style="background-color:gray;color:yellow" readonly></div>
				
				</div> 
			    <div class="form-group">
				<label class="col-sm-4 control-label">Class</label>
				<div class="col-sm-5"><input type="text" class="form-control" value="<?php echo $row['subject'];?>" id="class" name="class" style="background-color:#FF8800;color:#0099CC" readonly></div>
				<div class="col-sm-3"><input type="text" class="form-control" value="<?php echo $row['section'];?>"  name="section" style="background-color:#FF8800;color:#0099CC" readonly></div>
				</div> 
			 <?php
			 $sel1="select * from fees where class='$class' and session='$session' ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$class1=$row1['class'];
	$fees=$row1['fees'];
	$reg=$row1['reg'];
		$reg1=$row1['reg'];
	$add=$row1['addm'];
	$ann=$row1['ann'];
	$comp13=$row1['comp'];
	$gen12=$row1['gen'];
			 
			 ?>
  <input type="hidden" class="form-control" value="<?php echo $row['session'];?>" name="year"  />
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">Miscellaneous</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="add"  value="<?php if($row3['addm']==''){echo $row1['addm'] ;} else{echo 0;}?>" name="add" readonly required>
    </div>
  </div>
 
  <div class="form-group">
    <label  class="col-sm-4 control-label">Annual</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="ann" value="<?php 
      
      if($rowt)
      {
          if($row3['ann']==''){echo $row1['diary'] ;} else{echo 0;}
      }
      else
      {
          if($row3['ann']==''){echo $row1['ann'] ;} else{echo 0;}
      }
      
      ?>" name="ann" readonly required >
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Registration</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="reg12"  value="0" name="reg1" required >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Exam</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" value='0' id="exam"  name="exam" required >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Computer</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="comp" name="comp" value="<?php echo $comp13;;?>"readonly required>
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Generator</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="gen" value="0"  name="gen" readonly required>
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Maint/Med</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="reg" value="0" name="reg" readonly required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Others</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" value='0' id="other" placeholder="Other Charge" name="other" required>
    </div>
  </div>
    <div class="form-group">
    <label  class="col-sm-4 control-label">Remark</label>
    <div class="col-sm-8">
      <input type="text" class="form-control"  placeholder="Remark" name="other_remark" >
    </div>
  </div>
  
  
			
  
  
  

  
			 </div>
			  <!----dusari row-->
				<div class="col-sm-6">
				    <br/>
				    	
				 
				    
			
  
   
  <div class="form-group">
    <label  class="col-sm-4 control-label">Tution Fee</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="fee" value="<?php echo $fees;?>" name="fees"  readonly required>
      <input type="hidden" class="form-control" id="feess" value="<?php echo $fees;?>" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Conveyance</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="conv" value="<?php if($code!='0' or $code!=''){echo $code;}else{echo '0';}?>" name="conv" readonly required>
      <input type="hidden" class="form-control" id="conv123" value="<?php echo $code;?>" >
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Conv Cons</label>
    <div class="col-sm-8">
      
      <input type="number" class="form-control" id="convcons" value='0' readonly>
      <input type="hidden" class="form-control" id="convcons1" value="<?php if($conv!=''){echo $conv;}else{echo '0';}?>"">
    </div>
  </div>
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">PreDues</label>
    <div class="col-sm-8">
      <input type="number" readonly style="color:red" id="dew" name="pre" value="<?php 
	  
	  if($search!='' or $search!=NULL)
	  {
	  if($remain!='')
	  { echo $remain;} 
  else{echo '0';}
	  }
	  else
	  {
		 if($remain42!='')
	  { echo $remain42;} 
  else{echo '0';} 
	  }
	 
	  
	  
	  ?>" class="form-control"  required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">MonthTotal</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="mtotal"  name="mtotal"  style="background-color:#3F729B;color:yellow" title="Please select Month" readonly required>
    </div>
  </div>
  <div class="form-group">
     <label  class="col-sm-4 control-label" STYLE="FONT-SIZE:13PX;FONT-WEIGHT:BOLD;color:blue;">GRAND TOTAL</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="total" style="font-size:18px;font-weight:bold;color:blue;background-color:#f06292" name="total1" readonly required>
    </div>
  </div>
   <div class="form-group">
    <label  class="col-sm-4 control-label">Consession</label>
    <div class="col-sm-8">
        <input type="hidden" class="form-control" id="con1"  value="<?php echo $fixf ?>" >
         <input type="hidden" class="form-control" id="convcons1"  value="<?php echo $conv;?>">
      
      <input type="number" class="form-control" id="con" value="<?php echo $fixf ?>" name="con" required>
      <textarea id="remark" rows="4" cols="32" style="resize:none" name="remark" ><?php echo $note;?></textarea>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Payable Amount</label>
    <div class="col-sm-8">
      <input type="number" style="color:green; font-weight:bold;font-size:19px"class="form-control" id="payble"   required readonly>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Paid</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="paid"  name="paid" required>
    </div>
  </div>
 
			<div class="form-group">
    <label  class="col-sm-4 control-label">New Dues</label>
    <div class="col-sm-8">
      <input type="number" style="color:red" class="form-control" id="ndew"  name="due" readonly required>
    </div>
  </div>  	
    	
		
    		<div class="form-group">
    <label  class="col-sm-4 control-label">Paid Mode</label>
    <div class="col-sm-8">
    <select class='form-control' name='mode'><option>Cash</option><option>UPI</option><option>CHECK</option><option>BANK</option></select>
      
    </div>
  </div>	

  
				</div>
				
				<!----dusari row-->
				
				
				
				
  <div class="form-group">
    
    <div class="col-sm-5">
      
	   <br/>
				<center><button class="btn btn-primary" id="btn">Submit</button>
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	</div>
	
	
	
	<?php
	break;
	
case 10:
	
	 
	$ch=implode(',',$_POST['choice']);
//	echo $ch;
	$name=$_POST['name'];
		$remark1=$_POST['remark'];
			$other_remark1=$_POST['other_remark'];
			
			$remark=addslashes($remark1);
				$other_remark=addslashes($other_remark1);
	$exam=$_POST['exam'];
	$other=$_POST['other'];
	$ann=$_POST['ann'];
	$paid=$_POST['paid'];
	$add=$_POST['add'];
	$reg=$_POST['reg'];
	$reg1=$_POST['reg1'];
	$comp=$_POST['comp'];
		$pre=$_POST['pre'];
	$gen=$_POST['gen'];
	$van=$_POST['conv'];
	$con=$_POST['con'];
	$search=$_POST['app'];
	$board=$_POST['board'];

		$mtotal=$_POST['mtotal'];
	$class=$_POST['class'];
	$month=$_POST['month'];
	$mode=$_POST['mode'];
	$fee=$_POST['fees'];
		$pr=$_POST['pr'];
		$mobile1=$_POST['mobile1'];
	//	$date_add=$_POST['date_add'];
	
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
			$date1=date('Y-m-d');
	$year=$_POST['year'];
	$email=$_POST['email'];
	$total=$_POST['total1'];
	$remain=$total-$paid-$con;
	$sel3="select * from studentfees where search='$search' and year='$year' and status=''";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
	$monthc=$row3['month'];
		$tags = explode(',' , $ch);
$a=array();


foreach($tags as $i) {
	if($i=='April')
	{
		array_push($a,'1');
	}
	if($i=='May')
	{
		array_push($a,'2');
	}
	if($i=='Jun')
	{
		array_push($a,'3');
	}
	if($i=='July')
	{
		array_push($a,'4');
	}
	if($i=='August')
	{
		array_push($a,'5');
	}
	if($i=='September')
	{
		array_push($a,'6');
	}
	if($i=='October')
	{
		array_push($a,'7');
	}
	if($i=='November')
	{
		array_push($a,'8');
	}
	if($i=='December')
	{
		array_push($a,'9');
	}
	if($i=='January')
	{
		array_push($a,'10');
	}
	if($i=='February')
	{
		array_push($a,'11');
	}
	if($i=='March')
	{
		array_push($a,'12');
	}

}
 $count_month=max($a);

//echo '<br/>';
 $count_sel=count($a);

//echo '<br/>';
$s=0;
	$sel2="select * from  studentfees where search='$search' and year='$year' and status='' and month!='Dues'";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	
	$string=$row2['month'];
$tags = explode(',' , $string);


foreach($tags as $i =>$key) {
$i >0;
$s++;
  

}
}
$total_paid=$s+$count_sel;
	///
	$total_paid=$s+$count_sel;
	$sel15="select * from  studentfees where  status='Not' and search='$search' and status='' order by id desc";
	$res15=mysqli_query($conn,$sel15);
	$row15=mysqli_fetch_array($res15,MYSQLI_BOTH);
	
	if($row15)
	{
	    echo "Please Approved Fees From Admin Login";
	}
	else
	{
	if($user_login=='Cashier')
	{
	    if($con<=500)
	    {
	        if($count_month==$total_paid)
	{
	$sel1="select * from  studentfees where pr='$pr' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	if($row1)
	{
	    echo " Dues Paid Allready";
	}
	else
	{
$ins="insert into studentfees(name,class,month,fee,date,year,search,van,exam,other,total,board,remain,ann,addm,reg,comp,gen,paid,con,mtotal,pre,remark,reg1,fine,dpaid,to1,status,c_date,other_remark,mode,pr,email) values('$name','$class','$ch','$fee','$date1','$year','$search','$van','$exam','$other','$total','$board','$remain','$ann','$add','$reg','$comp','$gen','$paid','$con','$mtotal','$pre','$remark','$reg1','','','','','$date1','$other_remark','$mode','$pr','$email')";

	if(mysqli_query($conn,$ins))
	{
	    
		
			echo"Fees Submit";
		
	}
	else
	{
		echo"Fees Not Submit";
	}
	}
	}
	else
	{
		echo 'Please Select Month in Sequence';
	}
	    }
	    else
	    {
	        $ins="insert into studentfees(name,class,month,fee,date,year,search,van,exam,other,total,board,remain,ann,addm,reg,comp,gen,paid,con,mtotal,pre,remark,reg1,fine,dpaid,to1,status,c_date,other_remark,mode,pr,email) values('$name','$class','$ch','$fee','$date1','$year','$search','$van','$exam','$other','$total','$board','$remain','$ann','$add','$reg','$comp','$gen','$paid','$con','$mtotal','$pre','$remark','$reg1','','','','','$date1','$other_remark','$mode','$pr','$email')";

	if(mysqli_query($conn,$ins))
	{
	    
		
			echo"Fees Submit";
		
	}
	else
	{
		echo"Fees Not Submit";
	}
	    
	        
	        
	    }
	}
	else
	{
	 $ins="insert into studentfees(name,class,month,fee,date,year,search,van,exam,other,total,board,remain,ann,addm,reg,comp,gen,paid,con,mtotal,pre,remark,reg1,fine,dpaid,to1,status,c_date,other_remark,mode,pr,email) values('$name','$class','$ch','$fee','$date1','$year','$search','$van','$exam','$other','$total','$board','$remain','$ann','$add','$reg','$comp','$gen','$paid','$con','$mtotal','$pre','$remark','$reg1','','','','','$date1','$other_remark','$mode','$pr','$email')";

	if(mysqli_query($conn,$ins))
	{
	    
		
			echo"Fees Submit";
	}
	}
	}
	break;
	
	//=========================================================message==//
	case 11:
	
	$year=$_POST['year'];
	$date=date("d-m-Y");
	$message=$_POST['message'];
	$sel="select * from registration where session='$year'";
	$res=mysqli_query($conn,$sel);
	$mob="";
	$mess=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$mobile1=$row['mobile'];
		$mob= $mobile1.",".$mob;
		$mess++;
	}
	
	$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";

$msg=urlencode($message);
$rest=substr($mob,0,-1);
$to=$rest;

$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSSCH&receiver=$to&route=TA&msgtype=1&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count,session) value('$message','$mess','$year')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,date,session) value('$message','$date','$year')";
	$resme=mysqli_query($conn,$insme);
	echo"sms send";
}
else
{
	echo"sms not send";
}
	
	
	break ;
	///////all hindi msg
	case 1198:
	
	$year=$_POST['year'];
	$date=date("d-m-Y");
	$message=$_POST['message'];
	$sel="select * from registration where session='$year' and status=''";
	$res=mysqli_query($conn,$sel);
	$mob="";
	$mess=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$mobile1=$row['mobile'];
		$mob= $mobile1.",".$mob;
		$mess++;
	}
	
	$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";

$msg=urlencode($message);
$rest=substr($mob,0,-1);
$to=$rest;

//$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSSCH&receiver=$to&route=TA&msgtype=3&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count,session) value('$message','$mess','$year')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,date,session) value('$message','$date','$year')";
	$resme=mysqli_query($conn,$insme);
	echo"sms send";
}
else
{
	echo"sms not send";
}
	
	
	break ;
	case 111:
	
	$year=$_POST['year'];
	$class=$_POST['class'];
	$date=date("d-m-Y");
	$message=$_POST['message'];
	$sel="select * from registration where session='$year' and subject='$class' and status=''";
	$res=mysqli_query($conn,$sel);
	$mob="";
	$mess=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$mobile1=$row['mobile'];
		$mob= $mobile1.",".$mob;
		$mess++;
	}
	echo $mob;
	$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";

$msg=urlencode($message);
$rest=substr($mob,0,-1);
$to=$rest;

//$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSSCH&receiver=$to&route=TA&msgtype=1&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count,session) value('$message','$mess','$year')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,class,date,session) value('$message','$class','$date','$year')";
	$resme=mysqli_query($conn,$insme);
	echo"sms send";
}
else
{
	echo"sms not send";
}
	
	
	break ;
	case 112:
	
	$year=$_POST['year'];
	$class=$_POST['class'];
	$date=date("d-m-Y");
	$message=$_POST['message'];
	$sel="select * from registration where session='$year' and subject='$class' and status=''";
	$res=mysqli_query($conn,$sel);
	$mob="";
	$mess=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$mobile1=$row['mobile'];
		$mob= $mobile1.",".$mob;
		$mess++;
	}
	echo $mob;
	$username="AwadheshYadav";
$password="AwadheshYadav";
$senderid="MDSNIZ";

$msg=urlencode($message);
$rest=substr($mob,0,-1);
$to=$rest;

$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSSCH&receiver=$to&route=TA&msgtype=3&sms=$msg";

$result=file_get_contents($api);
if($result)
{
	$ins="insert into message (message,count,session) value('$message','$mess','$year')";
	$res=mysqli_query($conn,$ins);
	$insme="insert into message1 (message,class,date,session) value('$message','$class','$date','$year')";
	$resme=mysqli_query($conn,$insme);
	echo"sms send";
}
else
{
	echo"sms not send";
}
	
	
	break ;
	
	case 13:
	$year=$_POST['year'];
	$class=$_POST['class'];
  $sel="select * from  studentfees where year='$year' and class='$class' and status='' order by date desc ";
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  studentfees where year='$year' and class='$class' ";
	$res1=mysqli_query($conn,$sel1);
	$row2=mysqli_num_rows($res1);
	if($row2!=" ")
	{
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Month Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Admission.</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>DateTime</th><th>Update</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                 <th>Sr.</th><th>Sch No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Month Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Admission.</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>DateTime</th><th>Update</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['search'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['fee'];?></td><td><?php echo $row['ann'];?></td><td><?php echo $row['exam'];?></td><td><?php echo $row['van'];?></td><td><?php echo $row['addm'];?></td><td><?php echo $row['remain'];?></td><td><?php echo $row['other'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['date'];?></td>
	
	
	<td><a href="javascript:;" onclick="feeuprow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt>Not Record Available.</font>";
	}
	break;
	
	case 39:
	$id=$_POST['rowid'];

	$del="update  studentfees set status='Delete' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
		
	}
	else
	{
		echo"Not Deleted";
	}

	break;
	
	
	
	case 15:
	
	$rol=$_POST['rol'];
	
	
	
	$sel="select * from  studentfees where search='$rol' and status=''  order by date desc";
	
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  studentfees where search='$rol'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_num_rows($res1);
	if($row1==" ")
	{
		echo"<font color=red size=6pt>Not Fees Submit Or Invailid Session and Application Number.</font>";
	}
else
{
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: [ 'pdf', 'print']
    });
	
});
</script>
		<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
                <th style="text-align:center">Session</th><th style="text-align:center">Month</th><th style="text-align:center">Name</th><th style="text-align:center">Class</th><th style="text-align:center">Fees</th><th style="text-align:center">Exam</th><th style="text-align:center">Van</th><th style="text-align:center">Admission</th><th style="text-align:center">Total</th><th style="text-align:center">Date</th>
            </tr>
        </thead>
<tfoot>
            <tr>
               <th style="text-align:center">Session</th><th style="text-align:center">Month</th><th style="text-align:center">Name</th><th style="text-align:center">Class</th><th style="text-align:center">Fees</th><th style="text-align:center">Exam</th><th style="text-align:center">Van</th><th style="text-align:center">Admission</th><th style="text-align:center">Total</th><th style="text-align:center">Date</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	</td><td><?php echo $row['year'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['fee'];?></td><td><?php echo $row['exam'];?></td><td><?php echo $row['van'];?></td><td><?php echo $row['other'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['date'];?></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	
	<?php
		
}
	



	

	
	break;
	// contact---
	case 16:
$name=$_POST['name'];
$message1=$_POST['message'];
$mobile=$_POST['mobile'];
$subject=$_POST['subject'];
$email=$_POST['email'];

	$from=$email;
	
	$to="fmazm.meyer14@gmail.com";

$message=$name." mob-".$mobile." "."Msg-".$message1;
//echo"$message";
//echo"<br/>";

$headers="MIME-Version:1.0"."\r\n";  // header ko call krta hai header path
$headers=
"Content-type:text/html;charset:UTF-8"."\r\n";


if(mail($to,$subject,$message,$from))
{
	echo"Submit";
}
else
{
	echo"query not send";
	
}


break;
case 17:
$name=$_POST['name'];
$year=$_POST['year'];
$class=$_POST['class'];
$total=$_POST['total'];
$obtain=$_POST['obtain'];
$per1=$obtain/$total;
$per2=$per1*100;
$per=substr($per2,0,5);

$picture=$_FILES['picture']['name'];
$tempname=$_FILES['picture']['tmp_name'];
$location="img/".$picture;

$ins="insert into topper(name,year,class,total,obtain,picture,per) value('$name','$year','$class','$total','$obtain','$picture','$per')";
if($res=mysqli_query($conn,$ins))
{
	echo "Submit";
	move_uploaded_file($tempname,$location);
}

	else
	{
		echo"not submit";
	}
	


break;
case 18:
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Photo</th><th>Name</th><th>Year</th><th>class</th><th>Total</th><th>Obtain</th><th>Per</th><th>Delete</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th>Sr.</th><th>Photo</th><th>Name</th><th>Year</th><th>class</th><th>Total</th><th>Obtain</th><th>Per</th><th>Delete</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $sel="select * from  topper order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="60px" width="60px;"></td><td><?php echo $row['name'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['obtain'];?></td><td><?php echo $row['per'];?></td>
	
	
	
	<td><a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	case 22:
	$id=$_POST['rowid'];
	$sel="select * from  topper where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$photo=$row['picture'];
	$location="../code/img/".$photo;
	
	$del="delete from topper where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
		unlink($location);
	}
	else
	{
		echo"Not Deleted";
	}
	break;
	
	case 23:
	$year=$_POST['year'];
	$slip=$_POST['slip'];
  $sel="select * from  studentfees where year='$year' and search='$slip' ";
	$res=mysqli_query($conn,$sel);
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Scho. No.</th><th>Session</th><th>Name</th><th>Class</th><th>Fees Details</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th>Scho. No.</th><th>Session</th><th>Name</th><th>Class</th><th>Fees Details</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
		
	
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $row['search'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td>
	
	<td><a href="../admin/slip2.php?flag=<?php echo $row['search'];?>"><button class="btn btn-primary">Fees Details</button></a></td>
	
	
	
	</tr>
	
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	
	case 24:
	
	$sch=$_POST['std'];
	$session=$_POST['year'];
	
	
	
	
	$sel="select * from  registration where application='$sch' and session='$session' and status='' ";
	
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  registration where application='$sch' and session='$session' and status=''";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_num_rows($res1);
	if($row1==" ")
	{
		echo"<font color=red size=6pt>Not Admission Submit Or Invailid Session and Scholar Number.</font>";
	}
else
{
	
	?>
		<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
                <th style="text-align:center">Photo</th><th style="text-align:center">Sesion</th><th style="text-align:center">Name</th><th style="text-align:center">Father Name</th><th style="text-align:center">Mother Name</th><th style="text-align:center"> Class</th><th style="text-align:center">Address</th><th style="text-align:center">Admission Datetime</th>
            </tr>
        </thead>
<tfoot>
            <tr>
              <th style="text-align:center">Photo</th><th style="text-align:center">Session</th><th style="text-align:center">Name</th><th style="text-align:center">Father Name</th><th style="text-align:center">Mother Name</th><th style="text-align:center"> Class</th><th style="text-align:center">Address</th><th style="text-align:center">Admission Datetime</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$vil=$row['village'];
		$dist=$row['dist'];
		$add=$vil." ".$dist;
		?>
		 
	<tr class="text-center">
	<td><img src="code/img/<?php echo $row['picture'];?>" height="60px" width="60px;"></td><td><?php echo $row['session'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $add;?></td><td><?php echo $row['datetime'];?></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	
	<?php
		
}

	
	break;
	case 2424:
	
	$mobile=$_POST['mobile'];
	$session=$_POST['year'];
	
	
	
	
	$sel="select * from  registration where mobile='$mobile' and session='$session' and status=''  ";
	
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  registration where mobile='$mobile' and session='$session' and status=''";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_num_rows($res1);
	if($row1==" ")
	{
		echo"<font color=red size=6pt>Not Admission Submit Or Invailid Session and Mobile No.</font>";
	}
else
{
	
	?>
		<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
             <tr >
                <th style="text-align:center">Photo</th><th style="text-align:center">Sesion</th><th style="text-align:center">Name</th><th style="text-align:center">Father Name</th><th style="text-align:center">Mother Name</th><th style="text-align:center"> Class</th><th style="text-align:center">Address</th><th style="text-align:center">Admission Datetime</th><th>Print</th>
            </tr>
        </thead>
<tfoot>
            <tr >
                <th style="text-align:center">Photo</th><th style="text-align:center">Sesion</th><th style="text-align:center">Name</th><th style="text-align:center">Father Name</th><th style="text-align:center">Mother Name</th><th style="text-align:center"> Class</th><th style="text-align:center">Address</th><th style="text-align:center">Admission Datetime</th><th>Print</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$vil=$row['village'];
		$dist=$row['dist'];
		$add=$vil." ".$dist;
		?>
		 
	<tr class="text-center">
	<td><img src="code/img/<?php echo $row['picture'];?>" height="60px" width="60px;"></td><td><?php echo $row['session'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $add;?></td><td><?php echo $row['datetime'];?></td>
	
	<td><a href="student_print1.php?flag=<?php echo $row['id'];?>"><span class="fa fa-print"></span></a></td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	
	<?php
		
}

	
	break;
	
	case 25:
	
	$rol=$_POST['roll'];
	
	$exam=$_POST['exam'];
	$class=$_POST['class'];
	//echo $class;
	if($class=='LKG'or $class=='UKG' or $class=='PLAY GROUP' or $class=='NURSERY' )
		{
			//echo'ok';
	$sel1="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$mark1=$row1['mark1'];
	$mark2=$row1['mark2'];
	$mark3=$row1['mark3'];
	$total=$mark1+$mark2+$mark3;
	$per1=$total/150;
	$per2=$per1*100;
	$per=substr($per2,0,5);
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: [ 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Examination-&emsp;<?php echo $exam;?></th>
            </tr>
        </thead>

<tbody>		
  
		 
	<tr class="text-center">
	<td>Year</td><td style="font-weight:bold"><?php echo $row1['session'];?></td><td>Roll No.</td><td style="font-weight:bold"><?php echo $rol;?></td><td>Name</td><td><?php echo $row1['name'];?></td><td>Class</td><td style="font-weight:bold"><?php echo $row1['class'];?></td>
	
	</tr>
	<tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Result</th>
            </tr>
			<tr class="text-center">
	<td colspan="2">Subject</td><td>Max Marks</td><td>Obtain Marks</td><td colspan="3">Total</td><td colspan="2">Percentage</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark1'];?></td><td rowspan="3" colspan="3" style="font-weight:bold"><?php echo $total;?>/150</td><td rowspan="3" style="font-weight:bold"><?php echo $per;?>&nbsp;%</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark2'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">MATHEMATICS</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark3'];?></td>
	
	</tr>
	
	 </tbody>
    </table>
	
	</div>
	<button onclick="print('fee')" >print</button>
	<a href="index.php"><button>Back</button></a>
	<?php
	
		}
		/////first//////
		else if($class=='FIRST'or $class=='SECOND' or $class=='THIRD' or $class=='FOURTH' or $class=='FIFTH' )
		{
			//echo'ok';
	$sel1="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$mark1=$row1['mark1'];
	$mark2=$row1['mark2'];
	$mark3=$row1['mark3'];
	$mark4=$row1['mark4'];
	$mark5=$row1['mark5'];
	$mark6=$row1['mark6'];
	$mark7=$row1['mark7'];
	$mark8=$row1['mark8'];
	$mark9=$row1['mark9'];
	$total=$mark1+$mark2+$mark3+$mark4+$mark5+$mark6+$mark7+$mark8+$mark9;
	$per1=$total/400;
	$per2=$per1*100;
	$per=substr($per2,0,5);
	?>
	

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Examination-&emsp;<?php echo $exam;?></th>
            </tr>
        </thead>

<tbody>		
  
		 
	<tr class="text-center">
	<td>Year</td><td style="font-weight:bold"><?php echo $row1['session'];?></td><td>Roll No.</td><td style="font-weight:bold"><?php echo $rol;?></td><td>Name</td><td><?php echo $row1['name'];?></td><td>Class</td><td style="font-weight:bold"><?php echo $row1['class'];?></td>
	
	</tr>
	<tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Result</th>
            </tr>
			<tr class="text-center">
	<td colspan="2">Subject</td><td>Max Marks</td><td>Obtain Marks</td><td colspan="3">Total</td><td colspan="2">Percentage</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark1'];?></td><td rowspan="9" colspan="3" style="font-weight:bold"><?php echo $total;?>/400</td><td rowspan="9" style="font-weight:bold"><?php echo $per;?>&nbsp;%</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH READER</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark2'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH GRAMMAR</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark3'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">MATHEMATICS</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark4'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">E.V.S.</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark5'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">COMPUTER</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark6'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">G.K.</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark7'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ART</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark8'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI GRAMMAR</td><td>50</td><td style="font-weight:bold"><?php echo $row1['mark9'];?></td>
	
	</tr>
	
	 </tbody>
    </table>
	
	</div>
	<button onclick="print('fee')" >print</button>
	<a href="index.php"><button>Back</button></a>
	<?php
	
		}
		else if($class=='SIXTH'or $class=='SEVENTH' or $class=='EIGHTH' )
		{
			//echo'ok';
	$sel1="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	
	
	$mark1=$row1['mark1'];
	$mark2=$row1['mark2'];
	$mark3=$row1['mark3'];
	$mark4=$row1['mark4'];
	$mark5=$row1['mark5'];
	$mark6=$row1['mark6'];
	$mark7=$row1['mark7'];
	$mark8=$row1['mark8'];
	$mark9=$row1['mark9'];
	$mark10=$row1['mark10'];
	$total=$mark1+$mark2+$mark3+$mark4+$mark5+$mark6+$mark7+$mark8+$mark9+$mark10;
	$per1=$total/500;
	$per2=$per1*100;
	$per=substr($per2,0,5);
	?>
	
<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: [ 'pdf', 'print']
    });
	
});
</script>
	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Examination-&emsp;<?php echo $exam;?></th>
             </tr>
        </thead>

<tbody>		
  <?php
  $sel="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam' and session='$year'";
	
	$res=mysqli_query($conn,$sel);
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td>Year</td><td style="font-weight:bold"><?php echo $row1['session'];?></td><td>Roll No.</td><td style="font-weight:bold"><?php echo $rol;?></td><td>Name</td><td><?php echo $row['name'];?></td><td>Class</td><td style="font-weight:bold"><?php echo $row['class'];?></td>
	
	</tr>
	<tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Result</th>
            </tr>
			<tr class="text-center">
	<td colspan="2">Subject</td><td>Max Marks</td><td>Obtain Marks</td><td colspan="3">Total</td><td colspan="2">Percentage</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark1'];?></td><td rowspan="10" colspan="3" style="font-weight:bold"><?php echo $total;?>/500</td><td rowspan="10" style="font-weight:bold"><?php echo $per;?>&nbsp;%</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI GRAMMAR</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark2'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH READER</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark3'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH GRAMMAR</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark4'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">MATHEMATICS</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark5'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">SCIENCE</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark6'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">SO. SCIENCE</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark7'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">COMPUTER</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark8'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">G.K.</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark9'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ART</td><td>50</td><td style="font-weight:bold"><?php echo $row['mark10'];?></td>
	
	</tr>
	<?php
	}
	
	
	?>
	 </tbody>
    </table>
	
	</div>
	<button onclick="print('fee')" >print</button>
	<a href="index.php"><button>Back</button></a>
	<?php
	
		}
	/////////////9//////
	
	else if($class=='NINTH'or $class=='TENTH' )
		{
			//echo'ok';
	$sel1="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$mark1=$row1['mark1'];
	$mark2=$row1['mark2'];
	$mark3=$row1['mark3'];
	$mark4=$row1['mark4'];
	$mark5=$row1['mark5'];
	$mark6=$row1['mark6'];
	
	
	$total=$mark1+$mark2+$mark3+$mark4+$mark5+$mark6;
	$per1=$total/600;
	$per2=$per1*100;
	$per=substr($per2,0,5);
	?>
	

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Examination-&emsp;<?php echo $exam;?></th>
            </tr>
        </thead>

<tbody>		
  
		 
	<tr class="text-center">
	<td>Year</td><td style="font-weight:bold"><?php echo $row1['session'];?></td><td>Roll No.</td><td style="font-weight:bold"><?php echo $rol;?></td><td>Name</td><td><?php echo $row1['name'];?></td><td>Class</td><td style="font-weight:bold"><?php echo $row1['class'];?></td>
	
	</tr>
	<tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Result</th>
            </tr>
			<tr class="text-center">
	<td colspan="2">Subject</td><td>Max Marks</td><td colspan="2">Obtain Marks</td><td colspan="2">Total</td><td colspan="2">Percentage</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI</td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark1'];?></td><td></td><td rowspan="6" colspan="2" style="font-weight:bold"><?php echo $total;?>/600</td><td rowspan="6" style="font-weight:bold"><?php echo $per;?>&nbsp;%</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH </td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark2'];?></td><td style="font-weight:bold"><?php echo $row1['mark3'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">MATHEMATICS</td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark4'];?></td><td rowspan="4"></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">SCIENCE</td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark5'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">SO. SCIENCE</td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark6'];?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ART</td><td>100</td><td style="font-weight:bold"><?php echo $row1['mark7'];?></td>
	
	</tr>
	
	
	
	
	 </tbody>
    </table>
	
	</div>
	<button onclick="print('fee')" >print</button>
	<a href="index.php"><button>Back</button></a>
	<?php
	
		}
		/////////////11//////
	
	else if($class=='ELEVENTH'or $class=='TWELFTH' )
		{
			//echo'ok';
	$sel1="select * from six_eightresult where rol='$rol' and class='$class' and exam='$exam'";
	
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$mark1=$row1['mark1'];
	$mark12=$row1['mark12'];
	$hindi=$mark1+$mark12;
	$mark2=$row1['mark2'];
	$mark3=$row1['mark3'];
	$english=$mark2+$mark3;///////
	
	$mark4=$row1['mark4'];
	$mark5=$row1['mark5'];
	$math=$mark4+$mark5;
	$mark6=$row1['mark6'];
	$mark7=$row1['mark7'];
	
	$physics=$mark6+$mark7;
	$mark8=$row1['mark8'];
	$mark9=$row1['mark9'];
	
	$chemistry=$mark8+$mark9;
	$mark10=$row1['mark10'];
	$mark11=$row1['mark11'];
	
	$bio=$mark10+$mark11;
	
	$total=$mark1+$mark2+$mark3+$mark4+$mark5;
	$per1=$total/500;
	$per2=$per1*100;
	$per=substr($per2,0,5);
	?>
	

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Examination-&emsp;<?php echo $exam;?></th>
            </tr>
        </thead>

<tbody>		
  
		 
	<tr class="text-center">
	<td>Year</td><td style="font-weight:bold"><?php echo $row1['session'];?></td><td>Roll No.</td><td style="font-weight:bold"><?php echo $rol;?></td><td>Name</td><td><?php echo $row1['name'];?></td><td>Class</td><td style="font-weight:bold"><?php echo $row1['class'];?></td>
	
	</tr>
	<tr class="text-center">
                <th colspan="8" style="text-align:center;font-size:22px">Result</th>
            </tr>
			<tr class="text-center">
	<td colspan="2">Subject</td><td>Max Marks</td><td colspan="2">Obtain Marks</td><td colspan="2">Total</td><td colspan="2">Percentage</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">HINDI</td><td>100</td><td style="font-weight:bold"><?php echo $mark1;?></td><td style="font-weight:bold"><?php echo $mark12;?></td><td rowspan="6" colspan="2" style="font-weight:bold"><?php echo $total;?>/600</td><td rowspan="6" style="font-weight:bold"><?php echo $per;?>&nbsp;%</td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">ENGLISH </td><td>100</td><td style="font-weight:bold"><?php echo $mark2;?></td><td style="font-weight:bold"><?php echo $mark3;?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">MATHEMATICS</td><td>100</td><td style="font-weight:bold"><?php echo $mark4;?></td><td style="font-weight:bold"><?php echo $mark5;?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">PHYSICS</td><td>100</td><td style="font-weight:bold"><?php echo $mark6;?></td><td style="font-weight:bold"><?php echo $mark7;?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">CHEMISTRY</td><td>100</td><td style="font-weight:bold"><?php echo $mark8;?></td><td style="font-weight:bold"><?php echo $mark9;?></td>
	
	</tr>
	<tr class="text-center">
	<td colspan="2" style="font-weight:bold">BIOLOGY</td><td>100</td><td style="font-weight:bold"><?php echo $mark10;?></td><td style="font-weight:bold"><?php echo $mark11;?></td>
	
	</tr>
	
	
	
	
	 </tbody>
    </table>
	
	</div>
	<button onclick="print('fee')" >print</button>
	<a href="index.php"><button>Back</button></a>
	<?php
	
		}
	
	break;
	

	case 27:
	?>
	
		<script>

    $("#con").focus(function(){
        $("#remark").toggle('show');
    });
	$(document).ready(function(){
		$("#remark").toggle("hide");
});
</script>
<script>

    
	$(document).ready(function(){
		
		$("#con").change(function(){
        var co=$("#con").val();
		
        var re=$("#remark").val();
		if(co!='0')
		{
			$("#remark").attr("required", "true");
		}
		else
		{
			$("#remark").removeAttr('required');
		}
    });
		
});
</script>
<script>

	$(document).ready(function(){
		
		$("#con").keyup(function(){
			$con1=$("#con").val();
			if($con1=="0")
		{
			
			$("#con").css("border-color","green");
			
		}
		
		
        
    });
		$("#paid").keyup(function(){
			$con1=$("#con").val();
			$rem12=$("#remark").val();
			if($con1!="0")
		{
			if($rem12=="")
			{
			$("#con").css("border-color","red");
			}
			else
			{
				$("#con").css("border-color","green");
			}
		}
		else
		{
			$("#con").css("border-color","green");
			
		}
		
        
    });
		
});
//////////////////////////////////////////////////////////////////////for remark required
</script>

	<script>
	

	
		$("document").ready(function(){
		
		$("#con").keyup(function(){
			
		
				var total12=$("#total").val();
		
			var con12=$("#con").val();
		
			var total121= parseInt(total12) - parseInt(con12) ;
			
			$("#paid").val(total121);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#paid").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
		$("document").ready(function(){
		
		$("#ndew").focus(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	// for check box coding (JAN)/////
	$("document").ready(function(){
		var totalm=0;
		
		var fees123=$("#feess").val();
		var conv123=$("#conv123").val();
		
		$(".option1").change(function(){
			
			 var m=$(":checkbox").filter(':checked').length;
			 var lem=0;
			 
			 for(i=0;i< m;i++)
			 {
				 lem++;
				 //alert(lem);
			 }
			 
		var fees1=$("#fee").val();
			var fees34=$("#fees34").val();
		var feess1=$("#feess").val();
		var fees12=lem*fees123;
		var conv12=lem*conv123;
			var add1=$("#add").val();
			var conv=$("#conv").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1);
			var totalg= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1);
		
			
			if($(this).prop("checked")==true)
		{
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#conv").val(conv12);
		}
		else
		{
		var checkbox = document.getElementsByName('choice[]');
			 var n = checkbox.length;
			 var lem=0;
			
			 for(j=0;j< n;j++)
			 {
				 lem++;
				 //alert(lem1);
			 }
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#conv").val(conv12);
		
		}
		});
		
		
	});
	
	
	$("document").ready(function(){
		
		$("#other").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#exam").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#add").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#ann").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1) + parseInt(reg1) + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
		});
		
		
	});
	// for check box coding/////
	</script>
	
	
	<?php
$app=$_REQUEST['application'];
	
	
	
	//echo"$eid";
	$sel="select * from  registration where application='$app' and session='2018-2019'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$board=$row['mediam'];
	$class=$row['subject'];
	$village=$row['village'];
	$code=$row['code'];
	$application=$row['application'];
	$session=$row['session'];
	//echo $session;
	///////////////fees
	$selapp="select * from studentfees where search='$app' and status='' order by id desc";
	$resapp=mysqli_query($conn,$selapp);
	$rowapp=mysqli_fetch_array($resapp,MYSQLI_BOTH);
	$idapp=$rowapp['id'];
//	echo $idapp;
	//for search
	
		$sel1="select * from fees where class='$class' ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$class1=$row1['class'];
	$fees=$row1['fees'];
	$reg=$row1['reg'];
	$add=$row1['addm'];
	$ann=$row1['ann'];
	$comp13=$row1['comp'];
	$gen12=$row1['gen'];
	///////////////convence
	$sel2="select * from convence where code='$code'";
	$res2=mysqli_query($conn,$sel2);
	$row2=mysqli_fetch_array($res2,MYSQLI_BOTH);
	$vill=$row2['vill'];
	$conv=$row2['conv'];
	///////////////studentfees
	$sel3="select * from studentfees where id='$idapp' and status=''";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
	$regs=$row3['reg'];
	$adms=$row3['addm'];
	$comp14=$row3['comp'];
	$anns=$row3['ann'];
		$gen12=$row3['gen'];
			$date12=$row3['date'];
			//echo $date12;
		
	///////////////studentfees1
	$sel4="select * from studentfees where search='$application' and year='$session' and status='' order by id desc";
	$res4=mysqli_query($conn,$sel4);
	$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
	$remain=$row4['remain'];
	$gen12=$row4['gen'];
		$regc=$row4['reg'];
	$hob=explode(",",$row3['month']);
		//echo $hob;
	
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				<marquee><span style="color:red"> महीने पर क्लिक करने पर महीने के अनुसार conveyance  और  Month Fees  दोनों एक साथ बढ़ेंगी | किसी छात्र की लास्ट में जमा की गयी फिश ही अपडेट होगी )</span></marquee>
				<div class="panel-body">
				
				<div style="background-color:yellow">
			
			<?php
			$mon='';
	  $selm="select * from studentfees where id='$idapp' and status='' order by id asc";
	$resm=mysqli_query($conn,$selm);
	while($rowm=mysqli_fetch_array($resm,MYSQLI_BOTH))
	{
		$monthm=$rowm['month'];
		$mon=$monthm.",";
		echo "<font color=red size=2pt>".$mon."</font>";
	}
	  
	  
	  ?>
			
			</div>
				<form class="form-horizontal" onsubmit="return feesdatanew(this)" >
				
				 
			<center>	<input type="checkbox" name="choice[]" class="option1" value="April"
				<?php foreach($hob as $h){if($h=='April'){echo' checked';}}?>>Apr&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="May"
				<?php foreach($hob as $h){if($h=='May'){echo' checked';}}?>>May&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="Jun"
				<?php foreach($hob as $h){if($h=='Jun'){echo' checked';}}?>>Jun&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="July"
				<?php foreach($hob as $h){if($h=='July'){echo' checked';}}?>>Jul&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="August"
				<?php foreach($hob as $h){if($h=='August'){echo'checked';}}?>>Aug&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="September"
				<?php foreach($hob as $h){if($h=='September'){echo' checked';}}?>>Sep&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="October"
				<?php foreach($hob as $h){if($h=='October'){echo'checked';}}?>>Oct&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="November"
				<?php foreach($hob as $h){if($h=='November'){echo' checked';}}?>>Nov&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="December"
				<?php foreach($hob as $h){if($h=='December'){echo'checked';}}?>>Dec&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="January" 
				 <?php foreach($hob as $h){if($h=='January'){echo' checked';}}?> >Jan &emsp;
				<input type="checkbox" name="choice[]" class="option1" value="February"
				<?php foreach($hob as $h){if($h=='February'){echo' checked';}}?>>Feb&emsp;
				<input type="checkbox" name="choice[]" class="option1" value="March"
				<?php foreach($hob as $h){if($h=='March'){echo' checked';}}?>>Mar</center>
				
				 <!----phli row-->
				 
				<div class="col-sm-6">
				    <br/>
				    <div class="form-group">
    <label  class="col-sm-4 control-label">Scho.-</label>
    <div class="col-sm-8">
      <input type="number" class="form-control"  value="<?php echo $app;?>" name="scho" style="background-color:green;color:yellow"readonly >
    </div>
  </div>
				<div class="form-group">
				<input type="hidden" value="<?php echo $idapp;?>" name="idapp" />
					<input type="hidden" value="<?php echo $row3['paid'];?>" name="opaid" />
						<input type="hidden" value="<?php echo $row3['total'];?>" name="ototal" />
							<input type="hidden" value="<?php echo $row3['date'];?>" name="odate" />
								<input type="hidden" value="<?php echo $row3['month'];?>" name="omonth" />
				<input type="hidden" value="<?php echo $board ;?>" name="board"/>
					<input type="hidden" value="<?php echo $fees ;?>" id="fees34"/>
						<input type="hidden" value="<?php echo $conv ;?>" id="conv34"/>
				<label class="col-sm-2 control-label">Name</label>
				<div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name" readonly style="background-color:pink;color:black" /></div>
				</div>
				<div class="form-group">
				<label class="col-sm-4 control-label">Father Name</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>"  style="background-color:gray;color:yellow" readonly></div>
				
				</div> 
			    <div class="form-group">
				<label class="col-sm-4 control-label">Class</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['subject'];?>" name="class" style="background-color:#FF8800;color:#0099CC" readonly></div>
				
				</div> 
			
  <input type="hidden" class="form-control" value="<?php echo $row['session'];?>" name="year"  />
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">Admission</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="add"  value="<?php echo $row3['addm'];?>" name="add" required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Annual</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="ann" value="<?php echo $row3['ann'];?>" name="ann" required >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Exam</label>
    <div class="col-sm-8">
      <input type="number" class="form-control"value="<?php echo $row3['exam'];?>" id="exam"  name="exam" required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Computer</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="comp" name="comp" value="<?php echo $row3['comp'];?>" required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Generator</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="gen" value="<?php echo $row3['gen'];?>"  name="gen"  required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Maint/Med</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="reg" value="<?php echo $row3['reg'];?>" name="reg" required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Others</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" value="<?php echo $row3['other'];?>" id="other"  name="other" required>
    </div>
  </div>
  
			
  
  
  

  
			 </div>
			  <!----dusari row-->
				<div class="col-sm-6">
				    <br/>
				    	<div class="form-group">
				    	    <span style="color:blue">&emsp;Pre Date-<?php echo $row3['date'];?></span>
    <label  class="col-sm-4 control-label ">Date</label>
    <div class="col-sm-8">
        <?php $date12=date("d-m-Y");?>
      <input type="date"  value="<?php echo $date12;?>"  class="form-control" name="date"  required>
    </div>
  </div>
				 
				    
			
  
   
  <div class="form-group">
      <span style="color:blue">&emsp;Pre Fee-<?php echo $row3['fee'];?></span>
    <label  class="col-sm-4 control-label">MonthFee</label>
    <div class="col-sm-8">
  <input type="number" class="form-control" id="fee" value="<?php echo $row3['fee'];?>" name="fees"  readonly required>
      <input type="hidden" class="form-control" id="feess" value="<?php echo $fees;?>" >
    </div>
  </div>
  <div class="form-group">
      <span style="color:blue">&emsp;Pre Conv-<?php echo $row3['van'];?></span>
    <label  class="col-sm-4 control-label">Conveyance</label>
    <div class="col-sm-8">
     <input type="number" class="form-control" id="conv" value="<?php echo $row3['van']?>" name="conv" readonly required>
      <input type="hidden" class="form-control" id="conv123" value="<?php echo $conv;?>" >
    </div>
  </div>
  
  
  <div class="form-group">
      <span style="color:blue">&emsp;Pre Dues-<?php echo $row3['remain'];?></span>
    <label  class="col-sm-4 control-label">PreDues</label>
    <div class="col-sm-8">
      <input type="number" style="color:red" id="dew" name="pre" value="<?php echo $row3 [remain];?>" class="form-control"  required>
    </div>
  </div>
  <div class="form-group">
      <span style="color:blue">&emsp;Pre Month Total-<?php echo $row3['mtotal'];?></span>
    <label  class="col-sm-4 control-label">MonthTotal</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="mtotal"  name="mtotal"  value="<?php echo $row3['mtotal'];?>" style="background-color:#3F729B;color:yellow" title="Please select Month" required>
    </div>
  </div>
  <div class="form-group">
      
     <label  class="col-sm-4 control-label" STYLE="FONT-SIZE:13PX;FONT-WEIGHT:BOLD;color:blue;">GRAND TOTAL</label>
    <div class="col-sm-8">
         
      <input type="number" class="form-control" id="total"  style="font-size:18px;font-weight:bold;color:blue;background-color:#f06292" name="total1" readonly required>
    </div>
  </div>
   <div class="form-group">
    <label  class="col-sm-4 control-label">Consession</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="con" value="<?php echo $row3['con'];?>" name="con" required>
       <input id="remark" class="form-control" style="height:50px" name="remark" value="<?php echo $rowapp['remark'];?>"/>
    </div>
  </div>
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">Paid</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="paid" value="<?php echo $row3['paid'];?>" name="paid" required>
      <input type="hidden" value="<?php echo $row3['paid'];?>" name="paid12">
    </div>
  </div>
 
			<div class="form-group">
    <label  class="col-sm-4 control-label">New Dues</label>
    <div class="col-sm-8">
      <input type="number" style="color:red" class="form-control" id="ndew"  name="due" readonly required>
    </div>
  </div>  	
    	
			

  
				</div>
				
				<!----dusari row-->
				
				
				
				
  <div class="form-group">
    
    <div class="col-sm-5">
      
	   <br/>
				<center><button class="btn btn-primary" id="btn"  >Submit</button>
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	</div>
	
	
	
	<?php
	break;
	
	case 47:
	
	 
	$ch=implode(',',$_POST['choice']);
//	echo $ch;
	$name=$_POST['name'];
	$exam=$_POST['exam'];
	$other=$_POST['other'];
	$scho=$_POST['scho'];
	$ann=$_POST['ann'];
	$paid=$_POST['paid'];
	$add=$_POST['add'];
	$reg=$_POST['reg'];
	$comp=$_POST['comp'];
		$odate=$_POST['odate'];
			$omonth=$_POST['omonth'];
			$opaid=$_POST['opaid'];
			$ototal=$_POST['ototal'];
		$pre=$_POST['pre'];
	$gen=$_POST['gen'];
	$van=$_POST['conv'];
		$paid12=$_POST['paid12'];
	$con=$_POST['con'];
	$idapp=$_POST['idapp'];
		
	$board=$_POST['board'];
	$remain=$_POST['due'];
		$mtotal=$_POST['mtotal'];
		$remark=$_POST['remark'];
	$class=$_POST['class'];
	$month=$_POST['month'];
	$fee=$_POST['fees'];
		$date1=$_POST['date'];
$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
	
	$year=$_POST['year'];
	$total=$_POST['total1'];
	$sel3="select * from studentfees where search='$search' and status='' and year='$year'";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
	$monthc=$row3['month'];
	
	$up="update studentfees set month='$ch',fee='$fee',date='$date1',van='$van',exam='$exam',other='$other',total='$total',remain='$remain',ann='$ann',addm='$add',reg='$reg',comp='$comp',gen='$gen',paid='$paid',con='$con',mtotal='$mtotal',remark='$remark' where id='$idapp'";
	if(mysqli_query($conn,$up))
	{
	    


		$ins12="insert into updatefees(name,class,month,fee,date,year,search,van,exam,other,total,paid,dues,opaid,ototal,odate,omonth) values('$name','$class','$ch','$fee','$edate','$year','$scho','$van','$exam','$other','$total','$paid','$remain','$paid12','$ototal','$odate','$omonth')";
		if(mysqli_query($conn,$ins12))
		{
			echo"Fees update";
		}
	}
	else
	{
		echo"Fees Not update";
	}
	
	
	break;

	/// update data fees
	break;
	
	case 28:
	$date4=$_POST['date1'];
	$date1=date("d-m-Y",strtotime($date4));
//	$date3=$_POST['date2'];
//	$date2=date("d-m-Y",strtotime($date3));
	
  $sel="select * from updatefees where date Like '$date1' order by id desc";
	$res=mysqli_query($conn,$sel);
	$sel1="select * from updatefees where date Like '$date1' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	
	$row1=mysqli_num_rows($res1);
	if($row1!="")
	{
		
	
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Name</th><th>Class</th><th>Old Month</th><th> Change Month</th><th>Old Total Fees</th><th>Change Total Fees</th><th>Old Date</th><th>Change Date</th><th>Delete</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                 <th>Sr.</th><th>Sch No.</th><th>Name</th><th>Class</th><th>Old Month</th><th> Change Month</th><th>Old Total Fees</th><th>Change Total Fees</th><th>Old Date</th><th>Change Date</th><th>Delete</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['search'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['omonth'];?></td><td style="color:red"><?php echo $row['month'];?></td><td><?php echo $row['opaid'];?></td><td style="color:red"><?php echo $row['paid'];?></td><td><?php echo $row['odate'];?></td><td style="color:red"><?php echo $row['date'];?></td>
	<td><a href="javascript:;" onclick="deleterow12(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt>Not Update Fees.</font>";
	}
	break;
	
	
	/////////print student date//////
	case 29:
	
	?>
	

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
                <th style="text-align:center">Sr.</th><th style="text-align:center">Photo</th><th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Fname</th><th style="text-align:center">Mname</th><th style="text-align:center">Session</th><th style="text-align:center">Class</th><th style="text-align:center">Address</th><th style="text-align:center">Mobile</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
  $session=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
  $sel="select * from  registration where session='$session' and subject='$class' and section='$section' and status=''";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
		$b=$row['postoffice'];
	
	$c=$row['dist'];
	$d=$row['mobile'];
	
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['application'];?></td><td><?php echo $row['2']."<br/><b>Dob-</b>".$row['dob'];?></td><td><?php echo $row['fname']."<br/><b>Cate-</b>".$row['caste'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['session']."<br/>".$row['date'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $a."<br>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c;?></td><td><?php echo $row['mobile'];?></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	
		case 2996:
	
	?>
	

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
                <th style="text-align:center">Sr.</th><th style="text-align:center">Photo</th><th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Fname</th><th style="text-align:center">Mname</th><th style="text-align:center">Session</th><th style="text-align:center">Class</th><th style="text-align:center">Address</th><th style="text-align:center">Mobile</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
  $session=$_POST['session'];

  $sel="select * from  registration where session='$session' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
		$b=$row['postoffice'];
	
	$c=$row['dist'];
	$d=$row['mobile'];
	
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['application'];?></td><td><?php echo $row['name']."<br/><b>Dob-</b>".$row['dob'];?></td><td><?php echo $row['fname']."<br/><b>Cate-</b>".$row['caste'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['session']."<br/>".$row['datetime'];?></td><td><?php echo $row['subject'];?>/<?php echo $row['section'];?></td><td><?php echo $a."<br>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c;?></td><td><?php echo $row['mobile'];?></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	
	
	///////all fees print////
	
	
	case 30:
	
	$email=$_POST['email'];
	$sel1="select * from  session   order by id desc ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$session=$row1['session'];
	if($email=='All')
		{
		$sel="select * from  studentfees  where   status='' and id>=499  order by id desc ";
		}
		else
		{
		$sel="select * from  studentfees  where   status='' and id>=499 and email='$email'  order by id desc ";
		}
  
	$res=mysqli_query($conn,$sel);
	
	
	?>
	

	<script>

$(document).ready(function() {
    $('#example').DataTable( {
        fixedHeader: true,
		dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: [
            'pageLength','excel',
			{ extend: 'pdfHtml5', footer: true,
				
                orientation: 'landscape',
                pageSize: 'LEGAL'
			}
			
        ]
		
    } );
} );
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Slip No.</th><th>Scho. No.</th><th>Session</th><th>Month</th><th>Name</th><th>Class</th><th>Paid</th><th>Dues</th><th>Date</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	$s=1;
	$p=0;
		$re=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $p=$row['paid']+$p;
	    $re=$row['remain']+$re;
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['id'];?></td><td><?php echo $row['search'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td style="font-weight:bold"><?php echo $row['paid'];?></td><td><?php echo $row['remain'];?></td><td><?php echo $row['date'];?></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	<tfoot>
            <tr>
                <th>Sr.</th><th>Slip No.</th><th>Scho. No.</th><th>Session</th><th>Month</th><th>Name</th><th>Class</th><th><?php echo $p;?></th><th>Dues By Paid in Time</th><th>Date</th>
            </tr>
        </tfoot>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	
	break;
	
case 31:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  registration where id='$eid' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$d=$a." ".$b." ".$c;
	?>
	
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform" onsubmit="return changerow(this)">
				
			<input type="text" value="<?php echo $row['name'];?>" readonly  class='form-control'/><br/>
			<input type="text" value="<?php echo $row['subject'];?>" readonly class='form-control' />
			<input type="text" value="<?php echo $row['session'];?>" name='oldsession' readonly class='form-control' />
				<div class="form-group">
				<label class="col-sm-3 control-label">New Session</label>
				<div class="col-sm-8">
					<?php 
	$selc="select * from session";
	$resc=mysqli_query($conn,$selc);
	?>
	<select class="form-control" style="font-weight:bold" id="select" name="session" required>
	
	  <option value=''>--Select--</option>
	  <?php 
	  
	  while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option><?php echo $rowc['session'];?></option>
	  <?php
	  }
	  
	  ?>
	  </select>
				
				
				
			
				</div>
				</div>
				<br/>
				<br/>
				
				<div class="form-group">
				<label class="col-sm-3 control-label">New Class</label>
				<div class="col-sm-8">
				<?php 
	$selc="select * from subclass";
	$resc=mysqli_query($conn,$selc);
	?>
				<select class="form-control" style="font-weight:bold" id="select" name="class">
	
	  <option >--Select--</option>
	  <?php 
	  
	  while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option value="<?php echo $rowc['subclass'];?>"><?php echo $rowc['subclass'];?></option>
	  <?php
	  }
	  
	  ?>
	  </select>
				
				
			
				</div>
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">New Section</label>
				<div class="col-sm-8">
					<?php 
	$selc="select * from section";
	$resc=mysqli_query($conn,$selc);
	?>
	<select class="form-control" style="font-weight:bold" id="select" name="section" required>
	
	  <option value=''>--Select--</option>
	  <?php 
	  
	  while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option><?php echo $rowc['section'];?></option>
	  <?php
	  }
	  
	  ?>
	  </select>
				
				
				
			
				</div>
				</div>
				<br/>
				<br/>
	<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
				
				
				<center><button class="btn btn-primary">Trans</button>
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				
				</form>
	</div>
	</div>
	
	
	
	
	
	
	
	
	
	
	<?php
	
	
	
	break;
	
	case 32:
	$id=$_POST['id'];
	$sel="select * from  registration where id='$id' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	// for registration
	
	$name=$row['name'];
$code=$row['code'];
$adhar=$row['adhar'];
$mediam=$row['mediam'];
$caste=$row['caste'];
$minority=$row['minority'];
//echo"$name";
//echo"<br/>";
$father=$row['fname'];
//echo"$father";
$mother=$row['mname'];
//echo"$mother";
//echo"<br/>";
$app=$row['application'];
//echo"$app";
//echo"<br/>";

$gender=$row['gender'];
$session=$_POST['session'];
$oldsession=$row['session'];
 $oldsubject=$row['subject'];
//echo"$gender";
$dob=$row['dob'];
//echo"$dob";

//echo"$class";

//echo"$mother";


//echo"$high1";


$subject=$_POST['class'];
$section=$_POST['section'];
//echo"$inter1";

//echo"$grade";
$newimgname=$row['picture'];
$city=$row['city'];
//echo"$city";
$city1=$row['city1'];
//echo"$city";
$village=$row['village'];
//echo"$village";
$village1=$row['village1'];
//echo"$village1";
$postoffice=$row['postoffice'];
//echo"$postoffice";
$postoffice1=$row['postoffice1'];
//echo"$postoffice1";
$dist=$row['dist'];
//echo"$dist";
$dist1=$row['dist1'];
//echo"$dist1";
$state=$row['state'];
//echo"$state";
$state1=$row['state1'];
//echo"$state1";
$mobile=$row['mobile'];
//echo"$mobile";
$mobile1=$row['mobile1'];
//echo"$mobile1";
$pincode=$row['pincode'];
//echo"$pincode";
$pincode1=$row['pincode1'];
	// for registration
	///
	
	$whatsapp=$row['whatsapp'];
	
	
	
	
	$date=date("d-m-Y");
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
	$datetime=$date." ".$time;
	
				$sel12="select * from registration where application='$app' and  session='$session' and status=''";
				$res12=mysqli_query($conn,$sel12);
				$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
				$app12=$row12['application'];
				if(!$row12)
				{
	
	$ins="insert into  registration(application,name,fname,	mname,dob,gender,class,ele,board,year,total,obtain,per,grade,subject,city,village,postoffice,dist,state,mobile,pincode,picture,city1,village1,postoffice1,dist1, state1,mobile1,pincode1,session,mediam,adhar,datetime,minority,caste,code,last,whatsapp,action,action1,trans,tra,status,section) values('$app','$name','$father','$mother','$dob','$gender','$class','$ele','$board','$year','$tmark','$omark','$per','$grade','$subject','$city','$village','$postoffice','$dist','$state','$mobile','$pincode','$newimgname','$city1','$village1','$postoffice1','$dist1','$state1','$mobile1','$pincode1','$session','$mediam','$adhar','$datetime','$minority','$caste','$code','$last','$whatsapp','','','','','','$section')";
			
	if(mysqli_query($conn,$ins))
				{
					$new=$subject.' '.$section;
					$up="update registration set trans='$new' where id='$id'";
					if(mysqli_query($conn,$up))
					{
					    echo "Transfered";
					}
				}
				
				else
				{
					echo"not";
				}
				}
				else
				{
				    echo"Allready Transfer in session";
				}
	break;
	
	case 34:
	$application=$_REQUEST['application'];
	//echo $application;
	?>
		<h3>Long Slip Print</h3>
	<form action="slip.php" method="post">

	
	
	
	
	<input type="date"  required name='date'>
	<input type="hidden" value="<?php echo $application;?>" name="app">
	<input type="hidden" value="<?php echo '1';?>" name="no">
	<button >Go</button>
	
	&emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
	</form>
	<h3 style="color:green"></h3>
	<br/>
	<form action="slip.php" method="post">
	<input type="hidden" value="<?php echo $application;?>" name="app">
	<?php $date=date("d-m-Y");?>
	<input type="hidden" value="<?php echo $date;?>" name="date">
	<input type="hidden" value="<?php echo '2';?>" name="no">
	
	</form>

	
	
	<?php 
	
	
	
	
	break;
	case 36:
	$session=$_POST['session'];
  $sel1="select * from  registration where session ='$session' and status='' order by application asc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	
<link href="jq/jquery.dataTables.min.css" type="text/css" rel="stylesheet"/>
<link href="jq/buttons.dataTables.min.css" type="text/css" rel="stylesheet"/>


<script src="jq/jquery.dataTables.min.js"></script>
<script src="jq/dataTables.buttons.min.js"></script>
<script src="jq/buttons.flash.min.js"></script>
<script src="jq/jszip.min.js"></script>
<script src="jq/pdfmake.min.js"></script>
<script src="jq/vfs_fonts.js"></script>
<script src="jq/buttons.html5.min.js"></script>
<script src="jq/buttons.print.min.js"></script>

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr align="center">
               <th style="text-align:center">Sr.</th><th  style="text-align:center">Sch No .</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Session</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr tr align="center">
                <th style="text-align:center">Sr.</th><th  style="text-align:center">Sch No .</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Session</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
  $sel="select * from  registration where session ='$session' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject'];?>/<?php echo $row['section'];?></td><td><?php echo $row['session']."<br/>".$row['datetime'];?></td>
	
	<td>
	
	<a href="javascript:;" onclick="feesrow(<?php echo $row['id'];?>)"> <span class=""><button type="button" class="btn btn-primary">Fees</button></span></a>
&nbsp;
<a href="javascript:;" onclick="app1234(<?php echo $row['id'];?>)"><span> <button type="button" class="btn btn-info">Fees Details</button></span></a><BR/><br/>

<a href="javascript:;" onclick="dues123(<?php echo $row['application'];?>)"><span><button type="button" class="btn btn-warning">Dues Paid</button></span></a><br/><br/>
<a href="javascript:;" onclick="no123(<?php echo $row['id'];?>)"><span><button type="button" class="btn btn-warning">Noti_add</button></span></a>
<a href="javascript:;" onclick="no1234(<?php echo $row['id'];?>)"><span> <button type="button" class="btn btn-info">Noti Details</button></span></a>


	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 37:
	$id=$_POST['rowid'];
	
	
	$del="delete from updatefees where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
		
	}
	else
	{
		echo"Not Deleted";
	}
	break;
	
	case 38:
	$year=$_POST['year'];
//	$class=$_POST['class'];
  $sel="select * from  studentfees where year='$year'  and status=''  order by date desc ";
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  studentfees  where year='$year' and status=''  ";
	$res1=mysqli_query($conn,$sel1);
	$row2=mysqli_num_rows($res1);
	if($row2!=" ")
	{
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Slip No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Tution Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Misc.</th><th>Paid</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>DateTime</th><th>Delete</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th>Sr.</th><th>Sch No.</th><th>Slip No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Tution Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Misc.</th><th>Paid</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>DateTime</th><th>Delete</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['search'];?></td><td><?php echo $row['id'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['fee'];?></td><td><?php echo $row['ann'];?></td><td><?php echo $row['exam'];?></td><td><?php echo $row['van'];?></td><td><?php echo $row['addm'];?></td><td><?php echo $row['paid'];?></td><td><?php echo $row['remain'];?></td><td><?php echo $row['other'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['date'];?></td>
	
	
	<td><a href="javascript:;" onclick="deleterow13(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt>Not Record Available.</font>";
	}
	break;

	break;
	case 41:
	$month=$_POST['month'];
	
  $sel1="select * from  studentfees    where month ='$month' and status=''";
	$res1=mysqli_query($conn,$sel1);
	$paid1="";
	$dues1="";
	$con1="";
	while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
		
	{
		$paid=$row1['paid'];
		$cons=$row1['con'];
		$remain=$row1['remain'];
		$paid1=$paid+$paid1;
		$con1=$cons+$con1;
		$dues1=$remain+$dues1;
	}
	?>
	<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
	<tr align="center">
	<th style="text-align:center">Paid</th><th style="text-align:center">Dues</th><th style="text-align:center">Consession</th>
	</tr>
	<tr>
	
	<td style="text-align:center"><?php echo $paid1;?></td><td style="text-align:center"><?php echo $dues1;?></td><td style="text-align:center"><?php echo $con1;?></td>
	
	</tr>
	</table>
	
	<?php
	
	break;
	case 42:
	?>
	
<script>

$("document").ready(function(){
		
		$("#cons").keyup(function(){
		  
			var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
			// alert(paid1);
		});
		
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#ndew").focus(function(){
		   // alert('ok');
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
		
	
		
		
	});
	

	$("document").ready(function(){
		
		$("#paid12").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#paid12").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
		$("document").ready(function(){
		
		$("#other1").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
	
	
	</script>
	<?php
	$sch=$_REQUEST['application'];
	$application=$sch;
	//echo"$eid";
	$sel="select * from  studentfees where search='$sch' and status=''  order by id desc";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$paid12=$row['paid'];
		$year=$row['year'];
		$session=$year;
	
	/////////
		$sel1="select * from  registration where application='$sch' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	?>
	<div class="table-responsive">

       <center><h2 class="modal-title" style="color:green;background-color:yellow"> DUES PAID (<?php echo $year;?>) </h2> </center>
            
      
		<tbody>
		<form onsubmit="return feesupdate(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Sch.</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $sch;?>" name="search" id='search' readonly style="background-color:yellow;color:green"/></div>
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
				<input type="hidden" value="<?php echo $row['paid'];?>" name="paid13"/>
				<input type="hidden" value="<?php echo $row1['subject'];?>" name="class"/>
				<input type="hidden" value="<?php echo $row1['session'];?>" name="year"/>
					<input type="hidden" value="<?php echo rand(10000,500000);?>" name="pr" id="pr"/>
					<input type="hidden" value="<?php echo $row1['mediam'];?>" name="mediam"/>
					<input type="hidden" value="0" name="to"/>
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Name</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $row['name'];?>" name="name" readonly style="background-color:gray;color:pink" /></div>
				
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Dues</label>
				<div class="col-sm-3"><input type="number" value="<?php echo $row['remain'];?>"  name="dew" id="dew" readonly style="background-color:white;color:red"/></div>
				
				</div>
				
		<div class="form-group">
				<label class="col-sm-3 control-label">Paid</label>
				<div class="col-sm-3"><input type="number"   name="paid"  value="0" id="paid12" required /></div>
				
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Concession</label>
				<div class="col-sm-3"><input type="number"   value="0"id="cons" name="cons" required /></div>
				
				</div>
			
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Remark</label>
				<div class="col-sm-3"><input type="text"    id="remark" name="remark"  /></div>
				
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Other</label>
				<div class="col-sm-3"><input type="number"   name="other"  value="0" id="other1" required /></div>
				
				</div>
				<br/>
			
				<div class="form-group">
				<label class="col-sm-3 control-label">Other Remark</label>
				<div class="col-sm-3"><input type="text"    id="remark" name="other_remark"  /></div>
				
				</div>
				<div class="form-group">
				<label class="col-sm-3 control-label">Paid Mode</label>
				<div class="col-sm-3"><select class='form-control' name='mode'><option>Cash</option><option>UPI</option><option>CHECK</option><option>BANK</option></select></div>
				
				</div>
				
		<br/>
					<div class="form-group" >
				<label class="col-sm-3 control-label">New Dues</label>
				<div class="col-sm-3"><input type="number"  id="ndew12"  required readonly /></div>
				
				</div>
			<br/>
				<div class="form-group">
				<?php 
				
				date_default_timezone_set("asia/kolkata");
				
				$date1=date('Y-m-d');?>
				<div class="col-sm-3"><input type="hidden" value="<?php echo $date1;?>" name="date"  required /></div>
				
				</div>
		<center><button class="btn btn-danger" id='btn' >Paid</button></center>
		
		</form>
		
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
	case 43:

	$id=$_POST['id'];
	$name=$_POST['name'];
		$board=$_POST['mediam'];
//	echo $name;
	$class=$_POST['class'];
//	echo $class;
	$date1=$_POST['date'];
	
	$year=$_POST['year'];
	$cons=$_POST['cons'];
		$remark=$_POST['remark'];
//	echo $year;
	$dew=$_POST['dew'];
		$to1=$_POST['to'];
//	echo $dew;
	$date=date("d-m-Y",strtotime($date1));
//	echo $date;
	//echo $id;
	$search=$_POST['search'];
//	echo $search;
	$paid13=$_POST['paid13'];
	//echo $search;
	$paid=$_POST['paid'];
	$mode=$_POST['mode'];
		$pr=$_POST['pr'];
	echo $paid;
	$other=$_POST['other'];
	$other_remark=$_POST['other_remark'];
	//echo $paid;
//	$ndew=$_POST['ndew'];
//	echo $ndew;
	$paid8=$paid+$paid13;
$amou=$paid+$cons;
	
	$b='0';
	$total=$dew+$other;
	$re=$total-$amou;
	//echo"$eid";
	$sel15="select * from  studentfees where  status='Not' and search='$search' order by id desc";
	$res15=mysqli_query($conn,$sel15);
	$row15=mysqli_fetch_array($res15,MYSQLI_BOTH);
	if($row15)
	{echo 'Please Fees Aproved From Admin';}
	else
	{
	if($user_login=='Cashier')
	{
if($cons<=500)
{
        $sel1="select * from  studentfees where pr='$pr' and status='' order by id desc";
        $res1=mysqli_query($conn,$sel1);
        $row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
        if($row1)
        {
        echo " Dues Paid Allready";
        }
        else
        {
            $ins="insert into studentfees(name,class,search,month,paid,remain,pre,date,year,exam,other,ann,addm,reg,comp,gen,board,con,remark,to1,fee,van,total,mtotal,reg1,fine,dpaid,status,mode,pr,other_remark,email) values('$name','$class','$search','Dues','$paid','$re','$dew','$date1','$year','0','$other','0','0','0','0','0','$board','$cons','$remark','$to1','0','0','$total','0','0','0','0','','$mode','$pr','$other_remark','$email')";
            
            if($res=mysqli_query($conn,$ins))
            {
            echo "Dues Paid";
            }
            else
            {
            echo "not update";
            }
        }
}
else
{
         $ins="insert into studentfees(name,class,search,month,paid,remain,pre,date,year,exam,other,ann,addm,reg,comp,gen,board,con,remark,to1,fee,van,total,mtotal,reg1,fine,dpaid,status,mode,pr,other_remark,email) values('$name','$class','$search','Dues','$paid','$re','$dew','$date1','$year','0','$other','0','0','0','0','0','$board','$cons','$remark','$to1','0','0','$total','0','0','0','0','Not','$mode','$pr','$other_remark','$email')";
            
            if($res=mysqli_query($conn,$ins))
            {
            echo "Dues Paid Please Approved From Admin Fees";
            }
            else
            {
            echo "not update";
            }
}
	}
	else
	{
	    	$sel1="select * from  studentfees where pr='$pr' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	if($row1)
	{
	    echo " Dues Paid Allready";
	}
	else
	{
		$ins="insert into studentfees(name,class,search,month,paid,remain,pre,date,year,exam,other,ann,addm,reg,comp,gen,board,con,remark,to1,fee,van,total,mtotal,reg1,fine,dpaid,status,mode,pr,other_remark,email) values('$name','$class','$search','Dues','$paid','$re','$dew','$date1','$year','0','$other','0','0','0','0','0','$board','$cons','$remark','$to1','0','0','$total','0','0','0','0','','$mode','$pr','$other_remark','$email')";
	
	if($res=mysqli_query($conn,$ins))
	{
		echo "Dues Paid";
	}
	else
	{
		echo "not update";
	}
	}
	}
}
	break;
	case 50:
	    $session=$_POST['session'];
	
  $sel1="select * from message1 where session='$session' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr tr align="center">
                <th style="text-align:center">Sr.</th><th  style="text-align:center">Message</th><th  style="text-align:center">Date</th><th  style="text-align:center">Delete</th>
            </tr>
        </thead>
<tfoot>
            <tr tr align="center">
                <th style="text-align:center">Sr.</th><th  style="text-align:center">Message</th><th  style="text-align:center">Date</th><th  style="text-align:center">Delete</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
  $sel="select * from  message1 where session='$session' order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><textarea cols="45" rows='5' style="" readonly><?php echo $row['message'];?></textarea></td><td><?php echo $row['date'];?></td>
	
	<td>
	
	
<a href="del12.php?flag=<?php echo $row['id'];?>"><span><button type="button" class="btn btn-danger">Delete</button></span></a>


	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	
	break;
case 51:
	$id=$_POST['rowid'];
	
	$del="delete from message1 where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
		
	}
	else
	{
		echo"Not Deleted";
	}
	break;
	case 52:
	$session=$_POST['session'];
	$month=$_POST['month'];
	echo $month;
  $sel="select  registration.name,registration.fname,registration.mname,registration.subject,registration.application,studentfees.remain,studentfees.month  from registration LEFT JOIN  studentfees on registration.application=studentfees.search  where registration.session='2018-2019' and month not like '%$month' order by studentfees.id desc ";
	$res=mysqli_query($conn,$sel);
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Name</th><th>fname</th><th>mname</th><th>subject</th><th>Amount</th>
            </tr>
        </thead>
<tfoot>
            <tr>
     <th>Sr.</th><th>Sch No.</th><th>Name</th><th>fname</th><th>mname</th><th>subject</th><th>Amount</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $row['remain'];?></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	
	break;
	case 61:
	//$ch=$_POST['choice'];
	//echo $ch;
	$session=$_POST['session'];
  $sel1="SELECT DISTINCT name,search,class FROM studentfees where year='$session' order by id desc ";
	$res1=mysqli_query($conn,$sel1);
	
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy',  'excel', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month</th><th  style="text-align:center">Dues</th>
            </tr>
        </thead>
<tfoot>
            <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month </th><th  style="text-align:center">Dues</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
  
	$s=1;
	while($row=mysqli_fetch_array($res1,MYSQLI_BOTH))
		
	{
		$search=$row['search'];
		$mon='';
		$paidt=0;
	$sel2="select * from studentfees where search='$search' and year='$session'and status=''  order by id desc ";
	$res2=mysqli_query($conn,$sel2);
	while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
	{
		$mon=$row2['month'].','.$mon;
		$paidt=$row2['paid']+$paidt;
		//echo $mon;
	
	}
	$sel13="select DISTINCT * from registration where application= '$search' and session='$session' and status='' ";
	$res13=mysqli_query($conn,$sel13);
	$row13=mysqli_fetch_array($res13,MYSQLI_BOTH);
	
	//// for dues
	$sel14="select  * from studentfees where search= '$search'and year='$session' and status='' order by id desc ";
	$res14=mysqli_query($conn,$sel14);
	$row14=mysqli_fetch_array($res14,MYSQLI_BOTH);
	
		?>
		 
	<tr class="text-center">
<td><?php echo $row['search'] ;?></td><td><?php echo $row['name'];?></td><td><?php echo $row13['fname'];?></td><td><?php echo $row['class'];?></td><td><?php echo $mon;?></td><td><?php echo $row14['remain'];?></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	<?php
	
	?>
	
	</div>
	
	<?php
	
	break;
	case 63:
	$class=$_POST['class'];
	$session=$_POST['session'];
	
	$selm="SELECT *  FROM studentfees where class= '$class' and year='$session' and status='' order by id desc ";
	$resm=mysqli_query($conn,$selm);
	$seln="SELECT *  FROM studentfees where class= '$class' and year='$session' and status='' order by id desc ";
	$resn=mysqli_query($conn,$seln);
	$paidm1=0;
	$paidm1=0;
	$cons1=0;
	while($rowm=mysqli_fetch_array($resm,MYSQLI_BOTH))
	{
		$paidm=$rowm['paid'];
		$paidm1=$paidm1+$paidm;
			$cons1=$rowm['con']+$cons1;
		//echo $paidm;
	}
	//echo $paidm1;
	//echo $ch;
  $sel1="SELECT DISTINCT name,search,class FROM studentfees where class= '$class' and year='$session' and status='' order by id desc ";
	$res1=mysqli_query($conn,$sel1);
	
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy',  'excel', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month</th><th  style="text-align:center">Total Paid</th><th  style="text-align:center">Dues</th><th  style="text-align:center">Cons</th>
            </tr>
        </thead>
<tfoot>
            <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month </th><th  style="text-align:center">Total Paid</th><th  style="text-align:center">Dues</th><th  style="text-align:center">Cons</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $due=0;
  
	$s=1;
	while($row=mysqli_fetch_array($res1,MYSQLI_BOTH))
		
	{
		$search=$row['search'];
		/////////paid total////////
		$mon='';
		$paidt=0;
		$cons=0;
		
	$sel2="select * from studentfees where search='$search'and year='$session' and status='' order by id desc ";
	$res2=mysqli_query($conn,$sel2);
	while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
	{
		$mon=$row2['month'].','.$mon;
		$paidt=$row2['paid']+$paidt;
		$cons=$row2['con']+$cons;
	
		
		//echo $mon;
	
	}
	/////////paid total////////
	
	
	/////////dues total////////
		
		
		
	$sel23="select * from studentfees where search='$search'  and year='$session' and status='' order by id desc limit 1 ";
	$res23=mysqli_query($conn,$sel23);
	while($row23=mysqli_fetch_array($res23,MYSQLI_BOTH))
	{
		$due1=$row23['remain'];
		$due=$row23['remain']+$due;
		
		
		//echo $due1;
		//echo $due;
	
	}
	/////////paid total////////
	$sel13="select DISTINCT * from registration where application= '$search'and session='$session' and status='' ";
	$res13=mysqli_query($conn,$sel13);
	$row13=mysqli_fetch_array($res13,MYSQLI_BOTH);
	
	//// for dues
	$sel14="select  * from studentfees where search= '$search' and year='$session' and status='' order by id desc ";
	$res14=mysqli_query($conn,$sel14);
	$row14=mysqli_fetch_array($res14,MYSQLI_BOTH);
	
		?>
		 
	<tr class="text-center">
<td><?php echo $row['search'] ;?></td><td><?php echo $row['name'];?></td><td><?php echo $row13['fname'];?></td><td><?php echo $row['class'];?></td><td><textarea rows="4" cols="26"><?php echo $mon;?></textarea></td><td><?php echo $paidt;?></td><td><?php echo $row14['remain'];?></td><td><?php echo $cons;?></td>
	
	
	</tr>
	
	<?php
	$s++;
	}
	?>
	<tr class="text-center">
<td colspan="5"><b>Total</b></td><td><b><?php echo $paidm1;?></b></td><td><b><?php echo $due; ?></b></td><td><b><?php echo $cons1; ?></b></td>
	
	
	</tr>
	 </tbody>
    </table>
	<?php
	
	?>
	
	</div>
	
	<?php
	
	break;
	case 68:
	$year=$_POST['year'];
	$class=$_POST['class'];
  $sel="select * from  studentfees where year='$year' and class='$class'  and status=''order by id asc ";
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  studentfees where year='$year' and class='$class' and status='' ";
	$res1=mysqli_query($conn,$sel1);
	$row2=mysqli_num_rows($res1);
	if($row2!=" ")
	{
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Month Fee</th><th> Total</th><th>DateTime</th><th>Edit</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                 <th>Sr.</th><th>Sch No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Month Fee</th><th> Total</th><th>DateTime</th><th>Edit</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['search'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['fee'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['date'];?></td>
	
	
	<td><a href="javascript:;" onclick="edit13(<?php echo $row['id'];?>)"><span class="">Edit</span></a></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt>Not Record Available.</font>";
	}
	break;
		case 69:
	$id=$_REQUEST['id'];
	//echo $application;
	$sel="select * from  studentfees where id='$id' and status='' ";
	$res=mysqli_query($conn,$sel);
	?>
	<form onsubmit="return updaterow(this)">

	
	
	
	
	<input type="date"  required name='date'>
		<input type="hidden" value='<?php echo $id;?>' required name='id'>
	
	<button >Change</button>
	
	&emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
	</form>

	<?php 
	
	
	
	
	break;
	
		case 70:
	$date=$_POST['date'];
	$id=$_POST['id'];
	//echo $application;
	$up="update studentfees set date='$date' where id='$id' and status='' ";
	$res=mysqli_query($conn,$up);
	if($res)
	{
	    echo 'change';
	}
	else
	{
	    echo 'not ';
	}



	
	
	
	
	break;
	
	///// for fees details 
	case 71:
	$id=$_REQUEST['id'];
	$selr="select * from  registration where id ='$id'";
$resr=mysqli_query($conn,$selr);
$rowr=mysqli_fetch_array($resr,MYSQLI_BOTH);
$sessionr=$rowr['session'];
//echo $sessionr;
$applicationr=$rowr['application'];

$sel1="select * from  studentfees where search ='$applicationr' and year='$sessionr' and status=''";
$res1=mysqli_query($conn,$sel1);
$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
//$search=$row1['search'];
$sel="select * from  registration where application ='$applicationr' and session='$sessionr' and status=''";
$res=mysqli_query($conn,$sel);
$row=mysqli_fetch_array($res,MYSQLI_BOTH);


$selb="select * from  registration where application ='$applicationr' and session='sessionr' and status='' order by id desc";
$resb=mysqli_query($conn,$selb);
$rowb=mysqli_fetch_array($resb,MYSQLI_BOTH);

$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'  >
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="70px" width="70px"/></span></td><td align="center"><span id="name"  style="font-size:20px;font-weight:bold">PACIFIC PUBLIC SCHOOL </span><br/>Semra No.1 , Chargawan-Gorakhpur<br/><span id="name1" style="font-size:18px;font-weight:bold"></span></td><td style="font-size:14px"><b>Contact-</b>7376598752<br/>9451960467 </td>
</tr>
</table>
<table border="1px;" width="100%" cellspacing="0">
<caption style="font-size:18px;font-weight:bold">Fees Statement <?php echo $row1['year'];?></caption>
<tr>
<td width="30%"><span id="name2">Scho. Number</span></td><td><span id="name3"><?php echo $row1['search'];?></span></td><td><b>Class</b></td><td><?php echo $row['subject'];?></td><td width="10%"align="right" rowspan="3"><span><img src="../code/img/<?php echo $row['picture'];?>" style="width:100%;" class="img-responsive" ></span></td>
</tr>
<tr>
<td width="30%"><span id="name2">Student Name</span></td><td width="" colspan="3"><span id="name3"><?php echo $row['name'];?></span></td>
</tr>
<tr>
<td width="30%"><span id="name2"> Father Name</span></td><td colspan="3"><span id="name3"><?php echo $row['fname'];?></span></td>
</tr>


</table>
<div class="table-responsive">
<table border="1px" width="100%" cellspacing="0px" >
<tr>
<td colspan='15' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Fees Receipt</span></td>

</tr>
<tr align="center">

<td><span id="name2">Sr.</span></td>
<td><span id="name2">Month</span></td>
<td><span id="name2" >Tution Fee</span></td>
<td><span id="name2" >Exam</span></td>
<td><span id="name2">Conv</span></td>

<td><span id="name2">Main</span></td>
<td><span id="name2">Miscellaneous</span></td>
<td><span id="name2">Reg</span></td>
<td><span id="name2">Comp</span></td>
<td><span id="name2">Gene</span></td>
<td><span id="name2">Ann</span></td>

<td><span id="name2">Other</span></td>
<td><span id="name2">Other Remark</span></td>
<td><span id="name2">Con</span></td>
<td><span id="name2">Cons Remark</span></td>
<td><span id="name2">Pre Dues</span></td>

<td><span id="name2">Paid</span></td>

<td><span id="name2">Dues</span></td>

<td><span id="name2">Date</span></td>
<td><span id="name2">Print</span></td>

</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;


$sel2="select * from  studentfees where search='$applicationr' and year='$sessionr' and status=''";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	$tot=$row2['total'];
	$paid13=$row2['paid'];
	
	$remain12=$row2['remain'];
	$sum=$tot+$sum;
	$sum1=$paid13+$sum1;
	$remain1=$remain12+$remain1;
?>
<tr align="center">

<td><span id="name3"><?php echo $row2['id'];?></span></td>
<td><span id="name3"><?php echo $row2['month'];?></span></td>
<td><span id="name3"><?php echo $row2['fee'];?></span></td>
<td><span id="name3"><?php echo $row2['exam'];?></span></td>
<td><span id="name3"><?php echo $row2['van'];?></span></td>

<td><span id="name3"><?php echo $row2['reg'];?></span></td>
<td><span id="name3"><?php echo $row2['addm'];?></span></td>
<td><span id="name3"><?php echo $row2['reg1'];?></span></td>
<td><span id="name3"><?php echo $row2['comp'];?></span></td>
<td><span id="name3"><?php echo $row2['gen'];?></span></td>
<td><span id="name3"><?php echo $row2['ann'];?></span></td>

<td><span id="name3"><?php echo $row2['other'];?></span></td>
<td><span id="name3"><?php echo $row2['other_remark'];?></span></td>
<td><span id="name3"><?php echo $row2['con'];?></span></td>
<td ><span id="name3"><?php echo $row2['remark'];?></span></td>
<td><span id="name3"><?php echo $row2['pre'];?></span></td>

<td><span id="name3"><?php echo $row2['paid'];?></span></td>

<td><span id="name3"><?php echo $row2['remain'];?></span></td>
<?php $daten=$row2['date'];
$date1=date("d-m-Y",strtotime($daten));  ?>
<td><span id="name3"><?php echo $date1;?></span></td>
<td><span id="name3"><a href="slip.php?flag=<?php echo $row2['id'];?>" target="_blank"><span class="fa fa-print"></span></a></span></td>

</tr>


<?php
}
?>
<tr align="center">

<td colspan="16" style="font-weight:bold;font-size:19px">Sub Total</td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2"><?php echo $sum1;?></span></td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2">
    <?php
    $sel23="select * from  studentfees where search='$applicationr' and year='$sessionr' and status='' order by id desc";
$res23=mysqli_query($conn,$sel23);
$row23=mysqli_fetch_array($res23,MYSQLI_BOTH);
	$remain23=$row23['remain'];
    
    
    echo $remain12;?></span></td>

</tr>
</table>
</div>
<table width="100%" frame="border" cellspacing="0">
<tr align="center">
<td width="50%"  align="left"><span id="name3" style="font-size:15px;font-weight:bold">Datetime</span></td>
</tr>
<tr>
<td  width="70%" align="left"><span ><?php echo $datetime;?></span></td><td><br/><br/></td><td width="50%" align="right"><span id="name3" style="font-size:15px;font-weight:bold" align="rightt">Sign Of Received Staff</span></td>
</tr>
</table>
</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
	
	case 72:
	   
	$search=$_REQUEST['app'];
	
include("../link/databaseconnection.php");
$sel4="select * from  registration where application ='$search' and status='' order by id desc";
$res4=mysqli_query($conn,$sel4);
$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
$sel12="select * from  studentfees where search ='$search' and status='' order by id desc";
$res12=mysqli_query($conn,$sel12);
$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
$search=$row12['search'];
$idd=$row12['id'];
$id12=$idd-1;
//echo $id12;
$date20=date("d-m-Y",strtotime($row12['date']));
$sel121="select * from  studentfees where search ='$search' and status='' and id='$idd' ";
$res121=mysqli_query($conn,$sel121);
$row121=mysqli_fetch_array($res121,MYSQLI_BOTH);

$date12=date("d-m-Y");
$sel1="select * from  studentfees where search ='$search' and status=''";
$res1=mysqli_query($conn,$sel1);

$sel10="select * from  studentfees where search ='$search' and status='' order by id desc ";
$res10=mysqli_query($conn,$sel10);
$row10=mysqli_fetch_array($res10,MYSQLI_BOTH);

$selde="select * from  studentfees where search ='$search' and status='' order by id desc limit 2  ";
$resde=mysqli_query($conn,$selde);
$rowde=mysqli_fetch_array($resde,MYSQLI_BOTH);
$idd=$rowde['id'];

//echo $idd;
$selmo="select * from  studentfees where search ='$search' and status='' order by id desc ";
$resmo=mysqli_query($conn,$selmo);
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");

$month12='';
$rowmo=mysqli_fetch_array($resmo,MYSQLI_BOTH);

	 $month12=$rowmo['month'];
	 //$month12=$month13.",".$month12;




//echo $date;

//echo"$app1";
?>

<html>
<head>
<style>
#name2
{
	
}
body{
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
   
    @media print
   {
       print-color-adjust: exact;
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  }
</style>

<script>

$(document).ready(function(){
//alert('Thanks For Print');
var divToPrint=document.getElementById('DivIdToPrint12');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();
$("#editmodel12111").modal("hide");
	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_details1.php';
		
	});
		function myFunction() 
{

}
});

</script>

<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>

    <script>
        
        $(document).ready(function(){
	
	var p=$("#pay").val();
	
});
    </script>
     <?php
  /**
   * Created by PhpStorm.
   * User: sakthikarthi
   * Date: 9/22/14
   * Time: 11:26 AM
   * Converting Currency Numbers to words currency format
   */
  
$number = $row10['paid'];
   $no = round($number);
   $point = round($number - $no, 2) * 100;
   $hundred = null;
   $digits_1 = strlen($no);
   $i = 0;
   $str = array();
   $words = array('0' => '', '1' => 'One', '2' => 'Two',
    '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
    '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
    '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
    '13' => 'Thirteen', '14' => 'Fourteen',
    '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
    '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
    '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
    '60' => 'Sixty', '70' => 'Seventy',
    '80' => 'Eighty', '90' => 'Ninety');
   $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
   while ($i < $digits_1) {
     $divider = ($i == 2) ? 10 : 100;
     $number = floor($no % $divider);
     $no = floor($no / $divider);
     $i += ($divider == 10) ? 1 : 2;
     if ($number) {
        $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
        $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
        $str [] = ($number < 21) ? $words[$number] .
            " " . $digits[$counter] . $plural . " " . $hundred
            :
            $words[floor($number / 10) * 10]
            . " " . $words[$number % 10] . " "
            . $digits[$counter] . $plural . " " . $hundred;
     } else $str[] = null;
  }
  $str = array_reverse($str);
  $result = implode('', $str);
  $points = ($point) ?
    "." . $words[$point / 10] . " " . 
          $words[$point = $point % 10] : '';
  
 ?> 

 <script>
function getIndianCurrency(float $number)
{
    $decimal = round($number - ($no = floor($number)), 2) * 100;
    $hundred = null;
    $digits_length = strlen($no);
    $i = 0;
    $str = array();
    $words = array(0 => '', 1 => 'one', 2 => 'two',
        3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
        7 => 'seven', 8 => 'eight', 9 => 'nine',
        10 => 'ten', 11 => 'eleven', 12 => 'twelve',
        13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
        16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
        19 => 'nineteen', 20 => 'twenty', 30 => 'thirty',
        40 => 'forty', 50 => 'fifty', 60 => 'sixty',
        70 => 'seventy', 80 => 'eighty', 90 => 'ninety');
    $digits = array('', 'hundred','thousand','lakh', 'crore');
    while( $i < $digits_length ) {
        $divider = ($i == 2) ? 10 : 100;
        $number = floor($no % $divider);
        $no = floor($no / $divider);
        $i += $divider == 10 ? 1 : 2;
        if ($number) {
            $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
            $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
            $str [] = ($number < 21) ? $words[$number].' '. $digits[$counter]. $plural.' '.$hundred:$words[floor($number / 10) * 10].' '.$words[$number % 10]. ' '.$digits[$counter].$plural.' '.$hundred;
        } else $str[] = null;
    }
    $Rupees = implode('', array_reverse($str));
    $paise = ($decimal) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
    return ($Rupees ? $Rupees . 'Rupees ' : '') . $paise .;
}
</script>
<div id='DivIdToPrint12'>
<style>
.a{
width:46%;
float:left;
}
@media print
   {
      .a{width:46%;}
	  .ab{width:5%;}
	  .sd{font-size:11px;}
	  #name7{font-size:10px;}
	  
	  }
      
   
   @media print
   {
      
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  }
      
   body{
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
   
    @media print
   {
       print-color-adjust: exact;
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  }
   
</style>
<div style="border:1px solid" class="a">
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="50px" width="50px"/></span></td><td align="left"><span id="name"  style="font-size:13px;text-align:left;font-weight:bold">PACIFIC PUBLIC SCHOOL</span><br/><span style='font-size:12px'>THE LAND OF WISDOM</span><br/><span style='font-size:10px'>Semra No. 1 Chargawan Gorakhpur, [Uttar Prades]-273013 </span></td><td style=' border-left: double;'><div style='margin-left:5px'><span style='font-size:10px;'>Registration/Affilatio No.</span><br/><span style='font-size:11px;'>AFFL NO-C/80/2014</span><br/><span style='font-size:10px'><i class="fa fa-phone-square"></i> 7376598752<br/><i class="fa fa-envelope"></i> spacificpublic@gmail.com</span></div></td>
</tr>
</table>
<table border="1px;"  width="100%"cellspacing="0" >
	<tr style='background-color:gray'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:white'>Fee Receipt</span></td><td colspan="2"><span  style="font-size:11px;color:white">Session : <?php echo $row12['year'];?></span></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:black'> Receipt No: <?php echo $row10['id'];?></span></td><td colspan="2"><span  style="font-size:11px;color:black">Date : <?php echo $date20;?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Scho. Number</span></td><td colspan="2"><span  style="font-size:11px"><?php echo $row12['search'];?></span></td><td align="center" rowspan="2"><span><img src="../code/img/<?php echo $row4['picture'];?>"  style="width:50px;height:50px" class="img-responsive" ></span></td>
</tr>
<tr>
    
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Student Name</span></td><td colspan='2'><span  style="font-size:11px"><?php echo $row4['name'];?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold"> Father Name</span></td><td><span  style="font-size:11px"><?php echo $row4['fname'];?></span></td><td style="font-size:11px"><b>Class</b></td><td  style="font-size:11px"><?php echo $row4['subject'];?>/<?php echo $row4['section'];?></td>
</tr>


</table>


<table frame="border" width="100%" cellspacing="0" height="25%">
<tr >

<td align="center" style="border: 1px solid black"><span id="name2"  ><b>Month</b></span></td><td colspan="12" style="border: 1px solid black"><textarea id="mo" class="mo" style="font-weight:bold;font-size:10px;resize:none" rows="3" cols="80"><?php echo $month12;?></textarea></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='9' style='padding: 3px'><span style='font-size:13px;color:black;font-weight:bold;padding: 6px'>Fee Type</span></td><td colspan="2" align="right" style='padding: 3px'><span  style="font-size:13px;color:black;font-weight:bold;padding:6px">Fee Amount </span></td>
</tr>
<tr >
<td width="25%" colspan='9' align="left" style='padding: 2px;'><span id="name2" >Tution Fee</span></td>
<td width="25%" colspan='2' align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['fee']=='0'){echo '';}else{echo $row10['fee'];}?> </span></td>

</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Conv Fee</span></td>
<td width="25%" align="right" colspan='2' style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['van']=='0'){echo '';}else{echo $row10['van'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Miscellaneous Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['addm']=='0'){echo '';}else{echo $row10['addm'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Annual Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['ann']=='0'){echo '';}else{echo $row10['ann'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Exam Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['exam']=='0'){echo '';}else{echo $row10['exam'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Computer Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['comp']=='0'){echo '';}else{echo $row10['comp'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Other Fee ( <?php echo $row10['other_remark']?>)</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['other']=='0'){echo '';}else{echo $row10['other'];}?> </span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Old Dues </span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['pre']=='0'){echo '';}else{echo $row10['pre'];}?> </span></td>
</tr>

<tr style='background-color:#D7D1D1;margin-top:100px' >
	
<td  colspan='9' style='border: 1px solid black;padding: 7px'><span style='font-size:13px;color:black;font-weight:bold'>Paymode Mode : <?php echo $row10['mode']?> </span></td><td colspan="2" align="right" style='border: 1px solid black;padding: 7px'><span  style="font-size:13px;color:black;font-weight:bold"><?php echo $row10['total']?> Rs. </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Discount (<?php echo $row10['remark']?>) : <?php if($row10['con']=='0'){echo '';}else{echo $row10['con'];}?> Rs.</span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Paid : <?php echo $row10['paid']?> Rs.</span></td><td  colspan='6'style='border: 1px solid black;padding: 7px;text-align:center' ><span style='font-size:13px;color:black;'>Dues Fee : <?php echo $row10['remain']?> </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;' ><span style='font-size:13px;color:black;'> Amount in Word : <?php echo $result . "Rupees  " . $points . " Only.";?> </span></td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><br/><span style='font-size:11px;color:black;'> PPRINCIPAL  </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:right' ><br/><span style='font-size:11px;color:black;'> ACCOUNTANT </td>
</tr>
<tr style='background-color:;margin-top:30px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Print : <?php echo date('d-M-Y')?> :  <?php echo $time;?> </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Student Copy  </span></td>
</tr>





<?php
$tot='0';
$paid16='0';
$due16='0';
$con12='0';
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	
	{
		$tot1=$row1['mtotal'];
		$paid15=$row1['paid'];
		$con=$row1['con'];
		$remain15=$row1['remain'];
	
		$tot16=$remain15+$paid15+$con;
		$due16=$remain15+$due16;
		$con12=$con+$con12;
		$tot=$tot16+$tot;
		$paid16=$paid16+$paid15;
		
	



?>

<?php

	}

?>

</table>





</div>
<div  class="ab" style="float:left;width:5%">--</div>
&emsp;<div style="border:1px solid" class="a">
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="50px" width="50px"/></span></td><td align="left"><span id="name"  style="font-size:13px;text-align:left;font-weight:bold">PACIFIC PUBLIC SCHOOL</span><br/><span style='font-size:12px'>THE LAND OF WISDOM</span><br/><span style='font-size:10px'>Semra No. 1 Chargawan Gorakhpur, [Uttar Prades]-273013 </span></td><td style=' border-left: double;'><div style='margin-left:5px'><span style='font-size:10px;'>Registration/Affilatio No.</span><br/><span style='font-size:11px;'>AFFL NO-C/80/2014</span><br/><span style='font-size:10px'><i class="fa fa-phone-square"></i> 7376598752<br/><i class="fa fa-envelope"></i> spacificpublic@gmail.com</span></div></td>
</tr>
</table>
<table border="1px;"  width="100%"cellspacing="0" >
	<tr style='background-color:gray'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:white'>Fee Receipt</span></td><td colspan="2"><span  style="font-size:11px;color:white">Session : <?php echo $row12['year'];?></span></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:black'> Receipt No: <?php echo $row10['id'];?></span></td><td colspan="2"><span  style="font-size:11px;color:black">Date : <?php echo $date20;?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Scho. Number</span></td><td colspan="2"><span  style="font-size:11px"><?php echo $row12['search'];?></span></td><td align="center" rowspan="2"><span><img src="../code/img/<?php echo $row4['picture'];?>"  style="width:50px;height:50px" class="img-responsive" ></span></td>
</tr>
<tr>
    
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Student Name</span></td><td colspan='2'><span  style="font-size:11px"><?php echo $row4['name'];?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold"> Father Name</span></td><td><span  style="font-size:11px"><?php echo $row4['fname'];?></span></td><td style="font-size:11px"><b>Class</b></td><td  style="font-size:11px"><?php echo $row4['subject'];?>/<?php echo $row4['section'];?></td>
</tr>


</table>


<table frame="border" width="100%" cellspacing="0" height="25%">
<tr >

<td align="center" style="border: 1px solid black"><span id="name2"  ><b>Month</b></span></td><td colspan="12" style="border: 1px solid black"><textarea id="mo" class="mo" style="font-weight:bold;font-size:10px;resize:none" rows="3" cols="80"><?php echo $month12;?></textarea></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='9' style='padding: 3px'><span style='font-size:13px;color:black;font-weight:bold;padding: 6px'>Fee Type</span></td><td colspan="2" align="right" style='padding: 3px'><span  style="font-size:13px;color:black;font-weight:bold;padding:6px">Fee Amount </span></td>
</tr>
<tr >
<td width="25%" colspan='9' align="left" style='padding: 2px;'><span id="name2" >Tution Fee</span></td>
<td width="25%" colspan='2' align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['fee']=='0'){echo '';}else{echo $row10['fee'];}?> </span></td>

</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Conv Fee</span></td>
<td width="25%" align="right" colspan='2' style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['van']=='0'){echo '';}else{echo $row10['van'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Miscellaneous Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['addm']=='0'){echo '';}else{echo $row10['addm'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Annual Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['ann']=='0'){echo '';}else{echo $row10['ann'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Exam Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['exam']=='0'){echo '';}else{echo $row10['exam'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Computer Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['comp']=='0'){echo '';}else{echo $row10['comp'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Other Fee ( <?php echo $row10['other_remark']?>)</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['other']=='0'){echo '';}else{echo $row10['other'];}?> </span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Old Dues </span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['pre']=='0'){echo '';}else{echo $row10['pre'];}?> </span></td>
</tr>

<tr style='background-color:#D7D1D1;margin-top:100px' >
	
<td  colspan='9' style='border: 1px solid black;padding: 7px'><span style='font-size:13px;color:black;font-weight:bold'>Paymode Mode : <?php echo $row10['mode']?> </span></td><td colspan="2" align="right" style='border: 1px solid black;padding: 7px'><span  style="font-size:13px;color:black;font-weight:bold"><?php echo $row10['total']?> Rs. </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Discount (<?php echo $row10['remark']?>) : <?php if($row10['con']=='0'){echo '';}else{echo $row10['con'];}?> Rs.</span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Paid : <?php echo $row10['paid']?> Rs.</span></td><td  colspan='6'style='border: 1px solid black;padding: 7px;text-align:center' ><span style='font-size:13px;color:black;'>Dues Fee : <?php echo $row10['remain']?> </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;' ><span style='font-size:13px;color:black;'> Amount in Word : <?php echo $result . "Rupees  " . $points . " Only.";?> </span></td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><br/><span style='font-size:11px;color:black;'> PPRINCIPAL  </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:right' ><br/><span style='font-size:11px;color:black;'> ACCOUNTANT </td>
</tr>
<tr style='background-color:;margin-top:30px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Print : <?php echo date('d-M-Y')?> :  <?php echo $time;?> </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Office Copy  </span></td>
</tr>





<?php
$tot='0';
$paid16='0';
$due16='0';
$con12='0';
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	
	{
		$tot1=$row1['mtotal'];
		$paid15=$row1['paid'];
		$con=$row1['con'];
		$remain15=$row1['remain'];
	
		$tot16=$remain15+$paid15+$con;
		$due16=$remain15+$due16;
		$con12=$con+$con12;
		$tot=$tot16+$tot;
		$paid16=$paid16+$paid15;
		
	



?>

<?php

	}

?>

</table>




</div>
</div>

</div>
<br/>


<br/>
<br/><br/>

<input type='button'  value='Print' onclick='printDiv();'>

	  <script>

	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint12');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write(' <html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html> ');



}
	
	</script>


	

				
</body>
</html>









<?php


	
	
	
	
	break;
	
	
	
	
	///// for fees details 
	case 721:
	   
	$search=$_REQUEST['app'];
	$application=$search;
	
include("../link/databaseconnection.php");
$sel4="select * from  registration where application ='$search' and status='' order by id desc";
$res4=mysqli_query($conn,$sel4);
$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
$sel12="select * from  studentfees where search ='$search' and status='' order by id desc";
$res12=mysqli_query($conn,$sel12);
$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
$search=$row12['search'];
$idd=$row12['id'];
$id12=$idd-1;
//echo $id12;
$date20=date("d-m-Y",strtotime($row12['date']));
$sel121="select * from  studentfees where search ='$search' and status='' and id='$idd' ";
$res121=mysqli_query($conn,$sel121);
$row121=mysqli_fetch_array($res121,MYSQLI_BOTH);

$date12=date("d-m-Y");
$sel1="select * from  studentfees where search ='$search' and status='' ";
$res1=mysqli_query($conn,$sel1);

$sel10="select * from  studentfees where search ='$search' and status='' order by id desc ";
$res10=mysqli_query($conn,$sel10);
$row10=mysqli_fetch_array($res10,MYSQLI_BOTH);

$selde="select * from  studentfees where search ='$search' and status='' order by id desc limit 2  ";
$resde=mysqli_query($conn,$selde);
$rowde=mysqli_fetch_array($resde,MYSQLI_BOTH);
$idd=$rowde['id'];

//echo $idd;
$selmo="select * from  studentfees where search ='$search' and status='' order by id desc ";
$resmo=mysqli_query($conn,$selmo);


$month12='';
$rowmo=mysqli_fetch_array($resmo,MYSQLI_BOTH);

	 $month12=$rowmo['month'];
	// $month12=$month13.",".$month12;


date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");

//echo $date;

//echo"$app1";
?>

<html>
<head>
<style>
#name2
{
	
}
body{
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
   
    @media print
   {
       print-color-adjust: exact;
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  }
</style>

<script>

$(document).ready(function(){
//alert('Thanks For Print');
var divToPrint=document.getElementById('DivIdToPrint12');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_details1.php';
		
	});
		function myFunction() 
{

}
});

</script>

<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>

    <script>
        
        $(document).ready(function(){
	
	var p=$("#pay").val();
	
});
    </script>
     <?php
  /**
   * Created by PhpStorm.
   * User: sakthikarthi
   * Date: 9/22/14
   * Time: 11:26 AM
   * Converting Currency Numbers to words currency format
   */
  
$number = $row10['paid'];
   $no = round($number);
   $point = round($number - $no, 2) * 100;
   $hundred = null;
   $digits_1 = strlen($no);
   $i = 0;
   $str = array();
   $words = array('0' => '', '1' => 'One', '2' => 'Two',
    '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
    '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
    '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
    '13' => 'Thirteen', '14' => 'Fourteen',
    '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
    '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
    '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
    '60' => 'Sixty', '70' => 'Seventy',
    '80' => 'Eighty', '90' => 'Ninety');
   $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
   while ($i < $digits_1) {
     $divider = ($i == 2) ? 10 : 100;
     $number = floor($no % $divider);
     $no = floor($no / $divider);
     $i += ($divider == 10) ? 1 : 2;
     if ($number) {
        $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
        $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
        $str [] = ($number < 21) ? $words[$number] .
            " " . $digits[$counter] . $plural . " " . $hundred
            :
            $words[floor($number / 10) * 10]
            . " " . $words[$number % 10] . " "
            . $digits[$counter] . $plural . " " . $hundred;
     } else $str[] = null;
  }
  $str = array_reverse($str);
  $result = implode('', $str);
  $points = ($point) ?
    "." . $words[$point / 10] . " " . 
          $words[$point = $point % 10] : '';
  
 ?> 

 <script>
function getIndianCurrency(float $number)
{
    $decimal = round($number - ($no = floor($number)), 2) * 100;
    $hundred = null;
    $digits_length = strlen($no);
    $i = 0;
    $str = array();
    $words = array(0 => '', 1 => 'one', 2 => 'two',
        3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
        7 => 'seven', 8 => 'eight', 9 => 'nine',
        10 => 'ten', 11 => 'eleven', 12 => 'twelve',
        13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
        16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
        19 => 'nineteen', 20 => 'twenty', 30 => 'thirty',
        40 => 'forty', 50 => 'fifty', 60 => 'sixty',
        70 => 'seventy', 80 => 'eighty', 90 => 'ninety');
    $digits = array('', 'hundred','thousand','lakh', 'crore');
    while( $i < $digits_length ) {
        $divider = ($i == 2) ? 10 : 100;
        $number = floor($no % $divider);
        $no = floor($no / $divider);
        $i += $divider == 10 ? 1 : 2;
        if ($number) {
            $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
            $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
            $str [] = ($number < 21) ? $words[$number].' '. $digits[$counter]. $plural.' '.$hundred:$words[floor($number / 10) * 10].' '.$words[$number % 10]. ' '.$digits[$counter].$plural.' '.$hundred;
        } else $str[] = null;
    }
    $Rupees = implode('', array_reverse($str));
    $paise = ($decimal) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
    return ($Rupees ? $Rupees . 'Rupees ' : '') . $paise .;
}
</script>
<div id='DivIdToPrint12'>
<style>
.a{
width:46%;
float:left;
}
@media print
   {
      .a{width:46%;}
	  .ab{width:5%;}
	  .sd{font-size:11px;}
	  #name7{font-size:10px;}
	  
	  }
      
   
   @media print
   {
      
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  }
     body{
  -webkit-print-color-adjust:exact !important;
  print-color-adjust:exact !important;
}
   
    @media print
   {
       print-color-adjust: exact;
	  table{width:100%;}
	  #mo{width:230px;}
	  
	  } 
   
   
</style>
<div style="border:1px solid" class="a">
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="50px" width="50px"/></span></td><td align="left"><span id="name"  style="font-size:13px;text-align:left;font-weight:bold">PACIFIC PUBLIC SCHOOL</span><br/><span style='font-size:12px'>THE LAND OF WISDOM</span><br/><span style='font-size:10px'>Semra No. 1 Chargawan Gorakhpur, [Uttar Prades]-273013 </span></td><td style=' border-left: double;'><div style='margin-left:5px'><span style='font-size:10px;'>Registration/Affilatio No.</span><br/><span style='font-size:11px;'>AFFL NO-C/80/2014</span><br/><span style='font-size:10px'><i class="fa fa-phone-square"></i> 7376598752<br/><i class="fa fa-envelope"></i> spacificpublic@gmail.com</span></div></td>
</tr>
</table>
<table border="1px;"  width="100%"cellspacing="0" >
	<tr style='background-color:gray'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:white'>Fee Receipt</span></td><td colspan="2"><span  style="font-size:11px;color:white">Session : <?php echo $row12['year'];?></span></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:black'> Receipt No: <?php echo $row10['id'];?></span></td><td colspan="2"><span  style="font-size:11px;color:black">Date : <?php echo $date20;?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Scho. Number</span></td><td colspan="2"><span  style="font-size:11px"><?php echo $row12['search'];?></span></td><td align="center" rowspan="2"><span><img src="../code/img/<?php echo $row4['picture'];?>"  style="width:50px;height:50px" class="img-responsive" ></span></td>
</tr>
<tr>
    
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Student Name</span></td><td colspan='2'><span  style="font-size:11px"><?php echo $row4['name'];?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold"> Father Name</span></td><td><span  style="font-size:11px"><?php echo $row4['fname'];?></span></td><td style="font-size:11px"><b>Class</b></td><td  style="font-size:11px"><?php echo $row4['subject'];?>/<?php echo $row4['section'];?></td>
</tr>


</table>


<table frame="border" width="100%" cellspacing="0" height="25%">
<tr >

<td align="center" style="border: 1px solid black"><span id="name2"  ><b>Month</b></span></td><td colspan="12" style="border: 1px solid black"><textarea id="mo" class="mo" style="font-weight:bold;font-size:10px;resize:none" rows="3" cols="80"><?php echo $month12;?></textarea></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='9' style='padding: 3px'><span style='font-size:13px;color:black;font-weight:bold;padding: 6px'>Fee Type</span></td><td colspan="2" align="right" style='padding: 3px'><span  style="font-size:13px;color:black;font-weight:bold;padding:6px">Fee Amount </span></td>
</tr>
<tr >
<td width="25%" colspan='9' align="left" style='padding: 2px;'><span id="name2" >Tution Fee</span></td>
<td width="25%" colspan='2' align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['fee']=='0'){echo '';}else{echo $row10['fee'];}?> </span></td>

</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Conv Fee</span></td>
<td width="25%" align="right" colspan='2' style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['van']=='0'){echo '';}else{echo $row10['van'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Miscellaneous Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['addm']=='0'){echo '';}else{echo $row10['addm'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Annual Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['ann']=='0'){echo '';}else{echo $row10['ann'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Exam Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['exam']=='0'){echo '';}else{echo $row10['exam'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Computer Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['comp']=='0'){echo '';}else{echo $row10['comp'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Other Fee ( <?php echo $row10['other_remark']?>)</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['other']=='0'){echo '';}else{echo $row10['other'];}?> </span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Old Dues </span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['pre']=='0'){echo '';}else{echo $row10['pre'];}?> </span></td>
</tr>

dth="25%" align="right" style='border-left: 1px solid black;padding: 20px'><span id="name2" > </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:100px' >
	
<td  colspan='9' style='border: 1px solid black;padding: 7px'><span style='font-size:13px;color:black;font-weight:bold'>Paymode Mode : <?php echo $row10['mode']?> </span></td><td colspan="2" align="right" style='border: 1px solid black;padding: 7px'><span  style="font-size:13px;color:black;font-weight:bold"><?php echo $row10['total']?> Rs. </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Discount (<?php echo $row10['remark']?>) : <?php if($row10['con']=='0'){echo '';}else{echo $row10['con'];}?> Rs.</span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Paid : <?php echo $row10['paid']?> Rs.</span></td><td  colspan='6'style='border: 1px solid black;padding: 7px;text-align:center' ><span style='font-size:13px;color:black;'>Dues Fee : <?php echo $row10['remain']?> </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;' ><span style='font-size:13px;color:black;'> Amount in Word : <?php echo $result . "Rupees  " . $points . " Only.";?> </span></td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><br/><span style='font-size:11px;color:black;'> PPRINCIPAL  </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:right' ><br/><span style='font-size:11px;color:black;'> ACCOUNTANT </td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Print : <?php echo date('d-M-Y')?> :  <?php echo $time;?> </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Student Copy  </span></td>
</tr>





<?php
$tot='0';
$paid16='0';
$due16='0';
$con12='0';
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	
	{
		$tot1=$row1['mtotal'];
		$paid15=$row1['paid'];
		$con=$row1['con'];
		$remain15=$row1['remain'];
	
		$tot16=$remain15+$paid15+$con;
		$due16=$remain15+$due16;
		$con12=$con+$con12;
		$tot=$tot16+$tot;
		$paid16=$paid16+$paid15;
		
	



?>

<?php

	}

?>

</table>





</div>
<div  class="ab" style="float:left;width:5%">--</div>
&emsp;<div style="border:1px solid" class="a">
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="50px" width="50px"/></span></td><td align="left"><span id="name"  style="font-size:13px;text-align:left;font-weight:bold">PACIFIC PUBLIC SCHOOL</span><br/><span style='font-size:12px'>THE LAND OF WISDOM</span><br/><span style='font-size:10px'>Semra No. 1 Chargawan Gorakhpur, [Uttar Prades]-273013 </span></td><td style=' border-left: double;'><div style='margin-left:5px'><span style='font-size:10px;'>Registration/Affilatio No.</span><br/><span style='font-size:11px;'>AFFL NO-C/80/2014</span><br/><span style='font-size:10px'><i class="fa fa-phone-square"></i> 7376598752<br/><i class="fa fa-envelope"></i> spacificpublic@gmail.com</span></div></td>
</tr>
</table>
<table border="1px;"  width="100%"cellspacing="0" >
	<tr style='background-color:gray'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:white'>Fee Receipt</span></td><td colspan="2"><span  style="font-size:11px;color:white">Session : <?php echo $row12['year'];?></span></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='2' style='padding:3px'><span style='font-size:12px;color:black'> Receipt No: <?php echo $row10['id'];?></span></td><td colspan="2"><span  style="font-size:11px;color:black">Date : <?php echo $date20;?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Scho. Number</span></td><td colspan="2"><span  style="font-size:11px"><?php echo $row12['search'];?></span></td><td align="center" rowspan="2"><span><img src="../code/img/<?php echo $row4['picture'];?>"  style="width:50px;height:50px" class="img-responsive" ></span></td>
</tr>
<tr>
    
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold">Student Name</span></td><td colspan='2'><span  style="font-size:11px"><?php echo $row4['name'];?></span></td>
</tr>
<tr>
<td style='padding:3px'><span id="name2"  style="font-size:11px;font-weight:bold"> Father Name</span></td><td><span  style="font-size:11px"><?php echo $row4['fname'];?></span></td><td style="font-size:11px"><b>Class</b></td><td  style="font-size:11px"><?php echo $row4['subject'];?>/<?php echo $row4['section'];?></td>
</tr>


</table>


<table frame="border" width="100%" cellspacing="0" height="25%">
<tr >

<td align="center" style="border: 1px solid black"><span id="name2"  ><b>Month</b></span></td><td colspan="12" style="border: 1px solid black"><textarea id="mo" class="mo" style="font-weight:bold;font-size:10px;resize:none" rows="3" cols="80"><?php echo $month12;?></textarea></td>
</tr>
<tr style='background-color:#D7D1D1'>
<td  colspan='9' style='padding: 3px'><span style='font-size:13px;color:black;font-weight:bold;padding: 6px'>Fee Type</span></td><td colspan="2" align="right" style='padding: 3px'><span  style="font-size:13px;color:black;font-weight:bold;padding:6px">Fee Amount </span></td>
</tr>
<tr >
<td width="25%" colspan='9' align="left" style='padding: 2px;'><span id="name2" >Tution Fee</span></td>
<td width="25%" colspan='2' align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['fee']=='0'){echo '';}else{echo $row10['fee'];}?> </span></td>

</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Conv Fee</span></td>
<td width="25%" align="right" colspan='2' style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['van']=='0'){echo '';}else{echo $row10['van'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Miscellaneous Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['addm']=='0'){echo '';}else{echo $row10['addm'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Annual Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['ann']=='0'){echo '';}else{echo $row10['ann'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Exam Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['exam']=='0'){echo '';}else{echo $row10['exam'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Computer Fee</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['comp']=='0'){echo '';}else{echo $row10['comp'];}?></span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Other Fee ( <?php echo $row10['other_remark']?>)</span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['other']=='0'){echo '';}else{echo $row10['other'];}?> </span></td>
</tr>
<tr align="left">
	<td width="25%" style=";padding: 2px" colspan='9'><span id="name2" >Old Dues </span></td>
<td width="25%" align="right" style='border-left: 1px solid black;padding: 2px'><span id="name2" ><?php if($row10['pre']=='0'){echo '';}else{echo $row10['pre'];}?> </span></td>
</tr>

<tr style='background-color:#D7D1D1;margin-top:100px' >
	
<td  colspan='9' style='border: 1px solid black;padding: 7px'><span style='font-size:13px;color:black;font-weight:bold'>Paymode Mode : <?php echo $row10['mode']?> </span></td><td colspan="2" align="right" style='border: 1px solid black;padding: 7px'><span  style="font-size:13px;color:black;font-weight:bold"><?php echo $row10['total']?> Rs. </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Discount (<?php echo $row10['remark']?>) : <?php if($row10['con']=='0'){echo '';}else{echo $row10['con'];}?> Rs.</span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:left' ><span style='font-size:13px;color:black;font-weight:bold'>Paid : <?php echo $row10['paid']?> Rs.</span></td><td  colspan='6'style='border: 1px solid black;padding: 7px;text-align:center' ><span style='font-size:13px;color:black;'>Dues Fee : <?php echo $row10['remain']?> </span></td>
</tr>
<tr style='background-color:#D7D1D1;margin-top:40px' >
<td  colspan='11'style='border: 1px solid black;padding: 7px;' ><span style='font-size:13px;color:black;'> Amount in Word : <?php echo $result . "Rupees  " . $points . " Only.";?> </span></td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><br/><span style='font-size:11px;color:black;'> PPRINCIPAL  </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;text-align:right' ><br/><span style='font-size:11px;color:black;'> ACCOUNTANT </td>
</tr>
<tr style='background-color:;margin-top:40px' >
<td  colspan='7'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Print : <?php echo date('d-M-Y')?> :  <?php echo $time;?> </span></td><td  colspan='5'style='border: 1px solid black;padding: 7px;' ><span style='font-size:11px;color:black;'> Office Copy  </span></td>
</tr>





<?php
$tot='0';
$paid16='0';
$due16='0';
$con12='0';
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	
	{
		$tot1=$row1['mtotal'];
		$paid15=$row1['paid'];
		$con=$row1['con'];
		$remain15=$row1['remain'];
	
		$tot16=$remain15+$paid15+$con;
		$due16=$remain15+$due16;
		$con12=$con+$con12;
		$tot=$tot16+$tot;
		$paid16=$paid16+$paid15;
		
	



?>

<?php

	}

?>

</table>



</div>
</div>

</div>
<br/>


<br/>
<br/><br/>

<input type='button'  value='Print' onclick='printDiv();'>

	  <script>

	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint12');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write(' <html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html> ');



}
	
	</script>


	

				
</body>
</html>









<?php


	
	
	
	
	break;
	
	///// for fees details 
	case 73:
	$session=$_POST['session'];
	$scholer=$_POST['scholer'];
//	$pass2=$_POST['pass'];
	$selr="select * from  registration where application ='$scholer' and session='$session' and status=''";
$resr=mysqli_query($conn,$selr);
$rowr=mysqli_fetch_array($resr,MYSQLI_BOTH);
$sessionr=$rowr['session'];
$pass=$rowr['application'];
$pass1='gcs'.$pass;
//echo $pass1;
if($scholer=='' or $scholer==NULL)
{
	
	//echo "<SCRIPT>alert('Scholer Number Invailid');window.location.href='checkfess.php';</SCRIPT>";
	//header("location:../checkfees.php");
}
if(!$rowr)
{
	echo "<SCRIPT>alert('Sch Number Invailid');window.location.href='checkfess.php';</SCRIPT>";
	//header("location:../checkfees.php");
}
//echo $sessionr;
$applicationr=$rowr['application'];

$sel1="select * from  studentfees where search ='$applicationr' and year='$sessionr' and status=''";
$res1=mysqli_query($conn,$sel1);
$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
//$search=$row1['search'];
$sel="select * from  registration where application ='$applicationr' and session='$sessionr' and status=''";
$res=mysqli_query($conn,$sel);
$row=mysqli_fetch_array($res,MYSQLI_BOTH);


$selb="select * from  registration where application ='$applicationr' and session='sessionr' and status='' order by id desc";
$resb=mysqli_query($conn,$selb);
$rowb=mysqli_fetch_array($resb,MYSQLI_BOTH);

$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;

?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'>
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="70px" width="70px"/></span></td><td align="center"><span id="name"  style="font-size:20px;font-weight:bold">PACIFIC PUBLIC SCHOOL </span><br/>Semra No.1 , Chargawan-Gorakhpur<br/><span id="name1" style="font-size:18px;font-weight:bold"></span></td><td style="font-size:14px"><b>Contact-</b>7376598752<br/>9451960467 </td>
</tr>
</table>
<table border="1px;" width="100%" cellspacing="0">
<caption style="font-size:18px;font-weight:bold">Fees Statement <?php echo $row1['year'];?></caption>
<tr>
<td width="30%"><span id="name2">Scho. Number</span></td><td><span id="name3"><?php echo $row1['search'];?></span></td><td><b>Class</b></td><td><?php echo $row['subject'];?></td><td width="10%"align="right" rowspan="3"><span><img src="../code/img/<?php echo $row['picture'];?>" style="width:100%;" class="img-responsive" ></span></td>
</tr>
<tr>
<td width="30%"><span id="name2">Student Name</span></td><td width="" colspan="3"><span id="name3"><?php echo $row['name'];?></span></td>
</tr>
<tr>
<td width="30%"><span id="name2"> Father Name</span></td><td colspan="3"><span id="name3"><?php echo $row['fname'];?></span></td>
</tr>


</table>

<table border="1px" width="100%" cellspacing="0px">
<tr>
<td colspan='17' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Fees Receipt</span></td>

</tr>
<tr align="center">


<td><span id="name2">Sr.</span></td>
<td><span id="name2">Month</span></td>
<td><span id="name2" >Tution Fee</span></td>
<td><span id="name2" >Exam</span></td>
<td><span id="name2">Conv</span></td>

<td><span id="name2">Main</span></td>
<td><span id="name2">Miscellaneous</span></td>
<td><span id="name2">Reg</span></td>
<td><span id="name2">Comp</span></td>
<td><span id="name2">Gene</span></td>
<td><span id="name2">Ann</span></td>

<td><span id="name2">Other</span></td>
<td><span id="name2">Other Remark</span></td>
<td><span id="name2">Con</span></td>
<td><span id="name2">Cons Remark</span></td>
<td><span id="name2">Pre Dues</span></td>

<td><span id="name2">Paid</span></td>

<td><span id="name2">Dues</span></td>

<td><span id="name2">Date</span></td>


</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;


$sel2="select * from  studentfees where search='$applicationr' and year='$sessionr' and status=''";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	$tot=$row2['total'];
	$paid13=$row2['paid'];
	
	$remain12=$row2['remain'];
	$sum=$tot+$sum;
	$sum1=$paid13+$sum1;
	$remain1=$remain12+$remain1;
?>
<tr align="center">

<td><span id="name3"><?php echo $row2['id'];?></span></td>
<td><span id="name3"><?php echo $row2['month'];?></span></td>
<td><span id="name3"><?php echo $row2['fee'];?></span></td>
<td><span id="name3"><?php echo $row2['exam'];?></span></td>
<td><span id="name3"><?php echo $row2['van'];?></span></td>

<td><span id="name3"><?php echo $row2['reg'];?></span></td>
<td><span id="name3"><?php echo $row2['addm'];?></span></td>
<td><span id="name3"><?php echo $row2['reg1'];?></span></td>
<td><span id="name3"><?php echo $row2['comp'];?></span></td>
<td><span id="name3"><?php echo $row2['gen'];?></span></td>
<td><span id="name3"><?php echo $row2['ann'];?></span></td>

<td><span id="name3"><?php echo $row2['other'];?></span></td>
<td><span id="name3"><?php echo $row2['other_remark'];?></span></td>
<td><span id="name3"><?php echo $row2['con'];?></span></td>
<td ><span id="name3"><?php echo $row2['remark'];?></span></td>
<td><span id="name3"><?php echo $row2['pre'];?></span></td>

<td><span id="name3"><?php echo $row2['paid'];?></span></td>

<td><span id="name3"><?php echo $row2['remain'];?></span></td>
<?php $daten=$row2['date'];
$date1=date("d-m-Y",strtotime($daten));  ?>
<td><span id="name3"><?php echo $date1;?></span></td>


</tr>


<?php
}
?>
<tr align="center">

<td colspan="16" style="font-weight:bold;font-size:19px">Sub Total</td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2"><?php echo $sum1;?></span></td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2">
    <?php    
    echo $remain12;?></span></td>

</tr>
</table>

<table width="100%" frame="border" cellspacing="0">
<tr align="center">
<td width="50%"  align="left"><span id="name3" style="font-size:15px;font-weight:bold">Datetime</span></td>
</tr>
<tr>
<td  width="70%" align="left"><span ><?php echo $datetime;?></span></td><td><br/><br/></td><td width="50%" align="right"><span id="name3" style="font-size:15px;font-weight:bold" align="rightt">Sign Of Received Staff</span></td>
</tr>
</table>
</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();
setTimeout(function(){newWin.close();},10);
}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
	
	///// for fees details 
	/////for present
	////for presenty////
	case 291:
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
               <th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Status</th><th style="text-align:center">Save</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	
  $session=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
	$date=$_POST['date'];
  $sel="select * from  registration where session='$session' and section='$section' and subject='$class' and status=''";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
		$b=$row['postoffice'];
	
	$c=$row['dist'];
	$app1=$row['application'];
	$fname=$row['fname'];
	$name=$row['name'];
	$session=$row['session'];
//	$date=date('Y-m-d');
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
 
	
	date_default_timezone_set("asia/kolkata");
	$d=$row['mobile'];
	$sel1="select * from  present1 where sch='$app1' and session='$session' and date='$date'";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];

		?>
		 
	<tr class="text-center">
	<td><?php echo $row['application'];?></td><td><?php echo $row['2']."<br/><b>F-</b>".$row['fname']?></td><td><?php if($status1=='P'){echo"<font color=green size=6pt> P</font>";} if($status1=='A') {echo"<font color=red size=6pt> A</font>";}?></td><td><a href="javascript:;" onclick="recordup(<?php echo $row['id'];?>,'<?php echo $date;?>')"><button><span class="glyphicon glyphicon-pencil"></span></button></a></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	
	
	///////all fees print////
	
	
	
	////for presenty////
	
	case 292:
	$name=$_POST['name'];
	$sch=$_POST['sch'];
	//$other=$_POST['other'];
	$fname=$_POST['fname'];
	$session=$_POST['session'];
	$class=$_POST['class'];
	$date=$_POST['date'];
	$status=$_POST['status'];
		$section=$_POST['section'];
	 	$sel12="select * from  present1 where sch='$sch' and session='$session' and date='$date'";
	$res12=mysqli_query($conn,$sel12);
	$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
	if(!$row12)
	{
	 $ins="insert into present1(sch,name,class,date,user,status,fname,session,section) values('$sch','$name','$class','$date','user','$status','$fname','$session',section)";
	$res=mysqli_query($conn,$ins);
		if($res)
		{
			echo"Save";
			
		}
		else
		{
			echo"not Save";
		}
	}
	else
	{
		$up ="update present1 set status='$status' where sch=$sch and date='$date'";
		$res1=mysqli_query($conn,$up);
		if($res1)
		{
		echo"Update";

		}
		else
		{
			echo" not Update";
		}
	}
	
	
	break;
	case 293:
	
	
	$id=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  registration where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	 $date=date('Y-m-d');
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
	 $app=$row['application'];
	 $name=$row['name'];
	 $subject=$row['subject'];
	?>
	<div class="table-responsive">

      
            
      
		<tbody>
		<form onsubmit="return recordupdate(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Sch.</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $name;?>"  readonly style="background-color:yellow;color:green"/></div>
				<input type="hidden" value="<?php echo $app;?>" name="sch"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
				<input type="hidden" value="<?php echo $row['name'];?>" name="name"/>
				<input type="hidden" value="<?php echo $row['fname'];?>" name="fname"/>
				<input type="hidden" value="<?php echo $row['subject'];?>" name="class"/>
				<input type="hidden" value="<?php echo $row['section'];?>" name="section"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
					<input type="hidden" value="<?php echo $row['session'];?>" name="session"/>
				</div>
		
				
		<br/>
		<br/>
				
		
				<div class="form-group">
				<label class="col-sm-3 control-label">Status.</label>
				<div class="col-sm-3">
				<select name="status"><option style="font-size:15px;color:green;font-weight:bold">P</option><option style="font-size:15px;color:red;font-weight:bold">A</option></select>
				</div>
		<center><button class="btn btn-danger">Save</button></center>
		
		</form>
		<br/>
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
	case 295:
	
	$sch=$_REQUEST['application'];
	date_default_timezone_set("asia/kolkata");
//	$date=date('Y-m-d');
	echo $date=$_REQUEST['date'];
	//echo"$eid";
	
	
		$sel1="select * from  registration where id='$sch' and status='' order by id desc ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	
	 
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	
	$time=date("h:i:sa");
	 $app=$row1['application'];
	 $sel="select * from  present1 where sch='$app' and date='$date' order by id desc ";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	 $name=$row1['name'];
	 
	?>
	<div class="table-responsive">

      
            
      
		<tbody>
		<form onsubmit="return recordupdate1(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Sch.</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $name;?>"  readonly style="background-color:yellow;color:green"/><br/></div>
				<br/>
				<div class="form-group">
			
				<div class="col-sm-12"><br/>Date - <input type="date" value="<?php echo date('Y-m-d');?>"   name='date'/></div>
				<input type="hidden" value="<?php echo $app;?>" name="sch"/>
			
				<input type="hidden" value="<?php echo $row1['name'];?>" name="name"/>
				<input type="hidden" value="<?php echo $row1['fname'];?>" name="fname"/>
				<input type="hidden" value="<?php echo $row1['subject'];?>" name="class"/>
				<input type="hidden" value="<?php echo $row1['id'];?>" name="id"/>
			<input type="hidden" value="<?php echo $row1['section'];?>" name="section"/>
					<input type="hidden" value="<?php echo $row1['session'];?>" name="session"/>
				</div>
		
				
		<br/>
		<br/>
				
		
				<div class="form-group">
				<label class="col-sm-3 control-label">Status.</label>
				<div class="col-sm-3">
				<select name="status"><option  <?php if($row['status']=='P'){echo'selected';}?> >P</option><option  <?php if($row['status']=='A'){echo'selected';}?>>A</option></select>
				</div>
		<center><button class="btn btn-danger">Update</button></center>
		
		</form>
		<br/>
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
case 296:
	$name=$_POST['name'];
	$id=$_POST['id'];
	$sch=$_POST['sch'];
	//$other=$_POST['other'];
	$fname=$_POST['fname'];
	$session=$_POST['session'];
	$section=$_POST['section'];
	$class=$_POST['class'];
	$date=$_POST['date'];
	$status=$_POST['status'];
	$sel3="select * from  present1 where sch='$sch' and date='$date'";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
	if(!$row3)
	{
	     $inst="insert into present1(sch,name,class,date,user,status,fname,session,section) values('$sch','$name','$class','$date','user','P','$fname','$session','$section')";
	 if($res=mysqli_query($conn,$inst))
	 {
	     echo 'save';
	 }
	 else
	 {
	     echo 'no';
	 }
	}
	else
	{
	    $ins="update  present1 set date='$date',status='$status',session='$session' where sch='$sch' and date='$date'";
	if($res=mysqli_query($conn,$ins))
	 {
	    echo 'Update';
	 }
	 else
	 {
	     echo 'no up';
	 }
	}
	 
	
	break;
case 297:
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
               <th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Father</th><th style="text-align:center">Class</th><th style="text-align:center">Date</th><th style="text-align:center">Status</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	
  $session=$_POST['session'];
  $sdate=$_POST['sdate'];
  $edate=$_POST['edate'];
	$class=$_POST['class'];
		$section=$_POST['section'];
	/////
	$sel2="select * from  present1 where session='$session' and class='$class' and section='$section' and status='P' and date between '$sdate' and '$edate' ";
	$res2=mysqli_query($conn,$sel2);
	$count=mysqli_num_rows($res2);
//	echo $count;
	
	$sel21="select * from  present1 where session='$session' and class='$class' and section='$section'  and status='A' and date between '$sdate' and '$edate' ";
	$res21=mysqli_query($conn,$sel21);
	$count1=mysqli_num_rows($res21);
//	echo $count1;
	//$s=0;
	
	//echo $s++;
	$sel211="select * from  present1 where session='$session' and status='A' and date between '$sdate' and '$edate' ";
	$res211=mysqli_query($conn,$sel211);
	$count11=mysqli_num_rows($res211);
	
	$sel2111="select * from  present1 where session='$session' and status='P' and date between '$sdate' and '$edate' ";
	$res2111=mysqli_query($conn,$sel2111);
	$count111=mysqli_num_rows($res2111);
	/////
  $sel="select * from  present1 where session='$session' and class='$class' and date between '$sdate' and '$edate'";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	//$d=$row['mobile'];
	$sel1="select * from  present1 where session='$session' and class='$class' and date between '$sdate' and '$edate'";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];
	$date12=$row1['date'];
	$date=date("d-m-Y",strtotime($date12));
		?>
		 
	<tr class="text-center">
	<td><?php echo $row['sch'];?></td><td><?php echo $row['2'];?></td><td><?php echo $row['fname']?></td><td><?php echo $row['class'] ;?></td><td><?php echo $date;?></td><td><?php echo $row['status'] ;?></td>
	
	
	
	</tr>
	
	<?php
	$s++;
	}
	
	?>
		<tr class="text-center">
	<td style="font-weight:bold"> TOTAL</td><td style="font-weight:bold;color:green">PRESENT</td><td style="font-weight:bold;color:green;font-size:18px"><?php echo $count;?></td><td style="font-weight:bold">ABSENT</td><td style="font-weight:bold;color:red;font-size:18px"><?php echo $count1 ;?></td><td></td>
	
	</tr>
	<tr class="text-center">
	<td style="font-weight:bold" > ALL TOTAL</td><td style="font-weight:bold;color:green">ALL PRESENT</td><td style="font-weight:bold;color:green;font-size:18px"><?php echo $count111;?></td><td style="font-weight:bold">ALL ABSENT</td><td style="font-weight:bold;color:red;font-size:18px"><?php echo $count11 ;?></td><td></td>
	
	
	
	</tr>

	
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	case 2971:
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
               <th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Father</th><th style="text-align:center">Class</th><th style="text-align:center">Date</th><th style="text-align:center">Status</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	
  $session=$_POST['session'];
  $sdate=$_POST['sdate'];
  $edate=$_POST['edate'];
	$class=$_POST['class'];
	$sch=$_POST['sch'];
	/////
	$sel2="select * from  present1 where session='$session' and class='$class' and sch=$sch and status='P' and date between '$sdate' and '$edate' ";
	$res2=mysqli_query($conn,$sel2);
	$count=mysqli_num_rows($res2);
//	echo $count;
	
	$sel21="select * from  present1 where session='$session' and class='$class' and sch=$sch and status='A' and date between '$sdate' and '$edate' ";
	$res21=mysqli_query($conn,$sel21);
	$count1=mysqli_num_rows($res21);
	
	$sel211="select * from  present1 where session='$session' and status='A' and date between '$sdate' and '$edate' ";
	$res211=mysqli_query($conn,$sel211);
	$count11=mysqli_num_rows($res211);
	
	$sel2111="select * from  present1 where session='$session' and status='P' and date between '$sdate' and '$edate' ";
	$res2111=mysqli_query($conn,$sel2111);
	$count111=mysqli_num_rows($res2111);
//	echo $count1;
	//$s=0;
	
	//echo $s++;
	/////
  $sel="select * from  present1 where session='$session' and class='$class'  and sch=$sch  and date between '$sdate' and '$edate'";
	$res=mysqli_query($conn,$sel);
	
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	//$d=$row['mobile'];
	$sel1="select * from  present1 where session='$session' and class='$class' and sch=$sch  and  date between '$sdate' and '$edate'";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];
	$date12=$row1['date'];
	$date=date("d-m-Y",strtotime($date12));
		?>
		 
	<tr class="text-center">
	<td><?php echo $row['sch'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname']?></td><td><?php echo $row['class'] ;?></td><td><?php echo $date;?></td><td><?php echo $row['status'] ;?></td>
	
	
	
	</tr>
	
	<?php
	$s++;
	}
	
	?>
	
	
		<tr class="text-center">
	<td style="font-weight:bold" > Record </td><td style="font-weight:bold;color:green"> PRESENT</td><td style="font-weight:bold;color:green;font-size:18px"><?php echo $count;?></td><td style="font-weight:bold"> ABSENT</td><td style="font-weight:bold;color:red;font-size:18px"><?php echo $count1 ;?></td><td></td>
	
	</tr>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	case 298:
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
               <th style="text-align:center">Sch.No.</th><th style="text-align:center">Name</th><th style="text-align:center">Father</th><th style="text-align:center">Class</th><th style="text-align:center">Date</th><th style="text-align:center">Status</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	
  $session=$_POST['session'];
  $sdate=$_POST['sdate'];
  $edate=$_POST['edate'];
	$class=$_POST['class'];
	$sch=$_POST['sch'];
	/////
	$sel2="select * from  present1 where session='$session' and class='$class' and status='P' and sch='$sch' and date between '$sdate' and '$edate' ";
	$res2=mysqli_query($conn,$sel2);
	$count=mysqli_num_rows($res2);
//	echo $count;
	
	$sel21="select * from  present1 where session='$session' and class='$class' and status='A' and sch='$sch' and date between '$sdate' and '$edate' ";
	$res21=mysqli_query($conn,$sel21);
	$count1=mysqli_num_rows($res21);
//	echo $count1;
	//$s=0;
	
	//echo $s++;
	/////
  $sel="select * from  present1 where session='$session' and class='$class' and sch='$sch' and date between '$sdate' and '$edate'";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	//$d=$row['mobile'];
	$sel1="select * from  present1 where session='$session' and class='$class' and sch='$sch' and date between '$sdate' and '$edate'";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];
	$date12=$row1['date'];
	$date=date("d-m-Y",strtotime($date12));
		?>
		 
	<tr class="text-center">
	<td><?php echo $row['sch'];?></td><td><?php echo $row['2'];?></td><td><?php echo $row['fname']?></td><td><?php echo $row['class']?></td><td><?php echo $date;?></td><td><?php echo $row['status'] ;?></td>
	
	
	
	</tr>
	
	<?php
	$s++;
	}
	
	?>
	<tr class="text-center">
	<td style="font-weight:bold"> TOTAL</td><td style="font-weight:bold;color:green">PRESENT</td><td style="font-weight:bold;color:green;font-size:18px"><?php echo $count;?></td><td style="font-weight:bold">ABSENT</td><td style="font-weight:bold;color:red;font-size:18px"><?php echo $count1 ;?></td><td></td>
	
	
	
	</tr>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	//////for present
	///// id card
		case 1341:
	$year1=$_POST['session'];
		$class=$_POST['class'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and status=''";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">Class</th><th  style="text-align:center">Village</th><th  style="text-align:center">Post</th><th  style="text-align:center">Dist</th><th  style="text-align:center">Mobile</th>
            </tr>
        </thead>
<tfoot>
             <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Mother</th><th  style="text-align:center">Class</th><th  style="text-align:center">Village</th><th  style="text-align:center">Post</th><th  style="text-align:center">Dist</th><th  style="text-align:center">Mobile</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['id'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['mname'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $row['village'];?></td><td><?php echo $row['postoffice'];?></td><td><?php echo $row['dist'];?></td><td><?php echo $row['mobile'];?></td>
	
	

	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	////id card close
	///////for teacher attendence
	
	case 2911:
	
	?>
	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>

	


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr >
               <th style="text-align:center">Sr.</th><th style="text-align:center">Name</th><th style="text-align:center">Status</th><th style="text-align:center">Save</th>
            </tr>
        </thead>

<tbody>		
  <?php
  
	
 // $session=$_POST['session'];
	//$class=$_POST['class'];
  $sel="select * from  classteacher ";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$app1=$row['id'];
		$class1=$row['class1'];
		
	$date=date('Y-m-d');
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$d=$row['mobile'];
	$sel1="select * from  presentclassteacher where sch='$app1' and class='$class1' and date='$date' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];
	//echo $status1;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['name'].'<br/> Classteacher-'.$row['class1'];?></td><td><?php if($status1=='P'){echo"<font color=green size=6pt> P</font>";} if($status1=='A') {echo"<font color=red size=6pt> A</font>";}?></td><td><a href="javascript:;" onclick="record(<?php echo $row['id'];?>)"><button><span class="glyphicon glyphicon-ok"></span></button></a></td>
	
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	
	
	
	
	<?php
	break;
	
	
	///////all fees print////
	
	
	
	////for presenty////
	
	case 2922:
	$name=$_POST['name'];
	$sch=$_POST['sch'];
	//$other=$_POST['other'];
	$mobile=$_POST['mobile'];
	//$session=$_POST['session'];
	$class=$_POST['class'];
	$date=$_POST['date'];
	//echo $date;
	$status=$_POST['status'];
	 $sel1="select * from  presentclassteacher where sch='$sch' and date='$date' ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$name=$row1['name'];
	//echo $name;
	if($row1)
	{
		$up="update  presentclassteacher set sch='$sch',name='$name',class='$class',date='$date',status='$status' where sch='$sch' and date='$date'";
	$res1=mysqli_query($conn,$up);
	//echo "up";
		if($status=='A')
		{
		
	$mob=$mobile;
	$to=$mob;
	$date1=date("d-m-Y",strtotime($date));
$message='Dear Teacher, Mr. ' .$name. ' is Absent Today ' .$date1. "/-". "in School  
Regards 
GC School Jiyanpur.";

$msg=urlencode($message);


$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=GCSN&receiver=$to&route=TA&msgtype=1&sms=$msg";

$result=file_get_contents($api);
		

$ins2="insert into message (message,count) value('$message','1')";
	$res2=mysqli_query($conn,$ins2);
	}
	
	}
	else
	{
	 $ins="insert into presentclassteacher(sch,name,class,date,status,mobile) values('$sch','$name','$class','$date','$status','$mobile')";
	$res=mysqli_query($conn,$ins);
	if($res)
	{
		//echo"ok";
		if($status=='A')
		{
		
	$mob=$mobile;
	$to=$mob;
	$date1=date("d-m-Y",strtotime($date));
$message='Dear Teacher, Mr. ' .$name. ' is Absent Today ' .$date1. "/-". "in School  
Regards 
MDS NIZAMABAD AZAMGARH.";

$msg=urlencode($message);


$api="http://bulksms.jupitersms.com/index.php/smsapi/httpapi/?uname=brkweb&password=india&sender=MDSNIZ&receiver=$to&route=TA&msgtype=1&sms=$msg";

$result=file_get_contents($api);
		

$ins2="insert into message (message,count) value('$message','1')";
	$res2=mysqli_query($conn,$ins2);
	}
	}
	else
	{
		echo "not";
	}
	}
	break;
	case 2931:
	
	
	$id=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  classteacher where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	 $date=date('Y-m-d');
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
	// $app=$row['application'];
	 $name=$row['name'];
	// $subject=$row['subject'];
	?>
	<div class="table-responsive">

      
            
      
		<tbody>
		<form onsubmit="return recordupdate(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Name</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $name;?>"  readonly style="background-color:yellow;color:green"/></div>
				<input type="hidden" value="<?php echo $id;?>" name="sch"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
				<input type="hidden" value="<?php echo $row['name'];?>" name="name"/>
				<input type="hidden" value="<?php echo $row['mobile'];?>" name="mobile"/>
				<input type="hidden" value="<?php echo $row['class1'];?>" name="class"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
					
				</div>
		
				
		<br/>
		<br/>
				
		
				<div class="form-group">
				<label class="col-sm-3 control-label">Status.</label>
				<div class="col-sm-3">
				<select name="status"><option style="font-size:15px;color:green;font-weight:bold">P</option><option style="font-size:15px;color:red;font-weight:bold">A</option></select>
				</div>
		<center><button class="btn btn-danger">Save</button></center>
		
		</form>
		<br/>
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
	case 611:
	//$ch=$_POST['choice'];
	//echo $ch;
	$session=$_POST['session'];
//	$class=$_POST['class'];
	$month=$_POST['month'];
  $sel1="select * from registration where session='$session' and status=''  order by id asc ";
	$res1=mysqli_query($conn,$sel1);
	
	
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy',  'excel', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
           <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month </th><th  style="text-align:center">Paid</th><th  style="text-align:center"> Dues UP TO <?php $ma=date("M"); echo $ma;?></th>
            </tr>
        </thead>

<tbody>		
  <?php
  $s=0;
  $toamount=0;
  $totalpay=0;
  while($row=mysqli_fetch_array($res1,MYSQLI_BOTH))
  {
  $app=$row['application'];
  $application=$row['application'];
  $code=$row['code'];
  $tra=$row['tra'];
  $subject=$row['subject'];
  $class=$subject;
  $sel24="select * from convence where code='$code' and session='$session'";
	$res24=mysqli_query($conn,$sel24);
	$row24=mysqli_fetch_array($res24,MYSQLI_BOTH);
	//$vill=$row2['vill'];
	$conv=$row24['conv'];
	$conv12=(int)$conv;
	
  ////////////for month show///////////
  	  //echo $conc;
	  	  $selca="select * from  studentfees where  month like '%April%' and year='$session' and search='$application' and status='' order by id desc ";
	$resca=mysqli_query($conn,$selca);
	$a='';
	if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH))
	{
		$a='1';
	}
	//////may
	$selcm="select * from  studentfees where  month like '%May%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescm=mysqli_query($conn,$selcm);
	$b='';
	if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH))
	{
		$b='2';
	}
	//////Jun
	$selcj="select * from  studentfees where  month like '%Jun%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescj=mysqli_query($conn,$selcj);
	$c='';
	if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH))
	{
		$c='3';
	}
	//////july
	$selcmj="select * from  studentfees where  month like '%July%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmj=mysqli_query($conn,$selcmj);
	$d='';
	if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH))
	{
		$d='4';
	}
	//////August
	$selcmja="select * from  studentfees where  month like '%August%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmja=mysqli_query($conn,$selcmja);
	$e='';
	if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH))
	{
		$e='5';
	}
	//////sep
	$selcms="select * from  studentfees where  month like '%September%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescms=mysqli_query($conn,$selcms);
	$f='';
	if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH))
	{
		$f='6';
	}
	//////oct
	$selcmjo="select * from  studentfees where  month like '%October%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjo=mysqli_query($conn,$selcmjo);
	$g='';
	if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH))
	{
		$g='7';
	}
	//////Nov
	$selcmjn="select * from  studentfees where  month like '%November%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjn=mysqli_query($conn,$selcmjn);
	$h='';
	if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH))
	{
		$h='8';
	}
	//////Dec
	$selcmjd="select * from  studentfees where  month like '%December%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjd=mysqli_query($conn,$selcmjd);
	$i='';
	if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH))
	{
		$i='9';
	}
	//////Jan
	$selcmjdj="select * from  studentfees where  month like '%January%' and year='$session' and search='$application'and status='' order by id desc ";
	$rescmjdj=mysqli_query($conn,$selcmjdj);
	$j='';
	if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH))
	{
		$j='10';
	}
	//////Jan
	$selcmf="select * from  studentfees where  month like '%February%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmf=mysqli_query($conn,$selcmf);
	$k='';
	if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH))
	{
		$k='11';
	}
	//////mar
	$selcmm="select * from  studentfees where  month like '%March%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmm=mysqli_query($conn,$selcmm);
	$l='';
	if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH))
	{
		$l='12';
	}
  ////////////for month show///////////
  
  ////max for month/////////
  $max=max($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l);
//  echo $max;
  ////max for month/////////
  
  
  if($max==11 or $max==12)
  {
      $ex1='300';
  }
  else
  {
      $ex1='0';
  }
  
  ////for month cal_days_in_month/////
  $sel211="select * from studentfees where year='$session' and class='$class' and search='$app' and status='' order by id asc ";
	$res211=mysqli_query($conn,$sel211);
	
	$row211=mysqli_fetch_array($res211,MYSQLI_BOTH);
	$month=$row211['month'];
	$pre1=$row211['pre'];
	
  ////////for month cal close/////
 
$sel="select * from studentfees where year='$session' and class='$class' and search='$app' and status=''  order by id asc ";
	$res=mysqli_query($conn,$sel);
	/////for fees paid 
	$am=0;

	$co=0;
	$mon='';
	while($row1=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$paid=$row1['paid'];
		$con=$row1['con'];
		$am=$am+$paid;
		$co=$co+$con;
		$m=$row1['month'];
		$mon=$mon.','.$m;
	}
	/////for fees paid 
	$totalpay=$totalpay+$am;
	////for class fees 
	$sel2="select * from fees where session='$session' and class='$class'  ";
	$res2=mysqli_query($conn,$sel2);
	/////for fees paid 
	$row2=mysqli_fetch_array($res2,MYSQLI_BOTH);
	if($tra=='')
	{
		$tra1=$row2['addm'];
	}
	else
	{
		$tra1=$row2['ann'];
	}
	//echo $tra1;
	$fees=$row2['fees'];
	$gen=$row2['gen'];
	$computer=$row2['comp'];
	$maint=$row2['reg'];
	
//

	$other=$row211['other'];
	$date=date("m");
	$m1=(int)$maint;
		
	$m2=(int)$tra1;
	$ma=(int)$max;
$m3=(int)$other;
	$m5=(int)$computer;
	$m6=(int)$gen;
	$date5=(int)$date;

	if( $date5==11 )
	{
		$ex='600';
	}
	else
	{
		$ex='300';
	}
	
	if($date==4)
	{
		$cal=1;
	}
	if($date==5)
	{
		$cal=2;
	}
	if($date==6)
	{
		$cal=3;
	}
	if($date==7)
	{
		$cal=4;
	}
	if($date==8)
	{
		$cal=5;
	}
	if($date==9)
	{
		$cal=6;
	}
	if($date==10)
	{
		$cal=7;
	}
	if($date==11)
	{
		$cal=8;
	}
	if($date==12)
	{
		$cal=9;
	}
	if($date==1)
	{
		$cal=10;
	}
	if($date==2)
	{
		$cal=11;
	}
	if($date==3)
	{
		$cal=12;
	}
	//echo $cal;
	
	$n=(int)$fees;
		$pai=$cal-$ma;
	 ////free///
  $sel211f="select * from free where session='$session' and class='$class' and sch='$app' ";
	$res211f=mysqli_query($conn,$sel211f);
	
	$row211f=mysqli_fetch_array($res211f,MYSQLI_BOTH);
	
	$sel211f1="select * from studentfees where year='$session' and class='$class' and search='$app' and status='' order by id asc";
	$res211f1=mysqli_query($conn,$sel211f1);
	
	$row211f1=mysqli_fetch_array($res211f1,MYSQLI_BOTH); 
		$pre=$row211f1['pre'];
	$feef=$row211f['fee'];
	$convf=$row211f['conv'];
	$fixf=$row211f['fix'];
	
	if($feef=='YES')
	{
		$ff=$pai*$n;
	}
	else
	{
		$ff='0';
	}
	
	if($convf=='YES')
	{
		$fc=$pai*$conv12;
	}
	else
	{
		$fc='0';
	}
	if($subject=='NINTH CBSE')
	{
	    $regn='1500';
	}
	else
	{
	    $regn='0';
	}
  ////free///
//	echo $ff;
//	echo $fc;
	//echo $n;
	$balance=$cal*$n;
	$fixc=(int)$fixf;
		$fixd=$pai*$fixc;
		
	$convm=$conv12*$cal;
	$tc=$fc+$ff+$fixd;
//	echo $n;
	$main=$balance+$m1+$m2+$m3+$m5+$m6+$convm+$ex+$pre1+$regn+$ex1-$conv12;
	$amountnet=$main-$am-$co-$tc;
	$toamount=$amountnet+$toamount;
	//echo $balance;
	////for class fees 
	$sel21="select * from studentfees where year='$session' and class='$class' and search='$app' and status='' ";
	$res21=mysqli_query($conn,$sel21);
	$row21=mysqli_fetch_array($res21,MYSQLI_BOTH);
	$dues=$row21['remain'];
		?>
		 
	<tr class="text-center">
<td><?php echo $row['application'] ;?></td><td><?php echo $row['name'];?></td><td><?php echo $row['fname'];?></td><td><?php echo $row['subject'];?></td><td><?php echo $mon;?></td><td><?php echo $am;?></td><td><?php echo $amountnet;?></td>
	
	
	</tr>
	<?php
	$s++;
	}
	?>
	<tr class="text-center">
<td>TOTAL</td><td></td><td></td><td></td><td></td><td><?php echo $totalpay;?></td><td><?php echo $toamount;?></td>
	
	
	</tr>
	<tfoot>
            <tr tr align="center">
                <th  style="text-align:center">Sch No.</th><th  style="text-align:center">Name</th><th  style="text-align:center">Father</th><th  style="text-align:center">Class</th><th  style="text-align:center">Paid Month </th><th  style="text-align:center"><?php echo $totalpay;?></th><th  style="text-align:center"> <?php echo $toamount;?></th>
            </tr>
        </tfoot>
	 </tbody>
    </table>
	<?php
	
	?>
	
	</div>
	
	<?php
	
	break;
	case 5555:
	$session=$_POST['session'];
	$date=$_POST['date'];
		$sel="select * from  registration where session='$session' and status=''";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
		$b=$row['postoffice'];
	
	$c=$row['dist'];
	$app1=$row['application'];
	$fname=$row['fname'];
	$name=$row['name'];
	$class=$row['subject'];
	$session=$row['session'];
	//$date=date('Y-m-d');
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
 $section=$row['section'];
	date_default_timezone_set("asia/kolkata");
	$d=$row['mobile'];
	$sel1="select * from  present1 where sch='$app1' and session='$session' and date='$date'";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$status1=$row1['status'];
	if($status1=='')
	{
	    $inst="insert into present1(sch,name,class,date,user,status,fname,session,section) values('$app1','$name','$class','$date','user','P','$fname','$session','$section')";
	$rest=mysqli_query($conn,$inst);
		$q=mysqli_query($conn,$rest);
	}
	
	
	$s++;
	}
	echo 'Students of All Class Present Successfully ! Please Absent One By One Student With Attendence Button';
	break;
		case 211:
	
	$session=$_POST['session'];
	$class=$_POST['class'];
	$section=$_POST['section'];
//	echo $session;
	$nsession=$_POST['nsession'];
	$nclass=$_POST['nclass'];
	$nsection=$_POST['nsection'];
	//	echo $nsession;
	$date=date("d-m-Y");
	
//		echo $nclass;
	$sel="select * from registration where subject='$class' and session='$session' and section='$section' and status=''";
	$res=mysqli_query($conn,$sel);
	
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$sch1=$row['application'];
	//	echo $sch1;
	$sel4="select * from registration where  session='$nsession' and subject='$nclass' and application='$sch1' and status=''";
	$res4=mysqli_query($conn,$sel4);
	$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
		$name=$row['name'];
		echo $name;
		echo '-';
$code=$row['code'];
$adhar=$row['adhar'];
$mediam=$row['mediam'];
$caste=$row['caste'];
$minority=$row['minority'];
//echo"$name";
//echo"<br/>";
$father=$row['fname'];
//echo"$father";
$mother=$row['mname'];

//echo"$mother";
//echo"<br/>";
$app=$row['application'];
//echo"$app";
//echo"<br/>";

$gender=$row['gender'];
$session=$_POST['session'];
//echo"$gender";
$dob=$row['dob'];
//echo"$dob";

//echo"$class";

//echo"$mother";


//echo"$high1";


$subject=$_POST['class'];
//echo"$inter1";

//echo"$grade";
$newimgname=$row['picture'];
$city=$row['city'];
//echo"$city";
$city1=$row['city1'];
//echo"$city";
$village=$row['village'];
//echo"$village";
$village1=$row['village1'];
//echo"$village1";
$postoffice=$row['postoffice'];
//echo"$postoffice";
$postoffice1=$row['postoffice1'];
//echo"$postoffice1";
$dist=$row['dist'];
//echo"$dist";
$dist1=$row['dist1'];
//echo"$dist1";
$state=$row['state'];
//echo"$state";
$state1=$row['state1'];
//echo"$state1";
$mobile=$row['mobile'];
//echo"$mobile";
$mobile1=$row['mobile1'];
//echo"$mobile1";
$pincode=$row['pincode'];
//echo"$pincode";
$pincode1=$row['pincode1'];
	// for registration
	///
	
	
	
	
	
	
	$date=date("d-m-Y");
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
	$datetime=$date." ".$time;
	
	if($row4)
	{echo"already transfered in New Session";}
	else
	{
	//$ins="insert into  registration(application,name,fname,	mname,dob,gender,class,ele,board,year,total,obtain,per,grade,subject,city,village,postoffice,dist,state,mobile,pincode,picture,city1,village1,postoffice1,dist1, state1,mobile1,pincode1,session,mediam,adhar,datetime,minority,caste,code,last,whatsapp,action,action1,trans,tra) values('$app','$name','$father','$mother','$dob','$gender','$class','$ele','$board','$year','$tmark','$omark','$per','$grade','$nclass','$city','$village','$postoffice','$dist','$state','$mobile','$pincode','$newimgname','$city1','$village1','$postoffice1','$dist1','$state1','$mobile1','$pincode1','$nsession','$mediam','$adhar','$datetime','$minority','$caste','$code','$last','$whatsapp','','','$class','$class')";
			
	if(mysqli_query($conn,$ins))
				{
					echo "Transfered";
				//	$up="update registration set trans='$nclass' where id='$sch1' and session='$session' order by id desc";
					$res1=mysqli_query($conn,$up);
				}
				else
				{
					echo"not";
				}
	}
	}
	
	
	
	break ;
	case 500:
	$eid=$_REQUEST['id'];
//echo"$eid";
	$sel="select * from  registration where id='$eid' and status=''";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$application=$row['application'];
	
	$sel12="select * from  registration where application='$application' and status='' order by id asc";
	$res12=mysqli_query($conn,$sel12);
	$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
	
	$sel123="select * from  registration where application='$application' and status='' order by id desc";
	$res123=mysqli_query($conn,$sel123);
	$row123=mysqli_fetch_array($res123,MYSQLI_BOTH);
	?>
<form class="form-horizontal" onsubmit="return updaterow12(this)">
	    <div class="row">
	        <div class="col-sm-6">
	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Student Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name" ></div>
	
	</div>
	
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Father Name</label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>" name="fname" ></div>
	
	</div>
	
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Mother Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['mname'];?>" name="mname" ></div>
	
	</div>
	 <div class="form-group">
    <label  class="col-sm-4 control-label">Gender<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="radio" value="male" <?php if($row['gender']=='male'){echo'checked';}?> name="gnd">&nbsp;Male&nbsp;
     <input type="radio" value="female" <?php if($row['gender']=='female'){echo'checked';}?> name="gnd">&nbsp;Female
    </div>
  </div>
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">First Admission in class </label>
		<div class="col-sm-8"><select class="form-control"  name="first_class" required>
	<option value="">---select---</option>
	<option <?php if($row12['subject']=='NURSERY'){echo'selected';}?>>NURSERY</option>
	<option <?php if($row12['subject']=='LKG'){echo'selected';}?>>LKG</option>
	<option <?php if($row12['subject']=='UKG'){echo'selected';}?>>UKG</option>
	<option <?php if($row12['subject']=='PLAY GROUP'){echo'selected';}?>>PLAY GROUP</option>
	<option <?php if($row12['subject']=='FIRST'){echo'selected';}?>>FIRST</option>
	<option <?php if($row12['subject']=='SECOND'){echo'selected';}?>>SECOND</option>
	<option <?php if($row12['subject']=='THIRD'){echo'selected';}?>>THIRD</option>
	<option <?php if($row12['subject']=='FOURTH'){echo'selected';}?>>FOURTH</option>
	<option <?php if($row12['subject']=='FIFTH'){echo'selected';}?>>FIFTH</option>
	<option <?php if($row12['subject']=='SIXTH'){echo'selected';}?>>SIXTH</option>
	<option <?php if($row12['subject']=='SEVENTH'){echo'selected';}?>>SEVENTH</option>
	<option <?php if($row12['subject']=='EIGHTH'){echo'selected';}?>>EIGHTH</option>
	<option <?php if($row12['subject']=='NINTH'){echo'selected';}?>>NINTH</option>
	<option <?php if($row12['subject']=='TENTH'){echo'selected';}?>>TENTH</option>
	<option <?php if($row12['subject']=='ELEVENTH'){echo'selected';}?>>ELEVENTH</option>
		<option <?php if($row12['subject']=='TWELFTH'){echo'selected';}?>>TWELFTH</option>
		
		</select></div>
	
	</div>
	 <div class="form-group">
    <label  class="col-sm-4 control-label">First Admission Date<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="dob"  name="first_date"> <span><p style="color:blue">DD-MM-YYYY</p></span>
    </div>
  </div>
	<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Lost Admission in class </label>
		<div class="col-sm-8"><select class="form-control"  name="lost_class" required>
	<option value="">---select---</option>
	<option <?php if($row123['subject']=='NURSERY'){echo'selected';}?>>NURSERY</option>
	<option <?php if($row123['subject']=='LKG'){echo'selected';}?>>LKG</option>
	<option <?php if($row123['subject']=='UKG'){echo'selected';}?>>UKG</option>
	<option <?php if($row123['subject']=='PLAY GROUP'){echo'selected';}?>>PLAY GROUP</option>
	<option <?php if($row123['subject']=='FIRST'){echo'selected';}?>>FIRST</option>
	<option <?php if($row123['subject']=='SECOND'){echo'selected';}?>>SECOND</option>
	<option <?php if($row123['subject']=='THIRD'){echo'selected';}?>>THIRD</option>
	<option <?php if($row123['subject']=='FOURTH'){echo'selected';}?>>FOURTH</option>
	<option <?php if($row123['subject']=='FIFTH'){echo'selected';}?>>FIFTH</option>
	<option <?php if($row123['subject']=='SIXTH'){echo'selected';}?>>SIXTH</option>
	<option <?php if($row123['subject']=='SEVENTH'){echo'selected';}?>>SEVENTH</option>
	<option <?php if($row123['subject']=='EIGHTH'){echo'selected';}?>>EIGHTH</option>
	<option <?php if($row123['subject']=='NINTH'){echo'selected';}?>>NINTH</option>
	<option <?php if($row123['subject']=='TENTH'){echo'selected';}?>>TENTH</option>
	<option <?php if($row123['subject']=='ELEVENTH'){echo'selected';}?>>ELEVENTH</option>
		<option <?php if($row123['subject']=='TWELFTH'){echo'selected';}?>>TWELFTH</option>
		
		</select></div>
	
	</div>
	 <div class="form-group">
  
    <label  class="col-sm-4 control-label">Board <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="mediam" >
	<option value="">---select---</option>
	<option <?php if($row['mediam']=='UP BOARD'){echo'selected';}?>>UP BOARD</option>
	<option <?php if($row['mediam']=='CBSE BOARD'){echo'selected';}?>>CBSE BOARD</option>
	
	
	</select>
	</div>
	</div>
	  <div class="form-group">
	     
    <label  class="col-sm-4 control-label">Nationality<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="city"  name="nationality">
    </div>
  </div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Total Number of Working Days<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="number" class="form-control"  name="working_days" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Total Number of Working Days Present<span style="color:red"></span></label>
    <div class="col-sm-8">
     <input type="number" class="form-control"  name="working_days_present">
    </div>
  </div>
	   <div class="form-group">
  
    <label  class="col-sm-4 control-label">Exam Lost Taken <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="exam_month" required >
	<option value="">---select---</option>
	<option >March</option>
	<option >April</option>
	<option >May</option>
	<option >Jun</option>
	<option >July</option>
	<option >August</option>
	<option >September</option>
	<option >October</option>
	<option >November</option>
	<option >December</option>
	<option >January</option>
	<option >February</option>
	
	
	</select>
	</div>
	</div>
	  <div class="form-group">
  
    <label  class="col-sm-4 control-label">Result<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="result" required >
	<option value="">---select---</option>
	<option >Passed</option>
	<option >Failed</option>
	
	
	
	</select>
	</div>
	</div>
	   <div class="form-group">
    <label  class="col-sm-4 control-label">Concession Available<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control"  name="consession" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Games Played / Extra Currcular Activities<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control"   name="game" >
    </div>
  </div>

 
 
	</div>

	<div class="col-sm-6">
 <div class="form-group">
    <label  class="col-sm-4 control-label">Adhar card<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="mother" value="<?php echo $row['adhar'];?>" name="adhar"  >
    </div>
  </div>
	
	 <div class="form-group">
  
    <label  class="col-sm-4 control-label">Category<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="caste" required>
	<option value="">---select---</option>
	<option <?php if($row['caste']=='GEN'){echo'selected';}?>>GEN</option>
	<option <?php if($row['caste']=='OBC'){echo'selected';}?>>OBC</option>
	<option <?php if($row['caste']=='ST'){echo'selected';}?>>ST</option>
	<option <?php if($row['caste']=='SC'){echo'selected';}?>>SC</option>
			
	
	
	
	</select>
	</div>
	</div>
	 <div class="form-group">
    <label  class="col-sm-4 control-label">Date Of Birth<span style="color:red">*</span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="dob" value="<?php echo $row['dob']?>" name="dob"> <span><p style="color:blue">DD-MM-YYYY</p></span>
    </div>
  </div>
	
	<div class="form-group">
    <label  class="col-sm-4 control-label">Date Of Issue of Certificate<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="code"  name="issue_date"  ><span><p style="color:blue">DD-MM-YYYY</p></span>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Reason For Leaving School<span style="color:red"></span></label>
    <div class="col-sm-8">
      <input type="text" class="form-control"   name="leaving_reason"  >
    </div>
  </div>
	 <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">First Admission in Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="first_session" >
	<option value="">---select---</option>
				<option <?php if($row12['session']=='2018-2019'){echo'selected';}?>>2018-2019</option>
				<option <?php if($row12['session']=='2019-2020'){echo'selected';}?>>2019-2020</option>
				<option <?php if($row12['session']=='2020-2021'){echo'selected';}?>>2020-2021</option>
				<option <?php if($row12['session']=='2021-2022'){echo'selected';}?>>2021-2022</option>
				<option <?php if($row12['session']=='2022-2023'){echo'selected';}?>>2022-2023</option>
	</select>
	</div>
	</div>
	 <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Lost Admission in Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="lost_session" >
	<option value="">---select---</option>
				<option <?php if($row123['session']=='2018-2019'){echo'selected';}?>>2018-2019</option>
				<option <?php if($row123['session']=='2019-2020'){echo'selected';}?>>2019-2020</option>
				<option <?php if($row123['session']=='2020-2021'){echo'selected';}?>>2020-2021</option>
				<option <?php if($row123['session']=='2021-2022'){echo'selected';}?>>2021-2022</option>
				<option <?php if($row123['session']=='2022-2023'){echo'selected';}?>>2022-2023</option>
	</select>
	</div>
	</div>
	<div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Promotion to Higher Class <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="promotion" >
	<option value="">---select---</option>
				<option >Yes</option>
				<option >No</option>
				
	</select>
	</div>
	</div>
		<div class="form-group">
		<br/>
	<label class="col-sm-4 control-label">Promotion in class </label>
		<div class="col-sm-8"><select class="form-control"  name="promotion_class" required>
	<option value="">---select---</option>
	<option >NURSERY</option>
	<option >LKG</option>
	<option >UKG</option>
	<option >PLAY GROUP</option>
	<option >FIRST</option>
	<option >SECOND</option>
	<option >THIRD</option>
	<option >FOURTH</option>
	<option >FIFTH</option>
	<option >SIXTH</option>
	<option >SEVENTH</option>
	<option >EIGHTH</option>
	<option >NINTH</option>
	<option >TENTH</option>
	<option >ELEVENTH</option>
		<option >TWELFTH</option>
		
		</select></div>
	
	</div>
	 <div class="form-group">
  <br/>
    <label  class="col-sm-4 control-label">Sch. No.<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<input type="text" class="form-control" value="<?php echo $application;?>"  name="app" required readonly />
	<input type="hidden" class="form-control" value="<?php echo $eid;?>"  name="id1234" required />
	
	</div>
	</div>
	
  <div class="form-group">
  
    <label  class="col-sm-4 control-label">General Conduct<span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="conduct" required >
	<option value="">---select---</option>
	<option >Good</option>
	<option >Better</option>
	<option >Best</option>
	
	
	
	</select>
	</div>
	</div>
	  <div class="form-group">
    <label  class="col-sm-4 control-label">Any Other Remark<span style="color:red">*</span></label>
    <div class="col-sm-8">
     <input type="text" class="form-control"   name="remark" >
    </div>
  </div>
	</div>
	
	</div>
	<center>
	 <button class="btn btn-success" >Submit</button>&emsp;&emsp;<center>
	</form>
	
<?php 
	break;
		case 501:
	$name=$_POST['name'];
	$application=$_POST['app'];

$fname=$_POST['fname'];
$first_date=$_POST['first_date'];
$issue_date=$_POST['issue_date'];
//echo"$father";
$mname=$_POST['mname'];
$gnd=$_POST['gnd'];
$first_class=$_POST['first_class'];
$lost_class=$_POST['lost_class'];
$mediam=$_POST['mediam'];
$nationality=$_POST['nationality'];
$working_days=$_POST['working_days'];
$working_days_present=$_POST['working_days_present'];
$exam_month=$_POST['exam_month'];
$result=$_POST['result'];
$consession=$_POST['consession'];
$game=$_POST['game'];
$adhar=$_POST['adhar'];
$caste=$_POST['caste'];
$leaving_reason=$_POST['leaving_reason'];
$first_session=$_POST['first_session'];
$lost_session=$_POST['lost_session'];
$promotion=$_POST['promotion'];
$promotion_class=$_POST['promotion_class'];
$conduct=$_POST['conduct'];
$remark=$_POST['remark'];

$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");


			
//--------------------------------------------------------------------
				$sel12="select * from certificate where application='$application'";
				$res12=mysqli_query($conn,$sel12);
				$row12=mysqli_fetch_array($res12,MYSQLI_BOTH);
				
				
	if($row12)
	{
	$up="update certificate set first_class='$first_class',lost_class='$lost_class',mediam='$mediam',nationality='$nationality',working_days='$working_days',working_days_present='$working_days_present',exam_month='$exam_month',result='$result',consession='$consession',game='$game',adhar='$adhar',caste='$caste',leaving_reason='$leaving_reason',first_session='$first_session',lost_session='$lost_session',promotion='$promotion',promotion_class='$promotion_class',conduct='$conduct',remark='$remark',date='$date',time='$time',first_date='$first_date',issue_date='$issue_date' where application='$application' ";
	if(mysqli_query($conn,$up))
		{
			echo 'Update Old Data Successfully';
		}
		else
		{
			echo 'Not Update Old Data ';
		}
	
	}
	else
	{
		$ins="insert into certificate(application,name,fname,mname,gnd,first_class,lost_class,mediam,nationality,working_days,working_days_present,exam_month,result,consession,game,adhar,caste,leaving_reason,first_session,lost_session,promotion,promotion_class,conduct,remark,date,time,first_date,issue_date)values('$application','$name','$fname','$mname','$gnd','$first_class','$lost_class','$mediam','$nationality','$working_days','$working_days_present','$exam_month','$result','$consession','$game','$adhar','$caste','$leaving_reason','$first_session','$lost_session','$promotion','$promotion_class','$conduct','$remark','$date','$time','$first_date','$issue_date')";
		if(mysqli_query($conn,$ins))
		{
			echo 'Submit';
		}
		else
		{
			echo 'not Insert';
		}
	}
				// for updation and image 
				//
			
//-------------------------------------------------------------
	break;
	case 51512:
	$session=$_POST['session'];
	$section=$_POST['section'];
	$class=$_POST['class'];
  $sel1="select * from  registration where session ='$session' and  subject='$class' and status='' order by id asc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>

 
     <style>
					
.work
{
	min-height:200px;
}
.gap
{
	height:100px;
}
				


	
   td{font-size:20px;
		}
		#classset{text-align:right}
   
					</style>
<?php 
		 $sel="select * from  registration where session ='$session' and section='$section' and subject='$class' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	$p=0;
	$s=1;
		while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
			
		{	
		
		?>
				
					<div  style="border-style:solid"> 
					<table >
					<tr><td colspan="4">.</td></tr>
					<th  colspan="4" style="text-align:center">* DESK SLIP *</th>
					</tr>
					<tr>
					<td style="font-weight:bold">Roll No.:-&nbsp;</td><td><?php  echo $s++;?></td><td style="font-weight:bold;text-align:center">&nbsp;&nbsp;Class:-&nbsp;&nbsp;</td><td style="text-align:right" id="classset"><?php echo $row['subject'];?> <?php echo $row['section'];?></td>
					</tr>
					<tr>
					<td style="font-weight:bold">Student's Name:-&nbsp;</td><td  colspan="3"><?php echo $row['name'];?></td>
					</tr>
					<tr>
					<td style="font-weight:bold">Father's Name:-&nbsp;</td><td colspan="3" ><?php echo $row['fname'];?></td>
					</tr>
					<tr><td colspan="4">.</td></tr>
					</table>
						
					</div>
				</div>
				
				<?php
				$p++;
				if($p==6 )
			{
			    ?><p style="page-break-after: always;">&nbsp;</p> <?php 
			    $p=0;
			}
			
		}
	
			?>
				
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	?>
	 
	
	<?php
	break;
		case 511:
	$session=$_POST['session'];
	$section=$_POST['section'];
	$class=$_POST['class'];
  $sel1="select * from  registration where session ='$session'  and subject='$class' and status='' order by id asc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>

<?php 
		 $sel="select * from  registration where session ='$session' and section='$section' and subject='$class' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	
	$sel1="select * from  pgukgadmit where  class='$class' order by id asc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
		while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
			
		{	
		
		?>
				<div class="col-sm-3 col-xs-3 "  id="set" >
					<div  style="border-style:solid"> 
					<table  height="100px">
					<tr>
					<th  colspan="7" style="text-align:center">* STUDENT DETAILS *</th>
					</tr>
					<tr>
					<td style="font-weight:bold">Roll No.:-&nbsp;</td><td><?php echo $row['id'];?></td><td style="font-weight:bold;text-align:center">&nbsp;&nbsp;Class:-&nbsp;&nbsp;</td><td style="text-align:right" id="classset"><?php echo $row['subject'];?></td>
					</tr>
					<tr>
					<td style="font-weight:bold">Student's Name:-&nbsp;</td><td  colspan="3"><?php echo $row['name'];?></td>
					</tr>
				
				
					</table>
						
					</div>
					
				</div>
				<div class="col-sm-9 col-xs-9 "  id="set1" >
					<div  style="border-style:solid"> 
					<table  border="1px solid" height='100px' WIDTH="100%">
					<tr>
					<th   colspan="9" style="text-align:center">* EXAM ATTENDENCE *</th>
					</tr>
					<tr>
					<td></td><td ><?php echo $row1['date1'];?></td><td><?php echo $row1['date2'];?></td><td ><?php echo $row1['date3'];?></td><td ><?php echo $row1['date4'];?></td><td ><?php echo $row1['date5'];?></td><td ><?php echo $row1['date6'];?></td><td ><?php echo $row1['date7'];?></td><td ><?php echo $row1['date8'];?></td><td ><?php echo $row1['date9'];?></td>
					</tr>
					<tr>
					<td>Signature</td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td><td style="font-weight:bold"></td>
					</tr>
				
				
					</table>
						
					</div>
					
				</div>
				
				<?php
			
		}
		?></br><?php
			?>
				
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 1819:
	$year1=$_POST['session'];
	 $class=$_POST['class'];
	 
	 $sel13="select * from  pgukgadmit where class ='$class' order by id desc";
	$res13=mysqli_query($conn,$sel13);
	$row13=mysqli_fetch_array($res13,MYSQLI_BOTH);
  $sel1="select * from  registration where session ='$year1' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">SCH NO</th><th  style="text-align:center">NAME</th> <th  style="text-align:center">CLASS</th><th  style="text-align:center"><?php echo $row13['sub1']?></th><th  style="text-align:center"><?php echo $row13['sub2']?></th><th  style="text-align:center"><?php echo $row13['sub3']?></th><th  style="text-align:center"><?php echo $row13['sub4']?><span style="color:red"></span></th><th  style="text-align:center"><?php echo $row13['sub5']?></th><th  style="text-align:center"><?php echo $row13['sub6']?></th><th  style="text-align:center"><?php echo $row13['sub7']?></th><th  style="text-align:center"><?php echo $row13['sub8']?></th><th  style="text-align:center"><?php echo $row13['sub9']?></th>
            </tr>
        </thead>

<tbody>		
  <?php
  $year=$_POST['session'];
  $class=$_POST['class'];
  $sel="select * from  registration where session ='$year1' and subject='$class' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['subject'];?></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
		case 4242:
	?>
<script>
$("document").ready(function(){
		
		$("#cons").keyup(function(){
		   // alert('ok');
			var dew1=$("#dew").val();
			var paid1=$("#paid").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
			
			var total1= parseInt(dew1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew").val(total1);
		});
		
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#ndew").focus(function(){
		   // alert('ok');
			var dew1=$("#dew").val();
			var paid1=$("#paid").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
			
			var total1= parseInt(dew1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew").val(total1);
		});
		
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#cons").keypress(function(){
		   // alert('ok');
			var dew1=$("#dew").val();
			var paid1=$("#paid").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
			
			var total1= parseInt(dew1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew").val(total1);
		});
		
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#paid").keyup(function(){
			var dew1=$("#dew").val();
			var paid1=$("#paid").val();
			var cons1=$("#cons").val();
		//	var ndew1=$("#ndew").val();
			
			var total1= parseInt(dew1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew").val(total1);
		});
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#paid").keypress(function(){
			var dew1=$("#dew").val();
			var paid1=$("#paid").val();
			var cons1=$("#cons").val();
		//	var ndew1=$("#ndew").val();
			
			var total1= parseInt(dew1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew").val(total1);
		});
	
		
		
	});
	
	
		$(document).ready(function(){
		
		$("#cons").keyup(function(){
			//alert('c');
        var co=$("#cons").val();
		
        var re=$("#remark").val();
		if(co!='0')
		{
			$("#remark").attr("required", "true");
		}
		else
		{
			$("#remark").removeAttr('required');
		}
    });
		
});
	
	</script>
	<?php
	$sch=$_REQUEST['application'];
	$application=$sch;
	//echo"$eid";
		$sel67="select * from  registration where application='$sch' and status='' order by id desc";
	$res67=mysqli_query($conn,$sel67);
	$row67=mysqli_fetch_array($res67,MYSQLI_BOTH);
	
	$sel="select * from  studentfees where search='$sch' and status='' order by id desc";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$paid12=$row['paid'];
		$year=$row['year'];
		$session=$year;
	////FOR DUT
		  	  $selca="select * from  studentfees where  month like '%April%' and year='$session' and search='$application' and status='' order by id desc ";
	$resca=mysqli_query($conn,$selca);
	$a='';
	if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH))
	{
		$a='4';
	}
	//////may
	$selcm="select * from  studentfees where  month like '%May%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescm=mysqli_query($conn,$selcm);
	$b='';
	if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH))
	{
		$b='5';
	}
	//////Jun
	$selcj="select * from  studentfees where  month like '%Jun%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescj=mysqli_query($conn,$selcj);
	$c='';
	if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH))
	{
		$c='6';
	}
	//////july
	$selcmj="select * from  studentfees where  month like '%July%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmj=mysqli_query($conn,$selcmj);
	$d='';
	if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH))
	{
		$d='7';
	}
	//////August
	$selcmja="select * from  studentfees where  month like '%August%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmja=mysqli_query($conn,$selcmja);
	$e='';
	if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH))
	{
		$e='8';
	}
	//////sep
	$selcms="select * from  studentfees where  month like '%September%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescms=mysqli_query($conn,$selcms);
	$f='';
	if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH))
	{
		$f='9';
	}
	//////oct
	$selcmjo="select * from  studentfees where  month like '%October%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjo=mysqli_query($conn,$selcmjo);
	$g='';
	if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH))
	{
		$g='10';
	}
	//////Nov
	$selcmjn="select * from  studentfees where  month like '%November%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjn=mysqli_query($conn,$selcmjn);
	$h='';
	if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH))
	{
		$h='11';
	}
	//////Dec
	$selcmjd="select * from  studentfees where  month like '%December%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjd=mysqli_query($conn,$selcmjd);
	$i='';
	if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH))
	{
		$i='12';
	}
	//////Jan
	$selcmjdj="select * from  studentfees where  month like '%January%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmjdj=mysqli_query($conn,$selcmjdj);
	$j='';
	if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH))
	{
		$j='1';
	}
	//////Jan
	$selcmf="select * from  studentfees where  month like '%February%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmf=mysqli_query($conn,$selcmf);
	$k='';
	if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH))
	{
		$k='2';
	}
	//////mar
	$selcmm="select * from  studentfees where  month like '%March%' and year='$session' and search='$application' and status='' order by id desc ";
	$rescmm=mysqli_query($conn,$selcmm);
	$l='';
	if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH))
	{
		$l='3';
	}
  ////////////for month show///////////
  
  ////max for month/////////
  $max=max($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l);
 // echo $max;
  ////max for month/////////
  if($max==1)
  {
      $sh='January';
  }
  if($max==2)
  {
      $sh='February';
  }
  if($max==3)
  {
      $sh='March';
  }
  if($max==4)
  {
      $sh='April';
  }
  if($max==5)
  {
      $sh='May';
  }
  if($max==6)
  {
      $sh='Jun';
  }
  if($max==7)
  {
      $sh='July';
  }
  if($max==8)
  {
      $sh='August';
  }
  if($max==9)
  {
      $sh='September';
  }
  if($max==10)
  {
      $sh='October';
  }
  if($max==11)
  {
      $sh='November';
  }
  if($max==12)
  {
      $sh='December';
  }
	/////////
		$sel1="select * from  registration where application='$sch'  and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	?>
	<div class="table-responsive">

       <center><h2 class="modal-title" style="color:green;background-color:yellow"> PREE DUES ENTRY (<?php echo $year;?>) </h2> </center>
            
      
		<tbody>
		<form onsubmit="return feesupdate1(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Sch.</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $row67['application'];?>" name="search" id='search' readonly style="background-color:yellow;color:green"/></div>
				<input type="hidden" value="<?php echo $row67['id'];?>" name="id"/>
				<input type="hidden" value="<?php echo $row['paid'];?>" name="paid13"/>
				<input type="hidden" value="<?php echo $row67['subject'];?>" name="class"/>
				<input type="hidden" value="<?php echo $row67['session'];?>" name="year"/>
					<input type="hidden" value="<?php echo $row67['mediam'];?>" name="mediam"/>
					<input type="hidden" value="<?php echo $sh;?>" name="to"/>
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Name</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $row67['name'];?>" name="name" readonly style="background-color:gray;color:pink" /></div>
				
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Dues</label>
				<div class="col-sm-3"><input type="number" value="0"  name="dew" id="dew"  style="background-color:white;color:red"/></div>
				
				</div>
				
		<div class="form-group">
				<label class="col-sm-3 control-label">Paid</label>
				<div class="col-sm-3"><input type="number"   name="paid"  value="0" id="paid" required /></div>
				
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Concession</label>
				<div class="col-sm-3"><input type="number"   value="0"id="cons" name="cons" required /></div>
				
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Remark</label>
				<div class="col-sm-3"><input type="text"    id="remark" name="remark"  /></div>
				
				</div>
	
			<br/>
				<div class="form-group">
				<?php 
				
				date_default_timezone_set("asia/kolkata");
				
				$date1=date('Y-m-d');?>
				<div class="col-sm-3"><input type="hidden" value="<?php echo $date1;?>" name="date"  required /></div>
				
				</div>
		<center><button class="btn btn-danger">Paid</button></center>
		
		</form>
		
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
	case 4343:

	$id=$_POST['id'];
	$name=$_POST['name'];
		$board=$_POST['mediam'];
//	echo $name;
	$class=$_POST['class'];
//	echo $class;
	$date1=$_POST['date'];
	
	$year=$_POST['year'];
	$cons=$_POST['cons'];
		$remark=$_POST['remark'];
//	echo $year;
	$dew=$_POST['dew'];
		$to1=$_POST['to'];
//	echo $dew;
	$date=date("d-m-Y",strtotime($date1));
//	echo $date;
	//echo $id;
	$search=$_POST['search'];
//	echo $search;
	$paid13=$_POST['paid13'];
	//echo $search;
	$paid=$_POST['paid'];
	echo $dew;
	//echo $paid;
//	$ndew=$_POST['ndew'];
//	echo $ndew;
	$paid8=$paid+$paid13;
$amou=$paid+$cons;
	$re=$dew-$amou;
	$b='0';
	//echo"$eid";
		$ins="insert into studentfees(name,class,search,month,paid,remain,pre,date,year,exam,other,ann,addm,reg,comp,gen,board,con,remark,to1,mtotal,dpaid,fine,reg1,van,total,fee) values('$name','$class','$search','Dues','$paid','$dew','$dew','$date1','$year','0','0','0','0','0','0','0','$board','$cons','$remark','$to1','0','0','0','0','0','0','0')";
	
	if($res=mysqli_query($conn,$ins))
	{
		echo " Dues Entry Success";
	}
	else
	{
		echo "not update";
	}
	
	break;
	case 9696:
	     $date=date('Y-m-d');
		 if($user_login=='Admin')
		 {
			$sel1="select * from  studentfees  where date='$date'  and status=''  order by id asc ";
		 }
		 else
		 {
			$sel1="select * from  studentfees  where date='$date'  and status=''  and email='$email' order by id asc ";
		 }
	            
	            $sum=0;
$res1=mysqli_query($conn,$sel1);
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
{
	$tot=$row1['total'];
	$search=$row1['search'];
	
	$paid=$row1['paid'];
	$remain12=$row1['remain'];
	$sum=$paid+$sum;
}
echo $row785['name'].'='.$sum;
	    
	    break;
	    
		case 9191:
	?>
<script>

    $("#con").focus(function(){
        $("#remark").toggle('show');
    });
	$(document).ready(function(){
		$("#remark").toggle("hide");
});
</script>
<script>

    
	$(document).ready(function(){
		
		$("#con").change(function(){
        var co=$("#con").val();
		
        var re=$("#remark").val();
		if(co!='0')
		{
			$("#remark").attr("required", "true");
		}
		else
		{
			$("#remark").removeAttr('required');
		}
    });
		
});
</script>
<script>

	$(document).ready(function(){
		
		$("#con").keyup(function(){
			$con1=$("#con").val();
			if($con1=="0")
		{
			
			$("#con").css("border-color","green");
			
		}
		
		
        
    });
		$("#paid").keyup(function(){
			$con1=$("#con").val();
			$rem12=$("#remark").val();
			if($con1!="0")
		{
			if($rem12=="")
			{
			$("#con").css("border-color","red");
			}
			else
			{
				$("#con").css("border-color","green");
			}
		}
		else
		{
			$("#con").css("border-color","green");
			
		}
		
        
    });
		
});
//////////////////////////////////////////////////////////////////////for remark required
</script>

	
	
	<script>
	

	
		$("document").ready(function(){
		$("#btn").prop("disabled",true);
		$("#con").keyup(function(){
			
		
				var total12=$("#total").val();
				
		var paidd=$("#paid").val();
			var con12=$("#con").val();
			
			var total121= parseInt(total12) - parseInt(con12) ;
			
			
			
			$("#paid").val(total121);
			
		});
		
		
	});
	// fo sep exam fee
	$("document").ready(function(){
		
		$("#sep").change(function(){
			
		
			//	alert("ok");
				
				if($("#sep").prop("checked")==true)
				{
				    
				var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
					var febc=parseInt(200);
					}
					if(sess=='2019-2020')
					{
					var febc=parseInt(300);
					}
					
					
					var d=$("#exam").val(febc);
					var sep1=$("#exam").val();
					var feb1=$("#exam").val();
				}
				else
				{
					var d=$("#exam").val('0');
					
				}
		});
		
		
		
	});
	//for feb exam fee
		// fo sep exam fee
	$("document").ready(function(){
		
		$("#feb").change(function(){
			
		
			//	alert("ok");
				
				if($("#feb").prop("checked")==true)
				{
				    
					var de=$("#exam").val();
					var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
					var febc=parseInt(de)+200;
					}
					if(sess=='2019-2020')
					{
					var febc=parseInt(de)+300;
					}
					var feb2=$("#exam").val(febc);
					
				}
				else
				{
					var d=$("#exam").val('0');
					
				}
		});
		
		
	});
	//for feb exam fee
	////for jul
	$("document").ready(function(){
		
		$("#jul").change(function(){
			
		
				//alert("ok");
				
				if($("#jul").prop("checked")==true)
				{
				    
					var class1=$("#class").val();
					var sess=$("#session1").val();
					if(sess=='2018-2019')
					{
						
					var jul1=parseInt(0);
					}
					if(sess=='2019-2020')
					{
						if(class1=='NINTH CBSE')
						{
					var jul1=parseInt(1500);
						}
						else
						{
							var jul1=parseInt(0);
						}
					}
					var feb213=$("#reg12").val(jul1);
					//alert("ok");
				}
				else
				{
					var d8=$("#reg12").val('0');
					
				}
		});
		
		
	});
	////for jul
	
	$("document").ready(function(){
		
		$("#paid").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	
	$("document").ready(function(){
		
		$("#con").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	$("document").ready(function(){
		
		$("#con").keyup(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
		$("document").ready(function(){
		
		$("#ndew").focus(function(){
			
		
				var paidd=$("#paid").val();
				var conn=$("#con").val();
				var total12=$("#total").val();
		
			
		
			var total121= parseInt(total12) - parseInt(paidd)- parseInt(conn) ;
			
			$("#ndew").val(total121);
		});
		
		
	});
	// for check box coding (JAN)/////
	$("document").ready(function(){
		var totalm=0;
		
		var fees123=$("#fee").val();
		var conv123=$("#conv").val();
		var comp123=$("#comp").val();
		$(".option").change(function(){
			
			 var m=$(":checkbox").filter(':checked').length;
			 var lem=0;
			 
			 for(i=0;i< m;i++)
			 {
				 lem++;
				 //alert(lem);
			 }
			 if(lem>0)
				{
					//alert();
					$("#btn").prop("disabled",false);
				}
				else
				{
					$("#btn").prop("disabled",true);
				}
	 //for jun conv
	$("document").ready(function(){
		
		$("#jun1").change(function(){
			
		
			
				if($("#jun1").prop("checked")==true)
				{	//alert("ok");
				    var con12=$("#convcons1").val();
				    var con13=$('#convcons').val(con12);
					 var con14=$("#convcons").val();
				    var fees1=$("#fee").val();
				//	alert(con14);
		var conv1=$("#conv").val();
	//alert(conv1);
			var add1=$("#add").val();
			//alert(add1);
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
		//	alert(gen1);
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg1").val();
			//alert(reg12);
			var comp1=$("#comp").val();
			//alert(comp1);
			var ann1=$("#ann").val();
			//alert(ann1);
			var other1=$("#other").val();
			//alert(other1);
			var exam1=$("#exam").val();
			//alert(exam1);
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg1) - parseInt(con14);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg1)+ parseInt(dew1) - parseInt(con14);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
				}
				else{
				    
				     $('#convcons').val('0');
					
					 var con14=$("#convcons").val();
				    var fees1=$("#fee").val();
				//	alert(con13);
		var conv1=$("#conv").val();
	//alert(conv1);
			var add1=$("#add").val();
			//alert(add1);
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
		//	alert(gen1);
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg1").val();
		//	alert(reg12);
			var comp1=$("#comp").val();
			//alert(comp1);
			var ann1=$("#ann").val();
			//alert(ann1);
			var other1=$("#other").val();
			//alert(other1);
			var exam1=$("#exam").val();
			//alert(exam1);
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1) - parseInt(con14);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1) - parseInt(con14);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
				}
				
			
		});
		
		
	});
	//for jun conv
			 ////for consession reason
var con1=$("#con1").val();
var con1267=lem*con1;		
			////for consession reason 
		var fees1=$("#fee").val();
		//var comp1=$("#feess").val();
		
		var fees12=lem*fees123;
		var comp1=lem*comp123;
	//	alert(comp1);
		var conv12=lem*conv123;
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
		//	alert(reg1);
			var reg12=$("#reg12").val();
		//	var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) + parseInt(reg1) - parseInt(convcons1);
			var totalg= parseInt(fees12) + parseInt(add1) + parseInt(gen1) + parseInt(conv12)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1) + parseInt(reg1) + parseInt(reg12) - parseInt(convcons1);
		
			
			if($(this).prop("checked")==true)
		{
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#comp").val(comp1);
			$("#conv").val(conv12);
			$("#con").val(con1267);
		}
		else
		{
			var checkbox = document.getElementsByName('choice[]');
			 var n = checkbox.length;
			 var lem=0;
			
			 for(j=0;j< n;j++)
			 {
				 lem++;
				 //alert(lem1);
			 }
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			$("#fee").val(fees12);
			$("#conv").val(conv12);
			$("#comp").val(comp1);
			$("#con").val(con1267);
		}
		});
		
		
	});
	
	///for other
	$("document").ready(function(){
		
			$("#other").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		//	var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
		$("document").ready(function(){
		
			$("#reg12").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		var reg123=$("#reg12").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12)+ parseInt(reg123) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12)+ parseInt(reg123) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
		$("document").ready(function(){
		
			$("#exam").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
		//	var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	$("document").ready(function(){
		
		$("#convence").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg1=$("#reg").val();
			var reg12=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	

	$("document").ready(function(){
		
		$("#add").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
			var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
	/////payble
	$("document").ready(function(){
		
		$(".option").change(function(){
		//	alert("ok");
		
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	
	
	$("document").ready(function(){
		
		$("#ann").keyup(function(){
		//	alert("ok");
		
			var fees1=$("#fee").val();
		var conv1=$("#conv").val();
	
			var add1=$("#add").val();
			var dew1=$("#dew").val();
			var gen1=$("#gen").val();
			var paid1=$("#paid").val();
			//var conv1=$("#conv").val();
			var convcons1=$("#convcons").val();
			//	alert(convcons1);
			var con1=$("#con").val();
			var reg12=$("#reg").val();
			var reg1=$("#reg1").val();
			var comp1=$("#comp").val();
			var ann1=$("#ann").val();
			var other1=$("#other").val();
			var exam1=$("#exam").val();
			var totalm= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(reg12) - parseInt(convcons1);
			var totalg= parseInt(fees1) + parseInt(add1) + parseInt(gen1) + parseInt(conv1)  + parseInt(comp1) + parseInt(ann1) + parseInt(other1) + parseInt(exam1)+ parseInt(dew1)+ parseInt(reg12) - parseInt(convcons1);
			$("#mtotal").val(totalm);
			$("#total").val(totalg);
			
			var total3=$("#total").val();
		
			var con14=$("#con").val();
			var payble1=parseInt(total3)-parseInt(con14);
			$("#payble").val(payble1);
		});
		
		
	});
	//for other
	
	// for check box coding/////
	</script>
	
	
	<?php
	$fee_id=$_REQUEST['id'];
	//echo"$eid";
	$sel31="select * from studentfees where id='$fee_id' and status=''";
	$res31=mysqli_query($conn,$sel31);
	$row31=mysqli_fetch_array($res31,MYSQLI_BOTH);
	$eid=$row31['search'];
	$sel="select * from  registration where application='$eid' order by id desc";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$board=$row['mediam'];
	$class=$row['subject'];
	$village=$row['village'];
	$code=$row['code'];
	$application=$row['application'];
	$session=$row['session'];
	/// for transfer value set//
	$selt="select * from  registration where session='2022-2023' and application='$application' and status='' order by id desc";
	$rest=mysqli_query($conn,$selt);
	$rowt=mysqli_fetch_array($rest,MYSQLI_BOTH);
	$trans=$rowt['trans'];
		$selt1="select * from  registration where session='$session' and application='$application' and status='' order by id desc";
	$rest1=mysqli_query($conn,$selt1);
	$rowt1=mysqli_fetch_array($rest1,MYSQLI_BOTH);
	$tra=$rowt1['tra'];
	////////for set transfer////
	//////for consession 
	
	//echo $fix;
	//echo $reason;
	/// for consession
	///////////////fees
	
	$sel4="select * from studentfees where id='$fee_id'  and status='' order by id desc";
	$res4=mysqli_query($conn,$sel4);
	$row4=mysqli_fetch_array($res4,MYSQLI_BOTH);
	$remain=$row4['remain'];
	$search=$row4['search'];
	$gen12=$row4['gen'];
		$regc=$row4['reg'];
	$hob=explode(",",$row4['month']);
		//echo $hob;
		
	
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
		<?php
	  
	  ?>
		
	
				<div class="panel-body">
				<center><h2 class="modal-title" style="color:green;background-color:yellow"> CASH UPDATE (<?php echo $session;?>) </h2> </center>
				<div style="background-color:yellow">
			
			<?php
			$mon='';
	  $selm="select * from studentfees where id='$fee_id' and status='' order by id asc";
	$resm=mysqli_query($conn,$selm);
	while($rowm=mysqli_fetch_array($resm,MYSQLI_BOTH))
	{
		$monthm=$rowm['month'];
		$mon=$monthm.",";
		echo "<font color=red size=2pt>".$mon."</font>";
	}
	
	  
	  ?>
			
			</div>
				<form class="form-horizontal" onsubmit="return feesdata(this)" >
				
				 
				 <!----phli row-->
				 
				<div class="col-sm-6">
				    <br/>
				    <div class="form-group">
    <label  class="col-sm-4 control-label">Scho.-</label>
    <div class="col-sm-8">
      <input type="number" class="form-control"  value="<?php echo $application;?>" style="background-color:green;color:yellow"readonly >
    </div>
  </div>
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['application'];?>" name="app" id="app"/>
				<input type="hidden" value="<?php echo $fee_id;?>" name="fee_id" />
					<input type="hidden" value="<?php echo rand(10000,500000);?>" name="pr" id="pr"/>
					<input type="hidden" value="<?php echo $row['mobile'];?>" name="mobile1" />
					<input type="hidden" value="<?php echo $session;?>" name="" id="session1"/>
				<input type="hidden" value="<?php echo $board ;?>" name="board"/>
				<label class="col-sm-2 control-label">Name</label>
				<div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name" readonly style="background-color:pink;color:black" /></div>
				</div>
				<div class="form-group">
				<label class="col-sm-4 control-label">Father Name</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>"  style="background-color:gray;color:yellow" readonly></div>
				
				</div> 
			    <div class="form-group">
				<label class="col-sm-4 control-label">Class</label>
				<div class="col-sm-5"><input type="text" class="form-control" value="<?php echo $row['subject'];?>" id="class" name="class" style="background-color:#FF8800;color:#0099CC" readonly></div>
				<div class="col-sm-3"><input type="text" class="form-control" value="<?php echo $row['section'];?>"  name="section" style="background-color:#FF8800;color:#0099CC" readonly></div>
				</div> 
			 <?php
			 $sel1="select * from fees where class='$class' and session='$session' ";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$class1=$row1['class'];
	$fees=$row1['fees'];
	$reg=$row1['reg'];
		$reg1=$row1['reg'];
	$add=$row1['addm'];
	$ann=$row1['ann'];
	$comp13=$row1['comp'];
	$gen12=$row1['gen'];
			 
			 ?>
  <input type="hidden" class="form-control" value="<?php echo $row['session'];?>" name="year"  />
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">Miscellaneous</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="add"  value="<?php echo $row4['addm']?>" name="add" readonly required>
    </div>
  </div>
 
  <div class="form-group">
    <label  class="col-sm-4 control-label">Annual</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="ann" value="<?php echo $row4['ann']?>" name="ann" readonly required >
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Registration</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="reg12"  value="<?php echo $row4['reg']?>" name="reg1" required >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Exam</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" value='<?php echo $row4['exam']?>' id="exam"  name="exam" required >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Computer</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="comp" name="comp" value="<?php echo $row4['comp']?>"readonly required>
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Generator</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="gen" value="<?php echo $row4['gen']?>"  name="gen" readonly required>
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Maint/Med</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="reg" value="0" name="reg" readonly required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Others</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" value='<?php echo $row4['other']?>' id="other" placeholder="Other Charge" name="other" required>
    </div>
  </div>
    <div class="form-group">
    <label  class="col-sm-4 control-label">Remark</label>
    <div class="col-sm-8">
      <input type="text" class="form-control"  placeholder="Remark" value='<?php echo $row4['other_remark']?>'name="other_remark" >
    </div>
  </div>
  
  
			
  
  
  

  
			 </div>
			  <!----dusari row-->
				<div class="col-sm-6">
				    <br/>
				    	
				 
				    
			
  
   
  <div class="form-group">
    <label  class="col-sm-4 control-label">Tution Fee</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="fee" value="<?php echo $row4['fee']?>" name="fees"  readonly required>
      <input type="hidden" class="form-control" id="feess" value="<?php echo $fees;?>" >
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Conveyance</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="conv" value="<?php echo $row4['van']?>" name="conv" readonly required>
      <input type="hidden" class="form-control" id="conv123" value="<?php echo $code;?>" >
    </div>
  </div>
  <div class="form-group" style='display: none;'>
    <label  class="col-sm-4 control-label">Conv Cons</label>
    <div class="col-sm-8">
      
      <input type="number" class="form-control" id="convcons" value='0' readonly>
      <input type="hidden" class="form-control" id="convcons1" value="<?php if($conv!=''){echo $conv;}else{echo '0';}?>"">
    </div>
  </div>
  
  <div class="form-group">
    <label  class="col-sm-4 control-label">PreDues</label>
    <div class="col-sm-8">
      <input type="number" readonly style="color:red" id="dew" name="pre" value="<?php echo $row4['pre']?>" class="form-control"  required>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">MonthTotal</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="mtotal"  name="mtotal" value='<?php echo $row4['addm']?>' style="background-color:#3F729B;color:yellow" title="Please select Month" readonly required>
    </div>
  </div>
  <div class="form-group">
     <label  class="col-sm-4 control-label" STYLE="FONT-SIZE:13PX;FONT-WEIGHT:BOLD;color:blue;">GRAND TOTAL</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="total" value='<?php echo $row4['total']?>'style="font-size:18px;font-weight:bold;color:blue;background-color:#f06292" name="total1" readonly required>
    </div>
  </div>
   <div class="form-group">
    <label  class="col-sm-4 control-label">Consession</label>
    <div class="col-sm-8">
        <input type="hidden" class="form-control" id="con1"  value="<?php echo $row4['con']?>" >
         <input type="hidden" class="form-control" id="convcons1"  value="<?php echo $conv;?>">
      
      <input type="number" class="form-control" id="con" value="<?php echo $row4['con']?>" name="con" required>
      <textarea id="remark" rows="4" cols="32" style="resize:none" name="remark" ><?php echo $row4['remark']?></textarea>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Payable Amount</label>
    <div class="col-sm-8">
      <input type="number" style="color:green; font-weight:bold;font-size:19px"class="form-control" id="payble" value='<?php echo $row4['total']-$row4['paid']-$row4['con']?>'  required readonly>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-4 control-label">Paid</label>
    <div class="col-sm-8">
      <input type="number" class="form-control" id="paid"  name="paid" value='<?php echo $row4['paid']?>' required>
    </div>
  </div>
 
			<div class="form-group">
    <label  class="col-sm-4 control-label">New Dues</label>
    <div class="col-sm-8">
      <input type="number" style="color:red" class="form-control" id="ndew"  name="due" value='<?php echo $row4['remain']?>'readonly required>
    </div>
  </div>  	
    	
		
    		<div class="form-group">
    <label  class="col-sm-4 control-label">Paid Mode</label>
    <div class="col-sm-8">
    <select class='form-control' name='mode'>
		<option <?php if($row4['mode']=='Cash'){echo 'Selected';}?>>Cash</option>
		<option <?php if($row4['mode']=='UPI'){echo 'Selected';}?>>UPI</option>
		<option <?php if($row4['mode']=='CHECK'){echo 'Selected';}?>>CHECK</option>
		<option <?php if($row4['mode']=='BANK'){echo 'Selected';}?>>BANK</option></select>
      
    </div>
  </div>	
	<div class="form-group">
    <label  class="col-sm-4 control-label">Date</label>
    <div class="col-sm-8">
      <input type="date" style="color:red" class="form-control"   name="date12" value='<?php echo $row4['date']?>' required>
    </div>
  </div>  
  
  
				</div>
				
				<!----dusari row-->
				
				
				
				
  <div class="form-group">
    
    <div class="col-sm-5">
      
	   <br/>
				<center><button class="btn btn-primary" >Update</button>
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	</div>
	
	
	
	<?php
	break;
		case 1090:
	
	 
	//$ch=implode(',',$_POST['choice']);
//	echo $ch;
	$name=$_POST['name'];
		$remark1=$_POST['remark'];
			$other_remark1=$_POST['other_remark'];
			
			$remark=addslashes($remark1);
				$other_remark=addslashes($other_remark1);
	$exam=$_POST['exam'];
	$fee_id=$_POST['fee_id'];
	$other=$_POST['other'];
	$ann=$_POST['ann'];
	$paid=$_POST['paid'];
	$add=$_POST['add'];
	$reg=$_POST['reg'];
	$reg1=$_POST['reg1'];
	$comp=$_POST['comp'];
		$pre=$_POST['pre'];
	$gen=$_POST['gen'];
	$van=$_POST['conv'];
	$con=$_POST['con'];
	$search=$_POST['app'];
	$board=$_POST['board'];

		$mtotal=$_POST['mtotal'];
	$class=$_POST['class'];
	//$month=$_POST['month'];
	$mode=$_POST['mode'];
	$fee=$_POST['fees'];
		$pr=$_POST['pr'];
		$mobile1=$_POST['mobile1'];
	//	$date_add=$_POST['date_add'];
//	$date12=$_POST['date12'];
//$edate=date("d-m-Y",strtotime($date1));
//echo $edate;
	date_default_timezone_set("asia/kolkata");
	$time=date("h:i:sa");
			$date1=date('Y-m-d');
	$year=$_POST['year'];
	$total=$_POST['total1'];
	$remain=$total-$paid-$con;
	
	
	 $selm="select * from studentfees where id='$fee_id' ' order by id asc";
	$resm=mysqli_query($conn,$selm);
$rowm=mysqli_fetch_array($resm,MYSQLI_BOTH);

$search=$rowm['search'];
$name=$rowm['name'];
$class=$rowm['class'];	
$year=$rowm['year'];
$month=$rowm['month'];
$email=$rowm['email'];
$date12=$rowm['date'];

$ins="update studentfees set fee='$fee',van='$van',exam='$exam',other='$other',total='$total',remain='$remain',ann='$ann',addm='$add',reg='$reg',comp='$comp',gen='$gen',paid='$paid',con='$con',mtotal='$mtotal',pre='$pre',remark='$remark',reg1='$reg1',other_remark='$other_remark',mode='$mode',date='$date12' where id='$fee_id'";

	if(mysqli_query($conn,$ins))
	{
	    $ins1="insert into change_fees(name,class,month,fee,date,year,search,van,exam,other,total,board,remain,ann,addm,reg,comp,gen,paid,con,mtotal,pre,remark,reg1,fine,dpaid,to1,status,c_date,other_remark,mode,pr,email,fee_id) values('$name','$class','$ch','$fee','$date12','$year','$search','$van','$exam','$other','$total','','$remain','$ann','$add','$reg','$comp','$gen','$paid','$con','$mtotal','$pre','$remark','$reg1','','','','','$date1','$other_remark','$mode','','$email','$fee_id')";

		mysqli_query($conn,$ins1);
			echo"Fees Update";
		
	}
	else
	{
		echo"Fees Not Update";
	}
	break;
	case 3637:
	$session=$_POST['session'];
  $sel1="select * from  registration where session ='$session' and status='' order by application asc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	
<link href="jq/jquery.dataTables.min.css" type="text/css" rel="stylesheet"/>
<link href="jq/buttons.dataTables.min.css" type="text/css" rel="stylesheet"/>


<script src="jq/jquery.dataTables.min.js"></script>
<script src="jq/dataTables.buttons.min.js"></script>
<script src="jq/buttons.flash.min.js"></script>
<script src="jq/jszip.min.js"></script>
<script src="jq/pdfmake.min.js"></script>
<script src="jq/vfs_fonts.js"></script>
<script src="jq/buttons.html5.min.js"></script>
<script src="jq/buttons.print.min.js"></script>

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr align="center">
               <th style="text-align:center">Sr.</th><th  style="text-align:center">Sch No .</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Session</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr tr align="center">
                <th style="text-align:center">Sr.</th><th  style="text-align:center">Sch No .</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class</th><th  style="text-align:center">Session</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
  $sel="select * from  registration where session ='$session' and status='' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$a=$row['village'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject'];?>/<?php echo $row['section'];?></td><td><?php echo $row['session']."<br/>".$row['datetime'];?></td>
	
	<td>
	
	
<a href="javascript:;" onclick="app1234(<?php echo $row['id'];?>)"><span> <button type="button" class="btn btn-info">Fees Details</button></span></a><BR/><br/>



	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 7172:
	$id=$_REQUEST['id'];
	$selr="select * from  registration where id ='$id'";
$resr=mysqli_query($conn,$selr);
$rowr=mysqli_fetch_array($resr,MYSQLI_BOTH);
$sessionr=$rowr['session'];
//echo $sessionr;
$applicationr=$rowr['application'];

$sel1="select * from  studentfees where search ='$applicationr' and year='$sessionr' and status=''";
$res1=mysqli_query($conn,$sel1);
$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
//$search=$row1['search'];
$sel="select * from  registration where application ='$applicationr' and session='$sessionr' and status=''";
$res=mysqli_query($conn,$sel);
$row=mysqli_fetch_array($res,MYSQLI_BOTH);


$selb="select * from  registration where application ='$applicationr' and session='sessionr' and status='' order by id desc";
$resb=mysqli_query($conn,$selb);
$rowb=mysqli_fetch_array($resb,MYSQLI_BOTH);

$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'  >
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="70px" width="70px"/></span></td><td align="center"><span id="name"  style="font-size:20px;font-weight:bold">PACIFIC PUBLIC SCHOOL </span><br/>Semra No.1 , Chargawan-Gorakhpur<br/><span id="name1" style="font-size:18px;font-weight:bold"></span></td><td style="font-size:14px"><b>Contact-</b>7376598752<br/>9451960467 </td>
</tr>
</table>
<table border="1px;" width="100%" cellspacing="0">
<caption style="font-size:18px;font-weight:bold">Fees Statement <?php echo $row1['year'];?></caption>
<tr>
<td width="30%"><span id="name2">Scho. Number</span></td><td><span id="name3"><?php echo $row1['search'];?></span></td><td><b>Class</b></td><td><?php echo $row['subject'];?></td><td width="10%"align="right" rowspan="3"><span><img src="../code/img/<?php echo $row['picture'];?>" style="width:100%;" class="img-responsive" ></span></td>
</tr>
<tr>
<td width="30%"><span id="name2">Student Name</span></td><td width="" colspan="3"><span id="name3"><?php echo $row['name'];?></span></td>
</tr>
<tr>
<td width="30%"><span id="name2"> Father Name</span></td><td colspan="3"><span id="name3"><?php echo $row['fname'];?></span></td>
</tr>


</table>
<div class="table-responsive">
<table border="1px" width="100%" cellspacing="0px" >
<tr>
<td colspan='15' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Fees Receipt</span></td>

</tr>
<tr align="center">

<td><span id="name2">Sr.</span></td>
<td><span id="name2">Month</span></td>
<td><span id="name2" >Tution Fee</span></td>
<td><span id="name2" >Exam</span></td>
<td><span id="name2">Conv</span></td>

<td><span id="name2">Main</span></td>
<td><span id="name2">Miscellaneous</span></td>
<td><span id="name2">Reg</span></td>
<td><span id="name2">Comp</span></td>
<td><span id="name2">Gene</span></td>
<td><span id="name2">Ann</span></td>

<td><span id="name2">Other</span></td>
<td><span id="name2">Other Remark</span></td>
<td><span id="name2">Con</span></td>
<td><span id="name2">Cons Remark</span></td>
<td><span id="name2">Pre Dues</span></td>

<td><span id="name2">Paid</span></td>

<td><span id="name2">Dues</span></td>

<td><span id="name2">Date</span></td>
<td><span id="name2">Action</span></td>


</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;


$sel2="select * from  studentfees where search='$applicationr' and year='$sessionr' and status='' or search='$applicationr' and year='$sessionr' and status='Not' ";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	$tot=$row2['total'];
	$paid13=$row2['paid'];
	
	$remain12=$row2['remain'];
	$sum=$tot+$sum;
	$sum1=$paid13+$sum1;
	$remain1=$remain12+$remain1;
?>
<tr align="center">

<td><span id="name3"><?php echo $row2['id'];?></span></td>
<td><span id="name3"><?php echo $row2['month'];?></span></td>
<td><span id="name3"><?php echo $row2['fee'];?></span></td>
<td><span id="name3"><?php echo $row2['exam'];?></span></td>
<td><span id="name3"><?php echo $row2['van'];?></span></td>

<td><span id="name3"><?php echo $row2['reg'];?></span></td>
<td><span id="name3"><?php echo $row2['addm'];?></span></td>
<td><span id="name3"><?php echo $row2['reg1'];?></span></td>
<td><span id="name3"><?php echo $row2['comp'];?></span></td>
<td><span id="name3"><?php echo $row2['gen'];?></span></td>
<td><span id="name3"><?php echo $row2['ann'];?></span></td>

<td><span id="name3"><?php echo $row2['other'];?></span></td>
<td><span id="name3"><?php echo $row2['other_remark'];?></span></td>
<td><span id="name3"><?php echo $row2['con'];?></span></td>
<td ><span id="name3"><?php echo $row2['remark'];?></span></td>
<td><span id="name3"><?php echo $row2['pre'];?></span></td>

<td><span id="name3"><?php echo $row2['paid'];?></span></td>

<td><span id="name3"><?php echo $row2['remain'];?></span></td>
<?php $daten=$row2['date'];
$date1=date("d-m-Y",strtotime($daten));  ?>
<td><span id="name3"><?php echo $date1;?></span></td>
<td><a href="javascript:;" onclick="feesrow(<?php echo $row2['id'];?>)"> <span class=""><button type="button" class="btn btn-primary">Update</button></span></a>&emsp;<span id="name3"><a href="slip.php?flag=<?php echo $row2['id'];?>" target="_blank"><span class="fa fa-print"></span></a></span>
	
	&nbsp;<a href="javascript:;" onclick="deleterow13(<?php echo $row2['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a>
	<?php if($row2['status']=='Not'){?>
	&emsp;<a href="javascript:;" onclick="deleterow136(<?php echo $row2['id'];?>)">Approved</a>
	<?php }?>
	</td>

</tr>


<?php
}
?>
<tr align="center">

<td colspan="16" style="font-weight:bold;font-size:19px">Sub Total</td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2"><?php echo $sum1;?></span></td><td style="font-weight:bold;font-size:18px"><span id="name3"colspan="2">
    <?php
    $sel23="select * from  studentfees where search='$applicationr' and year='$sessionr' and status='' order by id desc";
$res23=mysqli_query($conn,$sel23);
$row23=mysqli_fetch_array($res23,MYSQLI_BOTH);
	$remain23=$row23['remain'];
    
    
    echo $remain12;?></span></td>

</tr>
</table>
</div>
<table width="100%" frame="border" cellspacing="0">
<tr align="center">
<td width="50%"  align="left"><span id="name3" style="font-size:15px;font-weight:bold">Datetime</span></td>
</tr>
<tr>
<td  width="70%" align="left"><span ><?php echo $datetime;?></span></td><td><br/><br/></td><td width="50%" align="right"><span id="name3" style="font-size:15px;font-weight:bold" align="rightt">Sign Of Received Staff</span></td>
</tr>
</table>
</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
	
case 3939:
	$id=$_POST['rowid'];

	$del="update  studentfees set status='' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"Restore Successfully";
		
	}
	else
	{
		echo"Not Restore";
	}

	break;
	case 396:
	$id=$_POST['rowid'];

	$del="update  studentfees set status='' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"Approved Successfully";
		
	}
	else
	{
		echo"Not Restore";
	}

	break;
	case 3839:
	$year=$_POST['year'];
//	$class=$_POST['class'];
  $sel="select * from  studentfees where year='$year'  and status='Delete'  order by date desc ";
	$res=mysqli_query($conn,$sel);
	$sel1="select * from  studentfees  where year='$year' and status='Delete'  ";
	$res1=mysqli_query($conn,$sel1);
	$row2=mysqli_num_rows($res1);
	if($row2!=" ")
	{
	
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th>Sr.</th><th>Sch No.</th><th>Slip No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Tution Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Misc.</th><th>Paid</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>Add DateTime</th><th>Action</th>
            </tr>
        </thead>
<tfoot>
           <tr>
                <th>Sr.</th><th>Sch No.</th><th>Slip No.</th><th>Session</th><th>Name</th><th>Class</th><th> Month</th><th>Tution Fee</th><th>Annual Fee</th><th>Exam Fee</th><th>Conveyance </th><th>Misc.</th><th>Paid</th><th>Dues Charge</th><th>Other Charge</th><th> Total</th><th>DateTime</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['search'];?></td><td><?php echo $row['id'];?></td><td><?php echo $row['year'];?></td><td><?php echo $row['name'];?></td><td><?php echo $row['class'];?></td><td><?php echo $row['month'];?></td><td><?php echo $row['fee'];?></td><td><?php echo $row['ann'];?></td><td><?php echo $row['exam'];?></td><td><?php echo $row['van'];?></td><td><?php echo $row['addm'];?></td><td><?php echo $row['paid'];?></td><td><?php echo $row['remain'];?></td><td><?php echo $row['other'];?></td><td><?php echo $row['total'];?></td><td><?php echo $row['date'];?></td>
	
	<td><a href="javascript:;" onclick="deleterow13(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-refresh"></span></a></td>
	
	

	
	
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt>Not Record Available.</font>";
	}
	break;
		case 18192021:
	$year1=$_POST['year'];
	 $class=$_POST['class'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' and status='' ";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table  class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
           
        </thead>

<tbody>		
  <?php
  $year=$_POST['year'];
  $class=$_POST['class'];
  // $exam=$_POST['exam'];
   
       $sel="select * from  registration where session ='$year' and subject='$class' and status=''  ";
   
   
	$res=mysqli_query($conn,$sel);
	$s=1;
		$sp='';
			$sp1=1;
			$p=1;
			$k='';
				$s=1;
		$sp2='';
			$sp1=1;
			$p=0;
			$k1='';
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
		$ap=$row['application'];
	$session=$row['session'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	
	
	$sel121="select * from  six_eightresult where session ='$session' and rol='$ap' and exam='HALF YEARLY EXAM'";
	$res121=mysqli_query($conn,$sel121);
	$row121=mysqli_fetch_array($res121,MYSQLI_BOTH);
	$sel1211="select * from  six_eightresult where session ='$session' and rol='$ap' and exam='ANNUAL EXAM'";
	$res1211=mysqli_query($conn,$sel1211);
	$row1211=mysqli_fetch_array($res1211,MYSQLI_BOTH);
	
	
	$p1=$row121['mark2p']+$row121['mark1p']+$row121['mark3p']+$row121['mark4p']+$row121['mark5p']+$row121['mark10p']+$row121['mark9p']+$row121['mark7p']+$row121['mark8p']+$row121['mark6p'];

		$p2=$row1211['mark2p']+$row1211['mark1p']+$row1211['mark3p']+$row1211['mark4p']+$row1211['mark5p']+$row1211['mark10p']+$row1211['mark9p']+$row1211['mark7p']+$row1211['mark8p']+$row1211['mark6p'];
	$n1=$row121['mark2n']+$row121['mark1n']+$row121['mark3n']+$row121['mark4n']+$row121['mark5n']+$row121['mark10n']+$row121['mark9n']+$row121['mark7n']+$row121['mark8n']+$row121['mark6n'];
	$e1=$row121['mark2e']+$row121['mark1e']+$row121['mark3e']+$row121['mark4e']+$row121['mark5e']+$row121['mark10e']+$row121['mark9e']+$row121['mark7e']+$row121['mark8e']+$row121['mark6e'];

	$m1=$row121['mark2m']+$row121['mark1m']+$row121['mark3m']+$row121['mark4m']+$row121['mark5m']+$row121['mark10m']+$row121['mark9m']+$row121['mark7m']+$row121['mark8m']+$row121['mark6m'];

	
	$n11=$row1211['mark2n']+$row1211['mark1n']+$row1211['mark3n']+$row1211['mark4n']+$row1211['mark5n']+$row1211['mark10n']+$row1211['mark9n']+$row1211['mark7n']+$row1211['mark8n']+$row1211['mark6n'];
	$e11=$row1211['mark2e']+$row1211['mark1e']+$row1211['mark3e']+$row1211['mark4e']+$row1211['mark5e']+$row1211['mark10e']+$row1211['mark9e']+$row1211['mark7e']+$row1211['mark8e']+$row1211['mark6e'];

	$m11=$row1211['mark2m']+$row1211['mark1m']+$row1211['mark3m']+$row1211['mark4m']+$row1211['mark5m']+$row1211['mark10m']+$row1211['mark9m']+$row1211['mark7m']+$row1211['mark8m']+$row1211['mark6m'];

	
					
		?>
		 
	<tr class="text-center">
	<td><?php echo $s++ ;?></td><td><?php echo $row['application'];?></td><td><b></ ><?php echo $row['name'];?></b></td><td>Exam</td><td>ENGLISH</td><td>HINDI</td><td>MATH</td><td>SCIENCE/EVS</td><td>S. SCIENCE</td><td>SANSKRIT</td><td>G.K.</td><td>COMPUTER</td><td>ART</td><td>S.U.P.W.</td><td>TOTAL</td>
	
	</tr>

		<tr class="text-center">
	<td></td><td></td><td>F-<b></ ><?php echo $row['fname'];?></b></td><td>PT1</td><td><?php echo $row121['mark2p'];?></td><td><?php echo $row121['mark1p'];?></td><td><?php echo $row121['mark3p'];?></td><td><?php echo $row121['mark4p'];?></td><td><?php echo $row121['mark5p'];?></td><td><?php echo $row121['mark10p'];?></td><td><?php echo $row121['mark9p'];?></td><td><?php echo $row121['mark7p'];?></td><td><?php echo $row121['mark8p'];?></td><td><?php echo $row121['mark6p'];?></td><td><?php echo $p1;?></td>
	
	</tr>
		<tr class="text-center">
	<td></td><td></td><td>M-<b></ ><?php echo $row['mname'];?></b></td><td>PT2</td><td><?php echo $row1211['mark2p'];?></td><td><?php echo $row1211['mark1p'];?></td><td><?php echo $row1211['mark3p'];?></td><td><?php echo $row1211['mark4p'];?></td><td><?php echo $row1211['mark5p'];?></td><td><?php echo $row1211['mark10p'];?></td><td><?php echo $row1211['mark9p'];?></td><td><?php echo $row1211['mark7p'];?></td><td><?php echo $row1211['mark8p'];?></td><td><?php echo $row1211['mark6p'];?></td><td><?php echo $p2;?></td>
	
	</tr>
		<tr class="text-center">
	<td></td><td></td><td></b></td><td>NB HALF</td><td><?php echo $row121['mark2n'];?></td><td><?php echo $row121['mark1n'];?></td><td><?php echo $row121['mark3n'];?></td><td><?php echo $row121['mark4n'];?></td><td><?php echo $row121['mark5n'];?></td><td><?php echo $row121['mark10n'];?></td><td><?php echo $row121['mark9n'];?></td><td><?php echo $row121['mark7n'];?></td><td><?php echo $row121['mark8n'];?></td><td><?php echo $row121['mark6n'];?></td><td><?php echo $n1;?></td>
	
	</tr>
	<tr class="text-center">
	<td></td><td></td><td></b></td><td>SB HALF</td><td><?php echo $row121['mark2e'];?></td><td><?php echo $row121['mark1e'];?></td><td><?php echo $row121['mark3e'];?></td><td><?php echo $row121['mark4e'];?></td><td><?php echo $row121['mark5e'];?></td><td><?php echo $row121['mark10e'];?></td><td><?php echo $row121['mark9e'];?></td><td><?php echo $row121['mark7e'];?></td><td><?php echo $row121['mark8e'];?></td><td><?php echo $row121['mark6e'];?></td><td><?php echo $e1;?></td>
	
	</tr>
		<tr class="text-center">
	<td></td><td></td><td></b></td><td> HALF</td><td><?php echo $row121['mark2m'];?></td><td><?php echo $row121['mark1m'];?></td><td><?php echo $row121['mark3m'];?></td><td><?php echo $row121['mark4m'];?></td><td><?php echo $row121['mark5m'];?></td><td><?php echo $row121['mark10m'];?></td><td><?php echo $row121['mark9m'];?></td><td><?php echo $row121['mark7m'];?></td><td><?php echo $row121['mark8m'];?></td><td><?php echo $row121['mark6m'];?></td><td><?php echo $m1;?></td>
	
	</tr>
		<tr class="text-center">
	<td></td><td></td><td></b></td><td>NB ANNUAL</td><td><?php echo $row1211['mark2n'];?></td><td><?php echo $row1211['mark1n'];?></td><td><?php echo $row1211['mark3n'];?></td><td><?php echo $row1211['mark4n'];?></td><td><?php echo $row1211['mark5n'];?></td><td><?php echo $row1211['mark10n'];?></td><td><?php echo $row1211['mark9n'];?></td><td><?php echo $row1211['mark7n'];?></td><td><?php echo $row1211['mark8n'];?></td><td><?php echo $row1211['mark6n'];?></td><td><?php echo $n11;?></td>
	
	</tr>
	<tr class="text-center">
	<td></td><td></td><td></b></td><td>SB ANNUAL</td><td><?php echo $row1211['mark2e'];?></td><td><?php echo $row1211['mark1e'];?></td><td><?php echo $row1211['mark3e'];?></td><td><?php echo $row1211['mark4e'];?></td><td><?php echo $row1211['mark5e'];?></td><td><?php echo $row1211['mark10e'];?></td><td><?php echo $row1211['mark9e'];?></td><td><?php echo $row1211['mark7e'];?></td><td><?php echo $row1211['mark8e'];?></td><td><?php echo $row1211['mark6e'];?></td><td><?php echo $e11;?></td>
	
	</tr>
		<tr class="text-center">
	<td></td><td></td><td></b></td><td> ANNUAL</td><td><?php echo $row1211['mark2m'];?></td><td><?php echo $row1211['mark1m'];?></td><td><?php echo $row1211['mark3m'];?></td><td><?php echo $row1211['mark4m'];?></td><td><?php echo $row1211['mark5m'];?></td><td><?php echo $row1211['mark10m'];?></td><td><?php echo $row1211['mark9m'];?></td><td><?php echo $row1211['mark7m'];?></td><td><?php echo $row1211['mark8m'];?></td><td><?php echo $row1211['mark6m'];?></td><td><?php echo $m11;?></td>
	
	</tr>
		<tr class="text-center" style='font-weight:bold'>
	<td></td><td></td><td></b></td><td colspan='11'> TOTAL</td><td ><?php echo $p1+$p2+$e1+$m1+$n1+$n11+$e11+$m11;?></td>
	
	</tr>
	<?php

	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 4289:
	?>
	
<script>

$("document").ready(function(){
		
		$("#cons").keyup(function(){
		  
			var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
			// alert(paid1);
		});
		
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#ndew").focus(function(){
		   // alert('ok');
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
		
	
		
		
	});
	

	$("document").ready(function(){
		
		$("#paid12").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
	$("document").ready(function(){
		
		$("#paid12").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
		$("document").ready(function(){
		
		$("#other1").keyup(function(){
		var dew1=$("#dew").val();
			var paid1=$("#paid12").val();
			var cons1=$("#cons").val();
			var ndew1=$("#ndew").val();
				var other1=$("#other1").val();
				var p=parseInt(paid1);
			var total1= parseInt(dew1)+parseInt(other1) -parseInt(cons1)- parseInt(paid1) ;
			
			$("#ndew12").val(total1);
		});
	
		
		
	});
	
	
	
	</script>
	<?php
	$id=$_REQUEST['application'];
	
	
	
	/////////
		$sel1="select * from  registration where id='$id' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$sch=$row1['application'];
	$session=$row1['session'];
	?>
	<div class="table-responsive">

       <center><h2 class="modal-title" style="color:green;background-color:yellow"> Notification Add (Sch- <?php echo $sch;?>) </h2> </center>
            
      
		<tbody>
		<form onsubmit="return feesupdate34(this)">
		<div class="form-group">
				<label class="col-sm-3 control-label">Sch.</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $sch;?>" name="sch" id='search' readonly style="background-color:yellow;color:green"/></div>
				<input type="hidden" value="<?php echo $id;?>" name="id" id='search' readonly style="background-color:yellow;color:green"/>
					<input type="hidden" value="<?php echo $session;?>" name="session" id='search' readonly style="background-color:yellow;color:green"/>
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Name</label>
				<div class="col-sm-3"><input type="text" value="<?php echo $row1['name'];?>" name="name" readonly style="background-color:gray;color:pink" /></div>
				
				</div>
		<div class="form-group">
				<label class="col-sm-3 control-label">Response Add</label>
				<div class="col-sm-3"><textarea class='form-control' name='response' required /></textarea></div>
				
				</div>
				<br/>
		<div class="form-group">
				<label class="col-sm-3 control-label">Response Date</label>
				<div class="col-sm-3"><input type="date"   class='form-control'name="re_date"  required /></div>
				
				</div>
				<br/>
				
			
				
				
		<center><button class="btn btn-danger" id='btn' >Submit</button></center>
		
		</form>
		
	<button style="background-color:red "class="close btn-block btn btn-danger" data-dismiss="modal"> <span style="color:yellow;background-color:red">Close </span> </button>
	</div>
	<?php
	break;
	case 4389:

	$sch=$_POST['sch'];
	$id=$_POST['id'];
	$name=$_POST['name'];
		$response=$_POST['response'];
		$session=$_POST['session'];

	$re_date=$_POST['re_date'];
	
	$date=date("Y-m-d");
	$sel1="select * from  notification where sch='$sch' and status='' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	if($row1)
	{
	    echo "Status Allready Active Please Update ";
	}
	else
	{
		$ins="insert into notification(s_id,sch,name,response,re_date,date,date_up,session,status) values('$id','$sch','$name','$response','$re_date','$date','0000-00-00','$session','')";
	
	if($res=mysqli_query($conn,$ins))
	{
		echo " Submit";
	}
	else
	{
		echo "not update";
	}
	}
	break;
	case 717236:
	$id=$_REQUEST['id'];
	$selr="select * from  registration where id ='$id'";
$resr=mysqli_query($conn,$selr);
$rowr=mysqli_fetch_array($resr,MYSQLI_BOTH);
$sessionr=$rowr['session'];
//echo $sessionr;
$applicationr=$rowr['application'];


$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'  >
<table frame="border" width="100%" >
<tr>
<td><span><img src="../images/logo.png" height="70px" width="70px"/></span></td><td align="center"><span id="name"  style="font-size:20px;font-weight:bold">PACIFIC PUBLIC SCHOOL </span><br/>Semra No.1 , Chargawan-Gorakhpur<br/><span id="name1" style="font-size:18px;font-weight:bold"></span></td><td style="font-size:14px"><b>Contact-</b>7376598752<br/>9451960467 </td>
</tr>
</table>

<div class="table-responsive">
<table border="1px" width="100%" cellspacing="0px" >
<tr>
<td colspan='15' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Notification Receipt</span></td>

</tr>
<tr align="center">

<td><span id="name2">Sr.</span></td>
<td><span id="name2">Sch</span></td>
<td><span id="name2" >Name</span></td>
<td><span id="name2" >Response</span></td>
<td><span id="name2">Response_date</span></td>



<td><span id="name2">Session</span></td>
<td><span id="name2">Add Date</span></td>

<td><span id="name2">Date-up</span></td>

<td><span id="name2">Action</span></td>


</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;

$s=1;
$sel2="select * from  notification where s_id='$id' ";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	
?>
<tr align="center">

<td><span id="name3"><?php echo $s++;?></span></td>
<td><span id="name3"><?php echo $row2['sch'];?></span></td>
<td><span id="name3"><?php echo $row2['name'];?></span></td>
<td><span id="name3"><?php echo $row2['response'];?></span></td>
<td><span id="name3"><?php echo $row2['re_date'];?></span></td>


<td><span id="name3"><?php echo $row2['session'];?></span></td>

<td><span id="name3"><?php echo $row2['date'];?></span></td>

<td><span id="name3"><?php echo $row2['date_up'];?></span></td>

<td>
	
<a href="javascript:;" onclick="deleterow13(<?php echo $row2['id'];?>)"><?php if($row2['status']=='') {?><span class="glyphicon glyphicon-remove"></span><?php } else{?><span class="glyphicon glyphicon-ok"></span><?php };?></a>
	
	</td>

</tr>


<?php
}
?>

</table>
</div>

</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
	case 2090:
	$id=$_POST['rowid'];
	$sel="select * from  notification where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$date=date("Y-m-d");
	if($row['status']=='')
	{
		$del="update notification  set status='Done',date_up='$date' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"Update Successfully";
	//	unlink($location);
	
	}
	else
	{
		echo"Not Deleted";
	}
	}
	else
	{
		$del="update notification  set status='' ,date_up='$date' where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"UPDATE Successfully";
	//	unlink($location);
	
	}
	else
	{
		echo"Not Deleted";
	}
	}
	
	break;
	case 209010:
$date=date('Y-m-d');
$sel26="select * from  notification where re_date='$date' and status=''";
$res26=mysqli_query($conn,$sel26);
$c=mysqli_num_rows($res26);
echo $c;
	break;
	case 7172369:
	
	
$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$date12=date('Y-m-d');
?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'  >


<div class="table-responsive">
<table border="1px" width="100%" cellspacing="0px" >
<tr>
<td colspan='15' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Notification Receipt</span></td>

</tr>
<tr align="center">

<td><span id="name2">Sr.</span></td>
<td><span id="name2">Sch</span></td>
<td><span id="name2" >Name</span></td>
<td><span id="name2" >Class</span></td>
<td><span id="name2" >Response</span></td>
<td><span id="name2">Response_date</span></td>



<td><span id="name2">Session</span></td>
<td><span id="name2">Add Date</span></td>

<td><span id="name2">Date-up</span></td>

<td><span id="name2">Action</span></td>


</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;

$s=1;
$sel2="select * from  notification where re_date='$date12' and status=''  ";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	$id=$row2['s_id'];
	$sel21="select * from  registration where id='$id'  ";
$res21=mysqli_query($conn,$sel21);
$row21=mysqli_fetch_array($res21,MYSQLI_BOTH);
?>
<tr align="center">

<td><span id="name3"><?php echo $s++;?></span></td>
<td><span id="name3"><?php echo $row2['sch'];?></span></td>
<td><span id="name3"><?php echo $row2['name'];?></span></td>
<td><span id="name3"><?php echo $row21['subject'];?></span></td>
<td><span id="name3"><?php echo $row2['response'];?></span></td>
<td><span id="name3"><?php echo $row2['re_date'];?></span></td>


<td><span id="name3"><?php echo $row2['session'];?></span></td>

<td><span id="name3"><?php echo $row2['date'];?></span></td>

<td><span id="name3"><?php echo $row2['date_up'];?></span></td>

<td>
	
<a href="javascript:;" onclick="deleterow13(<?php echo $row2['id'];?>)"><?php if($row2['status']=='') {?><span class="glyphicon glyphicon-ok"></span><?php } else{?><span class="glyphicon glyphicon-remove"></span><?php };?></a>
	
	</td>

</tr>


<?php
}
?>

</table>
</div>

</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
	case 717236910:
	
	
$date=date("d/m/Y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$date12=date('Y-m-d');
?>
<html>
<head>
<style>
#name2
{
	font-weight:bold;
	font-size:12px;
}
#name3
{
    font-size:12px;
}
</style>

	
<script>

$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='student_showfees.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id='DivIdToPrint'  >


<div class="table-responsive">
<table border="1px" width="100%" cellspacing="0px" >
<tr>
<td colspan='15' align="center"><span id="name4" style="font-size:18px;font-weight:bold">Notification Receipt</span></td>

</tr>
<tr align="center">

<td><span id="name2">Sr.</span></td>
<td><span id="name2">Sch</span></td>
<td><span id="name2" >Name</span></td>
<td><span id="name2" >Class</span></td>
<td><span id="name2" >Response</span></td>
<td><span id="name2">Response_date</span></td>



<td><span id="name2">Session</span></td>
<td><span id="name2">Add Date</span></td>

<td><span id="name2">Date-up</span></td>

<td><span id="name2">Action</span></td>


</tr>
<?php

$sum=0;
$sum1=0;

$remain1=0;

$s=1;
$sel2="select * from  notification where status='' order by re_date asc ";
$res2=mysqli_query($conn,$sel2);
while($row2=mysqli_fetch_array($res2,MYSQLI_BOTH))
{
	$id=$row2['s_id'];
	$sel21="select * from  registration where id='$id'  ";
$res21=mysqli_query($conn,$sel21);
$row21=mysqli_fetch_array($res21,MYSQLI_BOTH);
?>
<tr align="center">

<td><span id="name3"><?php echo $s++;?></span></td>
<td><span id="name3"><?php echo $row2['sch'];?></span></td>
<td><span id="name3"><?php echo $row2['name'];?></span></td>
<td><span id="name3"><?php echo $row21['subject'];?></span></td>
<td><span id="name3"><?php echo $row2['response'];?></span></td>
<td><span id="name3"><?php echo $row2['re_date'];?></span></td>


<td><span id="name3"><?php echo $row2['session'];?></span></td>

<td><span id="name3"><?php echo $row2['date'];?></span></td>

<td><span id="name3"><?php echo $row2['date_up'];?></span></td>

<td>
	
<a href="javascript:;" onclick="deleterow13(<?php echo $row2['id'];?>)"><?php if($row2['status']=='') {?><span class="glyphicon glyphicon-ok"></span><?php } else{?><span class="glyphicon glyphicon-remove"></span><?php };?></a>
	
	</td>

</tr>


<?php
}
?>

</table>
</div>

</div>
<br/>
<br/><br/>


<input type='button' id='btn' value='Print' onclick='printDiv();'>
	  <script>
	function printDiv() 
{
var divToPrint=document.getElementById('DivIdToPrint');
var newWin=window.open('','Print-Window');
newWin.document.open();
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
newWin.document.close();

}
	
	</script>
</body>
</html>









<?php


	
	
	
	
	break;
		case 100500:
	$year1=$_POST['session'];
  $sel1="select * from  registration where session ='$year1' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $id=$row['id'];
		$a=$row['village'];
		$id=$row['id'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	 $sel1="select * from  achievement where student_id ='$id' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	//$up="update registration set application='$id' where id='$id' order by id asc";
				//	mysqli_query($conn,$up);
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject']."<br/>"."<font color=red size=2pt>".'</font>'.$row1['position'];?></td><td><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></td>
	
	
	<td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a>
	
	
	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
	case 1005001:
	$eid=$_REQUEST['id'];
//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$application=$row['application'];
	$session=$row['session'];
	?>
<form class="form-horizontal" onsubmit="return updaterow(this)">
	    <div class="row">
	       	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Scholar No. </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $application;?>" name="sch"  readonly ></div>
	
	</div>
	
	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Student Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name"  readonly ></div>
	
	</div>
	
	<div class="form-group">
		
	<label class="col-sm-4 control-label">Father Name</label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>" name="fname" readonly></div>
	
	</div>
	
	<div class="form-group">
	
	<label class="col-sm-4 control-label">Class </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['subject'];?>" name="class" readonly ></div>
	<input type="hidden" class="form-control" value="<?php echo $eid;?>" name="id" readonly >
	</div>

	 <div class="form-group">
 
    <label  class="col-sm-4 control-label">Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="session" >
				
				<option ><?php echo $row['session'];?></option>
	</select>
		<br/>
	</div>
		<div class="form-group">
	
	<label class="col-sm-4 control-label">Add Position</label>
		<div class="col-sm-8"><input type="text" class="form-control"  name="position" required></div>
	
	</div>

  </div>
    </div>
	</div>
	
	
	 <button class="btn btn-success" >Update</button>&emsp;&emsp;
	</form>
	
<?php 
	break;
	case 1005002:
	$name=$_POST['name'];
$student_id=$_POST['id'];
//$student_id=$_POST['student_id'];
$session=$_POST['session'];
$class=$_POST['class'];
$position=$_POST['position'];
$sch=$_POST['sch'];

//echo $newimgname;
$date=date("Y-m-d");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$location="img/";
$location1="img/";
$size=$size/1024;


			
//--------------------------------------------------------------------
			
		$ins1="insert into achievement(student_id,sch,position,date,session,class) values('$student_id','$sch','$position','$date','$session','$class')";
	if(mysqli_query($conn,$ins1))
	{
		echo"Submit";
	}
	else
	{
		echo"not Submit";
	}

				// for updation and image 
				//
			
//-------------------------------------------------------------
	break;
		case 1005003:
	$year1=$_POST['session'];
  $sel1="select * from  achievement where session ='$year1' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Position</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Position</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  achievement where session ='$year1' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $student_id=$row['student_id'];
	    $sel3="select * from  registration where id ='$student_id' order by id asc";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
		$a=$row['village'];
		$id=$row['id'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	
	//$up="update registration set application='$id' where id='$id' order by id asc";
				//	mysqli_query($conn,$up);
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row3['application'];?></td><td><img src="../code/img/<?php echo $row3['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row3['2']."<br/>"." <b>Father-</b>".$row3['fname']."<br/>"." <b>Mother-</b>".$row3['mname']."<br/>". "<b>D.O.B-</b>".$row3['dob']."<br/>"."<b>Adh-</b>".$row3['adhar'];?></td><td><?php echo $row3['subject']."<br/>"."<font color=red size=2pt>".'</font>';?></td><td><?php echo $row['position'];?></td>
	
	
	<td><a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a>
	
	
	
	<br/><br/>&emsp;<a href="achievement_print.php?flag=<?php echo $row['id'];?>"><span class="fa fa-print"></span></a>
	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
		case 1005004:
	$id=$_POST['rowid'];

	$del="delete from achievement where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
	
		
	}
	else
	{
		echo"Not Deleted";
	}
	break;
		case 10050066:
	$year1=$_POST['session'];
		$class=$_POST['class'];
  $sel1="select * from  registration where session ='$year1' and subject='$class' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Record</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Address</th><th  style="text-align:center">Record</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  registration where session ='$year1'  and subject='$class' order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $id=$row['id'];
		$a=$row['village'];
		$id=$row['id'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	 $sel1="select * from  summer where student_id ='$id' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	//$up="update registration set application='$id' where id='$id' order by id asc";
				//	mysqli_query($conn,$up);
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row['application'];?></td><td><img src="../code/img/<?php echo $row['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row['name']."<br/>"." <b>Father-</b>".$row['fname']."<br/>"." <b>Mother-</b>".$row['mname']."<br/>". "<b>D.O.B-</b>".$row['dob']."<br/>"."<b>Adh-</b>".$row['adhar'];?></td><td><?php echo $row['subject']."<br/>"."<font color=red size=2pt>".'</font>';?></td><td><?php echo "<b>Vill-</b>".$a."<br/>"."<b>Post-</b>".$b."<br/>"."<b>Dist-</b>".$c."<br/>"."<b>Mob-</b>".$row['mobile'];?></td><td><?php echo $row1['part'];?>  <br/><?php echo $row1['on_this'];?> <br/> <?php echo $row1['day'];?></td>
	
	
	<td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a>
	
	
	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
		case 100500166:
	$eid=$_REQUEST['id'];
//echo"$eid";
	$sel="select * from  registration where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$application=$row['application'];
	$session=$row['session'];
	
	$sel1="select * from  summer where student_id ='$eid' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	
	?>
<form class="form-horizontal" onsubmit="return updaterow(this)">
	    <div class="row">
	       	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Scholar No. </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $application;?>" name="sch"  readonly ></div>
	<input type="hidden" class="form-control" value="<?php echo $row1['id'];?>" name="s_id"  readonly >
	</div>
	
	<div class="form-group">
		
	<label class="col-sm-4 control-label"> Student Name </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['name'];?>" name="name"  readonly ></div>
	
	</div>
	
	<div class="form-group">
		
	<label class="col-sm-4 control-label">Father Name</label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['fname'];?>" name="fname" readonly></div>
	
	</div>
	
	<div class="form-group">
	
	<label class="col-sm-4 control-label">Class </label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['subject'];?>" name="class" readonly ></div>
	<input type="hidden" class="form-control" value="<?php echo $eid;?>" name="id" readonly >
	</div>

	 <div class="form-group">
 
    <label  class="col-sm-4 control-label">Session <span style="color:red">*</span></label>
    <div class="col-sm-8">
	
	<select class="form-control"  name="session" >
				
				<option ><?php echo $row['session'];?></option>
	</select>
		<br/>
	</div>
		<div class="form-group">
	
	<label class="col-sm-4 control-label">Participating with Enthusiasm at</label>
		<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row1['part']?>" name="part" required></div>
	
	</div>
	<div class="form-group">
	
	<label class="col-sm-2 control-label">On This </label>
		<div class="col-sm-4"><input type="text" class="form-control" value="<?php echo $row1['on_this']?>"   name="on" required></div>
		<label class="col-sm-2 control-label">Day Of </label>
		<div class="col-sm-4"><input type="text" class="form-control"  name="day" value="<?php echo $row1['day']?>"  required></div>
	
	</div>

  </div>
    </div>
	</div>
	
	
	 <button class="btn btn-success" >Submit</button>&emsp;&emsp;
	</form>
	
<?php 
	break;
	case 100500266:
	$name=$_POST['name'];
$s_id=$_POST['s_id'];
$student_id=$_POST['id'];
//$student_id=$_POST['student_id'];
$session=$_POST['session'];
$class=$_POST['class'];
$part=$_POST['part'];
$day=$_POST['day'];
$on=$_POST['on'];
$sch=$_POST['sch'];

//echo $newimgname;
$date=date("Y-m-d");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$location="img/";
$location1="img/";
$size=$size/1024;


			
//--------------------------------------------------------------------
			if($s_id!='')
			{
			    $up="update summer set part='$part',day='$day',on_this='$on' where id='$s_id'";
			    mysqli_query($conn,$up);
			    echo"Update";
			}
			else
			{
		$ins1="insert into summer(student_id,sch,part,date,session,class,day,on_this) values('$student_id','$sch','$part','$date','$session','$class','$day','$on')";
	if(mysqli_query($conn,$ins1))
	{
		echo"Submit";
	}
	else
	{
		echo"not Submit";
	}
			}

				// for updation and image 
				//
			
//-------------------------------------------------------------
	break;
		case 100500366:
	$year1=$_POST['session'];
	$class=$_POST['class'];
  $sel1="select * from  summer where session ='$year1'  and class='$class' order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$count=mysqli_num_rows($res1);
	if($count!="")
	{
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: []
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Record</th><th  style="text-align:center">Action</th>
            </tr>
        </thead>
<tfoot>
            <tr>
                <th  style="text-align:center">Sr.</th><th  style="text-align:center">Sch No.</th><th  style="text-align:center">Photo</th><th  style="text-align:center">Name</th><th  style="text-align:center">Class<span style="color:red"></span></th><th  style="text-align:center">Record</th><th  style="text-align:center">Action</th>
            </tr>
        </tfoot>
<tbody>		
  <?php
  $year=$_POST['session'];
  $sel="select * from  summer where session ='$year1' and class='$class'  order by id asc";
	$res=mysqli_query($conn,$sel);
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
		
	{
	    $student_id=$row['student_id'];
	    $sel3="select * from  registration where id ='$student_id' order by id asc";
	$res3=mysqli_query($conn,$sel3);
	$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
		$a=$row['village'];
		$id=$row['id'];
	$b=$row['postoffice'];
	$c=$row['dist'];
	$e=$row['mobile'];
	$d=$a." ".$c;
	
	//$up="update registration set application='$id' where id='$id' order by id asc";
				//	mysqli_query($conn,$up);
		?>
		 
	<tr class="text-center">
	<td><?php echo $s;?></td><td><?php echo $row3['application'];?></td><td><img src="../code/img/<?php echo $row3['picture'];?>" height="90px" width="90px;"></td><td><?php echo $row3['2']."<br/>"." <b>Father-</b>".$row3['fname']."<br/>"." <b>Mother-</b>".$row3['mname']."<br/>". "<b>D.O.B-</b>".$row3['dob']."<br/>"."<b>Adh-</b>".$row3['adhar'];?></td><td><?php echo $row3['subject']."<br/>"."<font color=red size=2pt>".'</font>';?></td><td><?php echo $row['part'];?> On This <?php echo $row['on_this'];?> Day Of <?php echo $row['day'];?></td>
	
	
	<td><a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a>
	
	
	
	<br/><br/>&emsp;<a href="summer_print.php?flag=<?php echo $row['id'];?>"><span class="fa fa-print"></span></a>
	</td>
	</tr>
	<?php
	$s++;
	}
	?>
	 </tbody>
    </table>
	
	</div>
	
	<?php
	}
	else
	{
		echo"<font color=red size=6pt> NO DATA  Available</font>";
	}
	break;
		case 100500466:
	$id=$_POST['rowid'];

	$del="delete from summer where id='$id'";
	if(mysqli_query($conn,$del))
	{
		echo"deleted Successfully";
	
		
	}
	else
	{
		echo"Not Deleted";
	}
	break;
	
}

	
?>

MMCT - 2023