Current File : /home/inlingua/public_html/noida/icentex/admin_attendance/attendance_report.php
<?php
ini_set("max_execution_time",0);
include("header_attendance.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();
?>
<style type="text/css">

#dhtmltooltip{
position: absolute;
text-align: left;
border: 1px solid #cccccc;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}

.borderright{

border-right: 1px solid #000000;
}

.borderleft{

border-left: 1px solid #000000;
}

.bordertop{

border-top: 1px solid #000000;
}

.borderbottom{

border-bottom: 1px solid #000000;
}

.borderall{
border: 1px solid #000000;
}

</style>
<script type="text/javascript" src="js/calendar.js"></script> 
<script>
function lightb()
{
		$(document).ready(function(){
		
		$(".lightbox").colorbox({width:"80%", height:"85%", iframe:true});
		
		});
}


function submit_form()
{
// Perform basic checks on email address
    if (document.email_report.email.value != "")
	{	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.email_report.email.value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address');
	  document.email_report.email.focus();
      return false;
   }
    }
    else
	{	alert("Email address cannot be blank. Please enter it.");
		document.email_report.email.focus(); return false;
	}
	
	if(confirm("Are You Sure?"))
	{
	document.email_report.submit();
	}
	
	return true;
}
	</script>

	</script>
	
	<?php
if($_REQUEST['prevflag']=="yes")
{
$fl="Archive";
}
else
{
$fl="Current";
}

	?>


<div><h4>Course Records Report (<?php echo $fl;?>)</h4>
<div style='margin-left:5px;'>
<table width="100%" border="0">

<tr>
<td width="100%">Location: <select id="branch_id"  name="branch" onchange="displayCourseId_report('<?php echo $_REQUEST['prevflag']?>')" >
<?php 


if($_SESSION['id']=='602')
{
	echo '<option value="0">Select Option</option>';
	$queryB="select * from timesheet_location where status='1' and location='Gurgaon' order by location";
	
}
else if($_SESSION['id']=='518')
{
	echo '<option value="0">Select Option</option>';
	$queryB="select * from timesheet_location where status='1' and location='Noida' order by location";
	
}
else {
echo '<option value="All">All</option>';	
$queryB="select * from timesheet_location where status='1' order by location";
}



//$queryB="select * from timesheet_location where status='1' order by location";
$resultB=mysqli_query($conn,$queryB);
while($numB=mysqli_fetch_array($resultB))
{
if($numB[location]=="S.Extn")
{
$showL="South Extension";
}
else
{
$showL=$numB[location];
}
echo"<option value='".$numB[location]."'";
if($_REQUEST[branch]==$numB[location]) echo"selected";
echo">".$showL."</option>";
}
?>
</select>&nbsp;&nbsp;Level:&nbsp;
<select id="report_level_id"  name="level" onchange="displayCourseId_report('<?php echo $_REQUEST['prevflag']?>')">
  <option value="">Select Level</option>
  
<?php
 $querylevel="SELECT * FROM `ingl_billing_main` WHERE `bill_category` in (14,17,18,19,23,20,12) and recNo not in (1,98,100,99,101) and is_active='1'";

$resultlevel=mysqli_query($conn,$querylevel) or die(mysqli_query($conn,));
//$abc=mysqli_fetch_array($resultlevel);

while($level=mysqli_fetch_array($resultlevel))

{

echo"<option value='".$level['bill_details']."' ";


echo">".$level['bill_details']."</option>";

}

?>
</select>

Course ID:&nbsp;
<span id="report_course_id">
<?php 
$td=date("Y-m-d");
// $query="select * from ingl_course where instructor='".$_SESSION[id]."' && enddate<'".$td."' order by courseid";
if($_REQUEST['prevflag']=='yes')
{
 $query="select * from ingl_course where  enddate<'".$td."' " ;
}
else
{
 $query="select * from ingl_course where  enddate>='".$td."' ";
 }
 //$query="select * from ingl_course where instructor='".$_SESSION[id]."' order by courseid";
 if($_SESSION['username']=='0439')
		 {
	$query.="and branch = '".$_SESSION['branch']."'";		 
	} 
 
 $query .=" 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>";
}
else
{
echo "Please enter the Course ID ";
}
?></span></td>
</tr>

<tr><td  id="student_calendar_id" align="left"></td></tr>

<tr><td  id="" align="left">&nbsp;</td></tr>

<tr><td  id="student_attendance_id" align="center"></td></tr>
</table>



</div></div>
<?php
include("footer_attendance.php");
?>
<div id="dhtmltooltip"></div>

<script type="text/javascript">

/***********************************************
*DHTML code library (vikas umrao)
***********************************************/

var offsetxpoint=-50 //Customize x offset of tooltip
var offsetypoint=10 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetextDiv, thecolor, thewidth){

if (ns6||ie){
//if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor


tipobj.innerHTML=""+thetextDiv+"";

enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

</script>