<? 
require_once "include/application.php"; 
require_once "include/function.php";
require_once "include/parameter.php";

if(!$month || !$year){
	$month=date("m");
	$year=date("Y");	
} 
if(!$tomonth || !$toyear){
	$tomonth=date("m");
	$toyear=date("Y");	
} 

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="sddm.css" >
<script src="include/validation.js" type="text/javascript"></script>
<title><? echo TITLE?></title>
</head>
<body>

<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f1efd8">
  <tr>
    <td  colspan="2" align="center"><? require_once "include/header.php"; ?></td>
  </tr>
  <tr>
    <td colspan="2" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td width="185" valign="top" bgcolor="e6f3f9">
	
<? require_once "include/columnLeft.php";
if(array_search("Report",$menulist)==false)
		print("<script type='text/javascript'>location.href='index.php'</script>");

 ?>	</td>
    <td width="834" valign="top">
	<form name="form" method="post" action="userlogRptHtml.php" target="_blank" >
	  <table width="810" border="0" align="center" cellpadding="0" cellspacing="0">
      
      <tr>

        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="100%" height="30" class="TitleH3">User Log Report </td>
          </tr>
          <tr>
            <td height="1" bgcolor="#B8ED83"></td>
          </tr>
          <tr>
            <td ><? echo "<div class='Msg'>$action_msg</div>" ?>&nbsp;
              <input name="ty" type="hidden" id="ty" value="<? echo $ty ?>" /></td>
          </tr>

        </table>
          <table border="0" cellpadding="1" width="100%" cellspacing="2" class="small">
            <tr>
              <td width="769" height="7" class="text12"><span class="TextH1">From:
                  <?
echo "<select name='month'>";
echo '<option value="">-</option>\n';
foreach ($months  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($month==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> &nbsp; ';

echo "<select name='year'>";
echo '<option value="">-</option>\n';
foreach ($thisyears as $value) {
	echo '<option value="'.$value.'"';
	if($year==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?>
To:
<?
echo "<select name='tomonth'>";
echo '<option value="">-</option>\n';
foreach ($months  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($tomonth==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> &nbsp; ';

echo "<select name='toyear'>";
echo '<option value="">-</option>\n';
foreach ($thisyears as $value) {
	echo '<option value="'.$value.'"';
	if($toyear==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?>
User
<select name="user" id="user" >
<option value="all"></option>
                <?
			 
			 	$sql="select * from user order by id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["id"]."' ";
					if($user==$myrow["id"])echo "selected";
					echo ">".$myrow["id"]."</option>";
				}
			
?>
</select>
              </span></td>
            </tr>
            <tr>
              <td height="7" class="TextH1">&nbsp;</td>
            </tr>
            <tr>
              <td class="TextH2"><span class="text12"><span class="TextH1">
                <input name="btnSearch" type="submit" class="btn150" id="btnSearch" value="Generate"/>
              </span></span></td>
            </tr>
          </table></td>

      </tr>
 
    </table>
	  <br />
	</form>	</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#333333"><div align="center"><span class="Footer">
      <br />
      <? require_once "footer.php"; ?>
    </span></div></td>
  </tr>
</table>
</body>
</html>
