I want to modify this code into pop up alert. Currently, this code only produce error message. I want to modify it so when course clashed, the pop up will appear
if($clash_courses==1)
{
$error_msg .= 'Course ';
$c = 0;
foreach($course_id as $id){
$c++;
$error_msg .= $id;
if($c<count($course_id))
$error_msg .= ' and ';
}
$error_msg .= ' have clashed.';
}
Not the cleanest solution, but it should work. Another solution would be to access this script via AJAX, which can then feed the error back to the client-side as an ‘error object’ or even just a simple message that the client can then
alert.