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/../newcode.php
<?php 
include("../link/databaseconnection.php");
	error_reporting(0);
$flag=$_REQUEST['flag'];
if(!$flag)
			{
				header("location:http://gsmemorialpublicschool.brkweb.com");
			}
	
switch($flag)
{
	case 1:
	     ?> <select class="form-control" name="type" > <?php
	    $exam=$_POST['class12'];
		$selc="select * from pattern where exam='$exam'";
	$resc=mysqli_query($conn,$selc);
	 while($rowc=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	  ?>
	  <option><?php echo $rowc['type'];?></option>
	  <?php
	  }
	   ?></select> <?php
	   
	break;
	
case 2:
	    
	    $session=$_POST['session'];
	    $class=$_POST['class'];
	    $exam=$_POST['exam'];
	     $section=$_POST['section'];
	    $type=$_POST['type'];
	    	$selc2="select * from sub where class='$class'";
	$resc2=mysqli_query($conn,$selc2);
	$row1=mysqli_fetch_array($resc2,MYSQLI_BOTH);
	 ?>
	 <style>
	     th,td{font-size:13px;}
	     
	     
	 </style>
	 <div id='modal'>
	 <h4>Session - <?php echo $session?> &emsp; Class - <?php echo $class?> &emsp; Exam - <?php echo $exam?> &emsp; Type - <?php echo $type?> </h4>
	 <div class="table-responsive">
	      <table cellspacing="0"  width="100%">
	          <thead>
    <tr >
      <th>Sr</th>
      <th style='width:5px'>Sch</th>
  
      <th >Name</th>
       <th >Father</th>
       <th  ><?php echo $row1['s1'] ?></th>
        <th style='width: 20px;'><?php echo $row1['s2'] ?></th>
         <th style='width: 20px;'><?php echo $row1['s3'] ?></th>
          <th style='width: 20px;'><?php echo $row1['s4'] ?></th>
           <th style='width: 20px;'><?php echo $row1['s5'] ?></th>
            <th style='width: 20px;'><?php echo $row1['s6'] ?></th>
             <th style='width: 20px;'><?php echo $row1['s7'] ?></th>
              <th style='width: 20px;'><?php echo $row1['s8'] ?></th>
           <?php if($row1['s9']!=''){?> <th style='width:55px'><?php echo $row1['s9'] ?></th><?php }?>
               <?php if($row1['s10']!=''){?> <th style='width: 20px;'><?php echo $row1['s10'] ?></th><?php }?>
                <th style='width: 20px;'>Total</th>
    </tr>
  </thead>
  <tbody> <?php
	 $s=1;
		$selc="select * from registration where session='$session' and subject='$class' and status='' and section='$section' order by name asc";
	$resc=mysqli_query($conn,$selc);
	 while($row=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	      $app=$row['application'];
	       $reg=$row['id'];
	       $name=$row['name'];
	       
	       $selc12="select * from mark where session='$session' and exam='$exam' and type='$type' and sch='$app' ";
	$resc12=mysqli_query($conn,$selc12);
	$row12=mysqli_fetch_array($resc12,MYSQLI_BOTH);
	$up1="update registration set rol='$s' where  session='$session' and subject='$class' and status='' and section='$section' and id='$reg'";
					    if(mysqli_query($conn,$up1))
					    {
					        echo '';
					    }
	
	  ?>
	 
    <tr>
     <input type='hidden' value='<?php echo $class  ?>' name="class"  >
     <input type='hidden' value='<?php echo $session  ?>' name="session"  >
     <input type='hidden' value='<?php echo $exam  ?>' name="exam"  >
     <input type='hidden' value='<?php echo $type  ?>' name="type"  >
      <td><?php echo $s++;?></td>
      <td style="width: 20px;"><input type='text' value="<?php echo $row['application']?>" name="<?php echo $app.'app' ?>" readonly style='width:55px' ></td>
     <td><input type='text' value="<?php echo $row['name']?>" name="<?php echo $app.'name' ?>"  readonly ></td>
     <td><input type='text' value="<?php echo $row['fname']?>" name="<?php echo $app.'fname' ?>"  readonly ></td>
      <td style='width:55px'><input type='text' value="<?php echo $row12['s1']?>" name="<?php echo $app.'s1' ?>" style='width:100%' ></td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['s2']?>" name="<?php echo $app.'s2' ?>" style='width:100%' ></td>
        <td style='width:55px'><input type='text' value="<?php echo $row12['s3']?>" name="<?php echo $app.'s3' ?>"  style='width:100%'></td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['s4']?>" name="<?php echo $app.'s4' ?>"  style='width:100%'></td>
          <td style='width:55px'><input type='text' value="<?php echo $row12['s5']?>" name="<?php echo $app.'s5' ?>" style='width:100%' ></td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['s6']?>" name="<?php echo $app.'s6' ?>" style='width:100%' ></td>
            <?php if($row1['s7']!=''){ ?><td style='width:55px'><input type='text' value="<?php echo $row12['s7']?>" name="<?php echo $app.'s7' ?>" style='width:100%' ></td><?php }?>
             <?php if($row1['s8']!=''){ ?><td style='width:55px'><input type='text' value="<?php echo $row12['s8']?>" name="<?php echo $app.'s8' ?>"  style='width:100%'></td><?php }?>
              <?php if($row1['s9']!=''){?> <td style='width:55px'><input type='text' value="<?php echo $row12['s9']?>" name="<?php echo $app.'s9' ?>" style='width:100%' ></td><?php }?>
               <?php if($row1['s10']!=''){?><td style='width:55px'><input type='text' value="<?php echo $row12['s10']?>" name="<?php echo $app.'s10' ?>" style='width:100%' ></td><?php }?>
               <?php if($row12){?><td style='width:55px'><input type='text' value="<?php echo $to=(int)$row12['s1']+(int)$row12['s2']+(int)$row12['s3']+(int)$row12['s4']+(int)$row12['s5']+(int)$row12['s6']+(int)$row12['s7']+(int)$row12['s8']+(int)$row12['s9']+(int)$row12['s10'];?>"  style='width:100%' readonly ></td><?php }?>
    </tr>
   
	  <?php
	  								
													$sel121="select * from max_fill where session='$session' and exam='$exam' and type='$type' and sch='$app'";
					$res121=mysqli_query($conn,$sel121);
					if($row121=mysqli_fetch_array($res121,MYSQLI_BOTH))
					{
					    $up="update max_fill set obtain='$to' where  session='$session' and exam='$exam' and type='$type' and sch='$app'";
					    if(mysqli_query($conn,$up))
					    {
					        echo '';
					    }
					}
					else
					{
					    $ins="insert into max_fill (sch,reg_id,exam,type,session,class,obtain,name) values('$app','$reg','$exam','$type','$session','$class','$to','$name')";
					    if(mysqli_query($conn,$ins))
					    {
					        echo '';
					    }
					}
					
	  }
	 ?></tbody>
	          </table>
	          </div>
	         
	      </div>  <center><button class="btn btn-primary">Add</button></center>
	        <button onclick="print('modal')" >print</button>
	  <script>
	function print(modal) {
     var printContents = document.getElementById(modal).innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = printContents;

     window.print();
	

     document.body.innerHTML = originalContents;
}
	
	
	</script>
	      
	      <?php  
	   
break;

case 3:
	     $session=$_POST['session'];
	     $class=$_POST['class'];
	     $exam=$_POST['exam'];
	     $type=$_POST['type'];
			 
					$sel12="select * from registration where session='$session' and subject='$class' and status='' order by name asc";
					$res12=mysqli_query($conn,$sel12);
					$s=1;
					while($row12=mysqli_fetch_array($res12,MYSQLI_BOTH))
					{
					    $app=$row12['application'];
						$app=$_POST[$app."app"];
						//echo $app;
							$name=$_POST[$app."name"];
					//	echo $name;
					
				 	$s1=$_POST[$app."s1"];
						$s2=$_POST[$app."s2"];
							$s3=$_POST[$app."s3"];
								$s4=$_POST[$app."s4"];	
								$s5=$_POST[$app."s5"];
									$s6=$_POST[$app."s6"];
										$s7=$_POST[$app."s7"];
											$s8=$_POST[$app."s8"];
												$s9=$_POST[$app."s9"];
													$s10=$_POST[$app."s10"];
									if($type=='PT I' or $type=='PT II')
									{ 
									      $area='PT';
									    $sel123="select * from max_match where  class='$class' and area='$area'";
				                	$res123=mysqli_query($conn,$sel123);
				                    	$row123=mysqli_fetch_array($res123,MYSQLI_BOTH);
				                    	$row123['s1'];
				                    	if((int)$s1>$row123['s1'])
				                    	{
				                    	    echo $name.' '.' SUBJECT1'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s2>$row123['s2'])
				                    	{
				                    	    echo $name.' '.'SUBJECT2'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s3>$row123['s3'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s4>$row123['s4'])
				                    	{
				                    	    echo $name.' '.'SUBJECT4'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s5>$row123['s5'])
				                    	{
				                    	    echo $name.' '.'SUBJECT5'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s6>$row123['s6'])
				                    	{
				                    	    echo $name.' '.'SUBJECT6'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s7>$row123['s7'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s8>$row123['s8'])
				                    	{
				                    	    echo $name.' '.'SUBJECT8'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s9>$row123['s9'])
				                    	{
				                    	    echo $name.' '.'SUBJECT9'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s10>$row123['s10'])
				                    	{
				                    	    echo $name.' '.'SUBJECT10'.',';
				                    	    exit();
				                    	}
				                    	
									}
									
									if($type=='Note Book' or $type=='Sub Enr.')
									{
									    $area='NS';
									    $sel123="select * from max_match where  class='$class' and area='$area'";
				                	$res123=mysqli_query($conn,$sel123);
				                    	$row123=mysqli_fetch_array($res123,MYSQLI_BOTH);
				                    		if((int)$s1>$row123['s1'])
				                    	{
				                    	    echo $name.' '.' SUBJECT1'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s2>$row123['s2'])
				                    	{
				                    	    echo $name.' '.'SUBJECT2'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s3>$row123['s3'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s4>$row123['s4'])
				                    	{
				                    	    echo $name.' '.'SUBJECT4'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s5>$row123['s5'])
				                    	{
				                    	    echo $name.' '.'SUBJECT5'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s6>$row123['s6'])
				                    	{
				                    	    echo $name.' '.'SUBJECT6'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s7>$row123['s7'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s8>$row123['s8'])
				                    	{
				                    	    echo $name.' '.'SUBJECT8'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s9>$row123['s9'])
				                    	{
				                    	    echo $name.' '.'SUBJECT9'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s10>$row123['s10'])
				                    	{
				                    	    echo $name.' '.'SUBJECT10'.',';
				                    	    exit();
				                    	}
									    
									}
									if($type=='Half Yearly' or $type=='Annual Exam')
									{
									     $area='HA';
									    $sel123="select * from max_match where  class='$class' and area='$area' ";
				                	$res123=mysqli_query($conn,$sel123);
				                    	$row123=mysqli_fetch_array($res123,MYSQLI_BOTH);
				                    	if((int)$s1>$row123['s1'])
				                    	{
				                    	    echo $name.' '.' SUBJECT1'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s2>$row123['s2'])
				                    	{
				                    	    echo $name.' '.'SUBJECT2'.',';
				                    	    exit();
				                    	}
				                    	if((int)$s3>$row123['s3'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s4>$row123['s4'])
				                    	{
				                    	    echo $name.' '.'SUBJECT4'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s5>$row123['s5'])
				                    	{
				                    	    echo $name.' '.'SUBJECT5'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s6>$row123['s6'])
				                    	{
				                    	    echo $name.' '.'SUBJECT6'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s7>$row123['s7'])
				                    	{
				                    	    echo $name.' '.'SUBJECT3'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s8>$row123['s8'])
				                    	{
				                    	    echo $name.' '.'SUBJECT8'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s9>$row123['s9'])
				                    	{
				                    	    echo $name.' '.'SUBJECT9'.',';
				                    	    exit();
				                    	}
				                    		if((int)$s10>$row123['s10'])
				                    	{
				                    	    echo $name.' '.'SUBJECT10'.',';
				                    	    exit();
				                    	}
									}
									
													
													
													$sel121="select * from mark where session='$session' and exam='$exam' and type='$type' and sch='$app'";
					$res121=mysqli_query($conn,$sel121);
					if($row121=mysqli_fetch_array($res121,MYSQLI_BOTH))
					{
					     $up="update mark set s1='$s1',s2='$s2',s3='$s3',s4='$s4' ,s5='$s5',s6='$s6' ,s7='$s7',s8='$s8',s9='$s9',s10='$s10' where  session='$session' and exam='$exam' and type='$type' and sch='$app'";
					    if(mysqli_query($conn,$up))
					    {
					        echo '';
					    } 
					}
					else
					{
					     
					    $ins="insert into mark (sch,reg_id,exam,type,session,class,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10) values('$app','','$exam','$type','$session','$class','$s1','$s2','$s3','$s4','$s5','$s6','$s7','$s8','$s9','$s10')";
					    if(mysqli_query($conn,$ins))
					    {
					        echo '';
					    } 
					}
					
					$s++;}
	 
	 
	
	
	
	break;
	case 4:
	    
	    $session=$_POST['session'];
	    $class=$_POST['class'];
	    $exam=$_POST['exam'];
	    $all=$_POST['all'];
	    $sch=$_POST['sch'];
	      $section=$_POST['section'];
	    	$selc2="select * from grade where class='$class'";
	$resc2=mysqli_query($conn,$selc2);
	$row1=mysqli_fetch_array($resc2,MYSQLI_BOTH);
	 ?>
	 <style>
	     th,td{font-size:13px;}
	     
	     
	 </style>
	 <div class="table-responsive">
	      <table cellspacing="0"  width="100%">
	          <thead>
    <tr>
      <th>Sr</th>
      <th style='width:5px'>Sch</th>
  
      <th >Name</th>
       <th >Father</th>
       <th >Area</th>
       <th  ><?php echo $row1['g1'] ?></th>
        <th  style='width: 20px;'><?php echo $row1['g2'] ?></th>
         <th  style='width: 20px;'><?php echo $row1['g3'] ?></th>
          <th  style='width: 20px;'><?php echo $row1['g4'] ?></th>
           <th  style='width: 20px;'><?php echo $row1['g5'] ?></th>
            <th  style='width: 20px;'><?php echo $row1['g6'] ?></th>
             <th  style='width: 20px;'><?php echo $row1['g7'] ?></th>
              <th style='width: 20px;'><?php echo $row1['g8'] ?></th>
               <th  style='width:55px'><?php echo $row1['g9'] ?></th>
               <th  style='width:55px'><?php echo $row1['g10'] ?></th>
              
    </tr>
  </thead>
  <tbody> <?php
	 $s=1;
	 if($all=='Yes')
	 {
	     	$selc="select * from registration where session='$session' and subject='$class' and status='' and section='$section' order by name asc";
	 }
	 else
	 {
	     	$selc="select * from registration where session='$session' and subject='$class' and status='' and application='$sch' order by name asc";
	 }
	
	$resc=mysqli_query($conn,$selc);
	 while($row=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	      $app=$row['application'];
	       $reg=$row['id'];
	       
	       $selc12="select * from grade_mark where session='$session' and exam='$exam'  and sch='$app' ";
	$resc12=mysqli_query($conn,$selc12);
	$row12=mysqli_fetch_array($resc12,MYSQLI_BOTH);
	
	  ?>
	 
    <tr>
     <input type='hidden' value='<?php echo $class  ?>' name="class"  >
     <input type='hidden' value='<?php echo $session  ?>' name="session"  >
     <input type='hidden' value='<?php echo $exam  ?>' name="exam"  >
  
      <td><?php echo $s++;?></td>
      <td style="width: 20px;"><input type='text' value="<?php echo $row['application']?>" name="<?php echo $app.'app' ?>" readonly style='width:55px' ></td>
     <td><input type='text' value="<?php echo $row['name']?>" name="<?php echo $app.'name' ?>"  readonly ></td>
     <td><input type='text' value="<?php echo $row['fname']?>" name="<?php echo $app.'fname' ?>"  readonly ></td>
     <td style='color:red' >English</td>
     
      <td style='width:55px'><input type='text' value="<?php echo $row12['g1']?>" name="<?php echo $app.'g1' ?>" style='width:100%' ></td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g2']?>" name="<?php echo $app.'g2' ?>" style='width:100%' ></td>
        <td style='width:55px'><input type='text' value="<?php echo $row12['g3']?>" name="<?php echo $app.'g3' ?>"  style='width:100%'></td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g4']?>" name="<?php echo $app.'g4' ?>"  style='width:100%'></td>
          <td style='width:55px'><input type='text' value="<?php echo $row12['g5']?>" name="<?php echo $app.'g5' ?>" style='width:100%' ></td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g6']?>" name="<?php echo $app.'g6' ?>" style='width:100%' ></td>
            <td style='width:55px'><input type='text' value="<?php echo $row12['g7']?>" name="<?php echo $app.'g7' ?>" style='width:100%' ></td>
             <td style='width:55px'><input type='text' value="<?php echo $row12['g8']?>" name="<?php echo $app.'g8' ?>"  style='width:100%'></td>
              <td style='width:55px'><input type='text' value="<?php echo $row12['g9']?>" name="<?php echo $app.'g9' ?>" style='width:100%' ></td>
               <td style='width:55px'><input type='text' value="<?php echo $row12['g10']?>" name="<?php echo $app.'g10' ?>" style='width:100%' ></td>
             
      
              
    </tr>
    <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:green'>Hindi</td>
      <td style='width:55px'><input type='text' value="<?php echo $row12['g11']?>" name="<?php echo $app.'g11' ?>" style='width:100%' ></td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g12']?>" name="<?php echo $app.'g12' ?>" style='width:100%' ></td>
        <td style='width:55px'><input type='text' value="<?php echo $row12['g13']?>" name="<?php echo $app.'g13' ?>"  style='width:100%'></td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g14']?>" name="<?php echo $app.'g14' ?>"  style='width:100%'></td>
          <td style='width:55px'><input type='text' value="<?php echo $row12['g15']?>" name="<?php echo $app.'g15' ?>" style='width:100%' ></td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g16']?>" name="<?php echo $app.'g16' ?>" style='width:100%' ></td>
            <td style='width:55px'><input type='text' value="<?php echo $row12['g17']?>" name="<?php echo $app.'g17' ?>" style='width:100%' ></td>
             <td style='width:55px'><input type='text' value="<?php echo $row12['g18']?>" name="<?php echo $app.'g18' ?>"  style='width:100%'></td>
              <td style='width:55px'><input type='text' value="<?php echo $row12['g19']?>" name="<?php echo $app.'g19' ?>" style='width:100%' ></td>
               <td style='width:55px'><input type='text' value="<?php echo $row12['g20']?>" name="<?php echo $app.'g20' ?>" style='width:100%' ></td>
                
       
              
    </tr>
    <tr> <td></td>
      <td style="width: 20px;"></td>
     <td></td><td></td><td colspan='12'>=============================================</td></tr>
     <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:blue'>Maths</td>
      <td style='width:55px'>Basic Concepts</td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g21']?>" name="<?php echo $app.'g21' ?>" style='width:100%;height:100%' ></td>
        <td style='width:55px'>Number Concepts</td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g22']?>" name="<?php echo $app.'g22' ?>"  style='width:100%;height:100%'  ></td>
          <td style='width:55px'>Thinking Skills</td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g23']?>" name="<?php echo $app.'g23' ?>" style='width:100%;height:100%'  ></td>
            
                
       
              
    </tr>
      <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:black'>Environmental Studies</td>
      <td style='width:55px'>Activity / Project</td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g24']?>" name="<?php echo $app.'g24' ?>" style='width:100%;height:100%' ></td>
        <td style='width:55px'>Environmental Senstivity</td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g25']?>" name="<?php echo $app.'g25' ?>"  style='width:100%;height:100%'  ></td>
          <td style='width:55px'>Group Discussion</td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g26']?>" name="<?php echo $app.'g26' ?>" style='width:100%;height:100%'  ></td>
            
                
       
              
    </tr>
     <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:green'>Art, Craft</td>
      <td style='width:55px'>Interest</td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g27']?>" name="<?php echo $app.'g27' ?>" style='width:100%;height:100%' ></td>
        <td style='width:55px'>Creativity</td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g28']?>" name="<?php echo $app.'g28' ?>"  style='width:100%;height:100%'  ></td>
          <td style='width:55px'>Skill</td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g29']?>" name="<?php echo $app.'g29' ?>" style='width:100%;height:100%'  ></td>
            
                
       
              
    </tr>
     <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:black'>Games </td>
      <td style='width:55px'>Discipline</td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g30']?>" name="<?php echo $app.'g30' ?>" style='width:100%;height:100%' ></td>
        <td style='width:55px'>Enthusiam</td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g31']?>" name="<?php echo $app.'g31' ?>"  style='width:100%;height:100%'  ></td>
          <td style='width:55px'>Team Spirit</td>
           <td style='width:55px'><input type='text' value="<?php echo $row12['g32']?>" name="<?php echo $app.'g32' ?>" style='width:100%;height:100%'  ></td>
            
                
       
              
    </tr>
	  <tr>
     
      <td></td>
      <td style="width: 20px;"></td>
     <td></td>
     <td></td>
      <td style='color:black'>Present </td>
      
       <td style='width:55px'><input type='text' value="<?php echo $row12['p']?>" name="<?php echo $app.'p' ?>" style='width:100%;height:100%' ></td>
        
              
       
              
    </tr>
	  <?php
	  }
	 ?></tbody>
	          </table>
	          
	          <center><button class="btn btn-primary">Add</button></center>
	      </div> <?php  
	   
break;
case 5:
	     $session=$_POST['session'];
	     $class=$_POST['class'];
	     $exam=$_POST['exam'];
	    
			 
					$sel12="select * from registration where session='$session' and subject='$class' and status='' order by name asc";
					$res12=mysqli_query($conn,$sel12);
					$s=1;
					while($row12=mysqli_fetch_array($res12,MYSQLI_BOTH))
					{
					    $app=$row12['application'];
						$app=$_POST[$app."app"];
						echo $app;
							$name=$_POST[$app."name"];
					//	echo $name;
					
					$g1=$_POST[$app."g1"];
						$g2=$_POST[$app."g2"];
							$g3=$_POST[$app."g3"];
								$g4=$_POST[$app."g4"];	
								$g5=$_POST[$app."g5"];
									$g6=$_POST[$app."g6"];
										$g7=$_POST[$app."g7"];
											$g8=$_POST[$app."g8"];
												$g9=$_POST[$app."g9"];
													$g10=$_POST[$app."g10"];
													$g11=$_POST[$app."g11"];
						$g12=$_POST[$app."g12"];
							$g13=$_POST[$app."g13"];
								$g14=$_POST[$app."g14"];	
								$g15=$_POST[$app."g15"];
									$g16=$_POST[$app."g16"];
										$g17=$_POST[$app."g17"];
											$g18=$_POST[$app."g18"];
												$g19=$_POST[$app."g19"];
													$g20=$_POST[$app."g20"];
								$g21=$_POST[$app."g21"];
						$g22=$_POST[$app."g22"];
							$g23=$_POST[$app."g23"];
								$g24=$_POST[$app."g24"];	
								$g25=$_POST[$app."g25"];
									$g26=$_POST[$app."g26"];
										$g27=$_POST[$app."g27"];
											$g28=$_POST[$app."g28"];
												$g29=$_POST[$app."g29"];
													$g30=$_POST[$app."g30"];
													$g31=$_POST[$app."g31"];
									$g32=$_POST[$app."g32"];
									$p=$_POST[$app."p"];
													
													
													$sel121="select * from grade_mark where session='$session' and exam='$exam'  and sch='$app'";
					$res121=mysqli_query($conn,$sel121);
					if($row121=mysqli_fetch_array($res121,MYSQLI_BOTH))
					{
					    $up="update grade_mark set g1='$g1',g2='$g2',g3='$g3',g4='$g4' ,g5='$g5',g6='$g6' ,g7='$g7',g8='$g8',g9='$g9',g10='$g10',g11='$g11',g12='$g12',g13='$g13',g14='$g14' ,g15='$g15',g16='$g16' ,g17='$g17',g18='$g18',g19='$g19',g20='$g20',g21='$g21',g22='$g22',g23='$g23',g24='$g24' ,g25='$g25',g26='$g26' ,g27='$g27',g28='$g28',g29='$g29',g30='$g30',g31='$g31',g32='$g32' ,p='$p' where  session='$session' and exam='$exam'  and sch='$app'";
					    if(mysqli_query($conn,$up))
					    {
					        echo 'update';
					    }
					    else
					    {
					        echo 'not Update';
					    }
					}
					else
					{
					    $ins="INSERT INTO `grade_mark` (`id`, `sch`, `session`, `exam`, `g1`, `g2`, `g3`, `g4`, `g5`, `g6`, `g7`, `g8`, `g9`, `g10`, `g11`, `g12`, `g13`, `g14`, `g15`, `g16`, `g17`, `g18`, `g19`, `g20`, `g21`, `g22`, `g23`, `g24`, `g25`, `g26`, `g27`, `g28`, `g29`, `g30`, `g31`, `g32`, `p`) VALUES (NULL, '$app', '$session', '$exam', '$g1', '$g2', '$g3', '$g4', '$g5', '$g6', '$g7', '$g8', '$g9', '$g10', '$g11', '$g12', '$g13', '$g14', '$g15', '$g16', '$g17', '$g18', '$g19', '$g20', '$g21', '$g22', '$g23', '$g24', '$g25', '$g26', '$g27', '$g28', '$g29', '$g30', '$g31', '$g32', '$p');";
					    if(mysqli_query($conn,$ins))
					    {
					        echo 'insert';
					    }
					    else
					    {
					        echo 'no';
					    }
					}
					
					$s++;}
	 
	 
	
	
	
	break;
	case 6:
	    
	    $session=$_POST['session'];
	    $class=$_POST['class'];
	    $exam=$_POST['exam'];
	     $section=$_POST['section'];
	   
	    	$selc2="select * from grade where class='$class'";
	$resc2=mysqli_query($conn,$selc2);
	$row1=mysqli_fetch_array($resc2,MYSQLI_BOTH);
	 ?>
	 <style>
	     th,td{font-size:13px;}
	     
	     
	 </style>
	 <div class="table-responsive">
	      <table cellspacing="0"  width="100%">
	          <thead>
    <tr >
      <th>Sr</th>
      <th style='width:5px'>Sch</th>
  
      <th >Name</th>
       <th >Father</th>
       <th  ><?php echo $row1['g1'] ?></th>
        <th  style='width: 20px;'><?php echo $row1['g2'] ?></th>
         <th  style='width: 20px;'><?php echo $row1['g3'] ?></th>
          <th  style='width: 20px;'><?php echo $row1['g4'] ?></th>
          <th  style='width: 20px;'>Present</th>
           
    </tr>
  </thead>
  <tbody> <?php
	 $s=1;
		$selc="select * from registration where session='$session' and subject='$class' and status='' and section='$section' order by name asc";
	$resc=mysqli_query($conn,$selc);
	 while($row=mysqli_fetch_array($resc,MYSQLI_BOTH))
	  {
	      $app=$row['application'];
	       $reg=$row['id'];
	       
	       $selc12="select * from grade_mark where session='$session' and exam='$exam' and sch='$app' ";
	$resc12=mysqli_query($conn,$selc12);
	$row12=mysqli_fetch_array($resc12,MYSQLI_BOTH);
	
	  ?>
	 
    <tr>
     <input type='hidden' value='<?php echo $class  ?>' name="class"  >
     <input type='hidden' value='<?php echo $session  ?>' name="session"  >
     <input type='hidden' value='<?php echo $exam  ?>' name="exam"  >
    
      <td><?php echo $s++;?></td>
      <td style="width: 20px;"><input type='text' value="<?php echo $row['application']?>" name="<?php echo $app.'app' ?>" readonly style='width:55px' ></td>
     <td><input type='text' value="<?php echo $row['name']?>" name="<?php echo $app.'name' ?>"  readonly ></td>
     <td><input type='text' value="<?php echo $row['fname']?>" name="<?php echo $app.'fname' ?>"  readonly ></td>
     <td style='width:55px'><input type='text' value="<?php echo $row12['g1']?>" name="<?php echo $app.'g1' ?>" style='width:100%' ></td>
       <td style='width:55px'><input type='text' value="<?php echo $row12['g2']?>" name="<?php echo $app.'g2' ?>" style='width:100%' ></td>
        <td style='width:55px'><input type='text' value="<?php echo $row12['g3']?>" name="<?php echo $app.'g3' ?>"  style='width:100%'></td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['g4']?>" name="<?php echo $app.'g4' ?>"  style='width:100%'></td>
         <td style='width:55px'><input type='text' value="<?php echo $row12['p']?>" name="<?php echo $app.'p' ?>"  style='width:100%'></td>
    </tr>
   
	  <?php
	  }
	 ?></tbody>
	          </table>
	          
	          <center><button class="btn btn-primary">Add</button></center>
	      </div> <?php  
	   
break;

case 7:
	     $session=$_POST['session'];
	     $class=$_POST['class'];
	     $exam=$_POST['exam'];
	   
			 
					$sel12="select * from registration where session='$session' and subject='$class' and status='' order by name asc";
					$res12=mysqli_query($conn,$sel12);
					$s=1;
					while($row12=mysqli_fetch_array($res12,MYSQLI_BOTH))
					{
					    $app=$row12['application'];
						$app=$_POST[$app."app"];
						//echo $app;
							$name=$_POST[$app."name"];
					//	echo $name;
					
					$g1=$_POST[$app."g1"];
						$g2=$_POST[$app."g2"];
							$g3=$_POST[$app."g3"];
								$g4=$_POST[$app."g4"];
								$p=$_POST[$app."p"];
													
													$sel121="select * from grade_mark where session='$session' and exam='$exam'  and sch='$app'";
					$res121=mysqli_query($conn,$sel121);
					if($row121=mysqli_fetch_array($res121,MYSQLI_BOTH))
					{
					    $up="update grade_mark set g1='$g1',g2='$g2',g3='$g3',g4='$g4',p='$p' where  session='$session' and exam='$exam'  and sch='$app'";
					    if(mysqli_query($conn,$up))
					    {
					        echo '';
					    }
					}
					else
					{
					    $ins="insert into grade_mark (`id`, `sch`, `session`, `exam`, `g1`, `g2`, `g3`, `g4`, `p`) values(NULL, '$app', '$session', '$exam', '$g1', '$g2', '$g3', '$g4','$p')";
					    if(mysqli_query($conn,$ins))
					    {
					        echo '';
					    }
					}
					
					$s++;}
	 
	 
	
	
	
	break;
	
	
	case 8:
	
	$sel="select * from result_date order by id desc";
	$res=mysqli_query($conn,$sel);
	
	?>
	<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>Sr No.</th><th>Session</th><th>Result Date Term1</th><th>Result Date Term1</th><th>Study days Term-1</th><th>Study days Term-2</th><th>Class</th><th>Delete</th>
	</tr></thead>
	<?php 
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
	
	?>
	<tbody>		
	<tr>
	
	<td><?php echo $s++;?></td><td><?php echo $row['session'];?></td><td><?php echo $row['date1'];?></td><td><?php echo $row['date2'];?></td>
	<td><?php echo $row['term_1'];?></td><td><?php echo $row['term_2'];?></td><td><?php echo $row['class'];?></td>
<td> <a href="result_date.php?id=<?php echo $row['id'];?>"><span class="glyphicon glyphicon-pencil">Edit</span></a> &emsp;<a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</tbody>
	</table>
	</div>
	<?php 
	
	break;
	
	case 9:
	$id=$_POST['rowid'];
	$del="delete from result_date where id='$id'";
	if(mysqli_query($conn,$del))
		{
			echo"ok";
		}
		else
		{
			echo"not delete";
		}
	
	break;
	case 10:
	
	$session=$_POST['session'];
	$term_1=$_POST['term_1'];
	$term_2=$_POST['term_2'];
	$date1=$_POST['date1'];
	$date2=$_POST['date2'];
		$class=$_POST['class'];
	$id=$_POST['id'];
	if($id!='')
	{
	  $up="update  result_date set session='$session',term_1='$term_1',term_2='$term_2',date1='$date1',date2='$date2',class='$class' where id='$id'";  
	  mysqli_query($conn,$up);
	  echo 'update';
	}
	else
	{
	$ins="insert into result_date(session,term_1,term_2,date1,date2,class) values('$session','$term_1','$term_2','$date1','$date2','$class')";
	if(mysqli_query($conn,$ins))
	{
		echo"successfully Add";
	}
	else
	{
		echo"not add";
	}
	}
	
	break;
	


}


?>

MMCT - 2023