diff --git a/blank.php b/blank.php index f09e0d6d..a9909909 100644 --- a/blank.php +++ b/blank.php @@ -2,10 +2,10 @@ diff --git a/client_certificates.php b/client_certificates.php index 852ba6f6..d5ea31c7 100644 --- a/client_certificates.php +++ b/client_certificates.php @@ -1,11 +1,10 @@ - -
-
-

Certificates

-
- +
+

Certificates

+
+ +
-
-
-
- -
+
+ + +
-
-
- -
- -
-
-
- -
-
- Export -
-
- -
- -
-
- - "> - - - - - - - - - - - - - - - - - - +
+
+ Export +
+
- -
NameDomainIssued ByExpireAction
)" data-target="#editCertificateModal"> -
+
+ +
+
+ + "> + + + + + + + + + + + + + + + + + + + + + +
NameDomainIssued ByExpireAction
)" data-target="#editCertificateModal"> + +
+
+
- -
+ - + + $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM locations - WHERE location_client_id = $client_id - AND location_archived_at IS NULL - AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM locations + WHERE location_client_id = $client_id + AND location_archived_at IS NULL + AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%') + ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>
-
-

Locations

-
- +
+

Locations

+
+ +
-
-
-
- -
- -
-
- -
- -
-
-
+
+ + +
-
-
- Export - -
-
- -
- -
-
- - "> - - - - - - - - - - Primary Location

"; - }else{ - $primary_location_display = ""; - } - - ?> - - - - - - - - +
+
+ Export + +
+
- -
NameAddressPhoneHoursAction
- - - - " target="_blank">
-
+
+ +
+
+ + "> + + + + + + + + + + Primary Location

"; + } else { + $primary_location_display = ""; + } + + ?> + + + + + + + + + + + +
NameAddressPhoneHoursAction
+ + + + " target="_blank">
+ + +
+
+
- -
- - - +require_once("client_location_add_modal.php"); +require_once("client_location_import_modal.php"); +require_once("footer.php"); diff --git a/client_logins.php b/client_logins.php index be55ac01..8be4d70a 100644 --- a/client_logins.php +++ b/client_logins.php @@ -1,11 +1,11 @@ - - $sb, ' $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM logins + "SELECT SQL_CALC_FOUND_ROWS * FROM logins WHERE login_client_id = $client_id AND (login_name LIKE '%$q%' OR login_uri LIKE '%$q%') ORDER BY $sb $o LIMIT $record_from, $record_to" @@ -23,154 +23,151 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> -
+
-

Passwords

-
- -
+

Passwords

+
+ +
-
- -
+ + +
-
-
- -
- -
-
-
- -
-
- Export - -
-
- -
- -
-
- - "> - - - - - - - - - - - "; - } - $login_username = htmlentities(decryptLoginEntry($row['login_username'])); - if (empty($login_username)) { - $login_username_display = "-"; - }else{ - $login_username_display = "$login_username"; - } - $login_password = htmlentities(decryptLoginEntry($row['login_password'])); - $login_otp_secret = htmlentities($row['login_otp_secret']); - $login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"'; - if (empty($login_otp_secret)) { - $otp_display = "-"; - }else{ - $otp_display = " Hover.."; - } - $login_note = htmlentities($row['login_note']); - $login_important = $row['login_important']; - $login_contact_id = $row['login_contact_id']; - $login_vendor_id = $row['login_vendor_id']; - $login_asset_id = $row['login_asset_id']; - $login_software_id = $row['login_software_id']; - - ?> - - - - - - - - - +
+ Export + +
+ - include("client_login_edit_modal.php"); - } + + +
+
+
NameUsernamePasswordOTPURIAction
- - - - - - - -
+ "> + + + + + + + + + + + + while ($row = mysqli_fetch_array($sql)) { + $login_id = $row['login_id']; + $login_name = htmlentities($row['login_name']); + $login_uri = htmlentities($row['login_uri']); + if (empty($login_uri)) { + $login_uri_display = "-"; + } else { + $login_uri_display = "$login_uri"; + } + $login_username = htmlentities(decryptLoginEntry($row['login_username'])); + if (empty($login_username)) { + $login_username_display = "-"; + } else { + $login_username_display = "$login_username"; + } + $login_password = htmlentities(decryptLoginEntry($row['login_password'])); + $login_otp_secret = htmlentities($row['login_otp_secret']); + $login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"'; + if (empty($login_otp_secret)) { + $otp_display = "-"; + } else { + $otp_display = " Hover.."; + } + $login_note = htmlentities($row['login_note']); + $login_important = $row['login_important']; + $login_contact_id = $row['login_contact_id']; + $login_vendor_id = $row['login_vendor_id']; + $login_asset_id = $row['login_asset_id']; + $login_software_id = $row['login_software_id']; - -
NameUsernamePasswordOTPURIAction
-
- + ?> + + + + + + + + + + + + + + + + + + + + + + +
+
-
+
- + function generatePassword() { + document.getElementById("password").value = "" + } + - - +require_once("client_login_add_modal.php"); +require_once("share_modal.php"); +require_once("client_login_import_modal.php"); +require_once("footer.php"); diff --git a/client_logs.php b/client_logs.php index 35ce7b6f..75a76a62 100644 --- a/client_logs.php +++ b/client_logs.php @@ -2,15 +2,15 @@ require_once("inc_all_client.php"); if (!empty($_GET['sb'])) { - $sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb'])); + $sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb'])); } else { - $sb = "log_id"; + $sb = "log_id"; } // Reverse default sort if (!isset($_GET['o'])) { - $o = "DESC"; - $disp = "ASC"; + $o = "DESC"; + $disp = "ASC"; } //Rebuild URL @@ -30,88 +30,89 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>
-
-

