Current File : /home/inlingua/public_html/icentex/admin-in-centre/report.php |
<?php
include("header_cert.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 id="content-wrap" >
<div id="content-box" >
<div id="toolbar-title" >
<h3>
Visit Reports
</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="100%">
<br>
<?php
$month=date("m");
$year=date("Y");
//$year=2011;
?>
<script>
function validate(form)
{ if (document.form.startdate.value=="")
{ alert("Please Select Start Date.");
document.form.startdate.focus(); return false;
}
if (document.form.enddate.value=="")
{ alert("Please Select From Date.");
document.form.enddate.focus(); return false;
}
return true;
}
</script>
<script language="javascript">
$(function() {
$('#datepicker3').datepicker({
changeMonth: true,
changeYear: true
});
});
$(function() {
$('#datepicker4').datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
<font style="font-size:12px; color:#E84B1E"><?php if($_SESSION['existsheet']) { echo $_SESSION['existsheet']; unset ($_SESSION['existsheet']); }?></font>
<form action="visit_rpt.php" method="post" name="form" onsubmit=" return validate(this)">
<table width="100%">
<tr valign='top'><td>Start date : <input type='text' name='startdate' value="<?php echo $dbObject->getDbField('startdate');?>" size='12' maxlength='10' id="datepicker3">
From date: <input type='text' name='enddate' value="<?php echo $dbObject->getDbField('enddate');?>" size='12' maxlength='10' id="datepicker4">
for Location
<select name='location'>
<option value="All">All Location</option>
<?php
$querylocation="select primarycenter from timesheet_user where recNo='".$_SESSION['id']."'";
$resultlocation=mysqli_query($conn,$querylocation) or die(mysql_error($conn));
$numlocation=mysqli_fetch_array($resultlocation);
$queryloc="select * from timesheet_location";
$resultloc=mysqli_query($conn,$queryloc) or die(mysql_error($conn));
while ($numloc=mysqli_fetch_array($resultloc))
{
echo"<option value='".$numloc[location]."' ";
if($numlocation[primarycenter]==$numloc[location])
{
echo"selected";
}
echo">".$numloc[location]."</option>";
}
?>
</select>
<input type='submit' value="Report">
</td></tr>
<!--<tr><td width='15%'>
<form action="visit_rpt.php" method="post" name="form" onsubmit=" return validate(this)">
Report of</td><td> <select name='month'>
<option value="">Select Month</option>
<option value="01" <?php if($month=='01') echo"selected"; ?>>Jan</option>
<option value="02" <?php if($month=='02') echo"selected"; ?>>Feb</option>
<option value="03" <?php if($month=='03') echo"selected"; ?>>Mar</option>
<option value="04" <?php if($month=='04') echo"selected"; ?>>Apr</option>
<option value="05" <?php if($month=='05') echo"selected"; ?>>May</option>
<option value="06" <?php if($month=='06') echo"selected"; ?>>Jun</option>
<option value="07" <?php if($month=='07') echo"selected"; ?>>Jul</option>
<option value="08" <?php if($month=='08') echo"selected"; ?>>Aug</option>
<option value="09" <?php if($month=='09') echo"selected"; ?>>Sep</option>
<option value="10" <?php if($month=='10') echo"selected"; ?>>Oct</option>
<option value="11" <?php if($month=='11') echo"selected"; ?>>Nov</option>
<option value="12" <?php if($month=='12') echo"selected"; ?>>Dec</option>
</select>
of Year
<select name='year'>
<?php
for($j=2010;$j<=2020;$j++)
{
echo"<option value='".$j."' ";
if($j==$year)
{
echo"selected";
}
echo">".$j."</option>";
}
?>
</select>
for Location
<select name='location'>
<option value="All">All Location</option>
<?php
$querylocation="select primarycenter from timesheet_user where recNo='".$_SESSION['id']."'";
$resultlocation=mysqli_query($conn,$querylocation) or die(mysql_error($conn));
$numlocation=mysqli_fetch_array($resultlocation);
$queryloc="select * from timesheet_location";
$resultloc=mysqli_query($conn,$queryloc) or die(mysql_error($conn));
while ($numloc=mysqli_fetch_array($resultloc))
{
echo"<option value='".$numloc[location]."' ";
if($numlocation[primarycenter]==$numloc[location])
{
echo"selected";
}
echo">".$numloc[location]."</option>";
}
?>
</select>
<input type='submit' value="Report">
</form>
</td></tr>-->
</table>
</form>
<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>
<?php
include("footer_cert.php");
?>