if(!(isset($crsid))){ if(file_exists("$INC_PATH/instSt.php")) include "$INC_PATH/instSt.php"; die("Please select a course listed in the Results Files: section."); } if(!(isset($instr))){ if(file_exists("$INC_PATH/st.php")) include "$INC_PATH/st.php"; } if($button == "Send"){ $foundIt = ''; $email = ''; $file = "$INS_PATH/$instr/$crsid"; $ip = $REMOTE_ADDR; $email = "WCTReq From: $login $ip \n"; $email = $email . "WCTReq Course: $crsid\n"; $email = $email . "WCTID: $wctid\n"; $countRec = 0; if(!($fp = fopen($file, "r"))) die("Unable to open the input file."); while (!feof($fp)) { $buffer = fgets($fp, 30000); $socNum = substr($buffer,32,11); $pos1 = strpos($socNum,"-"); $pos2 = strrpos($socNum,"-"); if(($pos1 == 3) && ($pos2 == 6)) { $foundIt = "yes"; } if($foundIt == "yes"){ if(($pos1 == 3) & ($pos2 == 6)){ $countRec++; $soc1 = substr($buffer,32,3); $soc2 = substr($buffer,36,2); $soc3 = substr($buffer,39,4); $score = trim(substr($buffer,45,18)); $emaili = $emaili . $soc1. $soc2 . $soc3 . "," . $score. "\n"; } else { $foundIt = ''; } } } fclose($fp); mail("bogus@here.com","WebCT Import Request $crsid","$email$emaili", "FROM: Charlie Root<\$bogus@abuse.com\r\n"); if(file_exists("$INC_PATH/instSt.php")) include "$INC_PATH/instSt.php"; die("WebCT Email request for $countRec records processed."); } ?>