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/Scheduler/admin/credential/ |
Upload File : |
<? // admin/credential/credentialFormVerify.phpinc // Verify the credential form. t_Begin(); // Begin TRACKing included file. unset($formError); // Begin with no errors. // Verify credentialId. f('credentialId'); $is_valid = is_valid('credentialId',$f['credentialId'],'credentialId','credential',true); if ( $is_valid !== true ) { $formError['credentialId'] = $is_valid; } // ENTRY ERROR! The credentialId is not valid. // Verify credentialCode. f('credentialCode'); $is_valid = is_valid('credentialCode',$f['credentialCode'],'credentialCode','credential'); if ( $is_valid !== true ) { $formError['credentialCode'] = $is_valid; } // ENTRY ERROR! The credentialCode is not valid. if ( !isset($formError['credentialCode']) ) { if ( !$f['credentialCode'] ) $formError['credentialCode'] = 'The credential code cannot be blank.'; } if ( !isset($formError['credentialCode']) ) { if ( !$f['credentialId'] ) { // Ensure the credentialCode is unique. $query = " SELECT credentialId FROM `credential` WHERE credentialCode = '".query_safe($f['credentialCode'])."' "; d_Var('credentialInfo',$query,'q'); $credentialInfo = query_info($query); d_Var('$credentialInfo',$credentialInfo); if ( $credentialInfo ) { // There is already a credential using this credentialCode. This is an error. $formError['credentialCode'] = 'There is already a credential using the code ['.$f['credentialCode'].'].'; } } } // Verify credentialTitle. f('credentialTitle'); $is_valid = is_valid('credentialTitle',$f['credentialTitle'],'credentialTitle','credential'); if ( $is_valid !== true ) { $formError['credentialTitle'] = $is_valid; } // ENTRY ERROR! The credentialTitle is not valid. if ( !isset($formError['credentialTitle']) ) { if ( !$f['credentialTitle'] ) $formError['credentialTitle'] = 'The credential title cannot be blank.'; } // Verify credentialInactive. f('credentialInactive'); $is_valid = is_valid('credentialInactive',$f['credentialInactive'],'credentialInactive','credential'); if ( $is_valid !== true ) { $formError['credentialInactive'] = $is_valid; } // ENTRY ERROR! The credentialInactive is not valid. if ( !$f['credentialInactive'] ) $f['credentialInactive'] = 0; // Verify courses. f('courseList'); d_V('courseList'); $coursesNotFoundList = ''; $courseIds = array(); $courseCreditsTotal = 0; $courseCreditsMaxTotal = 0; for ( $year=1; $year<=2; $year++ ) { f('courseList_'.$year); $courses = explodeTrim(' ',str_replace("\n",' ',$f['courseList_'.$year])); d_Var("\$courses",$courses); if ( count($courses) && $courses[0] == '' ) $courses = array(); d_Var("\$courses",$courses); $courseIds[$year] = array(); foreach ( $courses as $course ) { // Loop thru courses. $query = " SELECT courseId , departmentCode , courseNumber , courseCredits , courseCreditsMax FROM `course` JOIN `department` ON department.departmentId = course.departmentId WHERE CONCAT(departmentCode,courseNumber) = '".$course."' "; d_Var('courseResult',$query,'q'); $courseResult = query_do($query); $courseCount = $GLOBALS['_QUERY']['count']; d_Var('$courseResult',$courseResult); if ( $courseCount ) { // course OK. query_seek($courseResult, 0); while ($courseInfo = query_row($courseResult)) { $courseIds[$year][] = $courseInfo['courseId']; $courseCreditsTotal += $courseInfo['courseCredits']; if ( !$courseInfo['courseCreditsMax'] ) { $courseCreditsMaxTotal += $courseInfo['courseCredits']; } else { $courseCreditsMaxTotal += $courseInfo['courseCreditsMax']; } } } else { // course not found. $coursesNotFoundList = listAppend($coursesNotFoundList,$course); } } // Loop thru courses. //d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/');d_Line('','/'); } #d_Var("\$courseIds",$courseIds,'d'); if ( listLen($coursesNotFoundList) ) { $coursesNotFoundListPlural = strpos($coursesNotFoundList,' ') ? '' : 's'; $coursesNotFoundListPredicate = strpos($coursesNotFoundList,' ') ? 'was' : 'were'; $formError['courseList'] = 'The following course'.$coursesNotFoundListPlural.' '.$coursesNotFoundListPredicate.' not found: '.listAnd(listSort($coursesNotFoundList)).'.<br>You need to open up <a class="btn btn-xs" href="'.$_SESSION['ROOT']['http'].'/admin/course" target="_blank">Course Management</a> and add these courses first or remove them from the list.'; } #$formError['force'] = 'force a form error'; @d_Var('$formError',$formError); t_End(); // End TRACKing included file. ?>