Audit Logs

-
- -
-
- -
- -
-
- -
- -
-
-
- -
-
- -
-
-
-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimestampUserTypeActionDescriptionIP AddressUser AgentEntity ID
$log_user_browser"; ?>
+
+

Audit Logs

+
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TimestampUserTypeActionDescriptionIP AddressUser AgentEntity ID
$log_user_browser"; ?>
+
+
- -
- + $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM networks - LEFT JOIN locations ON location_id = network_location_id - WHERE network_client_id = $client_id - AND (network_name LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM networks + LEFT JOIN locations ON location_id = network_location_id + WHERE network_client_id = $client_id + AND (network_name LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to" +); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>
-
-

Networks

-
- +
+

Networks

+
+ +
-
-
-
- -
+
+ + +
-
-
- -
- -
-
-
- -
-
- Export -
-
- -
- -
-
- - "> - - - - - - - - - - - - - - - - - - - - - - +
+ Export +
+ - } + + +
+
+
NamevLANNetworkGatewayDHCP RangeLocationAction
- - )" data-target="#editNetworkModal"> -
+ "> + + + + + + + + + + + + + while ($row = mysqli_fetch_array($sql)) { + $network_id = $row['network_id']; + $network_name = htmlentities($row['network_name']); + $network_vlan = htmlentities($row['network_vlan']); + if (empty($network_vlan)) { + $network_vlan_display = "-"; + } else { + $network_vlan_display = $network_vlan; + } + $network = htmlentities($row['network']); + $network_gateway = htmlentities($row['network_gateway']); + $network_dhcp_range = htmlentities($row['network_dhcp_range']); + if (empty($network_dhcp_range)) { + $network_dhcp_range_display = "-"; + } else { + $network_dhcp_range_display = $network_dhcp_range; + } + $network_location_id = $row['network_location_id']; + $location_name = htmlentities($row['location_name']); + if (empty($location_name)) { + $location_name_display = "-"; + } else { + $location_name_display = $location_name; + } - -
NamevLANNetworkGatewayDHCP RangeLocationAction
+ ?> + + + + )" data-target="#editNetworkModal"> + + + + + + + + + + + + + + +
+
- -
- + - $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM payments - LEFT JOIN invoices ON payment_invoice_id = invoice_id - LEFT JOIN accounts ON payment_account_id = account_id - WHERE invoice_client_id = $client_id - AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM payments + LEFT JOIN invoices ON payment_invoice_id = invoice_id + LEFT JOIN accounts ON payment_account_id = account_id + WHERE invoice_client_id = $client_id + AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to" +); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>
-
-

Payments

-
-
-
- -
- -
-
- -
- -
-
-
- -
-
- Export -
-
- -
-
-
-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Payment DateInvoice DateInvoiceInvoice AmountPayment AmountMethodReferenceAccount
+
+

