No Need for if conditions on a blank due date as it is required

This commit is contained in:
johnnyq 2024-04-01 16:49:08 -04:00
parent cf71a58526
commit 365cd79999
3 changed files with 4 additions and 14 deletions

View File

@ -26,11 +26,6 @@ if (isset($_GET['project_id'])) {
$project_name = nullable_htmlentities($row['project_name']);
$project_description = nullable_htmlentities($row['project_description']);
$project_due = nullable_htmlentities($row['project_due']);
if ($project_due) {
$project_due_display = "<small class='text-secondary'><i class='fa fa-fw fa-clock mr-2'></i>$project_due</small>";
} else {
$project_due_display = "<small class='text-secondary'><i class='fa fa-fw fa-clock mr-2'></i>No Date Set</small>";
}
$project_created_at = date("Y-m-d", strtotime($row['project_created_at']));
$project_updated_at = nullable_htmlentities($row['project_updated_at']);
@ -103,7 +98,7 @@ if (isset($_GET['project_id'])) {
<i class="fa fa-fw fa-2x fa-user text-secondary mr-3"></i>
<div class="media-body">
<h3 class="mb-0"><?php echo $client_name; ?></h3>
<div><?php echo $project_due_display; ?></div>
<div><small class='text-secondary'><i class='fa fa-fw fa-clock mr-2'></i><?php echo $project_due; ?></small></div>
</div>
</div>
</div>

View File

@ -33,12 +33,12 @@
</div>
<div class="form-group">
<label>Date Due</label>
<label>Date Due <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="due_date" value="<?php echo $project_due; ?>">
<input type="date" class="form-control" name="due_date" value="<?php echo $project_due; ?>" required>
</div>
</div>

View File

@ -99,11 +99,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$project_name = nullable_htmlentities($row['project_name']);
$project_description = nullable_htmlentities($row['project_description']);
$project_due = nullable_htmlentities($row['project_due']);
if ($project_due) {
$project_due_display = $project_due;
} else {
$project_due_display = "-";
}
$project_created_at = date("Y-m-d", strtotime($row['project_created_at']));
$project_updated_at = nullable_htmlentities($row['project_updated_at']);
@ -174,7 +169,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
</div>
<?php } ?>
</td>
<td><?php echo $project_due_display; ?></td>
<td><?php echo $project_due; ?></td>
<td>
<a href="client_tickets.php?client_id=<?php echo $client_id; ?>">
<?php echo $client_name; ?>