Notice: A session had already been started - ignoring session_start() in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 4

Notice: Use of undefined constant allow_course_uploading - assumed 'allow_course_uploading' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 5

Notice: Use of undefined constant registrationAcademicYear - assumed 'registrationAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 8

Notice: Use of undefined constant show_prepare_following_year_menu - assumed 'show_prepare_following_year_menu' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 9

Notice: Undefined index: WEBSITE_URL in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 18
"; // output comment if ($szComment != ""){echo "".$szComment."
";} // output debug info if (is_string($szDebugInfo)){ echo $szDebugInfo; }elseif (is_array($szDebugInfo)){ echo "
";
			print_r ($szDebugInfo);
			echo "
"; }elseif (gettype($szDebugInfo) == "resource"){ echo "
";
			echo "rows:".mysql_num_rows($szDebugInfo);
			echo "
"; }else{ echo "
";
			var_dump ($szDebugInfo);
			echo "
"; } echo ""; } } function utc_debug_enter($szFunctionName){ global $blutcDebug; if ($blutcDebug){ echo "
Entered:".$szFunctionName."
"; } } function utc_get_user_logs($intRows,$szSortBy,$szWhereClause){ utc_debug_enter("utc_get_user_logs($intRows,$szSortBy,$szWhereClause)"); // Get user logs sorted by a particular column // if intRows is 0, include all rows // if szSortBy is '', don't sort $sql= "SELECT * FROM user_log "; if ($szWhereClause != ''){ $sql = $sql." WHERE $szWhereClause ";} if ($szSortBy != ''){ $sql = $sql." ORDER BY $szSortBy ";} if ($intRows != 0){ $sql = $sql." LIMIT 0,$intRows ";} utc_debug($sql,"Get User Logs"); //send the query to the database $results = mysql_query($sql); utc_debug($results,"the results"); utc_debug(mysql_error(),"Query Error?"); //check the status of $results recordset if (mysql_num_rows($results)){ // convert result set into an array - need to retain order. $arrUserLogs = array(); while ($arrUserLog=mysql_fetch_assoc($results)){ utc_debug($arrUserLog,"The Row we are now looking at:" ); $arrUserLogs[$arrUserLog['intUserLogID']] = $arrUserLog; } utc_debug($arrUserLogs,"Returned:"); return $arrUserLogs; } else { utc_debug(0,"Returned:"); return 0; } //free the recordset mysql_free_result($results); } function utc_get_user_log($intUserLogID){ utc_debug_enter("utc_get_user_log($intUserLogID)"); // MUST supply a User Log ID if ($intUserLogID == null){ exit ('The UserLogID was not supplied'); } //get a specific user log by ID and returns an array // SQL statement for selecting information about the Category $sql="SELECT * FROM intUserLogID WHERE intUserLogID=$intUserLogID"; utc_debug($sql,"Get the User Log from the DB"); //send the query to the database $qUserLog=mysql_query($sql); utc_debug($qUserLog,"Query Result"); utc_debug(mysql_error(),"Query Error?"); //check the status of $results recordset if ($qUserLog){ $arrUserLog = array(); $arrUserLog = mysql_fetch_assoc($qUserLog); utc_debug($arrUserLog,"Returned:"); return $arrUserLog; } else { utc_debug(0,"Returned:"); return 0; } } function utc_remove_user_log($intUserLogID=0){ utc_debug_enter("utc_remove_user_log($intUserLogID)"); // remove the User Log from the database // SQL statement for removing the Branch if ($intUserLogID!=0){ $sql="DELETE FROM user_log WHERE intUserLogID=$intUserLogID"; } else { $sql="DELETE FROM user_log"; } utc_debug($sql,"Delete User Log"); //send the query to the database $results=mysql_query($sql); utc_debug(mysql_error(),"Query Error?"); } function utc_add_update_user_log($arrUserLog){ // returns the updated array of the UserLog inserted or updated utc_debug_enter("utc_add_update_user_log($arrUserLog)"); utc_debug($arrUserLog,"array passed in"); //get all field values from an array $intUserID = $_SESSION['userInfo']['id']; $szSessionID = $_COOKIE['PHPSESSID']; $szIPAddress = $_SERVER['REMOTE_ADDR']; if (is_array($arrUserLog)){ $intDocumentID = $arrUserLog['intDocumentID']; $intItemID = $arrUserLog['intItemID']; $intTypeID = $arrUserLog['intTypeID']; $intVariationID = $arrUserLog['intVariationID']; $szAction = $arrUserLog['szAction']; } else { $intDocumentID = ''; $intItemID = ''; $intTypeID = ''; $intVariationID = ''; $szAction = ''; } //assign default values for integer fields if ($intDocumentID==''){ $intDocumentID=0; } if ($intItemID==''){ $intItemID=0; } if ($intTypeID==''){ $intTypeID=0; } if ($intVariationID==''){ $intVariationID=0; } //add record $sql="INSERT INTO user_log ( intUserID,szSessionID,szIPAddress,intDocumentID,intItemID,intTimeStamp,szAction,intTypeID,intVariationID) VALUES ($intUserID,'$szSessionID','$szIPAddress',$intDocumentID,$intItemID,NOW(),'$szAction',$intTypeID,$intVariationID)"; utc_debug($sql,"to be executed"); $results=mysql_query($sql); utc_debug(mysql_error(),"Query Error?"); utc_debug($arrUserLog,"updated row"); return $arrUserLog; } function utc_get_users($intRows,$szSortBy,$szWhereClause){ utc_debug_enter("utc_get_users($intRows,$szSortBy,$szWhereClause)"); // Get users sorted by a particular column // if intRows is 0, include all rows // if szSortBy is '', don't sort $sql= "SELECT * FROM authuser "; if ($szWhereClause != ''){ $sql = $sql." WHERE $szWhereClause ";} if ($szSortBy != ''){ $sql = $sql." ORDER BY $szSortBy ";} if ($intRows != 0){ $sql = $sql." LIMIT 0,$intRows ";} utc_debug($sql,"Get User Logs"); //send the query to the database $results = mysql_query($sql); utc_debug($results,"the results"); utc_debug(mysql_error(),"Query Error?"); //check the status of $results recordset if (mysql_num_rows($results)){ // convert result set into an array - need to retain order. $arrUsers = array(); while ($arrUser=mysql_fetch_assoc($results)){ utc_debug($arrUser,"The Row we are now looking at:" ); $arrUsers[$arrUser['id']] = $arrUser; } utc_debug($arrUsers,"Returned:"); return $arrUsers; } else { utc_debug(0,"Returned:"); return 0; } //free the recordset mysql_free_result($results); } ?>
Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 64

Warning: mysql_query(): A link to the server could not be established in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 64

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 65

Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 71

Warning: mysql_query(): A link to the server could not be established in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 71

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 72

