diff --git a/README.md b/README.md index 948ff914..bb9e5dfb 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ ### Technologies Used * PHP/MySQL -* SB Admin Bootstrap CSS Framework +* AdminLTE3 * fontawesome * chart.js * moments.js @@ -78,11 +78,10 @@ * PHPmailer * mPDF * FullCalendar.io -* bootstrap-select +* Select2 * Date Range Picker * Bootstrap Typeahead -* EasyMDE forked from SimpleMDE -* parsedown +* SummerNote ### API Calls * Caller ID lookup (Returns a Name) - /api.php?api_key=[API_KEY]&cid=[PHONE_NUMBER] diff --git a/accounts.php b/accounts.php index f8374019..a3e20cea 100644 --- a/accounts.php +++ b/accounts.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "account_id"; + $sb = "account_name"; } if(isset($_GET['o'])){ @@ -35,8 +35,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM accounts diff --git a/categories.php b/categories.php index 5b6bdf76..5c10b75c 100644 --- a/categories.php +++ b/categories.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "category_type"; + $sb = "category_name"; } if(isset($_GET['o'])){ @@ -35,8 +35,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM categories WHERE (category_name LIKE '%$q%' OR category_type LIKE '%$q%') AND company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to"); diff --git a/clients.php b/clients.php index a6eac0fc..cbe67295 100644 --- a/clients.php +++ b/clients.php @@ -26,7 +26,7 @@ if(isset($_GET['q'])){ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "client_id"; + $sb = "client_name"; } //Column Order Filter @@ -39,8 +39,8 @@ if(isset($_GET['o'])){ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } //Date From and Date To Filter diff --git a/companies.php b/companies.php index 79befc8d..9927b187 100644 --- a/companies.php +++ b/companies.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "companies.company_id"; + $sb = "company_name"; } if(isset($_GET['o'])){ @@ -35,8 +35,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM companies, settings diff --git a/cron.php b/cron.php index 93a6a890..59c905f0 100644 --- a/cron.php +++ b/cron.php @@ -66,7 +66,7 @@ while($row = mysqli_fetch_array($sql_companies)){ //PAST DUE INVOICE ALERTS //$invoiceAlertArray = [$config_invoice_overdue_reminders]; - $invoiceAlertArray = [3,8,14,30,45,60,90,120]; + $invoiceAlertArray = [30,60,90,120,150]; foreach($invoiceAlertArray as $day){ diff --git a/invoices.php b/invoices.php index 5b9654b6..15d15284 100644 --- a/invoices.php +++ b/invoices.php @@ -74,7 +74,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "invoice_id"; + $sb = "invoice_number"; } if(isset($_GET['o'])){ diff --git a/payments.php b/payments.php index e935ef59..64d4c4a2 100644 --- a/payments.php +++ b/payments.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "payment_id"; + $sb = "payment_date"; } if(isset($_GET['o'])){ diff --git a/post.php b/post.php index c6a127d9..0d42f7a0 100644 --- a/post.php +++ b/post.php @@ -177,6 +177,7 @@ if(isset($_POST['verify'])){ if(isset($_POST['edit_general_settings'])){ $config_api_key = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_api_key'])); + $config_base_url = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_base_url'])); $path = "$config_invoice_logo"; @@ -190,7 +191,7 @@ if(isset($_POST['edit_general_settings'])){ move_uploaded_file($_FILES['file']['tmp_name'], $path); } - mysqli_query($mysqli,"UPDATE settings SET config_invoice_logo = '$path', config_api_key = '$config_api_key' WHERE company_id = $session_company_id"); + mysqli_query($mysqli,"UPDATE settings SET config_invoice_logo = '$path', config_api_key = '$config_api_key', config_base_url = '$config_base_url' WHERE company_id = $session_company_id"); //logging mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'General', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id"); diff --git a/products.php b/products.php index 5451af61..a2b193b4 100644 --- a/products.php +++ b/products.php @@ -35,8 +35,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM products, categories WHERE products.category_id = categories.category_id AND products.company_id = $session_company_id AND (product_name LIKE '%$q%' OR category_name LIKE '%$q%') ORDER BY $sb $o LIMIT $record_from, $record_to"); diff --git a/revenues.php b/revenues.php index 38667efb..e7eda108 100644 --- a/revenues.php +++ b/revenues.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "revenue_id"; + $sb = "revenue_date"; } if(isset($_GET['o'])){ diff --git a/settings-general.php b/settings-general.php index 0bf410e5..6f810df8 100644 --- a/settings-general.php +++ b/settings-general.php @@ -19,6 +19,17 @@ +
+ +
+
+ +
+ +
+ This is used by cron to send the correct url for invoice guest views +
+
diff --git a/tickets.php b/tickets.php index 8cbfd1b8..a686a2c4 100644 --- a/tickets.php +++ b/tickets.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "ticket_id"; + $sb = "ticket_number"; } if(isset($_GET['o'])){ diff --git a/trips.php b/trips.php index a5fad4a1..05152d0e 100644 --- a/trips.php +++ b/trips.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "trip_id"; + $sb = "trip_date"; } if(isset($_GET['o'])){ diff --git a/users.php b/users.php index 35d99087..7eb9cfb8 100644 --- a/users.php +++ b/users.php @@ -23,7 +23,7 @@ if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ - $sb = "user_id"; + $sb = "name"; } if(isset($_GET['o'])){ @@ -35,8 +35,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM users diff --git a/vendors.php b/vendors.php index 13b71c79..e2aaec51 100644 --- a/vendors.php +++ b/vendors.php @@ -31,8 +31,8 @@ $disp = "ASC"; } }else{ - $o = "DESC"; - $disp = "ASC"; + $o = "ASC"; + $disp = "DESC"; } //Date From and Date To Filter