mirror of
https://github.com/itflow-org/itflow
synced 2026-09-10 00:35:12 +00:00
Css fixes
This commit is contained in:
277
agent/trips.php
277
agent/trips.php
@@ -33,8 +33,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-route me-2"></i>Trips</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
@@ -52,12 +52,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="card-header py-3">
|
||||
<form autocomplete="off">
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(escapeHtml($q)); } ?>" placeholder="Search Trips">
|
||||
@@ -70,11 +70,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if (isset($_GET['dtf']) && $_GET['dtf'] !== '1970-01-01') { echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="collapse mt-3 <?php if (isset($_GET['dtf']) && $_GET['dtf'] !== '1970-01-01') { echo"show"; } ?>" id="advancedFilter">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<label>Date range</label>
|
||||
<div>
|
||||
<label class="form-label">Date range</label>
|
||||
<input type="text" id="dateFilter" class="form-control" autocomplete="off">
|
||||
<input type="hidden" name="canned_date" id="canned_date" value="<?= escapeHtml($_GET['canned_date']) ?? '' ?>">
|
||||
<input type="hidden" name="dtf" id="dtf" value="<?= escapeHtml($dtf ?? '') ?>">
|
||||
@@ -84,137 +84,136 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_date&order=<?= $disp ?>">
|
||||
Date <?php if ($sort == 'trip_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=user_name&order=<?= $disp ?>">
|
||||
Driver <?php if ($sort == 'user_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_purpose&order=<?= $disp ?>">
|
||||
Purpose <?php if ($sort == 'trip_purpose') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_source&order=<?= $disp ?>">
|
||||
Source <?php if ($sort == 'trip_source') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_destination&order=<?= $disp ?>">
|
||||
Destination <?php if ($sort == 'trip_destination') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_miles&order=<?= $disp ?>">
|
||||
Miles <?php if ($sort == 'trip_miles') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$trip_id = intval($row['trip_id']);
|
||||
$trip_date = escapeHtml($row['trip_date']);
|
||||
$trip_purpose = escapeHtml($row['trip_purpose']);
|
||||
$trip_source = escapeHtml($row['trip_source']);
|
||||
$trip_destination = escapeHtml($row['trip_destination']);
|
||||
$trip_miles = number_format(floatval($row['trip_miles']),1);
|
||||
$trip_user_id = intval($row['trip_user_id']);
|
||||
$trip_created_at = escapeHtml($row['trip_created_at']);
|
||||
$trip_archived_at = escapeHtml($row['trip_archived_at']);
|
||||
$round_trip = escapeHtml($row['round_trip']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = escapeHtml($row['client_name']);
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
} else {
|
||||
$client_name_display = "<a href='trips.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
if ($round_trip == 1) {
|
||||
$round_trip_display = "<i class='fa fa-fw fa-sync-alt text-secondary'></i>";
|
||||
} else {
|
||||
$round_trip_display = "";
|
||||
}
|
||||
$user_name = escapeHtml($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="text-dark ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_edit.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<?= $trip_date ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?= $user_name_display ?></td>
|
||||
<td><?= $trip_purpose ?></td>
|
||||
<td><?= $trip_source ?></td>
|
||||
<td><?= $trip_destination ?></td>
|
||||
<td><?= "<span class='text-end font-monospace'>$trip_miles</span> $round_trip_display" ?></td>
|
||||
<?php if (!$client_url) { ?>
|
||||
<td><?= $client_name_display ?></td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<div class="dropdown dropstart text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-bs-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="//maps.google.com?q=<?= $trip_source ?> to <?= $trip_destination ?>" target="_blank">
|
||||
<i class="fa fa-fw fa-map-marker-alt me-2"></i>Map it<i class="fa fa-fw fa-external-link-alt ms-2"></i>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_edit.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<i class="fa fa-fw fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
<a class="dropdown-item ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_copy.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<i class="fa fa-fw fa-copy me-2"></i>Copy
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_trip=<?= $trip_id ?>&csrf_token=<?= $_SESSION['csrf_token'] ?>">
|
||||
<i class="fa fa-fw fa-trash me-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once "../includes/filter_footer.php";
|
||||
?>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover mb-0">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_date&order=<?= $disp ?>">
|
||||
Date <?php if ($sort == 'trip_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=user_name&order=<?= $disp ?>">
|
||||
Driver <?php if ($sort == 'user_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_purpose&order=<?= $disp ?>">
|
||||
Purpose <?php if ($sort == 'trip_purpose') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_source&order=<?= $disp ?>">
|
||||
Source <?php if ($sort == 'trip_source') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_destination&order=<?= $disp ?>">
|
||||
Destination <?php if ($sort == 'trip_destination') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=trip_miles&order=<?= $disp ?>">
|
||||
Miles <?php if ($sort == 'trip_miles') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$trip_id = intval($row['trip_id']);
|
||||
$trip_date = escapeHtml($row['trip_date']);
|
||||
$trip_purpose = escapeHtml($row['trip_purpose']);
|
||||
$trip_source = escapeHtml($row['trip_source']);
|
||||
$trip_destination = escapeHtml($row['trip_destination']);
|
||||
$trip_miles = number_format(floatval($row['trip_miles']),1);
|
||||
$trip_user_id = intval($row['trip_user_id']);
|
||||
$trip_created_at = escapeHtml($row['trip_created_at']);
|
||||
$trip_archived_at = escapeHtml($row['trip_archived_at']);
|
||||
$round_trip = escapeHtml($row['round_trip']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = escapeHtml($row['client_name']);
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
} else {
|
||||
$client_name_display = "<a href='trips.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
if ($round_trip == 1) {
|
||||
$round_trip_display = "<i class='fa fa-fw fa-sync-alt text-secondary'></i>";
|
||||
} else {
|
||||
$round_trip_display = "";
|
||||
}
|
||||
$user_name = escapeHtml($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="text-dark ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_edit.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<?= $trip_date ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?= $user_name_display ?></td>
|
||||
<td><?= $trip_purpose ?></td>
|
||||
<td><?= $trip_source ?></td>
|
||||
<td><?= $trip_destination ?></td>
|
||||
<td><?= "<span class='text-end font-monospace'>$trip_miles</span> $round_trip_display" ?></td>
|
||||
<?php if (!$client_url) { ?>
|
||||
<td><?= $client_name_display ?></td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<div class="dropdown dropstart text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-bs-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="//maps.google.com?q=<?= $trip_source ?> to <?= $trip_destination ?>" target="_blank">
|
||||
<i class="fa fa-fw fa-map-marker-alt me-2"></i>Map it<i class="fa fa-fw fa-external-link-alt ms-2"></i>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_edit.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<i class="fa fa-fw fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
<a class="dropdown-item ajax-modal" href="#"
|
||||
data-modal-url="modals/trip/trip_copy.php?<?= $client_url ?>&id=<?= $trip_id ?>">
|
||||
<i class="fa fa-fw fa-copy me-2"></i>Copy
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_trip=<?= $trip_id ?>&csrf_token=<?= $_SESSION['csrf_token'] ?>">
|
||||
<i class="fa fa-fw fa-trash me-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once "../includes/filter_footer.php";
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user