From bdef68ddf5c8ddfda23f565ae664af53a2d1ed4d Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 13 Mar 2022 11:27:23 +0000 Subject: [PATCH] Add notes to client overview --- ajax.php | 12 +++ client_overview.php | 257 +++++++++++++++++++++++++------------------- 2 files changed, 156 insertions(+), 113 deletions(-) diff --git a/ajax.php b/ajax.php index 78c7c877..bc052352 100644 --- a/ajax.php +++ b/ajax.php @@ -141,4 +141,16 @@ if(isset($_GET['network_get_json_details'])){ } echo json_encode($response); +} + +if(isset($_POST['client_set_notes'])){ + $client_id = intval($_POST['client_id']); + $notes = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['notes']))); + + // Update notes + mysqli_query($mysqli, "UPDATE clients SET client_notes = '$notes' WHERE client_id = '$client_id'"); + + // Logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Client', log_action = 'Modify', log_description = '$session_name modified client notes', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_client_id = $client_id, log_user_id = $session_user_id, company_id = $session_company_id"); + } \ No newline at end of file diff --git a/client_overview.php b/client_overview.php index 6986faf4..98e32b42 100644 --- a/client_overview.php +++ b/client_overview.php @@ -5,7 +5,7 @@ $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departmen $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 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 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_client_id = $client_id AND company_id = $session_company_id ORDER BY login_updated_at DESC LIMIT 5"); @@ -40,161 +40,192 @@ $sql_tickets_stale = mysqli_query($mysqli,"SELECT * FROM tickets
- 0){ ?> + 0){ ?> + + + +
+ +
+
+
Client Notes
+ +
+
+ +
-
- -
-
-
Recent Contacts
- - - - 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']; - //$client_id = $row['client_id']; - //$client_name = $row['client_name']; - $department_name = $row['department_name']; +
+
+
Recent Contacts
+
+ + - - - - - + 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']; + //$client_id = $row['client_id']; + //$client_name = $row['client_name']; + $department_name = $row['department_name']; - + ?> + + + + + - -
-
-

+
+

-
+ + + +
+
- + - 0){ ?> + 0){ ?> - +
- -
-
-
Domains Expiring Soon (30d)
- - - +
+
Domains Expiring Soon (30d)
+
+ + - - - - + while($row = mysqli_fetch_array($sql_domains_expiring)){ + $domain_id = $row['domain_id']; + $domain_name = $row['domain_name']; + $domain_expire = $row['domain_expire']; - + ?> + + + + - -
-
+ + + +
+
- + - 0){ ?> + 0){ ?>
- -
-
-
Asset Warranties Expiring Soon (90d)
- - - +
+
Asset Warranties Expiring Soon (90d)
+
+ + - - - - + 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']; - + ?> + + + + - -
-
+ + + +
+
- + - 0){ ?> + 0){ ?>
- -
-
-
Stale Tickets (14d)
- - - +
+
Stale Tickets (14d)
+
+ + - - - - - + 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']; - + ?> + + + + + - -
-
+ + + +
+
- + - \ No newline at end of file + + + \ No newline at end of file