diff --git a/accounts.php b/accounts.php index 3397a380..30b6bcca 100644 --- a/accounts.php +++ b/accounts.php @@ -1,51 +1,19 @@ - + $sb, 'o' => $o))); - if(isset($_GET['o'])){ - if($_GET['o'] == 'ASC'){ - $o = "ASC"; - $disp = "DESC"; - }else{ - $o = "DESC"; - $disp = "ASC"; - } - }else{ - $o = "ASC"; - $disp = "DESC"; - } +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM accounts + WHERE account_name LIKE '%$q%' AND company_id = $session_company_id + ORDER BY $sb $o LIMIT $record_from, $record_to"); - //Rebuild URL - $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 accounts - WHERE account_name LIKE '%$q%' AND company_id = $session_company_id - ORDER BY $sb $o LIMIT $record_from, $record_to"); - - $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); ?> diff --git a/api.php b/api.php index 8383398e..a5ef6c29 100644 --- a/api.php +++ b/api.php @@ -9,7 +9,7 @@ $ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip())); $user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT'])); // Check API key is provided in GET request as 'api_key' -if(!isset($_GET['api_key']) OR empty($_GET['api_key'])) { +if(!isset($_GET['api_key']) || empty($_GET['api_key'])) { // Missing key header("HTTP/1.1 401 Unauthorized"); mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'API', log_action = 'Failed', log_description = 'No API Key specified', log_ip = '$ip', log_user_agent = '$user_agent', log_created_at = NOW()"); diff --git a/api/v1/assets/read.php b/api/v1/assets/read.php index 92b9b3ba..419ecfb1 100644 --- a/api/v1/assets/read.php +++ b/api/v1/assets/read.php @@ -1,13 +1,7 @@ "> - +
@@ -170,7 +140,7 @@ diff --git a/categories.php b/categories.php index 27e14ea8..b33a42af 100644 --- a/categories.php +++ b/categories.php @@ -1,27 +1,10 @@ $sb, 'o' => $o))); diff --git a/client_asset_edit_modal.php b/client_asset_edit_modal.php index a834b4d4..71816502 100644 --- a/client_asset_edit_modal.php +++ b/client_asset_edit_modal.php @@ -95,7 +95,7 @@ - +
@@ -135,7 +135,7 @@
- +
diff --git a/client_assets.php b/client_assets.php index abf0e202..187149e5 100644 --- a/client_assets.php +++ b/client_assets.php @@ -29,42 +29,12 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM as AND asset_archived_at IS NULL AND asset_client_id = $client_id")); $other_count = $row['count']; -//Paging -if(isset($_GET['p'])){ - $p = intval($_GET['p']); - $record_from = (($p)-1)*$_SESSION['records_per_page']; - $record_to = $_SESSION['records_per_page']; -}else{ - $record_from = 0; - $record_to = $_SESSION['records_per_page']; - $p = 1; -} - -if(isset($_GET['q'])){ - $q = mysqli_real_escape_string($mysqli,$_GET['q']); -}else{ - $q = ""; -} - if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ $sb = "asset_name"; } -if(isset($_GET['o'])){ - if($_GET['o'] == 'ASC'){ - $o = "ASC"; - $disp = "DESC"; - }else{ - $o = "DESC"; - $disp = "ASC"; - } -}else{ - $o = "ASC"; - $disp = "DESC"; -} - //Asset Type from GET if(isset($_GET['type']) && ($_GET['type']) == 'workstation'){ $type_query = "asset_type = 'desktop' OR asset_type = 'laptop'"; @@ -123,7 +93,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
- All Assets + All Assets 0){ ?> Workstations @@ -167,7 +137,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); "> Name - + Type @@ -176,11 +146,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); Serial Number - + Operating System Install Date - + Assigned To Location @@ -241,7 +211,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $device_icon = "print"; }elseif($asset_type == 'Camera'){ $device_icon = "video"; - }elseif($asset_type == 'Switch' or $asset_type == 'Firewall/Router'){ + }elseif($asset_type == 'Switch' || $asset_type == 'Firewall/Router'){ $device_icon = "network-wired"; }elseif($asset_type == 'Access Point'){ $device_icon = "wifi"; @@ -322,7 +292,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); ?> - + @@ -331,11 +301,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - + - + diff --git a/client_certificates.php b/client_certificates.php index fc71297b..65c2ad82 100644 --- a/client_certificates.php +++ b/client_certificates.php @@ -1,21 +1,5 @@ $sb, 'o' => $o))); diff --git a/client_contacts.php b/client_contacts.php index 965eb4db..679ceb36 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -1,16 +1,5 @@ $sb, 'o' => $o))); diff --git a/client_departments.php b/client_departments.php index 3c02af01..80386750 100644 --- a/client_departments.php +++ b/client_departments.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_documents.php b/client_documents.php index 5b1e9c70..7a3f797e 100644 --- a/client_documents.php +++ b/client_documents.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_files.php b/client_files.php index 6db97833..5f870e39 100644 --- a/client_files.php +++ b/client_files.php @@ -73,15 +73,15 @@ $num_of_files = mysqli_num_rows($sql_files_images) + mysqli_num_rows($sql_files_ $file_ext = $row['file_ext']; if($file_ext == 'pdf'){ $file_icon = "file-pdf"; - }elseif($file_ext == 'gz' or $file_ext == 'tar' or $file_ext == 'zip' or $file_ext == '7z' or $file_ext == 'rar'){ + }elseif($file_ext == 'gz' || $file_ext == 'tar' || $file_ext == 'zip' || $file_ext == '7z' || $file_ext == 'rar'){ $file_icon = "file-archive"; }elseif($file_ext == 'txt'){ $file_icon = "file-alt"; - }elseif($file_ext == 'doc' or $file_ext == 'docx'){ + }elseif($file_ext == 'doc' || $file_ext == 'docx'){ $file_icon = "file-word"; - }elseif($file_ext == 'xls' or $file_ext == 'xlsx' or $file_ext == 'ods'){ + }elseif($file_ext == 'xls' || $file_ext == 'xlsx' || $file_ext == 'ods'){ $file_icon = "file-excel"; - }elseif($file_ext == 'mp3' or $file_ext == 'wav' or $file_ext == 'ogg'){ + }elseif($file_ext == 'mp3' || $file_ext == 'wav' || $file_ext == 'ogg'){ $file_icon = "file-audio"; }else{ $file_icon = "file"; diff --git a/client_invoices.php b/client_invoices.php index dc9e94e1..01e146c6 100644 --- a/client_invoices.php +++ b/client_invoices.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); @@ -117,7 +87,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $category_name = $row['category_name']; $now = time(); - if(($invoice_status == "Sent" or $invoice_status == "Partial" or $invoice_status == "Viewed") and strtotime($invoice_due) < $now ){ + if(($invoice_status == "Sent" || $invoice_status == "Partial" || $invoice_status == "Viewed") && strtotime($invoice_due) < $now ){ $overdue_color = "text-danger font-weight-bold"; }else{ $overdue_color = ""; diff --git a/client_locations.php b/client_locations.php index ab9f0d70..47288f7c 100644 --- a/client_locations.php +++ b/client_locations.php @@ -1,16 +1,5 @@ $sb, 'o' => $o))); diff --git a/client_logins.php b/client_logins.php index 83c037b9..74c7bd52 100644 --- a/client_logins.php +++ b/client_logins.php @@ -2,42 +2,12 @@ require_once("rfc6238.php"); -//Paging -if(isset($_GET['p'])){ - $p = intval($_GET['p']); - $record_from = (($p)-1)*$_SESSION['records_per_page']; - $record_to = $_SESSION['records_per_page']; -}else{ - $record_from = 0; - $record_to = $_SESSION['records_per_page']; - $p = 1; -} - -if(isset($_GET['q'])){ - $q = mysqli_real_escape_string($mysqli,$_GET['q']); -}else{ - $q = ""; -} - if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ $sb = "login_name"; } -if(isset($_GET['o'])){ - if($_GET['o'] == 'ASC'){ - $o = "ASC"; - $disp = "DESC"; - }else{ - $o = "DESC"; - $disp = "ASC"; - } -}else{ - $o = "ASC"; - $disp = "DESC"; -} - //Rebuild URL $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o))); diff --git a/client_logs.php b/client_logs.php index 80401c8b..b03da127 100644 --- a/client_logs.php +++ b/client_logs.php @@ -1,37 +1,13 @@ $sb, 'o' => $o))); diff --git a/client_payments.php b/client_payments.php index 716664fe..3b57e0d6 100644 --- a/client_payments.php +++ b/client_payments.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_quotes.php b/client_quotes.php index 1e8b3a49..24236166 100644 --- a/client_quotes.php +++ b/client_quotes.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_recurring_invoices.php b/client_recurring_invoices.php index b3980b45..4e5148db 100644 --- a/client_recurring_invoices.php +++ b/client_recurring_invoices.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_routes.php b/client_routes.php index bd26b408..fdb2a232 100644 --- a/client_routes.php +++ b/client_routes.php @@ -1,6 +1,9 @@ 0 OR mysqli_num_rows($sql_logins) > 0){ ?> + if(mysqli_num_rows($sql_assets) > 0 || mysqli_num_rows($sql_logins) > 0){ ?>
Logins
    + if($sql_logins || $sql_assets){ ?>
    URLs
      - 2){ ?> + 2){ ?> diff --git a/client_software.php b/client_software.php index aeec9213..bb359755 100644 --- a/client_software.php +++ b/client_software.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_tickets.php b/client_tickets.php index 39e6df9b..edf9866e 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/client_trips.php b/client_trips.php index d170fadc..79a18944 100644 --- a/client_trips.php +++ b/client_trips.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/clients.php b/clients.php index 47fbf741..dd0d4cad 100644 --- a/clients.php +++ b/clients.php @@ -54,7 +54,7 @@ if(empty($_GET['canned_date'])) { } //Date Filter -if($_GET['canned_date'] == "custom" AND !empty($_GET['date_from'])){ +if($_GET['canned_date'] == "custom" && !empty($_GET['date_from'])){ $date_from = mysqli_real_escape_string($mysqli,$_GET['date_from']); $date_to = mysqli_real_escape_string($mysqli,$_GET['date_to']); }elseif($_GET['canned_date'] == "today"){ @@ -167,7 +167,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); Name Address Contact - Billing + Billing Action @@ -184,7 +184,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $location_city = $row['location_city']; $location_state = $row['location_state']; $location_zip = $row['location_zip']; - if(empty($location_address) AND empty($location_city) AND empty($location_state) AND empty($location_zip)){ + if(empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)){ $location_address_display = "-"; }else{ $location_address_display = "$location_address
      $location_city $location_state $location_zip"; @@ -270,7 +270,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); @@ -310,7 +310,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - + Balance
      diff --git a/companies.php b/companies.php index eeaab81a..fb71a6b2 100644 --- a/companies.php +++ b/companies.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/custom_links.php b/custom_links.php index dbbe09a6..f0543f64 100644 --- a/custom_links.php +++ b/custom_links.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/dashboard_financial.php b/dashboard_financial.php index 8ea68e62..55e985c2 100644 --- a/dashboard_financial.php +++ b/dashboard_financial.php @@ -493,7 +493,7 @@ var myLineChart = new Chart(ctx, { $income_for_month = $payments_for_month + $revenues_for_month; - if($income_for_month > 0 AND $income_for_month > $largest_income_month){ + if($income_for_month > 0 && $income_for_month > $largest_income_month){ $largest_income_month = $income_for_month; } @@ -532,7 +532,7 @@ var myLineChart = new Chart(ctx, { $income_for_month = $payments_for_month + $revenues_for_month; - if($income_for_month > 0 AND $income_for_month > $largest_income_month){ + if($income_for_month > 0 && $income_for_month > $largest_income_month){ $largest_income_month = $income_for_month; } @@ -568,7 +568,7 @@ var myLineChart = new Chart(ctx, { $row = mysqli_fetch_array($sql_projected); $invoice_for_month = $row['invoice_amount_for_month']; - if($invoice_for_month > 0 AND $invoice_for_month > $largest_invoice_month){ + if($invoice_for_month > 0 && $invoice_for_month > $largest_invoice_month){ $largest_invoice_month = $invoice_for_month; } @@ -604,7 +604,7 @@ var myLineChart = new Chart(ctx, { $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){ + if($expenses_for_month > 0 && $expenses_for_month > $largest_expense_month){ $largest_expense_month = $expenses_for_month; } @@ -681,7 +681,7 @@ var myLineChart = new Chart(ctx, { $trip_miles_for_month = $row['trip_miles_for_month']; $largest_trip_miles_month = 0; - if($trip_miles_for_month > 0 AND $trip_miles_for_month > $largest_trip_miles_month){ + if($trip_miles_for_month > 0 && $trip_miles_for_month > $largest_trip_miles_month){ $largest_trip_miles_month = $trip_miles_for_month; } diff --git a/expenses.php b/expenses.php index 45dd8d20..807c687e 100644 --- a/expenses.php +++ b/expenses.php @@ -1,41 +1,11 @@ 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) { + if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) || ((isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])))) { $mobile_browser++; } $mobile_ua = strtolower(substr(get_user_agent(), 0, 4)); diff --git a/get_credential.php b/get_credential.php index ba71b562..0de76a53 100644 --- a/get_credential.php +++ b/get_credential.php @@ -5,7 +5,7 @@ $chrome_id = "chrome-extension://afgpakhonllnmnomchjhidealcpmnegc"; $firefox_id = "moz-extension://857479e9-3992-4e99-9a5e-b514d2ad0a82"; if (isset($_SERVER['HTTP_ORIGIN'])) { - if($_SERVER['HTTP_ORIGIN'] == $chrome_id OR $_SERVER['HTTP_ORIGIN'] == $firefox_id){ + if($_SERVER['HTTP_ORIGIN'] == $chrome_id || $_SERVER['HTTP_ORIGIN'] == $firefox_id){ header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); header('Access-Control-Allow-Credentials: true'); } @@ -37,7 +37,7 @@ if(!isset($_COOKIE['user_extension_key'])){ $user_extension_key = $_COOKIE['user_extension_key']; // Check the key isn't empty, less than 17 characters or the word "disabled". -if(empty($user_extension_key) OR strlen($user_extension_key) < 16 OR strtolower($user_extension_key) == "disabled"){ +if(empty($user_extension_key) || strlen($user_extension_key) < 16 || strtolower($user_extension_key) == "disabled"){ $data['found'] = "FALSE"; $data['message'] = "ITFlow - You are not logged into ITFlow, do not have, or did not send the correct extension key cookie."; echo(json_encode($data)); @@ -55,7 +55,7 @@ $auth_user = mysqli_query($mysqli, "SELECT * FROM users LEFT JOIN user_settings $row = mysqli_fetch_array($auth_user); // Check SQL query state -if(mysqli_num_rows($auth_user) < 1 OR !$auth_user){ +if(mysqli_num_rows($auth_user) < 1 || !$auth_user){ $data['found'] = "FALSE"; $data['message'] = "ITFlow - You are not logged into ITFlow, do not have, or did not send the correct extension key cookie."; echo(json_encode($data)); diff --git a/guest_download_file.php b/guest_download_file.php index 06e7a039..b3d8c253 100644 --- a/guest_download_file.php +++ b/guest_download_file.php @@ -5,7 +5,7 @@ include("functions.php"); $ip = trim(strip_tags(mysqli_real_escape_string($mysqli,get_ip()))); $user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT'])); -if(isset($_GET['id']) AND isset($_GET['key'])){ +if(isset($_GET['id']) && isset($_GET['key'])){ $item_id = intval($_GET['id']); $item_key = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['key']))); @@ -13,7 +13,7 @@ if(isset($_GET['id']) AND isset($_GET['key'])){ $row = mysqli_fetch_array($sql); // Check result - if(mysqli_num_rows($sql) !== 1 OR !$row){ + if(mysqli_num_rows($sql) !== 1 || !$row){ exit("No file."); } @@ -23,7 +23,7 @@ if(isset($_GET['id']) AND isset($_GET['key'])){ } // Check item share is active & hasn't been viewed too many times - if($row['item_active'] !== "1" OR $row['item_views'] >= $row['item_view_limit']){ + if($row['item_active'] !== "1" || $row['item_views'] >= $row['item_view_limit']){ exit("Item cannot be viewed at this time."); } @@ -40,7 +40,7 @@ if(isset($_GET['id']) AND isset($_GET['key'])){ $file_sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id' LIMIT 1"); $file_row = mysqli_fetch_array($file_sql); - if(mysqli_num_rows($file_sql) !== 1 OR !$file_row){ + if(mysqli_num_rows($file_sql) !== 1 || !$file_row){ exit("No file."); } diff --git a/guest_view_invoice.php b/guest_view_invoice.php index f8b2ebc8..08a5919e 100644 --- a/guest_view_invoice.php +++ b/guest_view_invoice.php @@ -108,7 +108,7 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){ $balance = $invoice_amount - $amount_paid; //check to see if overdue - if($invoice_status !== "Paid" AND $invoice_status !== "Draft" AND $invoice_status !== "Cancelled"){ + if($invoice_status !== "Paid" && $invoice_status !== "Draft" && $invoice_status !== "Cancelled"){ $unixtime_invoice_due = strtotime($invoice_due) + 86400; if($unixtime_invoice_due < time()){ $invoice_color = "text-danger"; @@ -124,7 +124,7 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){ Print ');"> Download
      Incorrect URL.
"; include("guest_footer.php"); exit(); @@ -23,14 +23,14 @@ $sql = mysqli_query($mysqli, "SELECT * FROM shared_items WHERE item_id = '$item_ $row = mysqli_fetch_array($sql); // Check we got a result -if(mysqli_num_rows($sql) !== 1 OR !$row){ +if(mysqli_num_rows($sql) !== 1 || !$row){ echo "
No item to view. Check with the person that sent you this link to ensure it is correct and has not expired.
"; include("guest_footer.php"); exit(); } // Check item share is active & hasn't been viewed too many times -if($row['item_active'] !== "1" OR $row['item_views'] >= $row['item_view_limit']){ +if($row['item_active'] !== "1" || $row['item_views'] >= $row['item_view_limit']){ echo "
Item cannot be viewed at this time. Check with the person that sent you this link to ensure it is correct and has not expired.
"; include("guest_footer.php"); exit(); @@ -53,7 +53,7 @@ if($item_type == "Document"){ $doc_sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = '$item_related_id' AND document_client_id = '$client_id' LIMIT 1"); $doc_row = mysqli_fetch_array($doc_sql); - if(mysqli_num_rows($doc_sql) !== 1 OR !$doc_row){ + if(mysqli_num_rows($doc_sql) !== 1 || !$doc_row){ echo "
Error retrieving document to view.
"; include("guest_footer.php"); exit(); @@ -81,7 +81,7 @@ elseif($item_type == "File"){ $file_sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id' LIMIT 1"); $file_row = mysqli_fetch_array($file_sql); - if(mysqli_num_rows($file_sql) !== 1 OR !$file_row){ + if(mysqli_num_rows($file_sql) !== 1 || !$file_row){ echo "
Error retrieving file.
"; include("guest_footer.php"); exit(); @@ -102,7 +102,7 @@ elseif($item_type == "Login"){ $login_sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_id = '$item_related_id' AND login_client_id = '$client_id' LIMIT 1"); $login_row = mysqli_fetch_array($login_sql); - if(mysqli_num_rows($login_sql) !== 1 OR !$login_row){ + if(mysqli_num_rows($login_sql) !== 1 || !$login_row){ echo "
Error retrieving login.
"; include("guest_footer.php"); exit(); diff --git a/guest_view_quote.php b/guest_view_quote.php index c873c050..d5d31f84 100644 --- a/guest_view_quote.php +++ b/guest_view_quote.php @@ -86,7 +86,7 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
Accept Decline diff --git a/inc_all.php b/inc_all.php index bf1c547a..bf0679c4 100644 --- a/inc_all.php +++ b/inc_all.php @@ -8,5 +8,6 @@ include("top_nav.php"); include("side_nav.php"); include("inc_wrapper.php"); include("inc_alert_feedback.php"); +include("pagination_head.php"); ?> \ No newline at end of file diff --git a/inc_all_admin.php b/inc_all_admin.php index 122c9782..eb158605 100644 --- a/inc_all_admin.php +++ b/inc_all_admin.php @@ -16,5 +16,6 @@ include("top_nav.php"); include("admin_side_nav.php"); include("inc_wrapper.php"); include("inc_alert_feedback.php"); +include("pagination_head.php"); ?> \ No newline at end of file diff --git a/invoice.php b/invoice.php index 5dd6f7cd..df6c3a36 100644 --- a/invoice.php +++ b/invoice.php @@ -74,7 +74,7 @@ if(isset($_GET['invoice_id'])){ $balance = $invoice_amount - $amount_paid; //check to see if overdue - if($invoice_status !== "Paid" AND $invoice_status !== "Draft" AND $invoice_status !== "Cancelled"){ + if($invoice_status !== "Paid" && $invoice_status !== "Draft" && $invoice_status !== "Cancelled"){ $unixtime_invoice_due = strtotime($invoice_due) + 86400; if($unixtime_invoice_due < time()){ $invoice_overdue = "Overdue"; @@ -133,7 +133,7 @@ if(isset($_GET['invoice_id'])){ Send - + Add Payment
@@ -159,11 +159,11 @@ if(isset($_GET['invoice_id'])){ Print ');">Download PDF - + Send Email ">Guest URL - + Cancel diff --git a/invoice_payment_add_modal.php b/invoice_payment_add_modal.php index f65e4121..a9494d62 100644 --- a/invoice_payment_add_modal.php +++ b/invoice_payment_add_modal.php @@ -117,7 +117,7 @@
- +
diff --git a/invoices.php b/invoices.php index 68a96e21..6716927b 100644 --- a/invoices.php +++ b/invoices.php @@ -51,22 +51,6 @@ $real_overdue_amount = $total_overdue - $total_overdue_partial; - //Paging - if(isset($_GET['p'])){ - $p = intval($_GET['p']); - $record_from = (($p)-1)*$_SESSION['records_per_page']; - $record_to = $_SESSION['records_per_page']; - }else{ - $record_from = 0; - $record_to = $_SESSION['records_per_page']; - $p = 1; - } - - if(isset($_GET['q'])){ - $q = mysqli_real_escape_string($mysqli,$_GET['q']); - }else{ - $q = ""; - } if(!empty($_GET['sb'])){ $sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb'])); @@ -74,15 +58,8 @@ $sb = "invoice_number"; } - if(isset($_GET['o'])){ - if($_GET['o'] == 'ASC'){ - $o = "ASC"; - $disp = "DESC"; - }else{ - $o = "DESC"; - $disp = "ASC"; - } - }else{ + // Reverse default sort + if(!isset($_GET['o'])){ $o = "DESC"; $disp = "ASC"; } diff --git a/logs.php b/logs.php index a67df20c..ca8765cf 100644 --- a/logs.php +++ b/logs.php @@ -1,37 +1,13 @@ 10) { if($total_pages <= 100){ $pages_split = 10; } - if(($total_pages <= 1000) AND ($total_pages > 100)){ + if(($total_pages <= 1000) && ($total_pages > 100)){ $pages_split = 100; } - if(($total_pages <= 10000) AND ($total_pages > 1000)){ + if(($total_pages <= 10000) && ($total_pages > 1000)){ $pages_split = 1000; } if($p > 1){ @@ -61,7 +68,7 @@ if ($total_found_rows > 10) { while($i < $total_pages){ $i++; - if(($i == 1) OR (($p <= 3) AND ($i <= 6)) OR (($i > $total_pages - 6) AND ($p > $total_pages - 3 )) OR (is_int($i / $pages_split)) OR (($p > 3) AND ($i >= $p - 2) AND ($i <= $p + 3)) OR ($i == $total_pages)){ + if(($i == 1) || (($p <= 3) && ($i <= 6)) || (($i > $total_pages - 6) && ($p > $total_pages - 3 )) || (is_int($i / $pages_split)) || (($p > 3) && ($i >= $p - 2) && ($i <= $p + 3)) || ($i == $total_pages)){ if($p == $i ) { $page_class = "active"; }else{ diff --git a/pagination_head.php b/pagination_head.php new file mode 100644 index 00000000..ac4a8bfd --- /dev/null +++ b/pagination_head.php @@ -0,0 +1,40 @@ +purify(html_entity_decode($_POST['details'])))); $asset_id = intval($_POST['asset']); - if($client_id > 0 AND $contact == 0){ + if($client_id > 0 && $contact == 0){ $sql = mysqli_query($mysqli,"SELECT primary_contact FROM clients WHERE client_id = $client_id AND company_id = $session_company_id"); $row = mysqli_fetch_array($sql); $contact = $row['primary_contact']; @@ -5985,7 +5985,7 @@ if(isset($_POST['add_scheduled_ticket'])){ $frequency = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['frequency']))); $start_date = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['start_date']))); - if($client_id > 0 AND $contact == 0){ + if($client_id > 0 && $contact == 0){ $sql = mysqli_query($mysqli,"SELECT primary_contact FROM clients WHERE client_id = $client_id AND company_id = $session_company_id"); $row = mysqli_fetch_array($sql); $contact = $row['primary_contact']; @@ -7236,7 +7236,7 @@ if(isset($_GET['force_recurring'])){ if(isset($_POST['export_trips_csv'])){ $date_from = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['date_from']))); $date_to = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['date_to']))); - if(!empty($date_from) AND !empty($date_to)){ + if(!empty($date_from) && !empty($date_to)){ $date_query = "AND DATE(trip_date) BETWEEN '$date_from' AND '$date_to'"; $file_name_date = "$date_from-to-$date_to"; }else{ diff --git a/products.php b/products.php index fcbed3e9..529c48f7 100644 --- a/products.php +++ b/products.php @@ -1,40 +1,11 @@ $sb, 'o' => $o))); diff --git a/quote.php b/quote.php index 31b06c1f..c7fda824 100644 --- a/quote.php +++ b/quote.php @@ -109,7 +109,7 @@ if(isset($_GET['quote_id'])){ Send - + Accept Decline @@ -139,7 +139,7 @@ if(isset($_GET['quote_id'])){ Print ');">Download PDF - + Send Email ">Guest URL diff --git a/quotes.php b/quotes.php index f8407ffc..9c67d5da 100644 --- a/quotes.php +++ b/quotes.php @@ -1,39 +1,13 @@ 0 AND $expenses_for_month > $largest_expense_month){ + if($expenses_for_month > 0 && $expenses_for_month > $largest_expense_month){ $largest_expense_month = $expenses_for_month; } diff --git a/report_income_summary.php b/report_income_summary.php index b1042800..0950b470 100644 --- a/report_income_summary.php +++ b/report_income_summary.php @@ -189,7 +189,7 @@ var myLineChart = new Chart(ctx, { $income_for_month = $payments_for_month + $revenues_for_month; - if($income_for_month > 0 AND $income_for_month > $largest_income_month){ + if($income_for_month > 0 && $income_for_month > $largest_income_month){ $largest_income_month = $income_for_month; } diff --git a/revenues.php b/revenues.php index 407b9be1..21775094 100644 --- a/revenues.php +++ b/revenues.php @@ -1,37 +1,13 @@ $sb, 'o' => $o))); diff --git a/settings-api.php b/settings-api.php index efbfbec4..e3af4810 100644 --- a/settings-api.php +++ b/settings-api.php @@ -1,41 +1,11 @@ $sb, 'o' => $o))); diff --git a/settings-mail.php b/settings-mail.php index 31eef052..462976a4 100644 --- a/settings-mail.php +++ b/settings-mail.php @@ -92,7 +92,7 @@
- +
diff --git a/side_nav.php b/side_nav.php index 0cf373fb..40e5f061 100644 --- a/side_nav.php +++ b/side_nav.php @@ -78,7 +78,7 @@
- +
-
- -
-
- - "> - - - - - - - - - - - - - - - - - - - - - - -
TimestampUserTypeActionDescription
- - - -
-
- - - $sb, 'o' => $o))); diff --git a/vendors.php b/vendors.php index de0f4606..f9f47214 100644 --- a/vendors.php +++ b/vendors.php @@ -1,16 +1,5 @@