Payments

+
+
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+
+ Export +
+
+ +
+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Payment DateInvoice DateInvoiceInvoice AmountPayment AmountMethodReferenceAccount
+
+
- -
- + $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM quotes - LEFT JOIN categories ON category_id = quote_category_id - WHERE quote_client_id = $client_id - AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM quotes + LEFT JOIN categories ON category_id = quote_category_id + WHERE quote_client_id = $client_id + AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to" +); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); diff --git a/client_recurring_invoices.php b/client_recurring_invoices.php index 3c978527..fadeb453 100644 --- a/client_recurring_invoices.php +++ b/client_recurring_invoices.php @@ -1,141 +1,143 @@ - - $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT * FROM recurring - LEFT JOIN categories ON recurring_category_id = category_id - WHERE recurring_client_id = $client_id - AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR category_name LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT * FROM recurring + LEFT JOIN categories ON recurring_category_id = category_id + WHERE recurring_client_id = $client_id + AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR category_name LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?>
-
-

Recurring Invoices

-
- +
+

Recurring Invoices

+
+ +
-
-
-
- -
+
+ + +
+ +
+
+ +
+ +
+
+
+ +
+
+ Export +
+
-
-
- -
-
-
-
+ +
+
+ + "> + + + + + + + + + + + + + + -
- Export -
- + while ($row = mysqli_fetch_array($sql)) { + $recurring_id = $row['recurring_id']; + $recurring_prefix = htmlentities($row['recurring_prefix']); + $recurring_number = htmlentities($row['recurring_number']); + $recurring_scope = htmlentities($row['recurring_scope']); + $recurring_frequency = htmlentities($row['recurring_frequency']); + $recurring_status = htmlentities($row['recurring_status']); + $recurring_last_sent = $row['recurring_last_sent']; + if ($recurring_last_sent == 0) { + $recurring_last_sent = "-"; + } + $recurring_next_date = $row['recurring_next_date']; + $recurring_amount = floatval($row['recurring_amount']); + $recurring_currency_code = htmlentities($row['recurring_currency_code']); + $recurring_created_at = $row['recurring_created_at']; + $category_id = $row['category_id']; + $category_name = htmlentities($row['category_name']); + if ($recurring_status == 1) { + $status = "Active"; + $status_badge_color = "success"; + } else { + $status = "Inactive"; + $status_badge_color = "secondary"; + } - - -
-
-
NumberScopeFrequencyAmountLast SentNext DateCategoryStatusAction
- "> - - - - - - - - - - - - - - - while ($row = mysqli_fetch_array($sql)) { - $recurring_id = $row['recurring_id']; - $recurring_prefix = htmlentities($row['recurring_prefix']); - $recurring_number = htmlentities($row['recurring_number']); - $recurring_scope = htmlentities($row['recurring_scope']); - $recurring_frequency = htmlentities($row['recurring_frequency']); - $recurring_status = htmlentities($row['recurring_status']); - $recurring_last_sent = $row['recurring_last_sent']; - if ($recurring_last_sent == 0) { - $recurring_last_sent = "-"; - } - $recurring_next_date = $row['recurring_next_date']; - $recurring_amount = floatval($row['recurring_amount']); - $recurring_currency_code = htmlentities($row['recurring_currency_code']); - $recurring_created_at = $row['recurring_created_at']; - $category_id = $row['category_id']; - $category_name = htmlentities($row['category_name']); - if ($recurring_status == 1) { - $status = "Active"; - $status_badge_color = "success"; - }else{ - $status = "Inactive"; - $status_badge_color = "secondary"; - } - - ?> - - - - - - - - - - + + + + + + + + - - + + + - + ?> - -
NumberScopeFrequencyAmountLast SentNext DateCategoryStatusAction
ly +
ly - - -
+ +
+ + +
+
- -
- - - + $sb, ' $sql = mysqli_query( $mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets - LEFT JOIN clients on scheduled_ticket_client_id = client_id - WHERE scheduled_ticket_client_id = $client_id - AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%' - ORDER BY $sb $o LIMIT $record_from, $record_to" + LEFT JOIN clients on scheduled_ticket_client_id = client_id + WHERE scheduled_ticket_client_id = $client_id + AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%' + ORDER BY $sb $o LIMIT $record_from, $record_to" ); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - ?> @@ -95,10 +94,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal()">Edit - - Delete -
- + + Delete +
+
diff --git a/client_services.php b/client_services.php index 943eb574..5e3022d5 100644 --- a/client_services.php +++ b/client_services.php @@ -14,8 +14,8 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, ' // Overview SQL query $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM services - WHERE service_client_id = '$client_id' + "SELECT SQL_CALC_FOUND_ROWS * FROM services + WHERE service_client_id = '$client_id' AND (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%') ORDER BY $sb $o LIMIT $record_from, $record_to" ); @@ -112,12 +112,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); // Associated Assets (and their logins/networks/locations) $sql_assets = mysqli_query( $mysqli, - "SELECT * FROM service_assets - LEFT JOIN assets ON service_assets.asset_id = assets.asset_id - LEFT JOIN logins ON service_assets.asset_id = logins.login_asset_id - LEFT JOIN networks ON assets.asset_network_id = networks.network_id - LEFT JOIN locations ON assets.asset_location_id = locations.location_id - WHERE service_id = '$service_id'" + "SELECT * FROM service_assets + LEFT JOIN assets ON service_assets.asset_id = assets.asset_id + LEFT JOIN logins ON service_assets.asset_id = logins.login_asset_id + LEFT JOIN networks ON assets.asset_network_id = networks.network_id + LEFT JOIN locations ON assets.asset_location_id = locations.location_id + WHERE service_id = '$service_id'" ); // Associated logins diff --git a/client_shared_items.php b/client_shared_items.php index 22da8f11..a99a4c31 100644 --- a/client_shared_items.php +++ b/client_shared_items.php @@ -21,11 +21,11 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, ' $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM shared_items - WHERE item_client_id = $client_id + "SELECT SQL_CALC_FOUND_ROWS * FROM shared_items + WHERE item_client_id = $client_id AND item_active = '1' AND item_views != item_view_limit - AND item_expire_at > NOW() + AND item_expire_at > NOW() AND (item_note LIKE '%$q%') ORDER BY $sb $o LIMIT $record_from, $record_to" ); @@ -33,100 +33,98 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> -
-
-

