<?/*
Copyright (C) 2003 Media Net Link, Inc. Danville, CA 94526 USA

This file is part of AthenaRMS.

AthenaRMS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

AthenaRMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/?>
<div class="athenatitleshadow">Reports<div class="athenatitle">Reports</div></div>
<br />

<?php

  if (!array_key_exists('reports', $_SESSION)) $_SESSION['reports'] = array ();
  if (!array_key_exists('show_report', $_SESSION['reports'])) 
    $_SESSION['reports']['show_report'] = array ();
  $STORED = $_SESSION['reports'];

  if (!array_key_exists('start_year', $STORED))
    $STORED['start_year'] = date('Y');
  if (!array_key_exists('start_month', $STORED)) 
    $STORED['start_month'] = date('m');
  if (!array_key_exists('start_day', $STORED)) $STORED['start_day'] = date('d');
  if (!array_key_exists('end_year', $STORED)) $STORED['end_year'] = date('Y');
  if (!array_key_exists('end_month', $STORED)) $STORED['end_month'] = date('m');
  if (!array_key_exists('end_day', $STORED)) $STORED['end_day'] = date('d');
?>

<form action="weekly" method="get">

<table cellpadding="5" border="0" cellspacing="0">
<tr bgcolor="#b7d573">
  <td>&nbsp;</td>
  <td class="subtitleblk">MM</td>
  <td class="subtitleblk">/</td>
  <td class="subtitleblk">DD</td>
  <td class="subtitleblk">/</td>
  <td class="subtitleblk">YYYY</td>
</tr>
<tr bgcolor="#e6f0ce">
  <td bgcolor="#b7d573" class="subtitleblk">Start:</td>
  <td><input name="start_month" class="textsm" size="2" maxlength="2" value="<?php echo $STORED['start_month']; ?>" /></td>
  <td class="subtitleblk">/</td>
  <td><input name="start_day" class="textsm" size="2" maxlength="2" value="<?php echo $STORED['start_day']; ?>" /></td>
  <td class="subtitleblk">/</td>
  <td><input name="start_year" class="textsm" size="4" maxlength="4" value="<?php echo $STORED['start_year']; ?>" /></td>
</tr><tr bgcolor="#e6f0ce">
  <td bgcolor="#b7d573" class="subtitleblk">End:</td>
  <td><input name="end_month" class="textsm" size="2" maxlength="2" value="<?php echo $STORED['end_month']; ?>" /></td>
  <td class="subtitleblk">/</td>
  <td><input name="end_day" class="textsm" size="2" maxlength="2" value="<?php echo $STORED['end_day']; ?>" /></td>
  <td class="subtitleblk">/</td>
  <td><input name="end_year" class="textsm" size="4" maxlength="4" value="<?php echo $STORED['end_year']; ?>" /></td>

</tr><tr>
</tr>
</table>
<br />


<!--start report options-->

<table border="0" cellspacing="0" cellpadding="0">
<?php

  include 'lib/report_types.php';

  foreach ($REPORT_TYPES as $id => $name) {
    $checked = '';
    if (array_key_exists($id, $STORED['show_report']) 
	&& $STORED['show_report'][$id]) $checked = 'checked="checked"';
    $r = (array_key_exists($id, $REPORT_TYPE_BUTTONS) 
	  && $REPORT_TYPE_BUTTONS[$id])
       ? $REPORT_TYPE_BUTTONS[$id] : '';
    print <<<EOF
<tr><td><input class="textsm" type="checkbox" name="show_report[$id]" value="1" $checked /></td><td><font class="textsm"> $name $r</font></td></tr>

EOF;
  }
?>
</table>

<!--end report options-->

<!--

<?php

  include 'lib/report_types.php';

  foreach ($REPORT_TYPES as $id => $name) {
    $checked = '';
    if ($STORED[show_report][$id]) $checked = 'checked="checked"';
    print <<<EOF
<input type="checkbox" name="show_report[$id]" value="1" $checked /><><font class="textsm">$name</font><br />

EOF;
  }
?>

-->
<br />
<input type="submit" name="get_report" value="Get Report >>" />
<!-- <input type="submit" name="ticket_detail" value="View Ticket Detail" />
<input type="submit" name="by_response" value="Closed Ticket Count by Response Time" />
<input type="submit" name="download_detail" value="Download Ticket Detail" />
<input type="submit" name="download_totals" value="Download Ticket Count by Response Time" /> -->

</form>

<?php
  return; # skip the below, need to move to kronos

  echo Sub_Heading ('<a href="../projects/report">Project Feedback »</a>');
?>

<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr><td class="text" align="left" width="100%">
<ul class="text">
<li>Quality</li>
<li>Timeliness</li>
<li>Accuracy</li>
<li>Comments</li>
</ul>

</td></tr></table>
