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

if($ch==="delete_fee"){

	$id = $_POST['id'];

    $res=$db->delete("salary_components","where id='$id' ");
    if($res){
        echo "Deleted Successfully.";
    } else {
        echo "Something went wrong. Please try again.";
    }
}

if($ch==="departmentfaculty"){
    $dept = "";
	if($_POST['department']!=""){
    	$dept = " and department='$_POST[department]' ";
	}
	
	
	$staff = $db->getRows("select * from staff where session='".$_SESSION["admin"]["session"]."' and status=1 $dept order by name");
	?>
      <select class="" name="teacher_id">
      <option value="">--Select Teacher--</option>
      <?php 
            foreach($staff as $teacher){
                echo "<option value='$teacher[idno]'>$teacher[name]</option>";
                }
            ?>
        </select>
    <?php }
    
?>



