mirror of https://github.com/itflow-org/itflow
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:
parent
20a24b6ec6
commit
978c7c5db4
|
|
@ -9,6 +9,7 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
|
|
|
|||
|
|
@ -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"]);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@ $phone = preg_replace("/[^0-9]/", '',$_POST['phone']);
|
|||
$hours = sanitizeInput($_POST['hours']);
|
||||
$notes = sanitizeInput($_POST['notes']);
|
||||
$contact = intval($_POST['contact']);
|
||||
$location_primary = intval($_POST['location_primary']);
|
||||
$location_primary = intval($_POST['location_primary'] ?? 0);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="billable" value="0">
|
||||
<input type="hidden" name="use_primary_contact" value="0">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<?php if (isset($_GET['client_id'])) { ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue