$TotSBook"; } $query = "select Count(ID) from Teacher"; $result = mysql_db_query($db,$query ,$connection); while ($r = mysql_fetch_array($result)) { $NumTeacher= $r["Count(ID)"]; } $query="select MaxStudents from Course where Code='$CourseCode'"; $result = mysql_db_query($db,$query ,$connection); while ($r = mysql_fetch_array($result)) { $MaxSStu= $r["MaxStudents"]; } $TotSStuAccomodable=$MaxSStu * $NumTeacher; if ($TotSBook<$TotSStuAccomodable){ //space avail $NoSSpace="False"; $TotSBook=$TotSBook+1; $query8="Update CourseAvailability set Booking='$TotSBook' where Date='$StartDate1' and CourseCode='$CourseCode'"; $result8 = mysql_db_query($db,$query8 ,$connection); }else{ $NoSSpace="True"; do{ $SAD=explode("-",$StartDate1); $SAD2=mktime(0,0,0,$SAD[1],$SAD[2],$SAD[0]); $SArrivalDate2 = DateAdd ("d" ,-1,$SAD2); $StartDate1=strftime ("%Y-%m-%d" ,$SArrivalDate2); $query2="Select Booking from CourseAvailability where CourseCode='$CourseCode' and Date='$StartDate1'"; $result2 = mysql_db_query($db,$query2 ,$connection); while ($r = mysql_fetch_array($result2)) { $TotSBook= $r["Booking"]; } $TotSBook=$TotSBook-1; $query8="Update CourseAvailability set Booking='$TotSBook' where Date='$StartDate1' and CourseCode='$CourseCode'"; $result8 = mysql_db_query($db,$query8 ,$connection); }while($StartDate1>$StartDate); Echo "no space"; exit; //no space } }else{ $query2="Insert into CourseAvailability values('$CourseCode','$StartDate1',1)"; $result3 = mysql_db_query($db,$query2 ,$connection); $TotSBook=0 ; } $SAD=explode("-",$StartDate1); $SAD2=mktime(0,0,0,$SAD[1],$SAD[2],$SAD[0]); $SArrivalDate2 = DateAdd ("d" ,1,$SAD2); $StartDate1=strftime ("%Y-%m-%d" ,$SArrivalDate2); }while($StartDate1<=$SDepartDate); $connection = mysql_connect($server, $user, $pass); $query = "SELECT BookingID FROM IndividualBooking WHERE StudentID ='$StudentID'"; $result = mysql_db_query($db,$query ,$connection); while ($r= mysql_fetch_object($result)) { $BookingID=$r->BookingID; } $query9="Select Name,Rate from Course where Code='$CourseCode'"; $result9 = mysql_db_query($db,$query9 ,$connection); while ($r9= mysql_fetch_array($result9)) { $Rate= $r9["Rate"]; $CourseName=$r9["Name"]; } $query2="Insert into IndividualCourseBooking values('$BookingID','$StudentID', '$CourseCode','$StartDate','$SDepartDate','$Rate','$DurationID')"; $result2 = mysql_db_query($db,$query2 ,$connection); $Total=$Rate*$DurationID; ?>
Course Booking
   
Additional Course:
Additional Course Rate per Week:
Start Date:
Weeks:
   
Total Additional Course Fee:

A confirmation of your booking will be sent once you have paid the fees into the CCC' s account.

Please note that payment must be recieved 2 weeks before you start the course.

Account Name:
Bank Name:
Account Number:
Branch Code:
Swift Code: