<?php //query a specific request details with tid //get cid $tid = $_GET['tid']; $sql = "select * from test where ID_TEST='{$tid}'"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $cid = $row['ID_CLASS']; $sql = "select * from course where ID_CLASS='{$cid}'"; $result = mysql_query($sql); $temp = mysql_fetch_assoc($result); if ($cid != null) { //course $course = $temp['Subject'] . $temp['CatalogNumber']; $section = $temp['Section']; $term = termSwitch($temp['Term']); } // else{//ad hoc // $course = "<font color='red'>NA</font>"; // $section = "<font color='red'>NA</font>"; // $term = "<font color='red'>NA</font>"; // } $iid = $row['ID_INSTRUCTOR']; $duration = $row['Duration']; $startDT = $row['StartTime']; $endDT = $row['EndTime']; $status = $row['Status']; ?> <h2>Request Detail</h2> <table class='table table-striped table-bordered table-hover'> <tr>
$start = $row['StartTime']; $end = $row['EndTime']; $status = $row['Status']; $cid = $row['ID_CLASS']; $duration = $row['Duration']; //test's term if ($cid != null) { $term = termSwitch(substr($cid, -4)); } else { //find ad hoc's term by its start time (Fall: SEP-DEC; Winter: JAN; Spring: FEB-MAY; Summer: JUN) $temp = date_create($start)->format('Ym'); //201511 $term = termSwitch(substr($temp, -2)) . ' ' . substr($temp, 0, -2); } //ONLY Show current and future terms' if (termSwitch($term) >= termSwitch($cterm)) { //sort by term if ($term != $cterm) { $cterm = $term; echo "<tr><th colspan='5'>" . $cterm . "</th></tr>"; } echo "<tr>"; echo "<td><a href='ITestDetail.php?tid=" . $tid . "'>{$tid}</a></td>"; echo "<td>{$start}</td>"; echo "<td>{$end}</td>"; if ($status == null) { //INS_USE_CASE_3: PENDING REQUEST, Instructor can cancel his pending requests echo "<td><font color='orange'>Pending</font></td>"; //echo "<td><a href='Icancel.php?tid=".$tid."'>Cancel</a></td>"; ?> <td><a href="Icancel.php?tid=<?php
<!--term code: Fall 2015 is 1158, Winter 2016 is 1161, Spring 2016 is 1164, Summer 2016 is 1166 and Fall 2016 is 1168--> <td><?php $sql = "select term from testcenterinfo"; $result = mysql_query($sql) or die('Error: ' . mysql_error()); //sql ?> <select name='termC'> <?php while ($row = mysql_fetch_assoc($result)) { ?> <option value= <?php echo $row['term']; ?> ><?php echo termSwitch($row['term']); ?> </option><?php } ?> </td> </tr> <tr> <td>Duration(min)</td> <td><input type="text" id="durationC" name="durationC"></td> </tr> <tr> <td>Start Date and Time</td> <td><input type="datetime-local" id="startDTC" name="startDTC" min="<?php date_default_timezone_set('America/New_York'); echo date("Y-m-d\\TH:i", time());