<?php
include("../db.php");
$ch=$_REQUEST["type"];
if($ch=="fetchStudent"){
   
   if($_REQUEST["dbname"]=='reff_receipt')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");



	  echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>inst_id</td>";
	  echo "<td>idno</td>";
	  echo "<td>amount</td>";
	  echo "<td>Type</td>";
	  echo "<td>Date</td>";
	  echo "<td>Session</td>";
	  echo "<td>Action</td>";
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		   
		    echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";
		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['inst_id']."</td>";
		  	echo "<td>".$sList['idno']."</td>";
		  	echo "<td>".$sList['amount']."</td>";
		  	echo "<td>".$sList['type']."</td>";
		    echo "<td>".$sList['date']."</td>";
		    echo "<td>".$sList['session']."</td>";
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		echo "</table>";
	echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';
	}else{
		echo "No record Found...";
	}
   }
   
 if($_REQUEST["dbname"]=='installment_fine')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");
	  echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>idno</td>";
	  echo "<td>ins_name</td>";
	  echo "<td>udate</td>";
	  echo "<td>fine</td>";
	  echo "<td>reasion</td>";
	  echo "<td>Session</td>";
	  echo "<td>Action</td>";
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		    echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";

		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['idno']."</td>";
		  	echo "<td>".$sList['ins_name']."</td>";
		  	echo "<td>".$sList['udate']."</td>";
		  	echo "<td>".$sList['fine']."</td>";
		    echo "<td>".$sList['reasion']."</td>";
		    echo "<td>".$sList['session']."</td>";
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		    echo "</table>";
		    echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';

	}else{
		    echo "No record Found...";
	}
   }  
  
 if($_REQUEST["dbname"]=='installment_time')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");


	  echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>date</td>";
	  echo "<td>idno</td>";
	  echo "<td>ins_name</td>";
	 
	  echo "<td>Session</td>";
	  echo "<td>Action</td>";
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		   echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";

		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['date']."</td>";
		  	echo "<td>".$sList['idno']."</td>";
		  	echo "<td>".$sList['ins_name']."</td>";
		  
		    echo "<td>".$sList['session']."</td>";
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		   echo "</table>";
		   echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';

	}else{
		  echo "No record Found...";
	}
   }  
  
  
  
  if($_REQUEST["dbname"]=='receipt')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");


	  echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>Receipt No</td>";
	  echo "<td>udate</td>";
	  echo "<td>detail</td>";
	  echo "<td>amount</td>";
	
	  echo "<td>Action</td>";
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		    echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";

		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['id']."</td>";
		  	echo "<td>".$sList['udate']."</td>";
		  	echo "<td>".$sList['detail']."</td>";
		  	echo "<td>".$sList['amount']."</td>";
		 
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		echo "</table>";
		echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';

	}else{
		echo "No record Found...";
	}
   }  
  
 
 
  if($_REQUEST["dbname"]=='transaction')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and rid='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");
//	echo $ss="select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and rid='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'";


      echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>Adm.No</td>";
	  echo "<td>tfor</td>";
	  echo "<td>tid</td>";
	  echo "<td>type</td>";
	  echo "<td>amount</td>";
	  echo "<td>udate</td>";
	  echo "<td>detail</td>";
	  echo "<td>Action</td>";
	  echo "</tr>";
	  
	  	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		    echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";

		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['exp_id']."</td>";
		  	echo "<td>".$sList['tfor']."</td>";
		  	echo "<td>".$sList['tid']."</td>";
		  	echo "<td>".$sList['type']."</td>";
		  	echo "<td>".$sList['amount']."</td>";
		  	echo "<td>".$sList['udate']."</td>";
		  	echo "<td>".$sList['detail']."</td>";
		 
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		echo "</table>";
		echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';

	}else{
		echo "No record Found...";
	}
   }  
 
