mirror of
https://github.com/itflow-org/itflow
synced 2026-03-26 07:15:37 +00:00
Updated Client Overview UI and logic a bit
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contacts.company_id = $session_company_id ORDER BY contact_updated_at DESC LIMIT 5");
|
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contacts.company_id = $session_company_id ORDER BY contact_updated_at, contact_created_at DESC LIMIT 5");
|
||||||
|
|
||||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL AND company_id = $session_company_id ORDER BY vendor_updated_at DESC LIMIT 5");
|
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL AND company_id = $session_company_id ORDER BY vendor_updated_at DESC LIMIT 5");
|
||||||
|
|
||||||
@@ -51,207 +51,164 @@ $sql_tickets_stale = mysqli_query($mysqli,"SELECT * FROM tickets
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<?php if(mysqli_num_rows($sql_contacts) > 0){ ?>
|
<!-- Notes -->
|
||||||
|
|
||||||
<!-- Notes -->
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="col-4">
|
<div class="card card-outline card-primary mb-3">
|
||||||
|
<div class="card-body">
|
||||||
<div class="card card-outline card-primary mb-3">
|
<textarea class="form-control" rows=5 id="clientNotes" placeholder="Enter client notes here" onblur="updateClientNotes(<?php echo $client_id ?>)"><?php echo $client_notes ?></textarea>
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title mb-2"><i class="fa fa-sticky-note"></i> Client Notes</h5>
|
|
||||||
<textarea class="form-control" rows=8 id="clientNotes" onblur="updateClientNotes(<?php echo $client_id ?>)"><?php echo $client_notes ?></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Contacts-->
|
|
||||||
|
|
||||||
<div class="col-6">
|
|
||||||
|
|
||||||
<div class="card card-outline card-primary mb-3">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title mb-2"><i class="fa fa-users"></i> Recent Contacts</h5>
|
|
||||||
<table class="table table-borderless table-sm">
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_contacts)){
|
|
||||||
$contact_id = $row['contact_id'];
|
|
||||||
$contact_name = $row['contact_name'];
|
|
||||||
$contact_title = $row['contact_title'];
|
|
||||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
|
||||||
$contact_extension = $row['contact_extension'];
|
|
||||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
|
||||||
$contact_email = $row['contact_email'];
|
|
||||||
$contact_department = $row['contact_department'];
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=contacts"><?php echo $contact_name; ?></a>
|
|
||||||
<br><small class="text-secondary"><?php echo $contact_title; ?></small>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $contact_email; ?></td>
|
|
||||||
<td><?php echo "$contact_phone $contact_extension"; ?><br><?php echo $contact_mobile; ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
</div>
|
||||||
|
|
||||||
<?php if(mysqli_num_rows($sql_domains_expiring) > 0){ ?>
|
<div class="col-3">
|
||||||
|
|
||||||
<!-- Domains Expiring -->
|
<div class="card card-outline card-primary mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title"><i class="fa fa-history"></i> Recently Updated</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="col-4">
|
<?php
|
||||||
|
|
||||||
<div class="card card-outline card-danger mb-3">
|
while($row = mysqli_fetch_array($sql_contacts)){
|
||||||
<div class="card-body">
|
$contact_id = $row['contact_id'];
|
||||||
<h5 class="card-title mb-2"><i class="fa fa-globe"></i> Domains Expiring Soon <small class="text-secondary">(30d)</small></h5>
|
$contact_name = $row['contact_name'];
|
||||||
<table class="table table-borderless table-sm">
|
$contact_updated_at = $row['contact_updated_at'];
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_domains_expiring)){
|
?>
|
||||||
$domain_id = $row['domain_id'];
|
<p class="mb-1">
|
||||||
$domain_name = $row['domain_name'];
|
<i class="fa fa-fw fa-user text-secondary mr-1"></i>
|
||||||
$domain_expire = $row['domain_expire'];
|
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=contacts&q=<?php echo $contact_name; ?>"><?php echo $contact_name; ?></a>
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
?>
|
<?php
|
||||||
<tr>
|
|
||||||
<td><?php echo $domain_name; ?></td>
|
|
||||||
<td class="text-danger"><?php echo $domain_expire; ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
while($row = mysqli_fetch_array($sql_vendors)){
|
||||||
}
|
$vendor_id = $row['vendor_id'];
|
||||||
?>
|
$vendor_name = $row['vendor_name'];
|
||||||
|
$vendor_updated_at = $row['vendor_updated_at'];
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p class="mb-1">
|
||||||
|
<i class="fas fa-fw fa-building text-secondary mr-1"></i>
|
||||||
|
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=vendors&q=<?php echo $vendor_name; ?>"><?php echo $vendor_name; ?></a></td>
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<div class="col-3">
|
||||||
|
|
||||||
<?php if(mysqli_num_rows($sql_asset_warranties_expiring) > 0){ ?>
|
<div class="card card-outline card-warning mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title"><i class="fas fa-calendar-alt"></i> Upcoming Expirations</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
<!-- Asset Warrenties Expiring-->
|
<?php
|
||||||
|
|
||||||
<div class="col-4">
|
while($row = mysqli_fetch_array($sql_domains_expiring)){
|
||||||
|
$domain_id = $row['domain_id'];
|
||||||
|
$domain_name = $row['domain_name'];
|
||||||
|
$domain_expire = $row['domain_expire'];
|
||||||
|
|
||||||
<div class="card card-outline card-danger mb-3">
|
?>
|
||||||
<div class="card-body">
|
<p class="mb-1">
|
||||||
<h5 class="card-title mb-2"><i class="fa fa-laptop"></i> Asset Warranties Expiring Soon <small class="text-secondary">(90d)</small></h5>
|
<i class="fa fa-fw fa-globe text-secondary mr-1"></i>
|
||||||
<table class="table table-borderless table-sm">
|
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=domains&q=<?php echo $domain_name; ?>"><?php echo $domain_name; ?></a>
|
||||||
<tbody>
|
<span class="text-warning">-- <?php echo $domain_expire; ?></span>
|
||||||
<?php
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_asset_warranties_expiring)){
|
<?php
|
||||||
$asset_id = $row['asset_id'];
|
|
||||||
$asset_name = $row['asset_name'];
|
|
||||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
|
||||||
|
|
||||||
?>
|
while($row = mysqli_fetch_array($sql_asset_warranties_expiring)){
|
||||||
<tr>
|
$asset_id = $row['asset_id'];
|
||||||
<td><?php echo $asset_name; ?></td>
|
$asset_name = $row['asset_name'];
|
||||||
<td class="text-danger"><?php echo $asset_warranty_expire; ?></td>
|
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
?>
|
||||||
}
|
<p class="mb-1">
|
||||||
?>
|
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
|
||||||
|
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=assets&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
|
||||||
|
<span class="text-warning">-- <?php echo $asset_warranty_expire; ?></span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
while($row = mysqli_fetch_array($sql_asset_retire)){
|
||||||
|
$asset_id = $row['asset_id'];
|
||||||
|
$asset_name = $row['asset_name'];
|
||||||
|
$asset_install_date = $row['asset_install_date'];
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p class="mb-1">
|
||||||
|
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
|
||||||
|
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=assets&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
|
||||||
|
<span class="text-warning">-- <?php echo $asset_install_date; ?></span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if(mysqli_num_rows($sql_asset_retire) > 0){ ?>
|
|
||||||
|
|
||||||
<!-- Asset Retire -->
|
|
||||||
|
|
||||||
<div class="col-4">
|
|
||||||
|
|
||||||
<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> Assets Retiring Soon <small class="text-secondary">(7y)</small></h5>
|
|
||||||
<table class="table table-borderless table-sm">
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_asset_retire)){
|
|
||||||
$asset_id = $row['asset_id'];
|
|
||||||
$asset_name = $row['asset_name'];
|
|
||||||
$asset_install_date = $row['asset_install_date'];
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo $asset_name; ?></td>
|
|
||||||
<td class="text-danger"><?php echo $asset_install_date; ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if(mysqli_num_rows($sql_tickets_stale) > 0){ ?>
|
<?php if(mysqli_num_rows($sql_tickets_stale) > 0){ ?>
|
||||||
|
|
||||||
<!-- Stale Tickets -->
|
<!-- Stale Tickets -->
|
||||||
|
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
|
|
||||||
<div class="card card-outline card-danger mb-3">
|
<div class="card card-outline card-danger mb-3">
|
||||||
<div class="card-body">
|
<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>
|
<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">
|
<table class="table table-borderless table-sm">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_tickets_stale)){
|
while($row = mysqli_fetch_array($sql_tickets_stale)){
|
||||||
$ticket_id = $row['ticket_id'];
|
$ticket_id = $row['ticket_id'];
|
||||||
$ticket_prefix = $row['ticket_prefix'];
|
$ticket_prefix = $row['ticket_prefix'];
|
||||||
$ticket_number = $row['ticket_number'];
|
$ticket_number = $row['ticket_number'];
|
||||||
$ticket_subject = $row['ticket_subject'];
|
$ticket_subject = $row['ticket_subject'];
|
||||||
$ticket_created_at = $row['ticket_created_at'];
|
$ticket_created_at = $row['ticket_created_at'];
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id?>"><?php echo "$ticket_prefix$ticket_number"; ?></a</td>
|
|
||||||
<td><?php echo $ticket_subject; ?></td>
|
|
||||||
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id?>"><?php echo "$ticket_prefix$ticket_number"; ?></a>/td>
|
||||||
|
<td><?php echo $ticket_subject; ?></td>
|
||||||
|
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
<?php
|
||||||
</table>
|
}
|
||||||
</div>
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user