mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Simplified Client URL Handling in global client header logic
This commit is contained in:
14
trips.php
14
trips.php
@@ -8,9 +8,11 @@ $order = "DESC";
|
||||
if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND trip_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
} else {
|
||||
require_once "includes/inc_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
@@ -50,7 +52,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<?php if(isset($_GET['client_id'])) { ?>
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
@@ -111,7 +113,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
Date <?php if ($sort == 'trip_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (!isset($_GET['client_id'])) { ?>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
@@ -184,13 +186,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<td>
|
||||
<a class="text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_trip_edit.php<?php if (isset($_GET['client_id'])) { echo "?client_id=$client_id "; } ?>"
|
||||
data-ajax-url="ajax/ajax_trip_edit.php?<?php echo $client_url; ?>"
|
||||
data-ajax-id="<?php echo $trip_id; ?>"
|
||||
>
|
||||
<?php echo $trip_date; ?>
|
||||
</a>
|
||||
</td>
|
||||
<?php if (!isset($_GET['client_id'])) { ?>
|
||||
<?php if (!$client_url) { ?>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
<?php } ?>
|
||||
<td><?php echo $user_name_display; ?></td>
|
||||
@@ -210,14 +212,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_trip_edit.php<?php if (isset($_GET['client_id'])) { echo "?client_id=$client_id "; } ?>"
|
||||
data-ajax-url="ajax/ajax_trip_edit.php?<?php echo $client_url; ?>"
|
||||
data-ajax-id="<?php echo $trip_id; ?>"
|
||||
>
|
||||
<i class="fa fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_trip_copy.php<?php if (isset($_GET['client_id'])) { echo "?client_id=$client_id "; } ?>"
|
||||
data-ajax-url="ajax/ajax_trip_copy.php?<?php echo $client_url; ?>"
|
||||
data-ajax-id="<?php echo $trip_id; ?>"
|
||||
>
|
||||
<i class="fa fa-fw fa-copy mr-2"></i>Copy
|
||||
|
||||
Reference in New Issue
Block a user