Notice: Use of undefined constant shownames - assumed 'shownames' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 76

Notice: Use of undefined constant shownames - assumed 'shownames' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 78

Notice: Use of undefined constant showgender - assumed 'showgender' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 81

Notice: Use of undefined constant showgender - assumed 'showgender' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 83

Notice: Use of undefined constant showcourse - assumed 'showcourse' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 86

Notice: Use of undefined constant showcourse - assumed 'showcourse' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 88

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 93

Notice: Use of undefined constant szAcademicYear - assumed 'szAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 93

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 94

Notice: Use of undefined constant intYearID - assumed 'intYearID' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 94

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 95

Notice: Use of undefined constant szAcademicYear - assumed 'szAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 95

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 96

Notice: Use of undefined constant intapprovevalue - assumed 'intapprovevalue' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 96

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 98

Notice: Use of undefined constant intYearID_Ads - assumed 'intYearID_Ads' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 98

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 99

Notice: Use of undefined constant szAcademicYear_Ads - assumed 'szAcademicYear_Ads' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 99

Notice: Use of undefined constant next_academic_year_id - assumed 'next_academic_year_id' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 102

Notice: Use of undefined constant next_academic_year_id - assumed 'next_academic_year_id' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 103

Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 105

Warning: mysql_query(): A link to the server could not be established in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 105

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 106

Notice: Use of undefined constant next_academic_year - assumed 'next_academic_year' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 107

Notice: Use of undefined constant roundingmarksvalue - assumed 'roundingmarksvalue' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 109

Notice: Use of undefined constant gradingtype - assumed 'gradingtype' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 110

Notice: Use of undefined constant gpa_decimal_places - assumed 'gpa_decimal_places' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 111

Notice: Use of undefined constant accommodation_academic_year_id - assumed 'accommodation_academic_year_id' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 112

Notice: Use of undefined constant szAccommodation_academic_year - assumed 'szAccommodation_academic_year' in /var/www/html/aris.udom.ac.tz/settings.inc.php on line 113
"; print "Access Denied !"; print "

