Current File : /home/inlingua/public_html/noida/icentex/admin/backup/timesheet_excel_monthly.php |
<?php
ini_set("memory_limit","128M");
//this sets it unlimited
//echo"<br><br>";
ini_set("max_execution_time",0);
include("header.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();
?>
<div class="clear"></div>
<?php include("left.php"); ?>
<div id="content-wrap" style="padding-top:20px;" >
<div id="content-box" >
<div id="toolbar-title" >
<h3>
Excel Report (Month wise)
</h3>
<div class="clear"></div>
</div>
<div id="toolbar-box">
<div class="toolbar" id="toolbar"></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div id="element-box">
<div class="m">
<table class="adminform">
<tbody><tr>
<td valign="top" width="55%">
<br>
<?php
$half=$_REQUEST[half];
$month=$_REQUEST[month];
$year=$_REQUEST[year];
$num = cal_days_in_month(CAL_GREGORIAN, $month, $year); // 31
//echo "There was $num days in August 2003";
$date1="".$year."-".$month."-01";
$date2="".$year."-".$month."-".$num."";
$datetime2="".$date2."";
if($_REQUEST[location]=="All")
{
$query="select * from timesheet where fromDate >= '".$date1."' && toDate <= '".$date2."' && status_send ='1' && approve_status='1' && modify_status!='1' && modify_status!='3' group by instructorId,location order by Instname limit 0,1";
$result=mysql_query($query);
$num=mysql_fetch_array($result);
$count=mysql_num_rows($result);
$query1="select * from timesheet where fromDate >= '".$date1."' && fromDate <= '".$date2."' && status_send ='1' && approve_status='1' && modify_status!='1' && modify_status!='3' group by instructorId,location order by Instname limit 1,5000";
$result1=mysql_query($query1);
}
else
{
$query="select * from timesheet where fromDate >= '".$date1."' && toDate <= '".$date2."' && status_send ='1' && approve_status='1' && location='".$_REQUEST[location]."' && modify_status!='1' && modify_status!='3' group by instructorId,location order by Instname limit 0,1";
$result=mysql_query($query);
$num=mysql_fetch_array($result);
$count=mysql_num_rows($result);
$query1="select * from timesheet where fromDate >= '".$date1."' && toDate <= '".$date2."' && status_send ='1' && approve_status='1' && location='".$_REQUEST[location]."' && modify_status!='1' && modify_status!='3' group by instructorId,location order by Instname limit 1,100";
$result1=mysql_query($query1);
}
if($count>0)
{
//echo ini_set("max_execution_time","120");
//echo set_time_limit(120);
include("05featuredemo1_monthly.php");
echo"<div><a href='uploads/".$date1." to ".$date2."_".$_REQUEST['location'].".xlsx'>Click Here To Save</a></div>";
}
else
{
echo"<div>There Are No Records Under Your Selection Criteria</div>";
}
?>
<div id="cpanel">
<div style="float: left;">
<div class="icon"></div>
</div>
<div style="float: left;">
<div class="icon"></div>
</div>
<div style="float: left;"></div>
</div>
</td>
<td valign="top" width="45%"> </td>
</tr>
</tbody></table>
</div>
</div>
<div class="clear"></div>
<p class="copyright"> </p>
</div>
</div>
</body></html>