<?php
include("../db.php");
$ch = $_REQUEST["type"];


if($ch=="get_student_list"){

    $where = "";
    if($_POST["section"]!=""){
        $where = " and section='$_POST[section]'";
    }

	$sList=$db->getRows("select * from student where session='".$_SESSION["admin"]["session"]."' and class='".$_REQUEST["cls"]."' $where and issue_TC=0 and status=1 order by name");

	?>
	<select class="input-block-level" name="student">
        <option value="">--Student--</option>
        <?php 
		if(is_array($sList) && count($sList)>0){
			foreach($sList as $List){
				?>
				<option <?php if($List["idno"]==$_REQUEST["otype"])echo 'selected';?> value="<?php echo $List["idno"] ?>">
                <?php echo $List["name"]." - (".$List['fname'].")" ?>
                </option>
				<?php
			}
		}
		?>
    </select>
	<?php
}

?>