Project - Allow editing client after creation
This commit is contained in:
@@ -85,6 +85,25 @@ ob_start();
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Client</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client_id">
|
||||||
|
<option value="0">- No Client -</option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$select_client_id = intval($row['client_id']);
|
||||||
|
$select_client_name = nullable_htmlentities($row['client_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $select_client_id; ?>" <?php if ($client_id == $select_client_id) { echo "selected"; } ?>><?php echo $select_client_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-footer bg-white">
|
||||||
<button type="submit" name="edit_project" class="btn btn-primary text-bold">
|
<button type="submit" name="edit_project" class="btn btn-primary text-bold">
|
||||||
|
|||||||
@@ -88,25 +88,25 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (empty($_GET['client_id'])) { ?>
|
<?php if (empty($_GET['client_id'])) { ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client</label>
|
<label>Client</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="client_id">
|
||||||
|
<option value="0">- No Client -</option>
|
||||||
|
<?php
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
|
$client_id = intval($row['client_id']);
|
||||||
|
$client_name = nullable_htmlentities($row['client_name']);
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="client_id">
|
|
||||||
<option vlaue="0">- No Client -</option>
|
|
||||||
<?php
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
|
||||||
$client_id = intval($row['client_id']);
|
|
||||||
$client_name = nullable_htmlentities($row['client_name']);
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ if (isset($_POST['edit_project'])) {
|
|||||||
$project_manager = intval($_POST['project_manager']);
|
$project_manager = intval($_POST['project_manager']);
|
||||||
$client_id = intval($_POST['client_id']);
|
$client_id = intval($_POST['client_id']);
|
||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE projects SET project_name = '$project_name', project_description = '$project_description', project_due = '$due_date', project_manager = $project_manager WHERE project_id = $project_id");
|
mysqli_query($mysqli, "UPDATE projects SET project_name = '$project_name', project_description = '$project_description', project_due = '$due_date', project_manager = $project_manager, project_client_id = $client_id WHERE project_id = $project_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Project", "Edit", "$session_name edited project $project_name", $client_id, $project_id);
|
logAction("Project", "Edit", "$session_name edited project $project_name", $client_id, $project_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user