if($_REQUEST["dbname"]=='hostel_receipt')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");

	  echo "<table class='table'><tr>";
	  echo "<td></td>";
	  echo "<td>Sr.No</td>";
	  echo "<td>Receipt No</td>";
	  echo "<td>udate</td>";
	  echo "<td>detail</td>";
	  echo "<td>amount</td>";
	
	  echo "<td>Action</td>";
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		    echo"<td><input class='checkboxes' type='checkbox' value='".$sList['id']."' name='PLJan'</td>";

		    echo "<td>".$i."</td>";
		  	echo "<td>".$sList['id']."</td>";
		  	echo "<td>".$sList['udate']."</td>";
		  	echo "<td>".$sList['detail']."</td>";
		  	echo "<td>".$sList['amount']."</td>";
		 
		    echo '<td><a href="javascript:;" onclick="del(\''.URL_ADMIN_HOME.getQueryString($aryPgAct).'&id='.$sList['id'].'&tbl='.$_REQUEST["dbname"].'&sid='.$_REQUEST["id"].'\')" class="confirmation"><button type="button" class="btn btn-danger">Delete</button></a></td>';
	        echo "</tr>";
	        $i++;
		}
		echo "</table>";
		echo '<center><input type="submit"   class="btn btn-primary" onclick="getStudentfinePopup(\''.$_REQUEST["dbname"].'\')"  name="Delete" value="Delete all"><center>';

	}else{
		echo "No record Found...";
	}
   }  
  
  
  
 if($_REQUEST["dbname"]=='installment')
   {

	$studentList=$db->getRows("select *  from ".$_REQUEST["dbname"]."  where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_REQUEST["id"]."' and session='".$_SESSION["admin"]["session"]."'");
      echo "<form name='install' id='install' method='post'>";
	  echo "<table class='table'><tr>";
	  echo "<td>ip1</td>";
	  echo "<td>ip2</td>";
	  echo "<td>ip3</td>";
	  echo "<td>ip4</td>";
	  echo "<td>ip5</td>";
	  echo "<td>ip6</td>";
	  echo "<td>ip7</td>";
	  echo "<td>ip8</td>";
	  echo "<td>ip9</td>";
	  echo "<td>ip10</td>";
	  echo "<td>ip11</td>";
	  echo "<td>ip12</td>";
	 
	  echo "</tr>";
	if(is_array($studentList) && count($studentList)>0){
	$i=1;
	$aryPgAct=array("page_id"=>"service","action"=>"delete");
		foreach($studentList as $sList){
		    echo "<tr>";
		  
		    echo "<td><input type='text' class='textboxclass'></td>";
		  	echo "<td><input type='text' class='textboxclass'></td>";
		  	echo "<td><input type='text' class='textboxclass'></td>";
		    echo "<td><input type='text' class='textboxclass'></td>";
		  	echo "<td><input type='text' class='textboxclass'></td>";
		  	echo "<td><input type='text' class='textboxclass'></td>";
		  	echo "<td><input type='text' class='textboxclass'></td>";
		   echo "<td><input type='text' class='textboxclass'></td>";
		   echo "<td><input type='text' class='textboxclass'></td>";
		   echo "<td><input type='text' class='textboxclass'></td>";
		   echo "<td><input type='text' class='textboxclass'></td>";
		  echo "<td><input type='text' class='textboxclass'></td>";
		  
		 
	        echo "</tr>";
	        $i++;
		}
		echo "</table>";
		
		//echo '<center><input type="submit"   class="btn btn-primary" onclick="getupdaterecords(\'mail\')"  name="saveinstall" value="Save"><center>';
        echo "</form>";
	}else{
		echo "No record Found...";
	}
   }   
  
  
   
   
}


if($ch=="deleterecords"){
  $arrid=$_REQUEST["id"];
  $tablename=$_REQUEST["dbname"];
 
    foreach($arrid  as $sid)
    {
 $res=$db->delete($tablename,"where  id='".$sid."'");
   
   
    }





}

?>

