<?php 
$PageSecurity = 3;
include ('includes/session.inc');
include ('includes/function_lib.php');
include('includes/fun-php.php');
include('includes/fun-HRClass.php');
global $db; 
$getrec=DB_query("select * from crm_add_to_do where day(todo_date)='".$_REQUEST['day']."' and
	  year(todo_date)='".$_REQUEST['year']."' and  month(todo_date)='".$_REQUEST['month']."'",$db);
 ?>
 <script type="text/javascript" language="javascript">
  function toggle_visibility(id) {
       var e = document.getElementById(id);
	       e.style.display = 'none';
		       //alert(e.style.display);
			   window.print();
    }
  
</script>
<table width="100%" border="0">
<tr>
<td><strong>Showing Activities For Date <?php echo $_REQUEST['day'].'/'.$_REQUEST['month'].'/'.$_REQUEST['year'];?></strong></td>
</tr>
</table>
<br />
<table width="100%" border="1" style="border:#000000 solid 1px; border-collapse:collapse;">
	<tr bgcolor="#CCCCCC" height="25px;" style="font-weight:bold;">
		<td width="18%"><center>To Do Date</center></td>
		<td width="17%"><center>Subject</center></td>
		<td width="15%"><center>Description</center></td>
		<td width="17%"><center>Priority</center></td>
		<td width="17%"><center>Time</center></td>
		<td width="14%"><center>User</center></td>
	</tr>
	<?php while($getrecRor=DB_fetch_array($getrec)) {?>
	<tr>
		<td><center><?php echo ConvertSQLDate($getrecRor['todo_date']); ?></center></td>
		<td><center><?php echo $getrecRor['subject']; ?></center></td>
		<td><center><?php echo $getrecRor['description']; ?></center></td>
		<td><center><?php echo $getrecRor['priority']; ?></center></td>
		<td><center><?php echo $getrecRor['todostart_time']; ?></center></td>
		<td><center><?php
$user=explode(',',$getrecRor['createdby']);
$User1=implode("','",$user);
$Username="select * from www_users where id IN('".$User1."')";
$UserSql=DB_query($Username,$db);
while($UserRow=DB_fetch_array($UserSql))
{
echo $UserRow['userid']," ,";
} 
 ?></center></td>
	</tr>
	<?php } ?>
</table>
<div id="foo">
  <p align="center"> <a href="#" onclick="javascript:toggle_visibility('foo');" id="foo" >Print</a> </p>
</div>