mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Switched location to use ?? 0 in post for checkbox items that are not checked, this save from creating an extra hidden form field hence cleaner code
This commit is contained in:
@@ -47,17 +47,13 @@ if(isset($_POST['add_location'])){
|
||||
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_photo = '$new_file_name' WHERE location_id = $location_id");
|
||||
|
||||
$_SESSION['alert_message'] = 'File successfully uploaded.';
|
||||
}else{
|
||||
|
||||
$_SESSION['alert_message'] = 'There was an error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
|
||||
}
|
||||
}
|
||||
|
||||
// Logging
|
||||
logAction("Location", "Create", "$session_name created location $name", $client_id, $location_id);
|
||||
|
||||
$_SESSION['alert_message'] .= "Location <strong>$name</strong> created.";
|
||||
$_SESSION['alert_message'] = "Location <strong>$name</strong> created.";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
@@ -120,17 +116,13 @@ if(isset($_POST['edit_location'])){
|
||||
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_photo = '$new_file_name' WHERE location_id = $location_id");
|
||||
|
||||
$_SESSION['alert_message'] = 'File successfully uploaded.';
|
||||
}else{
|
||||
|
||||
$_SESSION['alert_message'] = 'There was an error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
|
||||
}
|
||||
}
|
||||
|
||||
// Logging
|
||||
logAction("Location", "Edit", "$session_name edited location $name", $client_id, $location_id);
|
||||
|
||||
$_SESSION['alert_message'] .= "Location <strong>$name</strong> updated";
|
||||
$_SESSION['alert_message'] = "Location <strong>$name</strong> updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user