Shared Items (Links)

-
-
-
- -
+
+
+

Shared Items (Links)

+
+
+ + +
-
-
- -
- +
+
+ +
+ +
+
- -
- -
-
- - "> - - - - - - - - - - - + +
+
+
Item NameItem TypeShare NoteViewsExpiresAction
+ "> - - - - - - + + + + + + - + + - -
- - - - Item NameItem TypeShare NoteViewsExpiresAction
+ while ($row = mysqli_fetch_array($sql)) { + $item_id = $row['item_id']; + $item_active = htmlentities($row['item_active']); + $item_key = htmlentities($row['item_key']); + $item_type = htmlentities($row['item_type']); + $item_related_id = $row['item_related_id']; + $item_note = htmlentities($row['item_note']); + $item_views = htmlentities($row['item_views']); + $item_view_limit = htmlentities($row['item_view_limit']); + $item_created_at = $row['item_created_at']; + $item_expire_at = $row['item_expire_at']; + + if ($item_type == 'Login') { + $share_item_sql = mysqli_query($mysqli, "SELECT login_name FROM logins WHERE login_id = '$item_related_id' AND login_client_id = '$client_id'"); + $share_item = mysqli_fetch_array($share_item_sql); + $item_name = htmlentities($share_item['login_name']); + } elseif ($item_type == 'Document') { + $share_item_sql = mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = '$item_related_id' AND document_client_id = '$client_id'"); + $share_item = mysqli_fetch_array($share_item_sql); + $item_name = htmlentities($share_item['document_name']); + } elseif ($item_type == 'File') { + $share_item_sql = mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id'"); + $share_item = mysqli_fetch_array($share_item_sql); + $item_name = htmlentities($share_item['file_name']); + } + + + ?> + + + + + + + + + + + + + + + + + +
+
-
-
$sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM software - LEFT JOIN logins ON login_software_id = software_id - WHERE software_client_id = $client_id - AND software_template = 0 - AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM software + LEFT JOIN logins ON login_software_id = software_id + WHERE software_client_id = $client_id + AND software_template = 0 + AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> -
-
-

Licenses

-
-
- - -