diff --git a/client.php b/client.php
index 944163a4..84c25aed 100644
--- a/client.php
+++ b/client.php
@@ -6,6 +6,8 @@
if(isset($_GET['client_id'])){
$client_id = intval($_GET['client_id']);
+ $sql = mysqli_query($mysqli,"UPDATE clients SET client_accessed_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
+
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE client_id = $client_id AND company_id = $session_company_id");
if(mysqli_num_rows($sql) == 0){
@@ -39,6 +41,7 @@ if(isset($_GET['client_id'])){
if($client_net_terms == 0){
$client_net_terms = $config_default_net_terms;
}
+ $client_support = $row['client_support'];
$client_notes = $row['client_notes'];
//Add up all the payments for the invoice and get the total amount paid to the invoice
diff --git a/client_side_nav.php b/client_side_nav.php
index aea83aca..e32f5377 100644
--- a/client_side_nav.php
+++ b/client_side_nav.php
@@ -13,6 +13,9 @@
Back
|
+
+ SUPPORT: ;">
+
CLIENT
diff --git a/clients.php b/clients.php
index 2a74a1a0..a26d694d 100644
--- a/clients.php
+++ b/clients.php
@@ -29,7 +29,7 @@ if(isset($_GET['q'])){
if(!empty($_GET['sb'])){
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
}else{
- $sb = "client_name";
+ $sb = "client_accessed_at";
}
//Column Order Filter
@@ -42,8 +42,8 @@ if(isset($_GET['o'])){
$disp = "ASC";
}
}else{
- $o = "ASC";
- $disp = "DESC";
+ $o = "DESC";
+ $disp = "ASC";
}
//Date From and Date To Filter
@@ -59,7 +59,7 @@ if(!empty($_GET['dtf'])){
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM clients
- WHERE (client_name LIKE '%$q%' OR client_type LIKE '%$q%' OR client_email LIKE '%$q%' OR client_contact LIKE '%$q%' OR client_phone LIKE '%$q%'
+ WHERE (client_name LIKE '%$q%' OR client_type LIKE '%$q%' OR client_support LIKE '%$q%' OR client_email LIKE '%$q%' OR client_contact LIKE '%$q%' OR client_phone LIKE '%$q%'
OR client_mobile LIKE '%$q%' OR client_address LIKE '%$q%' OR client_city LIKE '%$q%' OR client_state LIKE '%$q%' OR client_zip LIKE '%$q%')
AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt'
AND company_id = $session_company_id $permission_sql
@@ -147,6 +147,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$client_currency_code = $row['client_currency_code'];
$client_net_terms = $row['client_net_terms'];
$client_referral = $row['client_referral'];
+ $client_support = $row['client_support'];
$client_notes = $row['client_notes'];
$client_created_at = $row['client_created_at'];
$client_updated_at = $row['client_updated_at'];
@@ -176,6 +177,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
+
+ SUPPORT: ;">
+
+ Contract started:
$client_city $client_state $client_zip"; ?>
diff --git a/db.sql b/db.sql
index b726f3ea..40f7d703 100644
--- a/db.sql
+++ b/db.sql
@@ -1,8 +1,8 @@
--- MariaDB dump 10.19 Distrib 10.5.9-MariaDB, for debian-linux-gnu (x86_64)
+-- MariaDB dump 10.19 Distrib 10.5.11-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: localhost Database: admin_crm
+-- Host: localhost Database: pittpc_crm
-- ------------------------------------------------------
--- Server version 10.5.9-MariaDB-1:10.5.9+maria~focal
+-- Server version 10.5.11-MariaDB-1:10.5.11+maria~focal
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -176,10 +176,12 @@ CREATE TABLE `clients` (
`client_referral` varchar(200) DEFAULT NULL,
`client_currency_code` varchar(200) NOT NULL,
`client_net_terms` int(10) NOT NULL,
+ `client_support` varchar(100) DEFAULT NULL,
`client_notes` text DEFAULT NULL,
`client_created_at` datetime NOT NULL,
`client_updated_at` datetime DEFAULT NULL,
`client_archived_at` datetime DEFAULT NULL,
+ `client_accessed_at` datetime DEFAULT NULL,
`company_id` int(11) NOT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@@ -1005,4 +1007,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2021-04-30 17:52:53
+-- Dump completed on 2021-08-10 20:10:46
diff --git a/edit_client_modal.php b/edit_client_modal.php
index 17d3f654..52ced30c 100644
--- a/edit_client_modal.php
+++ b/edit_client_modal.php
@@ -52,6 +52,19 @@
+