From a28d1d6e577b630a6c2e47db815a1765ee34522b Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Wed, 4 Dec 2019 20:58:16 -0500 Subject: [PATCH] Added Adavnced Filter to customers and expenses, removed some text-mono, ui updates to ticket details, added quick links to reports under dashboard --- clients.php | 43 +++-- dashboard.php | 100 ++++++++++++ expenses.php | 39 ++++- post.php | 20 +-- products.php | 2 +- quotes.php | 2 +- report_expense_summary.php | 2 +- report_income_summary.php | 2 +- settings-general.php | 7 +- settings-user.php | 320 ++++++++++++++++++------------------- ticket.php | 53 +----- 11 files changed, 354 insertions(+), 236 deletions(-) diff --git a/clients.php b/clients.php index cbe67295..6a23b323 100644 --- a/clients.php +++ b/clients.php @@ -44,7 +44,7 @@ if(isset($_GET['o'])){ } //Date From and Date To Filter -if(isset($_GET['dtf'])){ +if(!empty($_GET['dtf'])){ $dtf = $_GET['dtf']; $dtt = $_GET['dtt']; }else{ @@ -65,11 +65,34 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
-
- -
- +
+
+
+ +
+ +
+
+
+ +
+
+
" id="advancedFilter"> +
+
+
+ + +
+
+
+
+ + +
+
+
@@ -77,7 +100,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); "> Name "> - Type Contact Balance Action @@ -129,8 +151,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); ?> - - + + +
+ + - $ + $
+
+
+
+

Expense Flow

+
+ + + + +
+
+
+ +
+
+
+
@@ -475,6 +497,84 @@ var myLineChart = new Chart(ctx, { } }); +// Set new default font family and font color to mimic Bootstrap's default styling +Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; +Chart.defaults.global.defaultFontColor = '#292b2c'; + +// Area Chart Example +var ctx = document.getElementById("expenseFlow"); +var myLineChart = new Chart(ctx, { + type: 'line', + data: { + labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + datasets: [{ + label: "Expense", + lineTension: 0.3, + backgroundColor: "rgba(2,117,216,0.2)", + borderColor: "rgba(2,117,216,1)", + pointRadius: 5, + pointBackgroundColor: "rgba(2,117,216,1)", + pointBorderColor: "rgba(255,255,255,0.8)", + pointHoverRadius: 5, + pointHoverBackgroundColor: "rgba(2,117,216,1)", + pointHitRadius: 50, + pointBorderWidth: 2, + data: [ + 0 AND expenses.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_expenses); + $expenses_for_month = $row['expense_amount_for_month']; + + if($expenses_for_month > 0 AND $expenses_for_month > $largest_expense_month){ + $largest_expense_month = $expenses_for_month; + } + + + ?> + + + + + ], + }], + }, + options: { + scales: { + xAxes: [{ + time: { + unit: 'date' + }, + gridLines: { + display: false + }, + ticks: { + maxTicksLimit: 12 + } + }], + yAxes: [{ + ticks: { + min: 0, + max: , + maxTicksLimit: 5 + }, + gridLines: { + color: "rgba(0, 0, 0, .125)", + } + }], + }, + legend: { + display: false + } + } +}); + + + // Set new default font family and font color to mimic Bootstrap's default styling Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; Chart.defaults.global.defaultFontColor = '#292b2c'; diff --git a/expenses.php b/expenses.php index 15aefdd0..184fe205 100644 --- a/expenses.php +++ b/expenses.php @@ -39,8 +39,14 @@ $disp = "ASC"; } + if(isset($_GET['category'])){ + $category = $_GET['category']; + }else{ + $category = '%'; + } + //Date From and Date To Filter - if(isset($_GET['dtf'])){ + if(!empty($_GET['dtf'])){ $dtf = $_GET['dtf']; $dtt = $_GET['dtt']; }else{ @@ -70,11 +76,34 @@
-
- -
- +
+
+
+ +
+ +
+
+
+ +
+
+
" id="advancedFilter"> +
+
+
+ + +
+
+
+
+ + +
+
+

diff --git a/post.php b/post.php index 0d42f7a0..5df4bc5a 100644 --- a/post.php +++ b/post.php @@ -15,8 +15,8 @@ use PHPMailer\PHPMailer\Exception; if(isset($_POST['add_user'])){ - $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); - $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); + $name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']))); + $email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']))); $password = md5($_POST['password']); $client_id = intval($_POST['client']); @@ -53,8 +53,8 @@ if(isset($_POST['add_user'])){ if(isset($_POST['edit_user'])){ $user_id = intval($_POST['user_id']); - $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); - $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); + $name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']))); + $email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']))); $current_password_hash = $_POST['current_password_hash']; $password = $_POST['password']; if($current_password_hash == $password){ @@ -87,14 +87,14 @@ if(isset($_POST['edit_user'])){ if(isset($_POST['add_company'])){ - $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); - $address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['address'])); - $city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['city'])); - $state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['state'])); - $zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip'])); + $name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']))); + $address = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['address']))); + $city = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['city']))); + $state = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['state']))); + $zip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip']))); $phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone'])); $phone = preg_replace("/[^0-9]/", '',$phone); - $site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['site'])); + $site = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['site']))); mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$name', company_created_at = NOW()"); diff --git a/products.php b/products.php index a2b193b4..b3e6711b 100644 --- a/products.php +++ b/products.php @@ -90,7 +90,7 @@ - $ + $ - +
+
+ +
+ +

diff --git a/settings-user.php b/settings-user.php index dc1e34d7..32202e45 100644 --- a/settings-user.php +++ b/settings-user.php @@ -11,175 +11,173 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs ?> -
-
-
User Settings
-
-
-
-
-
User Details
-
- -