Current File : /home/inlingua/www/faridabad/icentex/admin_attendance/ajax_select_course.php
<?php
// Include the database connection details
require('../dbConnection.php');

// Include common functions
require('../commonFunc.php');

// Include common functions
require('../globalVars.php');

// Include the table handler class
require('../dbHandler.class.php');

// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
$td=date("Y-m-d");
//$query="select * from ingl_course where recNo='".$_REQUEST[CID]."'";
$where=" where 1=1";

if($_REQUEST['branch_id']!='All') $where .=" and branch='".$_REQUEST['branch_id']."'";
if($_REQUEST['report_level_id']!='') $where .=" and level='".$_REQUEST['report_level_id']."'";
if($_REQUEST['prevflag']=='yes') $where .=" and enddate<'".$td."'";
if($_REQUEST['prevflag']=='no') $where .=" and enddate>='".$td."'";
 $query="select * from ingl_course   ";
 
 $query .=$where;
 $query .=" order by courseid";
 
 
 //$query="select * from ingl_course where instructor='".$_SESSION[id]."' order by courseid";
 //$query="select * from ingl_course  order by courseid";
$res=mysqli_query($conn,$query);
if(mysqli_num_rows($res)>0)
{
echo "<select name='courseId' onchange='displaycalendar_report(this.value)'>";
echo"<option value=''>Select Course ID</option>";
while($rsult=mysqli_fetch_array($res))
	{
	
	echo"<option value='".$rsult[recNo]."'" ;
	
	echo">".$rsult[courseid]."</option>";
	}
	echo"</select>";
}

?>