mirror of https://github.com/itflow-org/itflow
More work on Client Overview added Domains Expiring, Asset Warranty Expiring, Stale Tickets
This commit is contained in:
parent
5f883b608b
commit
d2d574f97e
|
|
@ -2,13 +2,37 @@
|
|||
|
||||
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departments ON contact_department_id = department_id WHERE contact_client_id = $client_id AND contacts.company_id = $session_company_id ORDER BY contact_updated_at DESC LIMIT 5");
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE (vendor_name LIKE '%$query%' OR vendor_phone LIKE '%$phone_query%') AND company_id = $session_company_id ORDER BY vendor_id DESC LIMIT 5");
|
||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id AND company_id = $session_company_id ORDER BY vendor_updated_at DESC LIMIT 5");
|
||||
|
||||
$sql_documents = mysqli_query($mysqli, "SELECT * FROM documents LEFT JOIN clients on document_client_id = clients.client_id WHERE document_name LIKE '%$query%' AND documents.company_id = $session_company_id ORDER BY document_id DESC LIMIT 5");
|
||||
$sql_documents = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_client_id = $client_id AND documents.company_id = $session_company_id ORDER BY document_updated_at 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");
|
||||
$sql_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_client_id = $client_id AND tickets.company_id = $session_company_id ORDER BY ticket_updated_at DESC LIMIT 5");
|
||||
|
||||
$sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE (login_name LIKE '%$query%' OR login_username 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_client_id = $client_id AND company_id = $session_company_id ORDER BY login_updated_at DESC LIMIT 5");
|
||||
|
||||
// Expiring Items
|
||||
|
||||
// Get Domains Expiring
|
||||
$sql_domains_expiring = mysqli_query($mysqli,"SELECT * FROM domains
|
||||
WHERE domain_client_id = $client_id
|
||||
AND domain_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||
AND company_id = $session_company_id ORDER BY domain_expire DESC"
|
||||
);
|
||||
|
||||
// Get Asset Warranties Expiring
|
||||
$sql_asset_warranties_expiring = mysqli_query($mysqli,"SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_warranty_expire < CURRENT_DATE + INTERVAL 90 DAY
|
||||
AND company_id = $session_company_id ORDER BY asset_warranty_expire DESC"
|
||||
);
|
||||
|
||||
// Get Stale Tickets
|
||||
$sql_tickets_stale = mysqli_query($mysqli,"SELECT * FROM tickets
|
||||
WHERE ticket_client_id = $client_id
|
||||
AND ticket_created_at < CURRENT_DATE + INTERVAL 14 DAY
|
||||
AND ticket_status = 'Open'
|
||||
AND company_id = $session_company_id ORDER BY ticket_created_at DESC"
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -21,20 +45,11 @@ $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE (login_name LIKE
|
|||
<!-- Contacts-->
|
||||
|
||||
<div class="col-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6><i class="fa fa-users"></i> Recent Contacts</h6>
|
||||
</div>
|
||||
|
||||
<div class="card card-outline card-primary mb-3">
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Cell</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<h5 class="card-title mb-2"><i class="fa fa-users"></i> Recent Contacts</h5>
|
||||
<table class="table table-borderless table-sm">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
|
|
@ -56,8 +71,118 @@ $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE (login_name LIKE
|
|||
<br><small class="text-secondary"><?php echo $contact_title; ?></small>
|
||||
</td>
|
||||
<td><?php echo $contact_email; ?></td>
|
||||
<td><?php echo "$contact_phone $contact_extension"; ?></td>
|
||||
<td><?php echo $contact_mobile; ?></td>
|
||||
<td><?php echo "$contact_phone $contact_extension"; ?><br><?php echo $contact_mobile; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(mysqli_num_rows($sql_contacts) > 0){ ?>
|
||||
|
||||
<!-- Domains Expiring-->
|
||||
|
||||
<div class="col-3">
|
||||
|
||||
<div class="card card-outline card-danger mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-2"><i class="fa fa-globe"></i> Domains Expiring Soon <small class="text-secondary">(30d)</small></h5>
|
||||
<table class="table table-borderless table-sm">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_domains_expiring)){
|
||||
$domain_id = $row['domain_id'];
|
||||
$domain_name = $row['domain_name'];
|
||||
$domain_expire = $row['domain_expire'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $domain_name; ?></td>
|
||||
<td class="text-danger"><?php echo $domain_expire; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(mysqli_num_rows($sql_asset_warranties_expiring) > 0){ ?>
|
||||
|
||||
<!-- Asset Warrenties Expiring-->
|
||||
|
||||
<div class="col-3">
|
||||
|
||||
<div class="card card-outline card-danger mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-2"><i class="fa fa-laptop"></i> Asset Warranties Expiring Soon <small class="text-secondary">(90d)</small></h5>
|
||||
<table class="table table-borderless table-sm">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_asset_warranties_expiring)){
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_name = $row['asset_name'];
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $asset_name; ?></td>
|
||||
<td class="text-danger"><?php echo $asset_warranty_expire; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(mysqli_num_rows($sql_tickets_stale) > 0){ ?>
|
||||
|
||||
<!-- Stale Tickets -->
|
||||
|
||||
<div class="col-5">
|
||||
|
||||
<div class="card card-outline card-danger mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-2"><i class="fa fa-ticket-alt"></i> Stale Tickets <small class="text-secondary">(14d)</small></h5>
|
||||
<table class="table table-borderless table-sm">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_tickets_stale)){
|
||||
$ticket_id = $row['ticket_id'];
|
||||
$ticket_prefix = $row['ticket_prefix'];
|
||||
$ticket_number = $row['ticket_number'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "$ticket_prefix$ticket_number"; ?></td>
|
||||
<td><?php echo $ticket_subject; ?></td>
|
||||
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue