Internal Error - couldn't open temp file $inFileName "); } $outFp = fopen ($outFileName,"w"); if($outFp == 0) { die("

Internal Error - couldn't open temp file $outFileName

"); } $splitEL = 1; while ($data = fgetcsv ($inFp, 1000, ",")) { //NameL, NameF, Club, SI, Rented, Start Block/Start time, class, course, IOA ID, Entry Form Number $NameL = $data[3]; $NameF = $data[4]; $Club = $data[15]; $SI = $data[1]; $Rented = $data[35]; if(strcasecmp($Rented, "X") == 0) $Rented = "Y"; $Start = $data[7]; $Split = $data[25]; $form = $data[20]; if(strcasecmp($Split, "Split") == 0) { if($Start == 2) { $Start = "Early Split"; $splitEL = 0; } else if($Start == 4) { $Start = "Late Split"; $splitEL = 1; } else { if($splitEL == 1) { $Start = "Early Split"; $splitEL = 0; } else { $Start = "Late Split"; $splitEL = 1; } } } else { if($Start == 2) $Start = "Early"; else if($Start == 3) $Start = "Middle"; else if($Start == 4) $Start = "Late"; } $Class = $data[18]; $Course = ""; $stringData = "\"$NameL\",\"$NameF\",\"$Club\",$SI,$Rented,$Start,$Class,$Course,,$form\n"; fwrite($outFp, $stringData); } fclose ($inFp); fclose ($outFp); ?>