/home/techb158/workloadmatch.com/Manager/Inc
Edit: /home/techb158/workloadmatch.com/Manager/Inc/Update_Course.php (2717B)
prepare("SELECT * FROM master_profile Where Master_ID = ?");
$stmts->bind_param('s', $user_n);
$stmts->execute();
$results = $stmts->get_result();
$rows = $results->fetch_assoc();
$stmts->close();
$Admin_ID = $rows['Admin_ID'];
$Master_ID = $rows['Master_ID'];
$Manager_ID = 0;
$Manager_ID_Profile = 0;
} else {
$stmts = $mysqli->prepare("SELECT * FROM manager_profile Where Manager_ID = ?");
$stmts->bind_param('s', $user_n);
$stmts->execute();
$results = $stmts->get_result();
$rows = $results->fetch_assoc();
$stmts->close();
$Admin_ID = $rows['Admin_ID'];
$Master_ID = $rows['Master_ID'];
$Manager_ID = $rows['Manager_ID'];
$Manager_ID_Profile = $rows['Manager_ID'];
}
$datetime =date("Y/m/d") . ' ' . date('H:i:s') ;
//header('Location: addgroup.php?error='.$mysqli->error);
//header('Location: addgroup.php?error='.$Link_ID.'');
//exit();
$prep_stmt = "SELECT Course_ID FROM Courses WHERE Course_ID = ? LIMIT 1";
$stmt = $mysqli->prepare($prep_stmt);
if ($stmt) {
// echo $_POST['G_ID'];
$stmt->bind_param('s', $Course_ID);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows == 1) {
// A user with this email address already exists
//$error_msg .= '
A user with this user name already exists.
';
$stmt = $mysqli->prepare("UPDATE Courses SET Course_Name=?, Course_Code=?, Course_Time=? WHERE Course_ID=?");
$stmt->bind_param('ssss', $Course_Name, $Course_Code, $Course_Time, $Course_ID);
if (!$stmt->execute()) {
//header('Location: addcourse.php?error=Course update failure!');
echo $mysqli->error;
exit();
}else{
set_flash_msg('Course update successfully. Thanks!', 'success');
header('Location: addcourse.php');
exit();
}
}
} else {
//$error_msg .= '
Database error
';
}
}else{
set_flash_msg('all information are required!', 'warning');
header('Location: addcourse.php');
exit();
}
}