/down_reports.php

http://swifttide.googlecode.com/ · PHP · 110 lines · 85 code · 14 blank · 11 comment · 9 complexity · 5470c95004e09802911c5bb050a8e3bf MD5 · raw file

  1. <?php
  2. /**********************************************/
  3. /* Coded by NubKnacker
  4. /**********************************************/
  5. // Last edit 11-24-2005, removed Report Cards. they are now a separate
  6. // link on the main menu.
  7. //Include global functions
  8. include_once "common.php";
  9. //Initiate database functions
  10. include_once "ez_sql.php";
  11. //Include paging class
  12. include_once "ez_results.php";
  13. // config
  14. include_once "configuration.php";
  15. $report = get_param("report");
  16. $sort1 = get_param("sort1");
  17. $sort2 = get_param("sort2");
  18. // echo "sort1=$sort1";
  19. // echo "sort2=$sort2";
  20. session_start();
  21. if(!session_is_registered('UserId') || $_SESSION['UserType'] != "A")
  22. {
  23. header ("Location: index.php?action=notauth");
  24. exit;
  25. }
  26. if ($sort1) {
  27. if ($_POST['report'] == 'discipline' || $_POST['report'] == 'attendance') {
  28. header("Location: makereport.php?report_type=".$_POST['report']."&sort1=".$_POST['sort1']."&sort2=".$_POST['sort2']."&start_db_date=".$_POST['start_date']."&end_db_date=".$_POST['end_date']);
  29. } else {
  30. header("Location: makereport.php?report_type=".$_POST['report']."&sort1=".$_POST['sort1']."&sort2=".$_POST['sort2']);
  31. }
  32. exit;
  33. }
  34. ?>
  35. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  36. <html xmlns="http://www.w3.org/1999/xhtml">
  37. <head>
  38. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  39. <title><?php echo _BROWSER_TITLE?></title>
  40. <style type="text/css" media="all">@import "student-admin.css";</style>
  41. <script language="JavaScript" src="datepicker.js"></script>
  42. </head>
  43. <body><img src="images/<?php echo _LOGO?>" border="0">
  44. <div id="Header">
  45. <table width="100%">
  46. <tr>
  47. <td width="50%" align="left"><font size="2"><b>&nbsp;&nbsp;<?php echo date(_DATE_FORMAT); ?></b></font></td>
  48. <td width="50%" align="right"><b><?php echo _DOWN_REPORTS_ADMIN_AREA?></b></td>
  49. </tr>
  50. </table>
  51. </div>
  52. <div id="Content">
  53. <h1><?php echo _DOWN_REPORTS_TITLE?></h1>
  54. <br>
  55. <form name="report_selection" method="POST" action="<?echo($_SERVER['PHP_SELF']);?>">
  56. <table border="0" cellpadding="1" cellspacing="1" width="100%">
  57. <tr class="trform">
  58. <td width="100%">
  59. <select name="report" onChange="javascript: changeReport()">
  60. <option value="students" selected="selected"><?php echo _DOWN_REPORTS_STUDENTS?></option>
  61. <option value="attendance"><?php echo _DOWN_REPORTS_ATTENDANCE?></option>
  62. <option value="discipline"><?php echo _DOWN_REPORTS_DISCIPLINE?></option>
  63. <!-- <option value="grades"><?php echo _DOWN_REPORTS_GRADES?></option> -->
  64. </select>
  65. <?php echo _DOWN_REPORTS_SORTED?>
  66. <select name="sort1">
  67. <option value="school_names_desc"><?php echo _DOWN_REPORTS_SCHOOL?></option>
  68. <option value="grades_id"><?php echo _DOWN_REPORTS_GRADES?></option>
  69. <option value="studentbio_ethnicity"><?php echo _DOWN_REPORTS_ETH?></option>
  70. <option value="studentbio_gender"><?php echo _DOWN_REPORTS_GENDER?></option>
  71. <option value="studentbio_bus"><?php echo _DOWN_REPORTS_ROUTE?></option>
  72. <option value="studentbio_homeroom"><?php echo _DOWN_REPORTS_HOME?></option>
  73. </select>
  74. <?php echo _DOWN_REPORTS_BY?>
  75. <select name="sort2">
  76. <option value="none"><?php echo _ADMIN_REPORTS_NONE?></option>
  77. <option value="school_names_desc"><?php echo _DOWN_REPORTS_SCHOOL?></option>
  78. <option value="grades_id"><?php echo _DOWN_REPORTS_GRADES?></option>
  79. <option value="studentbio_ethnicity"><?php echo _DOWN_REPORTS_ETH?></option>
  80. <option value="studentbio_gender"><?php echo _DOWN_REPORTS_GENDER?></option>
  81. <option value="studentbio_bus"><?php echo _DOWN_REPORTS_ROUTE?></option>
  82. <option value="studentbio_homeroom"><?php echo _DOWN_REPORTS_HOME?></option>
  83. </select>
  84. </td>
  85. </tr>
  86. <tr class="trform"><td><?php echo _DOWN_REPORTS_FROM?><input type="text" size=10 name="start_date" READONLY onclick="javascript:show_calendar('report_selection.start_date');"><a href="javascript:show_calendar('report_selection.start_date');"><img src="cal.gif" border="0" class="imma"></a>
  87. <?php echo _DOWN_REPORTS_TO?><input type="text" size=10 name="end_date" READONLY onclick="javascript:show_calendar('report_selection.end_date');"><a href="javascript:show_calendar('report_selection.end_date');"><img src="cal.gif" border="0" class="imma"></a>
  88. </td></tr><tr>
  89. <td width="100%" align="left"><input type="submit" name="submit" value="<?php echo _DOWN_REPORTS_DOWNLOAD?>" class="frmbut">
  90. </td></tr>
  91. </table>
  92. </form>
  93. </div>
  94. <?php include "admin_menu.inc.php"; ?>
  95. </body>
  96. </html>