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/Enrollment/parse/ |
Upload File : |
<? // Admin/Enrollment/parse/parseDARS_99_c.phpinc // Parse Done. echo '[',$DARS['StudentFirstName'],'] [',$DARS['StudentMiddleName'],'] [',$DARS['StudentLastName'],'] [',$DARS['StudentId'],"]<br>\n"; echo $DARS['CredentialTitle'],' - ',$DARS['CredentialCode'],"<br>\n"; $index = $f_DARSlnCount + 1; #exit; // Ensure the the Credential Code is in the database $query = " SELECT darscredentialId FROM `darscredential` WHERE darsCredentialCode = '".query_safe($DARS['CredentialCode'])."' "; $darscredentialResult = query_do($query); $darscredentialResultCount = $_SESSION['qry']['count']; if (!$darscredentialResultCount) { // The Credential Code is NOT in the database ?> <span class="error">**** New Credential code.</span><br> <? } foreach ($DARS['Section'] as $thisSection) { echo "<br>\n"; echo $thisSection['Title']; if ( $thisSection['Status'] ) echo '; ',$thisSection['Status']; if ( $thisSection['CreditsNeeds'] ) echo '; Needs ',$thisSection['CreditsNeeds'],' credits'; if ( $thisSection['CoursesNeeds'] ) echo '; Needs ',$thisSection['CoursesNeeds'],' courses'; echo "<br>\n"; echo 'SELECT FROM: '; if ( isset($thisSection['SelectFrom']) ) { foreach ($thisSection['SelectFrom'] as $key => $class) { #printVar('$key',$key); printVar('$class',$class); foreach ($class as $key2 => $value) { #printVar('$key2',$key2); printVar('$value',$value); switch ($key2) { case 'Dept': echo $value; break; case 'Numb': echo $value,' '; break; case 'orDept': echo 'or ',$value; break; case 'orNumb': echo $value,' '; break; } } } } #printVar("\$thisSection['SelectFrom']",$thisSection['SelectFrom']); echo "<br>\n"; } echo "<br>\n"; // Get the sessionId from the $DARS['DatePrepared']. $query = " SELECT * FROM `session` WHERE sessionStart <= '".$DARS['DatePrepared']."' AND sessionEnd >= '".$DARS['DatePrepared']."' AND (sessionType = 1 OR sessionType = 2) "; $sessionResult = query_do($query); $sessionResultCount = $_SESSION['qry']['count']; #printVar('$query',$query,'q'); #printVar('$sessionResultCount',$sessionResultCount); if ( !$sessionResultCount ) { // Get the next sessionId. $query = " SELECT * FROM `session` WHERE sessionStart > '".$DARS['DatePrepared']."' AND (sessionType = 1 OR sessionType = 2) ORDER BY sessionStart "; $sessionResult = query_do($query); $sessionResultCount = $_SESSION['qry']['count']; #printVar('$query',$query,'q'); #printVar('$sessionResultCount',$sessionResultCount); } if ($sessionResultCount) { mysqli_data_seek($sessionResult, 0); $sessionRow = mysqli_fetch_assoc($sessionResult); #printVar('$sessionRow',$sessionRow); $DARS['sessionId'] = $sessionRow['sessionId']; $DARS['sessionYRTR'] = $sessionRow['YRTR']; // Delete any previous DARS info for this student this semester. $query = " SELECT darsId FROM `dars` WHERE sessionId = ".$DARS['sessionId']." AND darsStudentId = '".query_safe($DARS['StudentId'])."' AND darsCredentialCode = '".query_safe($DARS['CredentialCode'])."' "; $darsResult = query_do($query); $darsResultCount = $_SESSION['qry']['count']; $darsDeleteMessage = ''; if ($darsResultCount) { mysqli_data_seek($darsResult, 0); $darsRow = mysqli_fetch_assoc($darsResult); $f_darsId = $darsRow['darsId']; // Get session name. $query = "SELECT sessionName, YRTR FROM session WHERE sessionId = ".$DARS['sessionId']; $darsSessionResult = query_do($query); $darsSessionResultCount = $_SESSION['qry']['count']; if ( $darsSessionResultCount ) { mysqli_data_seek($darsSessionResult, 0); $darsSessionRow = mysqli_fetch_assoc($darsSessionResult); $darsSessionName = $darsSessionRow['sessionName'].' ('.$darsSessionRow['YRTR'].') session'; } else { $darsSessionName = 'session '.$DARS['sessionId']; } $darsDeleteMessage = 'Replaces DARS '.$darsRow['darsId'].' for '.$darsSessionName.'.<br>Student: '.$DARS['StudentFirstName'].' '.$DARS['StudentLastName'].'. StudentId: '.$DARS['StudentId'].'. CCode: '.$DARS['CredentialCode'].'.'; // DELETE old DARS from dars table. $query = " DELETE FROM `dars` WHERE darsId = ".$f_darsId." "; $darsDelete = query_do($query); // DELETE old DARS from darssection table. $query = " DELETE FROM `darssection` WHERE darsId = ".$f_darsId." "; $darssectionDelete = query_do($query); // DELETE old DARS from darssectionclass table. $query = " DELETE FROM `darssectionclass` WHERE darsId = ".$f_darsId." "; $darssectionclassDelete = query_do($query); // DELETE old DARS from darssectionselectfrom table. $query = " DELETE FROM `darssectionselectfrom` WHERE darsId = ".$f_darsId." "; $darssectionselectfromDelete = query_do($query); // DELETE old DARS from darsplacementtest table. $query = " DELETE FROM `darsplacementtest` WHERE darsId = ".$f_darsId." "; $darsplacementtestDelete = query_do($query); // DELETE old DARS from darstestscore table. This can be removed once the darstestscore table is moved to the darsplacementtest table. $query = " DELETE FROM `darstestscore` WHERE darsId = ".$f_darsId." "; $darstestscoreDelete = query_do($query); } // See if this darsCredentialCode and darsCredentialTitle are in the darscredential table. $DARS['CredentialCode'] $query = " SELECT darscredentialId, darscredentialTitle, darscredentialcodeId, darsCredentialCode FROM `darscredential` WHERE darscredentialTitle = '".query_safe($DARS['CredentialTitle'])."' AND darsCredentialCode = '".query_safe($DARS['CredentialCode'])."' ORDER BY darscredentialTitle "; $darscredentialResult = query_do($query); $darscredentialResultCount = $_SESSION['qry']['count']; if (!$darscredentialResultCount) { // INSERT the darscredentialTitle and darsCredentialCode. $query = " INSERT INTO `darscredential` ( darscredentialTitle, darsCredentialCode ) VALUES ( '".query_safe($DARS['CredentialTitle'])."', '".query_safe($DARS['CredentialCode'])."' ) "; $darscredentialInsert = query_do($query); } // INSERT DARS information. // To create the default statements below use TextPad and // Find what: (^.*$) // Replace with: if (\1 == "") \1 = 0; if ( !isset($DARS['StudentCreditsInProgress']) ) $DARS['StudentCreditsInProgress'] = 0; if ( !isset($DARS['LastClassYRTR']) ) $DARS['LastClassYRTR'] = ''; if ( !isset($DARS['LastRegisteredYRTR']) ) $DARS['LastRegisteredYRTR'] = ''; /* * / if ($DARS['StudentCumulativeCompletionPercentage'] == "") $DARS['StudentCumulativeCompletionPercentage'] = 0; if ($DARS['StudentCreditsAdded'] == "") $DARS['StudentCreditsAdded'] = 0; if ($DARS['StudentGPA'] == "") $DARS['StudentGPA'] = 0; if ($DARS['CredentialCreditsTotal'] == "") $DARS['CredentialCreditsTotal'] = 0; if ($DARS['CredentialCreditsEarned'] == "") { #printVar('$DARS',$DARS); exit; if ( $DARS['CredentialCreditsTotal'] && $DARS['CredentialCreditsNeeded'] ) { $DARS['CredentialCreditsEarned'] = $DARS['CredentialCreditsTotal'] - $DARS['CredentialCreditsNeeded']; } else { $DARS['CredentialCreditsEarned'] = 0; } } if ($DARS['CredentialCreditsInProgress'] == "") $DARS['CredentialCreditsInProgress'] = 0; if ($DARS['CredentialCreditsNeeded'] == "") $DARS['CredentialCreditsNeeded'] = 0; /* */ $query = " INSERT INTO `dars` ( sessionId, darsStudentId, darsStudentFirstName, darsStudentMiddleName, darsStudentLastName, darsStudentCumulativeCompletionPercentage, darsStudentGPA, darsStudentCreditsAdded, darsStudentCreditsInProgress, darsStudentHolds, darsDatePrepared, darsAdvisor, darsCredentialCode, darsCredentialTitle, darsCredentialCreditsTotal, darsCredentialCreditsRequired, darsCredentialCreditsEarned, darsCredentialCreditsInProgress, darsCredentialCreditsNeeds, darsCredentialEdPlanSemesterUsed, darsCredentialEdPlanYrUsed, darsCredentialStatus, darsLastClassYRTR, darsLastRegisteredYRTR ) VALUES ( ".$DARS['sessionId'].", '".query_safe($DARS['StudentId'])."', '".query_safe($DARS['StudentFirstName'])."', '".query_safe($DARS['StudentMiddleName'])."', '".query_safe($DARS['StudentLastName'])."', ".$DARS['StudentCumulativeCompletionPercentage'].", ".$DARS['StudentGPA'].", ".$DARS['StudentCreditsAdded'].", ".$DARS['StudentCreditsInProgress'].", '".query_safe($DARS['StudentHolds'])."', '".query_safe($DARS['DatePrepared'])."', '".query_safe($DARS['Advisor'])."', '".query_safe($DARS['CredentialCode'])."', '".query_safe($DARS['CredentialTitle'])."', ".$DARS['CredentialCreditsTotal'].", ".$DARS['CredentialCreditsRequired'].", ".$DARS['CredentialCreditsEarned'].", ".$DARS['CredentialCreditsInProgress'].", ".$DARS['CredentialCreditsNeeds'].", '".query_safe($DARS['CredentialEdPlanSemesterUsed'])."', '".query_safe($DARS['CredentialEdPlanYrUsed'])."', '".query_safe($DARS['CredentialStatus'])."', '".query_safe($DARS['LastClassYRTR'])."', '".query_safe($DARS['LastRegisteredYRTR'])."' ) "; $darsInsert = query_do($query); $f_darsId = mysqli_insert_id($_SESSION['DATABASE_LINK']); // INSERT the DARS text. $query = " INSERT INTO `darsrawtext` ( darsId, darsText ) VALUES ( ".$f_darsId.", '".query_safe($f_DARS_Report)."' ) "; $darsrawtextInsert = query_do($query); // Get the darsId. $query = " SELECT darsId FROM `dars` WHERE sessionId = ".$DARS['sessionId']." AND darsStudentId = '".query_safe($DARS['StudentId'])."' AND darsCredentialCode = '".query_safe($DARS['CredentialCode'])."' "; $darsResult = query_do($query); $darsResultCount = $_SESSION['qry']['count']; if ($darsResultCount == 1) { mysqli_data_seek($darsResult, 0); $darsRow = mysqli_fetch_assoc($darsResult); $f_darsId = $darsRow['darsId']; echo 'darsId = ',$f_darsId,". "; echo 'darsYRTR = ',$DARS['sessionYRTR'],". "; echo 'LastClassYRTR = ',$DARS['LastClassYRTR'],". "; echo 'LastRegisteredYRTR = ',$DARS['LastRegisteredYRTR'],".<br>\n"; if ( $darsDeleteMessage != '' ) echo '<span class="error">'.$darsDeleteMessage."</span><br>\n"; } else { $f_error = 'DARS data entered into table but not found. This is a program error.<span class=\"pv_fl\"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); ?> Enter another DARS Report.<br> <? include('Admin/Enrollment/EnterDARS/EnterDARSForm.phpinc'); include('common/pageFooter.phpinc'); } // INSERT 'TestScores'. for ($i=0; $i<count($DARS['PlacementTest']); $i++) { #printVar('$darsTestScoreKey',$darsTestScoreKey); #printVar('$darsTestScoreValue',$darsTestScoreValue); $query = " INSERT INTO `darsplacementtest` ( darsId, darsplacementtestName, darsplacementtestScore "; if ( $DARS['PlacementTest'][$i]['Date'] != '' ) { $query .= " ,darsplacementtestDate "; } $query .= " ) VALUES ( ".$f_darsId.", '".query_safe($DARS['PlacementTest'][$i]['Name'])."', ".$DARS['PlacementTest'][$i]['Score']." "; if ( $DARS['PlacementTest'][$i]['Date'] != '' ) { $query .= " ,'".$DARS['PlacementTest'][$i]['Date']."' "; } $query .= " ) "; $darstestscoreInsert = query_do($query); } // INSERT DARS section info. // Loop through the $DARS['Section']s. foreach ($DARS['Section'] as $darsSectionKey => $darsSectionValue) { #printVar('$darsSectionKey',$darsSectionKey); #printVar('$darsSectionValue',$darsSectionValue); if ( !isset($darsSectionValue['CreditsAdded']) || $darsSectionValue['CreditsAdded'] == "") $darsSectionValue['CreditsAdded'] = 0; if ( !isset($darsSectionValue['CreditsInProgress']) || $darsSectionValue['CreditsInProgress'] == "") $darsSectionValue['CreditsInProgress'] = 0; if ( !isset($darsSectionValue['CreditsNeeds']) || $darsSectionValue['CreditsNeeds'] == "") $darsSectionValue['CreditsNeeds'] = 0; if ( !isset($darsSectionValue['CreditsRequired']) || $darsSectionValue['CreditsRequired'] == "") $darsSectionValue['CreditsRequired'] = 0; if ( !isset($darsSectionValue['CreditsAdded']) || $darsSectionValue['CoursesAdded'] == "") $darsSectionValue['CoursesAdded'] = 0; if ( !isset($darsSectionValue['CoursesInProgress']) || $darsSectionValue['CoursesInProgress'] == "") $darsSectionValue['CoursesInProgress'] = 0; if ( !isset($darsSectionValue['CoursesNeeds']) || $darsSectionValue['CoursesNeeds'] == "") $darsSectionValue['CoursesNeeds'] = 0; if ( !isset($darsSectionValue['CoursesRequired']) || $darsSectionValue['CoursesRequired'] == "") $darsSectionValue['CoursesRequired'] = 0; $query = " INSERT INTO `darssection` ( darsId, darssectionTitle, darssectionStatus, darssectionCreditsAdded, darssectionCreditsInProgress, darssectionCreditsNeeds, darssectionCreditsRequired, darssectionCoursesAdded, darssectionCoursesInProgress, darssectionCoursesNeeds ) VALUES ( ".$f_darsId.", '".query_safe($darsSectionValue['Title'])."', '".query_safe($darsSectionValue['Status'])."', ".$darsSectionValue['CreditsAdded'].", ".$darsSectionValue['CreditsInProgress'].", ".$darsSectionValue['CreditsNeeds'].", ".$darsSectionValue['CreditsRequired'].", ".$darsSectionValue['CoursesAdded'].", ".$darsSectionValue['CoursesInProgress'].", ".$darsSectionValue['CoursesNeeds']." ) "; d_Var('darssectionInsert',$query,'q'); $darssectionInsert = query_do($query); // Get the f_darssectionId. $f_darssectionId = mysqli_insert_id($_SESSION['DATABASE_LINK']); d_Var('$f_darssectionId',$f_darssectionId,''); @d_Var("\$darsSectionValue['Class']",$darsSectionValue['Class'],''); if ( isset($darsSectionValue['Class']) ) { foreach ($darsSectionValue['Class'] as $classKey => $classValue) { #printVar('$classKey',$classKey); #printVar('$classValue',$classValue); if ($classValue['Credits'] == '') $classValue['Credits'] = 0; if ( !isset($classValue['DepartmentTaken']) ) $classValue['DepartmentTaken'] = ''; if ( !isset($classValue['NumberTaken']) ) $classValue['NumberTaken'] = ''; // INSERT class info. $query = " INSERT INTO `darssectionclass` ( darsId, darssectionId, darssectionclassSemester, darssectionclassYear, darssectionclassDept, darssectionclassNumb, darssectionclassCredits, darssectionclassGrade, darssectionclassLegend, darssectionclassTitle, darssectionclassComment, darssectionclassDepartmentTaken, darssectionclassNumberTaken ) VALUES ( ".$f_darsId.", ".$f_darssectionId.", '".query_safe($classValue['Semester'])."', '".query_safe($classValue['Year'])."', '".query_safe($classValue['Department'])."', '".query_safe($classValue['Number'])."', ".$classValue['Credits'].", '".query_safe($classValue['Grade'])."', '".query_safe($classValue['Legend'])."', '".query_safe($classValue['Title'])."', '".query_safe($classValue['Comment'])."', '".query_safe($classValue['DepartmentTaken'])."', '".query_safe($classValue['NumberTaken'])."' ) "; d_Var('darssectionclassInsert',$query,'q'); $darssectionclassInsert = query_do($query); d_Var('$darssectionclassInsert',$darssectionclassInsert,''); } } if ( isset($darsSectionValue['SelectFrom']) ) { foreach ($darsSectionValue['SelectFrom'] as $selectFromKey => $selectFromValue) { #printVar('$selectFromKey',$selectFromKey); #printVar('$selectFromValue',$selectFromValue); if ( isset($selectFromValue['Dept']) ) { // INSERT select from info. if (!isset($selectFromValue['orDept'])) $selectFromValue['orDept'] = ''; if (!isset($selectFromValue['orNumb'])) $selectFromValue['orNumb'] = ''; if ( strlen($selectFromValue['orNumb']) > 4 ) $selectFromValue['orNumb'] = substr($selectFromValue['orNumb'],0,4); $query = " INSERT INTO `darssectionselectfrom` ( darsId, darssectionId, darssectionselectfromDept, darssectionselectfromNumb, darssectionselectfromOrDept, darssectionselectfromOrNumb ) VALUES ( ".$f_darsId.", ".$f_darssectionId.", '".query_safe($selectFromValue['Dept'])."', '".query_safe($selectFromValue['Numb'])."', '".query_safe($selectFromValue['orDept'])."', '".query_safe($selectFromValue['orNumb'])."' ) "; d_Var('darssectionselectfromInsert',$query,'q'); $darssectionselectfromInsert = query_do($query); d_Var('$darssectionselectfromInsert',$darssectionselectfromInsert,''); } } } } d_Var('$DARS',$DARS,'d'); ?> <br> Enter another DARS Report.<br> <? include('Admin/Enrollment/EnterDARS/EnterDARSForm.phpinc'); include('common/pageFooter.phpinc'); } else { $f_error = 'No session was found for DARS Date Prepared: '.$DARS['DatePrepared'].'.<span class=\"pv_fl\"> '.basename(__FILE__).':'.__LINE__.'</span>'; include('common/displayErrorsAndMessages.phpinc'); printVar('$DARS',$DARS); } echo "<br>\n"; #printVar('$DARS',$DARS); #exit; ?>