"; print ""; print "You do not have permission to access this page at the moment !"; } // if this is a private area, enforce that the user login if ($blnPrivateArea){ // Check if the sessions are set if (isset($_SESSION['userInfo']) && $_SESSION['userInfo'] !=""){ $check = $_SESSION['userInfo']; }else{ // if not display the error message // auth_display_message(); global $login; print ""; exit; } } /* 1 = Browse only 2 = Edit + Browse 4 = Delete + Edit + Browse */ function auth_checkgroup ($groupName){ // is the user a member of the group that has been passed in? if (isset($_SESSION['groupInfo'][$groupName])){ return 1; }else{ return 0; } } function auth_checkgroup_and_exit ($groupName){ // is the user a member of the group that has been passed in? if ( !auth_checkgroup($groupName) ) { // if not display a message and exit. auth_display_message(); exit; } } function auth_checkrestrictionlevel ($intRestrictionLevel){ // does the user have this restriction level or lesser? if (isset($_SESSION['restrictionInfo']['intRestriction']) && $_SESSION['restrictionInfo']['intRestriction'] <= $intRestrictionLevel){ return 1; }else{ return 0; } } function auth_checkrestriction ($szField,$id) { if ($_SESSION['restrictionInfo'][$szField] == $id) { return true; } else { return false; } } function auth_checkrestriction_and_exit ($szField,$id){ // is the user restricted from seeing this item? if (auth_checkrestriction($szField,$id) == 0) { // if not display a message and exit. auth_display_message(); exit; } else { //Continue } } // new function comparing with $username, $act, $privilege function auth_checkAct($act){ //if ($_SESSION['safi'] == 12) //{ // var_dump($act); // var_dump($_SESSION['actInfo']); //} if ($_SESSION['actInfo'][$act] == 1) { return true; } else { return false; } } function auth_checkObj ($obj,$intPrivilege=1){ if (isset($_SESSION['objInfo'][$obj]) && (($_SESSION['objInfo'][$obj] & $intPrivilege) == $intPrivilege)) { return true; }else{ return false; } } function auth_checkAct_and_exit ($act){ // is the user a member of the group that has been passed in? //var_dump($act); //var_dump(auth_checkAct($act)); //die; if (auth_checkAct($act) == false ) { // if not display a message and exit. auth_display_message(); exit; } } function auth_checkObj_and_exit ($obj,$intPrivilege=1){ // is the user a member of the group that has been passed in? if ( !auth_checkObj($obj,$intPrivilege) ) { // if not display a message and exit. auth_display_message(); exit; } } function check_func(){ echo "check function
"; return 0; } function auth_RestrictAct ($act) { if ($_SESSION['actInfo'][$act]['restricted'] == 1) { return true; } else { return false; } } function auth_RestrictObj ($obj){ if ($_SESSION['objInfo'][$obj]['restricted'] == 1) { return true; } else { return false; } } //Starting from department level on.......Thats why course leader is restricted function restriction($action, $deptid, $facultyid, $collegeid) { if (auth_RestrictAct($action) == true) { if ($_SESSION['restrictionInfo'][intRestriction] == 5) { $allowed = false; } if (!isset($_SESSION['restrictionInfo'][intRestriction])) { $allowed = false; } //Is this your department?, faculty ?, college? if ($_SESSION['restrictionInfo'][intRestriction] == 4) { $allowed = auth_checkrestriction("intDeptID",$deptid); } elseif ($_SESSION['restrictionInfo'][intRestriction] == 3){ $allowed = auth_checkrestriction("intFacultyID",$facultyid); } elseif ($_SESSION['restrictionInfo'][intRestriction] == 2){ $allowed = auth_checkrestriction("intCollegeID",$collegeid); } elseif ($_SESSION['restrictionInfo'][intRestriction] == 1) { $allowed = true; } } else { $allowed = false; } return $allowed; } function restriction_and_exit($action, $deptid, $facultyid, $collegeid) { if (restriction($action, $deptid, $facultyid, $collegeid) == true) { return true; } else { auth_display_message(); exit; } } function restriction_special_degree_and_exit($action, $facultyid, $collegeid, $degree_realid) { $sql = "SELECT intAdminDepartment FROM tbl_degree_programmes WHERE deg_real_id = $degree_realid"; $q = debug_run_query($sql); $intRecords = mysql_num_rows($q); //If you have permission to access any of these departments which relates to the degree_real_id $allowed_access_degree_special = 0; if ($intRecords > 0) { while ($arrRow = mysql_fetch_assoc($q)) { if ($arrRow[intAdminDepartment] > 0) { if (restriction($action, $arrRow[intAdminDepartment], $facultyid, $collegeid) == true) { $allowed_access_degree_special = 1; } } } } if ($allowed_access_degree_special == 1) { return true; } else { auth_display_message(); exit; } } ?> 1 AND tbl_inst_faculties_data.tbl_Academicyears_intYearID = $AcademicYearId "; $q=mysql_query($sql); if (mysql_num_rows($q)){ return 1; }else{ return 0; } } function check_degree_year_approved($degree_year_id) { $sql = "SELECT tbl_inst_faculties_data.tbl_approve_results_intApproveId AS approveid FROM tbl_degree_year INNER JOIN tbl_degree_programmes ON tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID INNER JOIN tbl_inst_faculties_data ON tbl_inst_faculties_data.tbl_inst_faculties_data_intFaculty_ID = tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID WHERE tbl_degree_year.intDegreeYearID = $degree_year_id AND tbl_inst_faculties_data.tbl_approve_results_intApproveId > 1"; $q=mysql_query($sql); if (mysql_num_rows($q)){ return 1; }else{ return 0; } } function get_degree_year_course_info($degree_year_course_id) { $sql = "SELECT tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID AS facultyId FROM tbl_degree_year_courses INNER JOIN tbl_degree_year ON tbl_degree_year.intDegreeYearID = tbl_degree_year_courses.tbl_Degree_Year_intDegreeYearID INNER JOIN tbl_degree_programmes ON tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID WHERE tbl_degree_year_courses.intProgCourseID = $degree_year_course_id "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_faculty($intFacultyID){ // get faculty details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID WHERE tbl_inst_faculties.intFaculty_ID = $intFacultyID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // fac doesn't exist return 0; } } function get_dept($intDeptID){ // get department details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_faculty_departments.intDept_ID, tbl_faculty_departments.szDeptName, tbl_faculty_departments.intFirstSemPublishingStatus, tbl_faculty_departments.intFirstSemPublishingRemarks From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_faculty_departments ON tbl_faculty_departments.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID WHERE tbl_faculty_departments.intDept_ID = $intDeptID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // dept doesn't exist return 0; } } function get_degree($intProgID){ // get degree details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_degree_programmes.intProg_ID, tbl_degree_programmes.szProgramCode, tbl_degree_programmes.szProgramName, tbl_degree_programmes_real.deg_real_id, tbl_degree_programmes_real.szProgramNameReal, tbl_degree_programmes.intAdminDepartment From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_degree_programmes ON tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join tbl_degree_programmes_real ON tbl_degree_programmes.deg_real_id = tbl_degree_programmes_real.deg_real_id WHERE tbl_degree_programmes.intProg_ID = $intProgID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_degree_year($intDegreeYearID){ // get degree year details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_degree_programmes.intProg_ID, tbl_degree_programmes.intAdminDepartment, tbl_degree_programmes.intCoursesShared, tbl_degree_year.intDegreeRequiredUnits AS intUnitsRequired, tbl_degree_programmes.szProgramAcronym, tbl_degree_programmes.szProgramCode, tbl_degree_programmes.szProgramName, tbl_degree_programmes.intDegreeType, tbl_degree_year.intYear, tbl_degree_year.intDegreeYearID, tbl_degree_year.tbl_Degree_Year_Status_intDegreeYearStatusID, tbl_degree_year_status.szDegreeYearStatus, tbl_degree_year.blnAllowCourseRegSem1, tbl_degree_year.blnAllowCourseRegSem2, tbl_degree_year.blnFinalYear, tbl_degree_year.intCombinedSubject, tbl_degree_year.intCourseUnitsRequiredSem1, tbl_degree_year.intCourseUnitsRequiredSem2, tbl_academicyears.intYearID, tbl_degree_programmes_real.deg_real_id, tbl_degree_programmes_real.szProgramNameReal, tbl_academicyears.szAcademicYear From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_degree_programmes ON tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join tbl_degree_year ON tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID Inner Join tbl_academicyears ON tbl_academicyears.intYearID = tbl_degree_year.tbl_Academicyears_intYearID Inner Join tbl_degree_year_status ON tbl_degree_year.tbl_Degree_Year_Status_intDegreeYearStatusID = tbl_degree_year_status.intDegreeYearStatusID Inner Join tbl_degree_programmes_real ON tbl_degree_programmes.deg_real_id = tbl_degree_programmes_real.deg_real_id WHERE tbl_degree_year.intDegreeYearID = $intDegreeYearID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_degree_year_next($intDegreeYearID){ // get degree year details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_degree_programmes.intProg_ID, tbl_degree_programmes.intAdminDepartment, tbl_degree_programmes.intCoursesShared, next_tbl_degree_year.intDegreeRequiredUnits AS intUnitsRequired, tbl_degree_programmes.szProgramCode, tbl_degree_programmes.szProgramName, next_tbl_degree_year.intYear, next_tbl_degree_year.intDegreeYearID, next_tbl_degree_year.blnAllowCourseRegSem1, next_tbl_degree_year.blnAllowCourseRegSem2, next_tbl_degree_year.blnFinalYear, tbl_degree_programmes_real.deg_real_id, tbl_degree_programmes_real.szProgramNameReal From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_degree_programmes ON tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join next_tbl_degree_year ON next_tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID Inner Join tbl_degree_programmes_real ON tbl_degree_programmes.deg_real_id = tbl_degree_programmes_real.deg_real_id WHERE next_tbl_degree_year.intDegreeYearID = $intDegreeYearID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_course_offering($intCourseOfferingID){ // get course details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_faculty_departments.intDept_ID, tbl_faculty_departments.szDeptName, tbl_course_offering.intCourse_Offer_ID, tbl_course_offering.tbl_Course_Offering_Status_intCourseOfferingStatusID, tbl_course_offering.intSemester, tbl_course_offering.tbl_Academicyears_intYearID, tbl_course_offering.tbl_course_offering_levels_intLevelId, tbl_course_offering.courseOwner, tbl_course_offering.CAentry, tbl_course_offering.UEentry, tbl_course_offering.intScoresType, tbl_course_offering.minimumCA, tbl_course_offering.intCourseManageid, tbl_course_offering.intPassGradeId, tbl_degree_courses.intCourse_ID, tbl_degree_courses.intCourseUnits, tbl_degree_courses.szCourseCode, tbl_degree_courses.szCourseTitle, tbl_degree_courses.rlCAWeight, tbl_degree_courses.rlUEWeight, tbl_academicyears.szAcademicYear FROM tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_faculty_departments ON tbl_faculty_departments.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join tbl_course_offering ON tbl_course_offering.tbl_Faculty_Departments_intDept_ID = tbl_faculty_departments.intDept_ID Inner Join tbl_degree_courses ON tbl_course_offering.tbl_Degree_Courses_intCourse_ID = tbl_degree_courses.intCourse_ID Inner Join tbl_academicyears ON tbl_course_offering.tbl_Academicyears_intYearID = tbl_academicyears.intYearID WHERE tbl_course_offering.intCourse_Offer_ID = $intCourseOfferingID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_course_offering_next($intCourseOfferingID) { // get course details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_faculty_departments.intDept_ID, tbl_faculty_departments.szDeptName, next_tbl_course_offering.intCourse_Offer_ID, next_tbl_course_offering.tbl_Course_Offering_Status_intCourseOfferingStatusID, next_tbl_course_offering.intSemester, tbl_degree_courses.intCourse_ID, tbl_degree_courses.intCourseUnits, tbl_degree_courses.szCourseCode, tbl_degree_courses.szCourseTitle, tbl_degree_courses.rlCAWeight, tbl_degree_courses.rlUEWeight From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_faculty_departments ON tbl_faculty_departments.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join next_tbl_course_offering ON next_tbl_course_offering.tbl_Faculty_Departments_intDept_ID = tbl_faculty_departments.intDept_ID Inner Join tbl_degree_courses ON next_tbl_course_offering.tbl_Degree_Courses_intCourse_ID = tbl_degree_courses.intCourse_ID WHERE next_tbl_course_offering.intCourse_Offer_ID = $intCourseOfferingID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_staff($intStaffID){ // get staff details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_faculty_departments.intDept_ID, tbl_faculty_departments.szDeptName, tbl_staff_details.szFirstName, tbl_staff_details.szMiddleName, tbl_staff_details.szSurName, tbl_staff_details.szSalutation, tbl_staff_details.intStaff_ID From tbl_staff_details LEFT Join tbl_faculty_departments ON tbl_faculty_departments.intDept_ID = tbl_staff_details.tbl_Faculty_Departments_intDept_ID LEFT Join tbl_inst_faculties ON tbl_inst_faculties.intFaculty_ID = tbl_faculty_departments.tbl_Inst_Faculties_intFaculty_ID Inner Join tbl_colleges ON tbl_colleges.intCollege_ID = tbl_inst_faculties.tbl_Colleges_intCollege_ID Inner Join tbl_institution ON tbl_institution.intInst_ID = tbl_colleges.tbl_Institution_intInst_ID WHERE tbl_staff_details.intStaff_ID = $intStaffID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_student($intStudentID){ // get student details $sql="Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_faculty_departments.szDeptName, tbl_faculty_departments.intDept_ID, tbl_degree_programmes.intProg_ID, tbl_degree_programmes.intAdminDepartment, tbl_degree_programmes.szProgramCode, tbl_degree_programmes.szProgramName, tbl_degree_programmes.intDegreeType, tbl_degree_year.intDegreeRequiredUnits AS intUnitsRequired, tbl_degree_year.intYear, tbl_degree_year.blnFinalYear, tbl_degree_year.intDegreeYearID, tbl_degree_year.tbl_Degree_Year_Status_intDegreeYearStatusID, tbl_academicyears.intYearID, tbl_academicyears.blnDefault, tbl_academicyears.szAcademicYear, tbl_registered_students.szSurName, tbl_registered_students.szFirstName, tbl_registered_students.szMiddleName, tbl_registered_students.szRegistrationNumber, tbl_registered_students.szSex, tbl_registered_students.dtDateOfBirth, tbl_registered_students.szPlaceOfBirth, tbl_registered_students.szMailingAddress, tbl_registered_students.szTelephoneNos, tbl_registered_students.szEmailAddress, tbl_registered_students.dtAdmissionDate, tbl_registered_students.dtCompletedDate, tbl_registered_students.szAdmissionType, tbl_registered_students.szSponsorshipType, tbl_registered_students.szStatusComments, tbl_registered_students.intGPAObtainedAll, tbl_registered_students.szFacultyName AS fname2, tbl_registered_students.szCollegeName AS cname2, Truncate((tbl_registered_students.studentGradePoints/tbl_registered_students.studentUnits),4) AS intFinalGPA, tbl_student_status.szStudentStatus, tbl_marital_status.szMaritalStatus, tbl_citizenship.szCitizenShip, tbl_citizenship.szCountryCode, tbl_registered_students.Student_ID, tbl_registered_students.tbl_Student_Status_intStudentStatusID FROM tbl_registered_students LEFT Join tbl_student_yearofstudy ON tbl_registered_students.Student_ID = tbl_student_yearofstudy.tbl_Registered_Students_Student_ID LEFT Join tbl_degree_year ON tbl_student_yearofstudy.tbl_Degree_Year_intDegreeYearID = tbl_degree_year.intDegreeYearID LEFT Join tbl_degree_programmes ON tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID LEFT Join tbl_faculty_departments ON tbl_faculty_departments.intDept_ID = tbl_degree_programmes.intAdminDepartment LEFT Join tbl_inst_faculties ON tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID LEFT Join tbl_academicyears ON tbl_academicyears.intYearID = tbl_degree_year.tbl_Academicyears_intYearID LEFT Join tbl_colleges ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID LEFT Join tbl_institution ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID left Join tbl_student_status ON tbl_student_status.intStudentStatusID = tbl_registered_students.tbl_Student_Status_intStudentStatusID left Join tbl_marital_status ON tbl_marital_status.intMStatusID = tbl_registered_students.tbl_Marital_Status_intMStatusID left Join tbl_citizenship ON tbl_citizenship.intCitizenShipID = tbl_registered_students.tbl_CitizenShip_intCitizenShipID WHERE tbl_registered_students.Student_ID = $intStudentID ORDER BY intYear DESC "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); $arrRow['intFinalGPA']=substr($arrRow['intFinalGPA'],0,3); return $arrRow; }else{ // doesn't exist return 0; } } function get_student_year_yearid_peracademicyear($intStudentID, $academicyearid, $degreeprogrammeid) { $sql= "SELECT intDegreeYearID, intYear FROM tbl_degree_year WHERE tbl_Academicyears_intYearID = $academicyearid AND tbl_Degree_Programmes_intProg_ID = $degreeprogrammeid"; $q=debug_run_query($sql); $intRecords = mysql_num_rows($q); $checking = 0; $tempdegreeyearid = 0; if ($intRecords >=1) { While ($arrRow = mysql_fetch_assoc($q)) { $tempdegreeyearid = $arrRow[intDegreeYearID]; $sql= "SELECT intStudyYearID FROM tbl_student_yearofstudy WHERE tbl_Degree_Year_intDegreeYearID = $tempdegreeyearid AND tbl_Registered_Students_Student_ID = $intStudentID AND tbl_student_yearofstudy.intType IN (1,2)"; $q2=debug_run_query($sql); $intRecords = mysql_num_rows($q2); if ($intRecords >=1) { $returnrecord = $arrRow; $checking = 1; } } } if ($checking == 0) { if ($tempdegreeyearid > 0) { //Check to see if the student has been a finalist in previous years $sql = "SELECT intStudyYearID FROM tbl_student_yearofstudy INNER JOIN tbl_degree_year ON tbl_degree_year.intDegreeYearID = tbl_student_yearofstudy.tbl_Degree_Year_intDegreeYearID INNER JOIN tbl_academicyears ON tbl_academicyears.intYearID = tbl_degree_year.tbl_Academicyears_intYearID WHERE tbl_Registered_Students_Student_ID = $intStudentID AND tbl_academicyears.blnDefault NOT IN (1) AND tbl_degree_year.blnFinalYear = 1"; $q=debug_run_query($sql); $intRecords = mysql_num_rows($q); if ($intRecords > 0) //He/she was a finalist in previous academic years { $sql = "SELECT intYear FROM tbl_degree_year INNER JOIN tbl_academicyears ON tbl_academicyears.intYearID = tbl_degree_year.tbl_Academicyears_intYearID WHERE tbl_academicyears.blnDefault = 1 AND tbl_degree_year.blnFinalYear = 1 AND tbl_Degree_Programmes_intProg_ID = $degreeprogrammeid"; $q=debug_run_query($sql); $intRecords = mysql_num_rows($q); if ($intRecords > 0) { $arrRow2 = mysql_fetch_assoc($q); $intstudyyear = $arrRow2[intYear]; //Insert a carry over studyyear record $sql = "INSERT INTO tbl_student_yearofstudy ( tbl_Degree_Year_intDegreeYearID, tbl_Registered_Students_Student_ID, szYearOfStudy, intType ) VALUES ( $tempdegreeyearid, $intStudentID, $intstudyyear, 2)"; $qRun = debug_run_query($sql); $sql= "SELECT intStudyYearID FROM tbl_student_yearofstudy WHERE tbl_Degree_Year_intDegreeYearID = $tempdegreeyearid AND tbl_Registered_Students_Student_ID = $intStudentID AND tbl_student_yearofstudy.intType IN (1,2)"; $q2=debug_run_query($sql); $intRecords = mysql_num_rows($q2); if ($intRecords >=1) { $arrRow[intDegreeYearID] = $tempdegreeyearid; $checking = 1; $returnrecord = $arrRow; } else { $arrRow[intDegreeYearID] = 0; $returnrecord = $arrRow; } } else //intYear { $arrRow[intDegreeYearID] = 0; $returnrecord = $arrRow; } } else //Not a finalist in previous academic years { $arrRow[intDegreeYearID] = 0; $returnrecord = $arrRow; } } //$tempdegreeyearid > 0 else { $arrRow[intDegreeYearID] = 0; $returnrecord = $arrRow; } } else { //Leave it - checking = 1 } return $returnrecord; } function get_student_year($intStudentYearID){ // get student year details $sql=" Select tbl_institution.szInstName, tbl_institution.intInst_ID, tbl_institution.szInstAcronym, tbl_colleges.intCollege_ID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_inst_faculties.intFaculty_ID, tbl_inst_faculties.szFacultyName, tbl_inst_faculties.szFacultyCode, tbl_degree_programmes.intProg_ID, tbl_degree_programmes.szProgramCode, tbl_degree_programmes.szProgramName, tbl_degree_programmes.intAdminDepartment, tbl_degree_year.intYear, tbl_student_yearofstudy.intType, tbl_degree_year.intDegreeYearID, tbl_degree_year.blnFinalYear, tbl_degree_year.tbl_Degree_Year_Status_intDegreeYearStatusID, tbl_academicyears.intYearID, tbl_academicyears.szAcademicYear, tbl_student_yearofstudy.intStudyYearID, tbl_student_yearofstudy.tbl_Student_Year_Status_intStudentYearStatus, tbl_registered_students.szSurName, tbl_registered_students.szFirstName, tbl_registered_students.szMiddleName, tbl_registered_students.szRegistrationNumber, tbl_registered_students.Student_ID, tbl_registered_students.tbl_Student_Status_intStudentStatusID From tbl_institution Inner Join tbl_colleges ON tbl_colleges.tbl_Institution_intInst_ID = tbl_institution.intInst_ID Inner Join tbl_inst_faculties ON tbl_inst_faculties.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID Inner Join tbl_degree_programmes ON tbl_degree_programmes.tbl_Inst_Faculties_intFaculty_ID = tbl_inst_faculties.intFaculty_ID Inner Join tbl_degree_year ON tbl_degree_year.tbl_Degree_Programmes_intProg_ID = tbl_degree_programmes.intProg_ID Inner Join tbl_academicyears ON tbl_academicyears.intYearID = tbl_degree_year.tbl_Academicyears_intYearID Inner Join tbl_student_yearofstudy ON tbl_student_yearofstudy.tbl_Degree_Year_intDegreeYearID = tbl_degree_year.intDegreeYearID Inner Join tbl_registered_students ON tbl_registered_students.Student_ID = tbl_student_yearofstudy.tbl_Registered_Students_Student_ID Where tbl_student_yearofstudy.intStudyYearID = $intStudentYearID "; //var_dump($intStudentYearID); $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_halls($intHallHostelID){ // get halls details $sql=" Select tbl_acc_hall_hostel.intHallHostelID, tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intDefaultCollegeID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode From tbl_acc_hall_hostel Inner Join tbl_colleges ON tbl_acc_hall_hostel.intDefaultCollegeID = tbl_colleges.intCollege_ID Where tbl_acc_hall_hostel.intHallHostelID = $intHallHostelID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_block($intBlockID){ // get Block details $sql=" Select tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_block.intDefaultCollegeID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode From tbl_acc_hall_hostel Inner Join tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID Inner Join tbl_colleges ON tbl_acc_block.intDefaultCollegeID = tbl_colleges.intCollege_ID Where tbl_acc_block.intBlockID = $intBlockID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_floor($intFloorID){ // get Floor details $sql=" Select tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_floor.intFloorID, tbl_acc_floor.szFloorName, tbl_acc_floor.intDefaultCollegeID, tbl_acc_floor.intDefaultRoomCapacity, tbl_acc_floor.intDefaultFirstRoomNo, tbl_acc_floor.intDefaultNumberOfRooms, tbl_acc_floor.szDefaultRoomType, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode From tbl_acc_hall_hostel Inner Join tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID Inner Join tbl_acc_floor ON tbl_acc_floor.tbl_acc_block_intBlockID = tbl_acc_block.intBlockID Inner Join tbl_colleges ON tbl_acc_floor.intDefaultCollegeID = tbl_colleges.intCollege_ID Where tbl_acc_floor.intFloorID = $intFloorID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_room_acyear($intRoomID, $acyearId){ // get Room details $sql=" Select tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_floor.intFloorID, tbl_acc_floor.szFloorName, tbl_acc_room.intRoomID, tbl_acc_room.szRoomNumber, tbl_acc_room.intNoOfBeds, tbl_acc_room.szRoomType, tbl_acc_room.intDefaultCollegeID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode From tbl_acc_hall_hostel Inner Join tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID Inner Join tbl_acc_floor ON tbl_acc_floor.tbl_acc_block_intBlockID = tbl_acc_block.intBlockID Inner Join tbl_acc_room ON tbl_acc_room.tbl_acc_floor_intFloorID = tbl_acc_floor.intFloorID Inner Join tbl_colleges ON tbl_acc_room.intDefaultCollegeID = tbl_colleges.intCollege_ID WHERE tbl_acc_room.intRoomID IN ( SELECT tbl_acc_bed.tbl_acc_room_intRoomID FROM tbl_acc_bed INNER JOIN tbl_acc_academicyearbeds ON tbl_acc_bed.intBedID = tbl_acc_academicyearbeds.tbl_acc_bed_intBedId WHERE tbl_acc_academicyearbeds.tbl_academic_year_intAcYearId = $acyearId ) AND tbl_acc_room.intRoomID = $intRoomID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_room($intRoomId) { // get Room details $sql=" Select tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_floor.intFloorID, tbl_acc_floor.szFloorName, tbl_acc_room.intRoomID, tbl_acc_room.szRoomNumber, tbl_acc_room.intNoOfBeds, tbl_acc_room.szRoomType, tbl_acc_room.intDefaultCollegeID, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode From tbl_acc_hall_hostel Inner Join tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID Inner Join tbl_acc_floor ON tbl_acc_floor.tbl_acc_block_intBlockID = tbl_acc_block.intBlockID Inner Join tbl_acc_room ON tbl_acc_room.tbl_acc_floor_intFloorID = tbl_acc_floor.intFloorID Inner Join tbl_colleges ON tbl_acc_room.intDefaultCollegeID = tbl_colleges.intCollege_ID Where tbl_acc_room.intRoomID = $intRoomId "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_bed($intBedID){ // get bed details $sql="SELECT tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_floor.intFloorID, tbl_acc_floor.szFloorName, tbl_acc_room.intRoomID, tbl_acc_room.szRoomNumber, tbl_acc_room.intNoOfBeds, tbl_acc_room.szRoomType, tbl_acc_bed.intBedID, tbl_acc_academicyearbeds.intAcc_acYearId, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_colleges.intCollege_ID, tbl_student_yearofstudy.intStudyYearID, tbl_registered_students.Student_ID, tbl_registered_students.szSurName, tbl_registered_students.szFirstName, tbl_registered_students.szMiddleName, tbl_registered_students.szRegistrationNumber FROM tbl_acc_hall_hostel INNER JOIN tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID INNER JOIN tbl_acc_floor ON tbl_acc_floor.tbl_acc_block_intBlockID = tbl_acc_block.intBlockID INNER JOIN tbl_acc_room ON tbl_acc_room.tbl_acc_floor_intFloorID = tbl_acc_floor.intFloorID INNER JOIN tbl_acc_bed ON tbl_acc_bed.tbl_acc_room_intRoomID = tbl_acc_room.intRoomID INNER JOIN tbl_acc_academicyearbeds ON tbl_acc_bed.intBedID = tbl_acc_academicyearbeds.tbl_acc_bed_intBedId INNER JOIN tbl_colleges ON tbl_acc_bed.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID LEFT JOIN tbl_student_yearofstudy ON tbl_acc_academicyearbeds.tbl_student_yearOfStudy_intStudyYearId = tbl_student_yearofstudy.intStudyYearID LEFT JOIN tbl_registered_students ON tbl_student_yearofstudy.tbl_Registered_Students_Student_ID = tbl_registered_students.Student_ID Where tbl_acc_bed.intBedID = $intBedID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } function get_bed_acyear($intAcYearBedID, $acyearId){ // get bed details $sql=" SELECT tbl_acc_hall_hostel.szHallHostelName, tbl_acc_hall_hostel.blnOnCampus, tbl_acc_hall_hostel.intHallHostelID, tbl_acc_block.intBlockID, tbl_acc_block.szBlockName, tbl_acc_floor.intFloorID, tbl_acc_floor.szFloorName, tbl_acc_room.intRoomID, tbl_acc_room.szRoomNumber, tbl_acc_room.intNoOfBeds, tbl_acc_room.szRoomType, tbl_acc_bed.intBedID, tbl_acc_academicyearbeds.intAcc_acYearId AS intAcYearBedId, tbl_colleges.szCollege_Name, tbl_colleges.szCollegeCode, tbl_colleges.intCollege_ID, tbl_student_yearofstudy.intStudyYearID, tbl_registered_students.Student_ID, tbl_registered_students.szSurName, tbl_registered_students.szFirstName, tbl_registered_students.szMiddleName, tbl_registered_students.szRegistrationNumber FROM tbl_acc_hall_hostel INNER JOIN tbl_acc_block ON tbl_acc_block.tbl_acc_hall_hostel_intHallHostelID = tbl_acc_hall_hostel.intHallHostelID INNER JOIN tbl_acc_floor ON tbl_acc_floor.tbl_acc_block_intBlockID = tbl_acc_block.intBlockID INNER JOIN tbl_acc_room ON tbl_acc_room.tbl_acc_floor_intFloorID = tbl_acc_floor.intFloorID INNER JOIN tbl_acc_bed ON tbl_acc_bed.tbl_acc_room_intRoomID = tbl_acc_room.intRoomID INNER JOIN tbl_colleges ON tbl_acc_bed.tbl_Colleges_intCollege_ID = tbl_colleges.intCollege_ID INNER JOIN tbl_acc_academicyearbeds ON tbl_acc_academicyearbeds.tbl_acc_bed_intBedId = tbl_acc_bed.intBedID LEFT JOIN tbl_student_yearofstudy ON tbl_acc_academicyearbeds.tbl_student_yearOfStudy_intStudyYearId = tbl_student_yearofstudy.intStudyYearID LEFT JOIN tbl_registered_students ON tbl_student_yearofstudy.tbl_Registered_Students_Student_ID = tbl_registered_students.Student_ID WHERE tbl_acc_academicyearbeds.tbl_academic_year_intAcYearId = $acyearId AND tbl_acc_academicyearbeds.intAcc_acYearId = $intAcYearBedID "; $q=mysql_query($sql); if (mysql_num_rows($q)){ // return row as array $arrRow = mysql_fetch_assoc($q); return $arrRow; }else{ // doesn't exist return 0; } } // department nav function print_tertiary_nav_dep($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ if (auth_checkObj('ACA:1:Department',1)){ echo 'Col: '.$arrRow[szCollegeCode].''; }else{ echo 'Col: '.$arrRow[szCollegeCode]; } } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; if (auth_checkObj('ACA:1:Department',1)){ echo 'Fac: '.$arrRow[szFacultyCode].''; }else{ echo 'Fac: '.$arrRow[szFacultyCode]; } } // department if (isset($arrRow[intDept_ID])){ echo ' > '; if (auth_checkObj('ACA:1:Department',1)){ echo 'Dpt: '.$arrRow[szDeptName].''; }else{ echo 'Dpt: '.$arrRow[szDeptName]; } } // Course Offering if (isset($arrRow[intCourse_ID])){ echo ' > '; if (auth_checkObj('ACA:5:Degree Courses',1)){ echo 'Crs: '.$arrRow[szCourseCode].''; }else{ echo 'Crs: '.$arrRow[szCourseCode]; } } // Staff Info if (isset($arrRow[intStaff_ID])){ echo ' > '; if (auth_checkObj('ACA:11:Staff Details',1)){ echo 'Stf: '.$arrRow[szSurName].', '.$arrRow[szSalutation].' '.$arrRow[szFirstName].''; }else{ echo 'Stf: '.$arrRow[szSurName].', '.$arrRow[szSalutation].' '.$arrRow[szFirstName]; } } echo "
"; } // department nav function print_tertiary_nav_courses($arrRow){ //Check permission to view course // echo "
";
    //print_r($arrRow);
    
    //print_r($_SESSION[restrictionInfo][intRestriction] > 4);//lecturer
    //die;
	echo '
'; // College if (isset($arrRow[intCollege_ID])){ //if (auth_checkObj('ACA:1:Department',1)){ if($_SESSION[restrictionInfo][intRestriction] <= 2) { //college acess echo 'Col: '.$arrRow[szCollegeCode].''; }else{ echo 'Col: '.$arrRow[szCollegeCode]; } } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; //if (auth_checkObj('ACA:1:Department',1)){ if($_SESSION[restrictionInfo][intRestriction] <= 3) { //faculty acess echo 'Fac: '.$arrRow[szFacultyCode].''; }else{ echo 'Fac: '.$arrRow[szFacultyCode]; } } // department if (isset($arrRow[intDept_ID])){ echo ' > '; //if (auth_checkObj('ACA:1:Department',1)){ if($_SESSION[restrictionInfo][intRestriction] <= 4) { //department acess echo 'Dpt: '.$arrRow[szDeptName].''; }else{ echo 'Dpt: '.$arrRow[szDeptName]; } } // Course Offering if (isset($arrRow[intCourse_ID])){ echo ' > '; //if (auth_checkObj('ACA:5:Degree Courses',1)){ if($_SESSION[restrictionInfo][intRestriction] <= 5) { //Course access echo 'Crs: '.$arrRow[szCourseCode].''; }else{ echo 'Crs: '.$arrRow[szCourseCode]; } } echo "
"; } // degree programme nav function print_tertiary_nav_deg($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ //if (auth_checkObj('ACA:2:Degree Programme',1)){ echo 'Col: '.$arrRow[szCollegeCode].''; //}else{ // echo 'Col: '.$arrRow[szCollegeCode]; //} } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; //if (auth_checkObj('ACA:2:Degree Programme',1)){ echo 'Fac: '.$arrRow[szFacultyCode].''; //}else{ // echo 'Fac: '.$arrRow[szFacultyCode]; //} } // degree if (isset($arrRow[intProg_ID])){ echo ' > '; //if (auth_checkObj('ACA:3:Degree Programme Year',1)){ echo 'Deg: '.$arrRow[szProgramCode].''; //}else{ // echo 'Deg: '.$arrRow[szProgramCode]; //} } // degree Year if (isset($arrRow[intDegreeYearID])){ echo ' > '; //if (auth_checkObj('ACA:4:Degree Year Courses',1)) //{ echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; //}else{ // echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; //} } // ImportInfo if (isset($arrRow[intimportdata])){ echo ' > '; //if (auth_checkObj('ACA:4:Degree Year Courses',1)) //{ echo ' Importing Data'; //}else{ // echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; //} } // Student Info if (isset($arrRow[Student_ID])){ echo ' > '; //if (auth_checkObj('ACA:7:Student Details',1)){ echo 'Stu: '.$arrRow[szSurName].', '.$arrRow[szFirstName].' '.$arrRow[szMiddleName].''; //}else{ // echo 'Stu: '.$arrRow[szSurName].', '.$arrRow[szFirstName].' '.$arrRow[szMiddleName]; //} } // Student Year Info if (isset($arrRow[intStudyYearID])){ echo ' > '; //if (auth_checkObj('ACA:8:Student Year of Study',1)){ echo 'Year: '.ordinalize($arrRow[intYear]).' Year'; //}else{ // echo 'Year: '.ordinalize($arrRow[intYear]).' Year'; //} } //Degree Year Courses if (isset($arrRow[intCourse_ID])){ echo ' > '; //if (auth_checkObj('ACA:5:Degree Courses',1)){ echo 'Crs: '.$arrRow[szCourseCode].''; //}else{ // echo 'Crs: '.$arrRow[szCourseCode]; //} } echo "
"; } // degree prog management nav function print_tertiary_nav_dpm($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ if (auth_checkObj('ACA:2:Degree Programme',1)){ echo 'Col: '.$arrRow[szCollegeCode].''; }else{ echo 'Col: '.$arrRow[szCollegeCode]; } } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; if (auth_checkObj('ACA:2:Degree Programme',1)){ echo 'Fac: '.$arrRow[szFacultyCode].''; }else{ echo 'Fac: '.$arrRow[szFacultyCode]; } } // degree if (isset($arrRow[intProg_ID])){ echo ' > '; if (auth_checkObj('ACA:3:Degree Programme Year',1)){ echo 'Deg: '.$arrRow[szProgramCode].''; }else{ echo 'Deg: '.$arrRow[szProgramCode].' - '.$arrRow[szProgramName]; } } // degree Year if (isset($arrRow[intDegreeYearID])){ echo ' > '; if (auth_checkObj('ACA:3:Degree Programme Year',1)){ echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; }else{ echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; } } echo "
"; } // Course Managment Nav function print_tertiary_nav_cm($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ if (auth_checkObj('ACA:6:Course Offering',1)){ echo 'Col: '.$arrRow[szCollegeCode].''; }else{ echo 'Col: '.$arrRow[szCollegeCode]; } } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; if (auth_checkObj('ACA:6:Course Offering',1)){ echo 'Fac: '.$arrRow[szFacultyCode].''; }else{ echo 'Fac: '.$arrRow[szFacultyCode]; } } // department if (isset($arrRow[intDept_ID])){ echo ' > '; if (auth_checkObj('ACA:6:Course Offering',1)){ echo 'Dpt: '.$arrRow[szDeptName].''; }else{ echo 'Dpt: '.$arrRow[szDeptName]; } } // Course Offering if (isset($arrRow[intCourse_ID])){ echo ' > '; if (auth_checkObj('ACA:6:Course Offering',1)){ echo 'Crs: '.$arrRow[szCourseCode].''; }else{ echo 'Crs: '.$arrRow[szCourseCode]; } } echo "
"; } // Staff Register Nav function print_tertiary_nav_sr($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ if (auth_checkObj('ACA:11:Staff Details',1)){ echo 'Col: '.$arrRow[szCollegeCode].''; }else{ echo 'Col: '.$arrRow[szCollegeCode]; } } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; if (auth_checkObj('ACA:11:Staff Details',1)){ echo 'Fac: '.$arrRow[szFacultyCode].''; }else{ echo 'Fac: '.$arrRow[szFacultyCode]; } } // department if (isset($arrRow[intDept_ID])){ echo ' > '; if (auth_checkObj('ACA:11:Staff Details',1)){ echo 'Dpt: '.$arrRow[szDeptName].''; }else{ echo 'Dpt: '.$arrRow[szDeptName]; } } // Staff Info if (isset($arrRow[intStaff_ID])){ echo ' > '; if (auth_checkObj('ACA:11:Staff Details',1)){ echo 'Stf: '.$arrRow[szSurName].', '.$arrRow[szSalutation].' '.$arrRow[szFirstName].''; }else{ echo 'Stf: '.$arrRow[szSurName].', '.$arrRow[szSalutation].' '.$arrRow[szFirstName]; } } echo "
"; } // public nav function print_tertiary_nav_pub($arrRow){ echo '
'; // College if (isset($arrRow[intCollege_ID])){ echo 'Col: '.$arrRow[szCollegeCode].''; } // Faculty if (isset($arrRow[intFaculty_ID])){ echo ' > '; echo 'Fac: '.$arrRow[szFacultyCode].''; } // degree if (isset($arrRow[intProg_ID])){ echo ' > '; echo 'Deg: '.$arrRow[szProgramCode].''; } // degree Year if (isset($arrRow[intDegreeYearID])){ echo ' > '; echo 'Yr: '.ordinalize($arrRow[intYear]).' Year'; } // Course Offering if (isset($arrRow[intCourse_ID])){ echo ' > '; echo 'Crs: '.$arrRow[szCourseCode].''; } echo "
"; } // accommodation conf nav function print_tertiary_nav_accom_conf($arrRow){ echo '
'; // Hall Hostel if (isset($arrRow[intHallHostelID])){ echo 'Halls: '.$arrRow[szHallHostelName].''; } // Block if (isset($arrRow[intBlockID])){ echo ' > '; echo 'Block: '.$arrRow[szBlockName].''; } // Floor if (isset($arrRow[intFloorID])){ echo ' > '; echo 'Floor: '.$arrRow[szFloorName].''; } // Room if (isset($arrRow[intRoomID])){ echo ' > '; echo 'Room: '.$arrRow[szRoomNumber].''; } echo "
"; } // accommodation main nav function print_tertiary_nav_accom($arrRow){ echo '
'; // Hall Hostel if (isset($arrRow[intHallHostelID])){ echo 'Halls: '.$arrRow[szHallHostelName].''; } // Block if (isset($arrRow[intBlockID])){ echo ' > '; echo 'Block: '.$arrRow[szBlockName].''; } // Floor if (isset($arrRow[intFloorID])){ echo ' > '; echo 'Floor: '.$arrRow[szFloorName].''; } // Room if (isset($arrRow[intRoomID])){ echo ' > '; echo 'Room: '.$arrRow[szRoomNumber].''; } echo "
"; } ?> = 11 and $num <= 19) return $num."th"; elseif ( $num % 10 == 1 ) return $num."st"; elseif ( $num % 10 == 2 ) return $num."nd"; elseif ( $num % 10 == 3 ) return $num."rd"; else return $num."th"; } # yes no function function yesno($bit){ if ($bit){ return "Yes"; }else{ return "No"; } } # Academic year function get_current_year(){ $sql = "Select tbl_academicyears.intYearID, tbl_academicyears.szAcademicYear From tbl_academicyears Where tbl_academicyears.blnDefault = 1 "; $qResult = mysql_query($sql); $arrYear = mysql_fetch_assoc($qResult); return $arrYear; } # Teacher teaches course function teacher_teaches_course($intCourseOfferingID){ $blnRetVal = false; if ($_SESSION[userInfo][intStaffID] != 0 && isset($_SESSION[restrictionInfo][arrAllowedCourses])){ if (in_array($intCourseOfferingID,$_SESSION[restrictionInfo][arrAllowedCourses])){ $blnRetVal = true; } } return $blnRetVal; } # Teacher is course Leader function teacher_leads_course($intCourseOfferingID){ $blnRetVal = false; if ($_SESSION[userInfo][intStaffID] != 0 && isset($_SESSION[restrictionInfo][arrLeadingCourses])){ if (array_key_exists($intCourseOfferingID,$_SESSION[restrictionInfo][arrLeadingCourses])){ $blnRetVal = true; } } return $blnRetVal; } # Teacher is Department head function teacher_head_department($intCourseOfferingID){ $blnRetVal = false; if ($_SESSION[restrictionInfo][intRestriction] == 4) { $blnRetVal = true; } return $blnRetVal; } # Teacher is Department head function teacher_head_faculty($intCourseOfferingID){ $blnRetVal = false; if ($_SESSION[restrictionInfo][intRestriction] == 3) { $blnRetVal = true; } return $blnRetVal; } # User has college read write function college_read_write($intCourseOfferingID){ $blnRetVal = false; if(isset($_SESSION[groupInfo]['College - Ready/Write']))//college { $blnRetVal = true; } return $blnRetVal; } function faculty_read_write($intCourseOfferingID){ $blnRetVal = false; if(isset($_SESSION[groupInfo]['Faculty - Read/Write']))//faculty { $blnRetVal = true; } return $blnRetVal; } function admin_check($intCourseOfferingID){ $blnRetVal = false; if ($_SESSION[restrictionInfo][intRestriction] == 1) { $blnRetVal = true; } return $blnRetVal; } ?>
Notice: Undefined index: SPC_USER_TYPE_SPC in /var/www/html/aris.udom.ac.tz/private_area/config.inc.php on line 30

Notice: Undefined variable: j in /var/www/html/aris.udom.ac.tz/private_area/config.inc.php on line 50

Notice: Use of undefined constant arrCurrentAcademicYear - assumed 'arrCurrentAcademicYear' in /var/www/html/aris.udom.ac.tz/private_area/config.inc.php on line 56

Fatal error: Call to undefined function auth_checkAct() in /var/www/html/aris.udom.ac.tz/private_area/config.inc.php on line 73