Add basic ticket search - would need further work to search by a ticket ID with a prefix. Possibly encourage a default prefix so we can filter that out?
This commit is contained in:
+48
-5
@@ -10,13 +10,14 @@ if(isset($_GET['query'])){
|
|||||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY vendor_id DESC LIMIT 5");
|
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY vendor_id DESC LIMIT 5");
|
||||||
$sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY product_id DESC LIMIT 5");
|
$sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY product_id DESC LIMIT 5");
|
||||||
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY login_id DESC LIMIT 5");
|
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY login_id DESC LIMIT 5");
|
||||||
|
$sql_tickets = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients on tickets.ticket_client_id = clients.client_id WHERE (ticket_subject LIKE '%$query%' OR ticket_number = '$query') AND tickets.company_id = $session_company_id ORDER BY ticket_id DESC LIMIT 5");
|
||||||
|
|
||||||
$q = htmlentities($_GET['query']);
|
$q = htmlentities($_GET['query']);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3><i class="fa fa-search"></i> Welcome to Global Search...</h3>
|
<h3><i class="fa fa-search"></i> Welcome to Global Search...</h3>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<!-- Clients-->
|
<!-- Clients-->
|
||||||
|
|
||||||
@@ -182,7 +183,49 @@ if(isset($_GET['query'])){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<!-- Tickets -->
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
<h6 class="mt-1"><i class="fa fa-tags"></i> Tickets</h6>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-striped table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Client</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
while($row = mysqli_fetch_array($sql_tickets)){
|
||||||
|
$ticket_id = $row['ticket_id'];
|
||||||
|
$ticket_subject = $row['ticket_subject'];
|
||||||
|
$ticket_client = $row['client_name'];
|
||||||
|
$ticket_status = $row['ticket_status'];
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id ?>"><?php echo $ticket_subject; ?></a></td>
|
||||||
|
<td><?php echo $ticket_client; ?></td>
|
||||||
|
<td><?php echo $ticket_status; ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user