Merge pull request #611 from wrongecho/linting
General formatting/cleanup
This commit is contained in:
+5
-2
@@ -11,9 +11,12 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM accounts
|
||||||
WHERE account_name LIKE '%$q%' AND company_id = $session_company_id
|
WHERE account_name LIKE '%$q%' AND company_id = $session_company_id
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,9 @@ if (isset($_GET['network_get_json_details'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lookup all client locations, as networks can be associated with any client location
|
// Lookup all client locations, as networks can be associated with any client location
|
||||||
$locations_sql = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations
|
$locations_sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT location_id, location_name FROM locations
|
||||||
WHERE location_client_id = '$client_id' AND company_id = '$session_company_id'"
|
WHERE location_client_id = '$client_id' AND company_id = '$session_company_id'"
|
||||||
);
|
);
|
||||||
while ($row = mysqli_fetch_array($locations_sql)) {
|
while ($row = mysqli_fetch_array($locations_sql)) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ require_once('../require_post_method.php');
|
|||||||
require_once('contact_model.php');
|
require_once('contact_model.php');
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$insert_id = FALSE;
|
$insert_id = false;
|
||||||
|
|
||||||
if (!empty($name) && !empty($email) && !empty($client_id)) {
|
if (!empty($name) && !empty($email) && !empty($client_id)) {
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ require_once('../require_post_method.php');
|
|||||||
$contact_id = intval($_POST['contact_id']);
|
$contact_id = intval($_POST['contact_id']);
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$delete_count = FALSE;
|
$delete_count = false;
|
||||||
|
|
||||||
if (!empty($contact_id)) {
|
if (!empty($contact_id)) {
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_id = $contact_id AND contact_client_id = $client_id AND company_id = '$company_id' LIMIT 1"));
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_id = $contact_id AND contact_client_id = $client_id AND company_id = '$company_id' LIMIT 1"));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ require_once('../require_post_method.php');
|
|||||||
$contact_id = intval($_POST['contact_id']);
|
$contact_id = intval($_POST['contact_id']);
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$update_count = FALSE;
|
$update_count = false;
|
||||||
|
|
||||||
if (!empty($contact_id)) {
|
if (!empty($contact_id)) {
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -17,7 +17,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 categories
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM categories
|
||||||
WHERE category_name LIKE '%$q%'
|
WHERE category_name LIKE '%$q%'
|
||||||
AND category_type = '$category'
|
AND category_type = '$category'
|
||||||
AND category_archived_at IS NULL
|
AND category_archived_at IS NULL
|
||||||
@@ -28,7 +30,9 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM categories
|
|||||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||||
|
|
||||||
//Colors Used
|
//Colors Used
|
||||||
$sql_colors_used = mysqli_query($mysqli,"SELECT category_color FROM categories
|
$sql_colors_used = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT category_color FROM categories
|
||||||
WHERE category_type = '$category'
|
WHERE category_type = '$category'
|
||||||
AND category_archived_at IS NULL
|
AND category_archived_at IS NULL
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
|
|||||||
+3
-1
@@ -55,7 +55,9 @@ if (isset($_GET['type']) && ($_GET['type']) == 'workstation') {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 assets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM assets
|
||||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||||
LEFT JOIN locations ON asset_location_id = location_id
|
LEFT JOIN locations ON asset_location_id = location_id
|
||||||
LEFT JOIN logins ON login_asset_id = asset_id
|
LEFT JOIN logins ON login_asset_id = asset_id
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ if (isset($_GET['contact_id'])) {
|
|||||||
if ($contact_id == $primary_contact) {
|
if ($contact_id == $primary_contact) {
|
||||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||||
} else {
|
} else {
|
||||||
$primary_contact_display = FALSE;
|
$primary_contact_display = false;
|
||||||
}
|
}
|
||||||
$contact_location_id = $row['contact_location_id'];
|
$contact_location_id = $row['contact_location_id'];
|
||||||
$location_name = htmlentities($row['location_name']);
|
$location_name = htmlentities($row['location_name']);
|
||||||
|
|||||||
+1
-1
@@ -133,7 +133,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
if ($contact_id == $primary_contact) {
|
if ($contact_id == $primary_contact) {
|
||||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||||
} else {
|
} else {
|
||||||
$primary_contact_display = FALSE;
|
$primary_contact_display = false;
|
||||||
}
|
}
|
||||||
$contact_location_id = $row['contact_location_id'];
|
$contact_location_id = $row['contact_location_id'];
|
||||||
$location_name = htmlentities($row['location_name']);
|
$location_name = htmlentities($row['location_name']);
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ if (!empty($q)) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 documents
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
||||||
WHERE document_template = 1
|
WHERE document_template = 1
|
||||||
AND documents.company_id = $session_company_id
|
AND documents.company_id = $session_company_id
|
||||||
$query_snippet
|
$query_snippet
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ if (!empty($_GET['folder_id'])) {
|
|||||||
$get_folder_id = intval($_GET['folder_id']);
|
$get_folder_id = intval($_GET['folder_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
||||||
WHERE document_client_id = $client_id
|
WHERE document_client_id = $client_id
|
||||||
AND documents.company_id = $session_company_id
|
AND documents.company_id = $session_company_id
|
||||||
AND document_template = 0
|
AND document_template = 0
|
||||||
|
|||||||
+12
-10
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -17,11 +16,14 @@ if (!isset($_GET['o'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 invoices
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||||
LEFT JOIN categories ON invoice_category_id = category_id
|
LEFT JOIN categories ON invoice_category_id = category_id
|
||||||
WHERE invoice_client_id = $client_id
|
WHERE invoice_client_id = $client_id
|
||||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%')
|
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
@@ -149,8 +151,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("invoice_copy_modal.php");
|
require("invoice_copy_modal.php");
|
||||||
include("invoice_edit_modal.php");
|
require("invoice_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -158,10 +160,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("invoice_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("invoice_add_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
+5
-2
@@ -11,10 +11,13 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 logins
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM logins
|
||||||
WHERE login_client_id = $client_id
|
WHERE login_client_id = $client_id
|
||||||
AND (login_name LIKE '%$q%' OR login_uri LIKE '%$q%')
|
AND (login_name LIKE '%$q%' OR login_uri LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -17,7 +16,9 @@ if (!isset($_GET['o'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 logs
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM logs
|
||||||
LEFT JOIN users ON log_user_id = user_id
|
LEFT JOIN users ON log_user_id = user_id
|
||||||
WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%')
|
WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||||
AND log_client_id = $client_id
|
AND log_client_id = $client_id
|
||||||
@@ -109,8 +110,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("footer.php"); ?>
|
<?php require_once("footer.php"); ?>
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
|
|||||||
+3
-1
@@ -15,7 +15,9 @@ $sql_logins = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_client_id
|
|||||||
// Expiring Items
|
// Expiring Items
|
||||||
|
|
||||||
// Get Domains Expiring
|
// Get Domains Expiring
|
||||||
$sql_domains_expiring = mysqli_query($mysqli, "SELECT * FROM domains
|
$sql_domains_expiring = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM domains
|
||||||
WHERE domain_client_id = $client_id
|
WHERE domain_client_id = $client_id
|
||||||
AND domain_expire != '0000-00-00'
|
AND domain_expire != '0000-00-00'
|
||||||
AND domain_archived_at IS NULL
|
AND domain_archived_at IS NULL
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
// SQL
|
// SQL
|
||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
||||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||||
WHERE scheduled_ticket_client_id = $client_id
|
WHERE scheduled_ticket_client_id = $client_id
|
||||||
AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||||
|
|||||||
+34
-28
@@ -12,7 +12,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
// Overview SQL query
|
// Overview SQL query
|
||||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM services
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM services
|
||||||
WHERE service_client_id = '$client_id'
|
WHERE service_client_id = '$client_id'
|
||||||
AND (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%')
|
AND (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||||
@@ -108,35 +110,36 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Associated Assets (and their logins/networks/locations)
|
// Associated Assets (and their logins/networks/locations)
|
||||||
$sql_assets = mysqli_query($mysqli, "SELECT * FROM service_assets
|
$sql_assets = mysqli_query(
|
||||||
LEFT JOIN assets
|
$mysqli,
|
||||||
ON service_assets.asset_id = assets.asset_id
|
"SELECT * FROM service_assets
|
||||||
LEFT JOIN logins
|
LEFT JOIN assets ON service_assets.asset_id = assets.asset_id
|
||||||
ON service_assets.asset_id = logins.login_asset_id
|
LEFT JOIN logins ON service_assets.asset_id = logins.login_asset_id
|
||||||
LEFT JOIN networks
|
LEFT JOIN networks ON assets.asset_network_id = networks.network_id
|
||||||
ON assets.asset_network_id = networks.network_id
|
LEFT JOIN locations ON assets.asset_location_id = locations.location_id
|
||||||
LEFT JOIN locations
|
|
||||||
ON assets.asset_location_id = locations.location_id
|
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associated logins
|
// Associated logins
|
||||||
$sql_logins = mysqli_query($mysqli, "SELECT * FROM service_logins
|
$sql_logins = mysqli_query(
|
||||||
LEFT JOIN logins
|
$mysqli,
|
||||||
ON service_logins.login_id = logins.login_id
|
"SELECT * FROM service_logins
|
||||||
|
LEFT JOIN logins ON service_logins.login_id = logins.login_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associated Domains
|
// Associated Domains
|
||||||
$sql_domains = mysqli_query($mysqli, "SELECT * FROM service_domains
|
$sql_domains = mysqli_query(
|
||||||
LEFT JOIN domains
|
$mysqli,
|
||||||
ON service_domains.domain_id = domains.domain_id
|
"SELECT * FROM service_domains
|
||||||
|
LEFT JOIN domains ON service_domains.domain_id = domains.domain_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
// Associated Certificates
|
// Associated Certificates
|
||||||
$sql_certificates = mysqli_query($mysqli, "SELECT * FROM service_certificates
|
$sql_certificates = mysqli_query(
|
||||||
LEFT JOIN certificates
|
$mysqli,
|
||||||
ON service_certificates.certificate_id = certificates.certificate_id
|
"SELECT * FROM service_certificates
|
||||||
|
LEFT JOIN certificates ON service_certificates.certificate_id = certificates.certificate_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -145,23 +148,26 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
//WHERE service_id = '$service_id'");
|
//WHERE service_id = '$service_id'");
|
||||||
|
|
||||||
// Associated Vendors
|
// Associated Vendors
|
||||||
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM service_vendors
|
$sql_vendors = mysqli_query(
|
||||||
LEFT JOIN vendors
|
$mysqli,
|
||||||
ON service_vendors.vendor_id = vendors.vendor_id
|
"SELECT * FROM service_vendors
|
||||||
|
LEFT JOIN vendors ON service_vendors.vendor_id = vendors.vendor_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associated Contacts
|
// Associated Contacts
|
||||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM service_contacts
|
$sql_contacts = mysqli_query(
|
||||||
LEFT JOIN contacts
|
$mysqli,
|
||||||
ON service_contacts.contact_id = contacts.contact_id
|
"SELECT * FROM service_contacts
|
||||||
|
LEFT JOIN contacts ON service_contacts.contact_id = contacts.contact_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associated Documents
|
// Associated Documents
|
||||||
$sql_docs = mysqli_query($mysqli, "SELECT * FROM service_documents
|
$sql_docs = mysqli_query(
|
||||||
LEFT JOIN documents
|
$mysqli,
|
||||||
ON service_documents.document_id = documents.document_id
|
"SELECT * FROM service_documents
|
||||||
|
LEFT JOIN documents ON service_documents.document_id = documents.document_id
|
||||||
WHERE service_id = '$service_id'"
|
WHERE service_id = '$service_id'"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (isset($_GET['q'])) {
|
if (isset($_GET['q'])) {
|
||||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||||
@@ -20,12 +19,15 @@ $sb = "item_created_at";
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 shared_items
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM shared_items
|
||||||
WHERE item_client_id = $client_id
|
WHERE item_client_id = $client_id
|
||||||
AND item_active = '1'
|
AND item_active = '1'
|
||||||
AND item_views != item_view_limit
|
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");
|
AND (item_note LIKE '%$q%') 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()"));
|
||||||
|
|
||||||
@@ -83,13 +85,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
$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_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);
|
$share_item = mysqli_fetch_array($share_item_sql);
|
||||||
$item_name = htmlentities($share_item['login_name']);
|
$item_name = htmlentities($share_item['login_name']);
|
||||||
}
|
} elseif ($item_type == 'Document') {
|
||||||
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_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);
|
$share_item = mysqli_fetch_array($share_item_sql);
|
||||||
$item_name = htmlentities($share_item['document_name']);
|
$item_name = htmlentities($share_item['document_name']);
|
||||||
}
|
} elseif ($item_type == 'File') {
|
||||||
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_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);
|
$share_item = mysqli_fetch_array($share_item_sql);
|
||||||
$item_name = htmlentities($share_item['file_name']);
|
$item_name = htmlentities($share_item['file_name']);
|
||||||
@@ -124,8 +124,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("footer.php"); ?>
|
<?php
|
||||||
|
require_once("footer.php");
|
||||||
|
|||||||
+8
-10
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -122,8 +121,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
<td><?php echo "$seat_count / $software_seats"; ?></td>
|
<td><?php echo "$seat_count / $software_seats"; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if ($login_id > 0) {
|
if ($login_id > 0) { ?>
|
||||||
?>
|
|
||||||
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
|
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
|
||||||
|
|
||||||
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
||||||
@@ -182,7 +180,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("client_software_edit_modal.php");
|
require("client_software_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -190,11 +188,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("client_software_add_modal.php"); ?>
|
<?php
|
||||||
<?php include("client_software_add_from_template_modal.php"); ?>
|
require_once("client_software_add_modal.php");
|
||||||
|
require_once("client_software_add_from_template_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if(!empty($_GET['sb'])){
|
if(!empty($_GET['sb'])){
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -102,7 +101,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("client_software_template_edit_modal.php");
|
require("client_software_template_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -110,10 +109,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("client_software_template_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("client_software_template_add_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
+11
-11
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -17,14 +16,17 @@ if (!isset($_GET['o'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 tickets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||||
LEFT JOIN assets ON ticket_asset_id = asset_id
|
LEFT JOIN assets ON ticket_asset_id = asset_id
|
||||||
LEFT JOIN locations ON ticket_location_id = location_id
|
LEFT JOIN locations ON ticket_location_id = location_id
|
||||||
WHERE ticket_client_id = $client_id
|
WHERE ticket_client_id = $client_id
|
||||||
AND (CONCAT(ticket_prefix,ticket_number) LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%' OR ticket_priority LIKE '%$q%' OR user_name LIKE '%$q%')
|
AND (CONCAT(ticket_prefix,ticket_number) LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%' OR ticket_priority LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
@@ -183,7 +185,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("ticket_edit_modal.php");
|
require("ticket_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -191,13 +193,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("ticket_add_modal.php");
|
require_once("ticket_add_modal.php");
|
||||||
include("scheduled_ticket_add_modal.php");
|
require_once("scheduled_ticket_add_modal.php");
|
||||||
?>
|
require_once("footer.php");
|
||||||
|
|
||||||
<?php include("footer.php"); ?>
|
|
||||||
|
|||||||
+21
-31
@@ -1,6 +1,5 @@
|
|||||||
<?php require_once("inc_all_client.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("inc_all_client.php");
|
||||||
|
|
||||||
if (isset($_GET['q'])) {
|
if (isset($_GET['q'])) {
|
||||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||||
@@ -23,9 +22,12 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 vendors
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||||
WHERE vendor_template = 1
|
WHERE vendor_template = 1
|
||||||
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%') ORDER BY $sb $o LIMIT $record_from, $record_to");
|
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%') 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()"));
|
||||||
|
|
||||||
@@ -108,42 +110,30 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
<i class="fa fa-fw fa-building text-secondary"></i>
|
<i class="fa fa-fw fa-building text-secondary"></i>
|
||||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($vendor_account_number)) {
|
if (!empty($vendor_account_number)) { ?>
|
||||||
?>
|
|
||||||
<br>
|
<br>
|
||||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</th>
|
</th>
|
||||||
<td><?php echo $vendor_description_display; ?></td>
|
<td><?php echo $vendor_description_display; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($vendor_contact_name)) {
|
if (!empty($vendor_contact_name)) { ?>
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php } else {
|
||||||
}else{
|
|
||||||
echo $vendor_contact_name_display;
|
echo $vendor_contact_name_display;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?php
|
if (!empty($vendor_phone)) { ?>
|
||||||
if (!empty($vendor_phone)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php }
|
||||||
}
|
|
||||||
?>
|
if (!empty($vendor_email)) { ?>
|
||||||
<?php
|
|
||||||
if (!empty($vendor_email)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<div class="dropdown dropleft text-center">
|
||||||
@@ -163,7 +153,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("vendor_template_edit_modal.php");
|
require("vendor_template_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -171,10 +161,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("vendor_template_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("vendor_template_add_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
foreach($domainAlertArray as $day){
|
foreach($domainAlertArray as $day){
|
||||||
|
|
||||||
//Get Domains Expiring
|
//Get Domains Expiring
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM domains
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM domains
|
||||||
LEFT JOIN clients ON domain_client_id = client_id
|
LEFT JOIN clients ON domain_client_id = client_id
|
||||||
WHERE domain_expire = CURDATE() + INTERVAL $day DAY
|
WHERE domain_expire = CURDATE() + INTERVAL $day DAY
|
||||||
AND domains.company_id = $company_id"
|
AND domains.company_id = $company_id"
|
||||||
@@ -108,7 +110,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
foreach($certificateAlertArray as $day){
|
foreach($certificateAlertArray as $day){
|
||||||
|
|
||||||
//Get Certs Expiring
|
//Get Certs Expiring
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM certificates
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM certificates
|
||||||
LEFT JOIN clients ON certificate_client_id = client_id
|
LEFT JOIN clients ON certificate_client_id = client_id
|
||||||
WHERE certificate_expire = CURDATE() + INTERVAL $day DAY
|
WHERE certificate_expire = CURDATE() + INTERVAL $day DAY
|
||||||
AND certificates.company_id = $company_id"
|
AND certificates.company_id = $company_id"
|
||||||
@@ -135,7 +139,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
foreach($warranty_alert_array as $day){
|
foreach($warranty_alert_array as $day){
|
||||||
|
|
||||||
//Get Asset Warranty Expiring
|
//Get Asset Warranty Expiring
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM assets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM assets
|
||||||
LEFT JOIN clients ON asset_client_id = client_id
|
LEFT JOIN clients ON asset_client_id = client_id
|
||||||
WHERE asset_warranty_expire = CURDATE() + INTERVAL $day DAY
|
WHERE asset_warranty_expire = CURDATE() + INTERVAL $day DAY
|
||||||
AND assets.company_id = $company_id"
|
AND assets.company_id = $company_id"
|
||||||
@@ -212,10 +218,19 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
$subject = "Ticket created - [$ticket_prefix$ticket_number] - $ticket_subject (scheduled)";
|
$subject = "Ticket created - [$ticket_prefix$ticket_number] - $ticket_subject (scheduled)";
|
||||||
$body = "<i style='color: #808080'>#--itflow--#</i><br><br>Hello, $contact_name<br><br>A ticket regarding \"$ticket_subject\" has been automatically created for you.<br><br>--------------------------------<br>$details--------------------------------<br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: Open<br>Portal: https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone";
|
$body = "<i style='color: #808080'>#--itflow--#</i><br><br>Hello, $contact_name<br><br>A ticket regarding \"$ticket_subject\" has been automatically created for you.<br><br>--------------------------------<br>$details--------------------------------<br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: Open<br>Portal: https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_ticket_from_email, $config_ticket_from_name,
|
$config_smtp_host,
|
||||||
$contact_email, $contact_name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_ticket_from_email,
|
||||||
|
$config_ticket_from_name,
|
||||||
|
$contact_email,
|
||||||
|
$contact_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
|
||||||
if ($mail !== true) {
|
if ($mail !== true) {
|
||||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $contact_email', notification_timestamp = NOW(), company_id = $company_id");
|
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $contact_email', notification_timestamp = NOW(), company_id = $company_id");
|
||||||
@@ -273,7 +288,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
|
|
||||||
foreach($invoiceAlertArray as $day){
|
foreach($invoiceAlertArray as $day){
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM invoices
|
||||||
LEFT JOIN clients ON invoice_client_id = client_id
|
LEFT JOIN clients ON invoice_client_id = client_id
|
||||||
LEFT JOIN contacts ON contact_id = primary_contact
|
LEFT JOIN contacts ON contact_id = primary_contact
|
||||||
WHERE invoice_status NOT LIKE 'Draft'
|
WHERE invoice_status NOT LIKE 'Draft'
|
||||||
@@ -306,10 +323,19 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
<br><br>
|
<br><br>
|
||||||
Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_invoice_from_email, $config_invoice_from_name,
|
$config_smtp_host,
|
||||||
$contact_email, $contact_name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_invoice_from_email,
|
||||||
|
$config_invoice_from_name,
|
||||||
|
$contact_email,
|
||||||
|
$contact_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
|
||||||
if ($mail === true) {
|
if ($mail === true) {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron Emailed Overdue Invoice', history_created_at = NOW(), history_invoice_id = $invoice_id, company_id = $company_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron Emailed Overdue Invoice', history_created_at = NOW(), history_invoice_id = $invoice_id, company_id = $company_id");
|
||||||
@@ -389,7 +415,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
mysqli_query($mysqli, "UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency), recurring_updated_at = NOW() WHERE recurring_id = $recurring_id");
|
mysqli_query($mysqli, "UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency), recurring_updated_at = NOW() WHERE recurring_id = $recurring_id");
|
||||||
|
|
||||||
if($config_recurring_auto_send_invoice == 1){
|
if($config_recurring_auto_send_invoice == 1){
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM invoices
|
||||||
LEFT JOIN clients ON invoice_client_id = client_id
|
LEFT JOIN clients ON invoice_client_id = client_id
|
||||||
LEFT JOIN contacts ON contact_id = primary_contact
|
LEFT JOIN contacts ON contact_id = primary_contact
|
||||||
WHERE invoice_id = $new_invoice_id
|
WHERE invoice_id = $new_invoice_id
|
||||||
@@ -412,10 +440,19 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||||||
$subject = "Invoice $invoice_prefix$invoice_number";
|
$subject = "Invoice $invoice_prefix$invoice_number";
|
||||||
$body = "Hello $contact_name,<br><br>Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$new_invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
$body = "Hello $contact_name,<br><br>Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$new_invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_invoice_from_email, $config_invoice_from_name,
|
$config_smtp_host,
|
||||||
$contact_email, $contact_name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_invoice_from_email,
|
||||||
|
$config_invoice_from_name,
|
||||||
|
$contact_email,
|
||||||
|
$contact_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
|
||||||
if ($mail === true) {
|
if ($mail === true) {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron Emailed Invoice!', history_created_at = NOW(), history_invoice_id = $new_invoice_id, company_id = $company_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron Emailed Invoice!', history_created_at = NOW(), history_invoice_id = $new_invoice_id, company_id = $company_id");
|
||||||
|
|||||||
@@ -88,10 +88,19 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $comp
|
|||||||
$email_subject = "Ticket created - [$config_ticket_prefix$ticket_number] - $subject";
|
$email_subject = "Ticket created - [$config_ticket_prefix$ticket_number] - $subject";
|
||||||
$email_body = "<i style='color: #808080'>#--itflow--#</i><br><br>Hello, $contact_name<br><br>Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: Open<br>https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone";
|
$email_body = "<i style='color: #808080'>#--itflow--#</i><br><br>Hello, $contact_name<br><br>Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: Open<br>https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_ticket_from_email, $config_ticket_from_name,
|
$config_smtp_host,
|
||||||
$contact_email, $contact_name,
|
$config_smtp_username,
|
||||||
$email_subject, $email_body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_ticket_from_email,
|
||||||
|
$config_ticket_from_name,
|
||||||
|
$contact_email,
|
||||||
|
$contact_name,
|
||||||
|
$email_subject,
|
||||||
|
$email_body
|
||||||
|
);
|
||||||
|
|
||||||
if ($mail !== true) {
|
if ($mail !== true) {
|
||||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $contact_email', notification_timestamp = NOW(), company_id = $company_id");
|
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $contact_email', notification_timestamp = NOW(), company_id = $company_id");
|
||||||
|
|||||||
@@ -58,14 +58,18 @@ $profit = $total_income - $total_expenses;
|
|||||||
|
|
||||||
$sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts WHERE company_id = $session_company_id");
|
$sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts WHERE company_id = $session_company_id");
|
||||||
|
|
||||||
$sql_latest_invoice_payments = mysqli_query($mysqli, "SELECT * FROM payments, invoices, clients
|
$sql_latest_invoice_payments = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM payments, invoices, clients
|
||||||
WHERE payment_invoice_id = invoice_id
|
WHERE payment_invoice_id = invoice_id
|
||||||
AND invoice_client_id = client_id
|
AND invoice_client_id = client_id
|
||||||
AND clients.company_id = $session_company_id
|
AND clients.company_id = $session_company_id
|
||||||
ORDER BY payment_id DESC LIMIT 5"
|
ORDER BY payment_id DESC LIMIT 5"
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql_latest_expenses = mysqli_query($mysqli, "SELECT * FROM expenses, vendors, categories
|
$sql_latest_expenses = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM expenses, vendors, categories
|
||||||
WHERE expense_vendor_id = vendor_id
|
WHERE expense_vendor_id = vendor_id
|
||||||
AND expense_category_id = category_id
|
AND expense_category_id = category_id
|
||||||
AND expenses.company_id = $session_company_id
|
AND expenses.company_id = $session_company_id
|
||||||
|
|||||||
+21
-7
@@ -9,7 +9,9 @@ if (isset($_GET['year'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GET unique years from expenses, payments and revenues
|
// GET unique years from expenses, payments and revenues
|
||||||
$sql_payment_years = mysqli_query($mysqli, "SELECT YEAR(expense_date) AS all_years FROM expenses
|
$sql_payment_years = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT YEAR(expense_date) AS all_years FROM expenses
|
||||||
WHERE company_id = $session_company_id
|
WHERE company_id = $session_company_id
|
||||||
UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id
|
UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id
|
||||||
UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues WHERE company_id = $session_company_id
|
UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues WHERE company_id = $session_company_id
|
||||||
@@ -17,28 +19,36 @@ $sql_payment_years = mysqli_query($mysqli, "SELECT YEAR(expense_date) AS all_yea
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Get Total Clients added
|
// Get Total Clients added
|
||||||
$sql_clients = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('client_id') AS clients_added FROM clients
|
$sql_clients = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('client_id') AS clients_added FROM clients
|
||||||
WHERE YEAR(client_created_at) = $year
|
WHERE YEAR(client_created_at) = $year
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
));
|
));
|
||||||
$clients_added = $sql_clients['clients_added'];
|
$clients_added = $sql_clients['clients_added'];
|
||||||
|
|
||||||
// Get Total contacts added
|
// Get Total contacts added
|
||||||
$sql_contacts = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('contact_id') AS contacts_added FROM contacts
|
$sql_contacts = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('contact_id') AS contacts_added FROM contacts
|
||||||
WHERE YEAR(contact_created_at) = $year
|
WHERE YEAR(contact_created_at) = $year
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
));
|
));
|
||||||
$contacts_added = $sql_contacts['contacts_added'];
|
$contacts_added = $sql_contacts['contacts_added'];
|
||||||
|
|
||||||
// Get Total assets added
|
// Get Total assets added
|
||||||
$sql_assets = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('asset_id') AS assets_added FROM assets
|
$sql_assets = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('asset_id') AS assets_added FROM assets
|
||||||
WHERE YEAR(asset_created_at) = $year
|
WHERE YEAR(asset_created_at) = $year
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
));
|
));
|
||||||
$assets_added = $sql_assets['assets_added'];
|
$assets_added = $sql_assets['assets_added'];
|
||||||
|
|
||||||
// Ticket count
|
// Ticket count
|
||||||
$sql_tickets = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS active_tickets
|
$sql_tickets = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('ticket_id') AS active_tickets
|
||||||
FROM tickets
|
FROM tickets
|
||||||
WHERE ticket_status != 'Closed'
|
WHERE ticket_status != 'Closed'
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
@@ -46,7 +56,9 @@ $sql_tickets = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id
|
|||||||
$active_tickets = $sql_tickets['active_tickets'];
|
$active_tickets = $sql_tickets['active_tickets'];
|
||||||
|
|
||||||
// Expiring domains (but not ones that have already expired)
|
// Expiring domains (but not ones that have already expired)
|
||||||
$sql_domains_expiring = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('domain_id') as expiring_domains
|
$sql_domains_expiring = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('domain_id') as expiring_domains
|
||||||
FROM domains
|
FROM domains
|
||||||
WHERE domain_expire != '0000-00-00'
|
WHERE domain_expire != '0000-00-00'
|
||||||
AND domain_expire > CURRENT_DATE
|
AND domain_expire > CURRENT_DATE
|
||||||
@@ -57,7 +69,9 @@ $sql_domains_expiring = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('
|
|||||||
$expiring_domains = $sql_domains_expiring['expiring_domains'];
|
$expiring_domains = $sql_domains_expiring['expiring_domains'];
|
||||||
|
|
||||||
// Expiring Certificates (but not ones that have already expired)
|
// Expiring Certificates (but not ones that have already expired)
|
||||||
$sql_certs_expiring = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('certificate_id') as expiring_certs
|
$sql_certs_expiring = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('certificate_id') as expiring_certs
|
||||||
FROM certificates
|
FROM certificates
|
||||||
WHERE certificate_expire != '0000-00-00'
|
WHERE certificate_expire != '0000-00-00'
|
||||||
AND certificate_expire > CURRENT_DATE
|
AND certificate_expire > CURRENT_DATE
|
||||||
|
|||||||
+3
-3
@@ -405,7 +405,7 @@ function getDomainRecords($name) {
|
|||||||
function getSSL($name) {
|
function getSSL($name) {
|
||||||
|
|
||||||
$certificate = array();
|
$certificate = array();
|
||||||
$certificate['success'] = FALSE;
|
$certificate['success'] = false;
|
||||||
|
|
||||||
// Only run if we think the domain is valid
|
// Only run if we think the domain is valid
|
||||||
if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
||||||
@@ -417,7 +417,7 @@ function getSSL($name) {
|
|||||||
|
|
||||||
// Get SSL/TSL certificate (using verify peer false to allow for self-signed certs) for domain on default port
|
// Get SSL/TSL certificate (using verify peer false to allow for self-signed certs) for domain on default port
|
||||||
$socket = "ssl://$name:443";
|
$socket = "ssl://$name:443";
|
||||||
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE, "verify_peer" => FALSE,)));
|
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => true, "verify_peer" => false,)));
|
||||||
$read = stream_socket_client($socket, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $get);
|
$read = stream_socket_client($socket, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $get);
|
||||||
|
|
||||||
// If the socket connected
|
// If the socket connected
|
||||||
@@ -427,7 +427,7 @@ function getSSL($name) {
|
|||||||
openssl_x509_export($cert['options']['ssl']['peer_certificate'], $export);
|
openssl_x509_export($cert['options']['ssl']['peer_certificate'], $export);
|
||||||
|
|
||||||
if ($cert_public_key_obj) {
|
if ($cert_public_key_obj) {
|
||||||
$certificate['success'] = TRUE;
|
$certificate['success'] = true;
|
||||||
$certificate['expire'] = date('Y-m-d', $cert_public_key_obj['validTo_time_t']);
|
$certificate['expire'] = date('Y-m-d', $cert_public_key_obj['validTo_time_t']);
|
||||||
$certificate['issued_by'] = strip_tags($cert_public_key_obj['issuer']['O']);
|
$certificate['issued_by'] = strip_tags($cert_public_key_obj['issuer']['O']);
|
||||||
$certificate['public_key'] = $export;
|
$certificate['public_key'] = $export;
|
||||||
|
|||||||
@@ -275,10 +275,18 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||||||
$subject = "Payment Received - Invoice $invoice_prefix$invoice_number";
|
$subject = "Payment Received - Invoice $invoice_prefix$invoice_number";
|
||||||
$body = "Hello $contact_name,<br><br>We have received your payment in the amount of " . $pi_currency . $pi_amount_paid . " for invoice <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>$invoice_prefix$invoice_number</a>. Please keep this email as a receipt for your records.<br><br>Amount: " . numfmt_format_currency($currency_format, $pi_amount_paid, $invoice_currency_code) . "<br>Balance: " . numfmt_format_currency($currency_format, '0', $invoice_currency_code) . "<br><br>Thank you for your business!<br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
$body = "Hello $contact_name,<br><br>We have received your payment in the amount of " . $pi_currency . $pi_amount_paid . " for invoice <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>$invoice_prefix$invoice_number</a>. Please keep this email as a receipt for your records.<br><br>Amount: " . numfmt_format_currency($currency_format, $pi_amount_paid, $invoice_currency_code) . "<br>Balance: " . numfmt_format_currency($currency_format, '0', $invoice_currency_code) . "<br><br>Thank you for your business!<br><br><br>~<br>$company_name<br>Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_invoice_from_email, $config_invoice_from_name,
|
$config_smtp_host,
|
||||||
$contact_email, $contact_name,
|
$config_smtp_username,
|
||||||
$subject, $body
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_invoice_from_email,
|
||||||
|
$config_invoice_from_name,
|
||||||
|
$contact_email,
|
||||||
|
$contact_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
);
|
);
|
||||||
|
|
||||||
// Email Logging
|
// Email Logging
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
|
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
|
||||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
|
|
||||||
require_once("guest_header.php"); ?>
|
require_once("guest_header.php"); ?>
|
||||||
|
|||||||
+15
-5
@@ -185,7 +185,9 @@ if (isset($_GET['client_id'])) {
|
|||||||
// Expiring Items
|
// Expiring Items
|
||||||
|
|
||||||
// Count Domains Expiring within 30 Days
|
// Count Domains Expiring within 30 Days
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('domain_id') AS num FROM domains
|
$row = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('domain_id') AS num FROM domains
|
||||||
WHERE domain_client_id = $client_id
|
WHERE domain_client_id = $client_id
|
||||||
AND domain_expire != '0000-00-00'
|
AND domain_expire != '0000-00-00'
|
||||||
AND domain_expire < CURRENT_DATE + INTERVAL 30 DAY
|
AND domain_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||||
@@ -195,7 +197,9 @@ if (isset($_GET['client_id'])) {
|
|||||||
$num_domains_expiring = $row['num'];
|
$num_domains_expiring = $row['num'];
|
||||||
|
|
||||||
// Count Certificates Expiring within 30 Days
|
// Count Certificates Expiring within 30 Days
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('certificate_id') AS num FROM certificates
|
$row = mysqli_fetch_assoc(mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT COUNT('certificate_id') AS num FROM certificates
|
||||||
WHERE certificate_client_id = $client_id
|
WHERE certificate_client_id = $client_id
|
||||||
AND certificate_expire != '0000-00-00'
|
AND certificate_expire != '0000-00-00'
|
||||||
AND certificate_expire < CURRENT_DATE + INTERVAL 30 DAY
|
AND certificate_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||||
@@ -205,7 +209,9 @@ if (isset($_GET['client_id'])) {
|
|||||||
$num_certs_expiring = $row['num'];
|
$num_certs_expiring = $row['num'];
|
||||||
|
|
||||||
// Get Asset Warranties Expiring
|
// Get Asset Warranties Expiring
|
||||||
$sql_asset_warranties_expiring = mysqli_query($mysqli,"SELECT * FROM assets
|
$sql_asset_warranties_expiring = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM assets
|
||||||
WHERE asset_client_id = $client_id
|
WHERE asset_client_id = $client_id
|
||||||
AND asset_warranty_expire != '0000-00-00'
|
AND asset_warranty_expire != '0000-00-00'
|
||||||
AND asset_archived_at IS NULL
|
AND asset_archived_at IS NULL
|
||||||
@@ -214,7 +220,9 @@ if (isset($_GET['client_id'])) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Get Assets Retiring
|
// Get Assets Retiring
|
||||||
$sql_asset_retire = mysqli_query($mysqli,"SELECT * FROM assets
|
$sql_asset_retire = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM assets
|
||||||
WHERE asset_client_id = $client_id
|
WHERE asset_client_id = $client_id
|
||||||
AND asset_install_date != '0000-00-00'
|
AND asset_install_date != '0000-00-00'
|
||||||
AND asset_archived_at IS NULL
|
AND asset_archived_at IS NULL
|
||||||
@@ -223,7 +231,9 @@ if (isset($_GET['client_id'])) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Get Stale Tickets
|
// Get Stale Tickets
|
||||||
$sql_tickets_stale = mysqli_query($mysqli,"SELECT * FROM tickets
|
$sql_tickets_stale = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM tickets
|
||||||
WHERE ticket_client_id = $client_id
|
WHERE ticket_client_id = $client_id
|
||||||
AND ticket_created_at < CURRENT_DATE - INTERVAL 14 DAY
|
AND ticket_created_at < CURRENT_DATE - INTERVAL 14 DAY
|
||||||
AND ticket_status != 'Closed'
|
AND ticket_status != 'Closed'
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ $config_mail_from_email = $row['config_mail_from_email'];
|
|||||||
$config_mail_from_name = $row['config_mail_from_name'];
|
$config_mail_from_name = $row['config_mail_from_name'];
|
||||||
|
|
||||||
// HTTP-Only cookies
|
// HTTP-Only cookies
|
||||||
ini_set("session.cookie_httponly", True);
|
ini_set("session.cookie_httponly", true);
|
||||||
|
|
||||||
// Tell client to only send cookie(s) over HTTPS
|
// Tell client to only send cookie(s) over HTTPS
|
||||||
if ($config_https_only) {
|
if ($config_https_only) {
|
||||||
ini_set("session.cookie_secure", True);
|
ini_set("session.cookie_secure", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle POST login request
|
// Handle POST login request
|
||||||
@@ -99,10 +99,19 @@ if (isset($_POST['login'])) {
|
|||||||
$subject = "$config_app_name new login for $user_name";
|
$subject = "$config_app_name new login for $user_name";
|
||||||
$body = "Hi $user_name, <br><br>A recent successful login to your $config_app_name account was considered a little unusual. If this was you, you can safely ignore this email!<br><br>IP Address: $ip<br> User Agent: $user_agent <br><br>If you did not perform this login, your credentials may be compromised. <br><br>Thanks, <br>ITFlow";
|
$body = "Hi $user_name, <br><br>A recent successful login to your $config_app_name account was considered a little unusual. If this was you, you can safely ignore this email!<br><br>IP Address: $ip<br> User Agent: $user_agent <br><br>If you did not perform this login, your credentials may be compromised. <br><br>Thanks, <br>ITFlow";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_mail_from_email, $config_mail_from_name,
|
$config_smtp_host,
|
||||||
$user_email, $user_name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_mail_from_email,
|
||||||
|
$config_mail_from_name,
|
||||||
|
$user_email,
|
||||||
|
$user_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -120,7 +129,7 @@ if (isset($_POST['login'])) {
|
|||||||
$_SESSION['user_name'] = $user_name;
|
$_SESSION['user_name'] = $user_name;
|
||||||
$_SESSION['user_role'] = $row['user_role'];
|
$_SESSION['user_role'] = $row['user_role'];
|
||||||
$_SESSION['csrf_token'] = randomString(156);
|
$_SESSION['csrf_token'] = randomString(156);
|
||||||
$_SESSION['logged'] = TRUE;
|
$_SESSION['logged'] = true;
|
||||||
|
|
||||||
// Setup encryption session key
|
// Setup encryption session key
|
||||||
if (isset($row['user_specific_encryption_ciphertext']) && $row['user_role'] > 1) {
|
if (isset($row['user_specific_encryption_ciphertext']) && $row['user_role'] > 1) {
|
||||||
@@ -174,10 +183,19 @@ if (isset($_POST['login'])) {
|
|||||||
$subject = "Important: $config_app_name failed 2FA login attempt for $user_name";
|
$subject = "Important: $config_app_name failed 2FA login attempt for $user_name";
|
||||||
$body = "Hi $user_name, <br><br>A recent login to your $config_app_name account was unsuccessful due to an incorrect 2FA code. If you did not attempt this login, your credentials may be compromised. <br><br>Thanks, <br>ITFlow";
|
$body = "Hi $user_name, <br><br>A recent login to your $config_app_name account was unsuccessful due to an incorrect 2FA code. If you did not attempt this login, your credentials may be compromised. <br><br>Thanks, <br>ITFlow";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_mail_from_email, $config_mail_from_name,
|
$config_smtp_host,
|
||||||
$user_email, $user_name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_mail_from_email,
|
||||||
|
$config_mail_from_name,
|
||||||
|
$user_email,
|
||||||
|
$user_name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTML feedback for incorrect 2FA code
|
// HTML feedback for incorrect 2FA code
|
||||||
|
|||||||
@@ -56,7 +56,9 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 logs
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM logs
|
||||||
LEFT JOIN users ON log_user_id = user_id
|
LEFT JOIN users ON log_user_id = user_id
|
||||||
LEFT JOIN clients ON log_client_id = client_id
|
LEFT JOIN clients ON log_client_id = client_id
|
||||||
WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||||
|
|||||||
+8
-9
@@ -1,4 +1,5 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -54,7 +55,9 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 payments
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM payments
|
||||||
LEFT JOIN invoices ON payment_invoice_id = invoice_id
|
LEFT JOIN invoices ON payment_invoice_id = invoice_id
|
||||||
LEFT JOIN clients ON invoice_client_id = client_id
|
LEFT JOIN clients ON invoice_client_id = client_id
|
||||||
LEFT JOIN accounts ON payment_account_id = account_id
|
LEFT JOIN accounts ON payment_account_id = account_id
|
||||||
@@ -170,17 +173,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
<td><?php echo $account_name; ?></td>
|
<td><?php echo $account_name; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php } ?>
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("footer.php"); ?>
|
<?php require_once("footer.php"); ?>
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ require_once('portal_functions.php');
|
|||||||
|
|
||||||
if (!isset($_SESSION)) {
|
if (!isset($_SESSION)) {
|
||||||
// HTTP Only cookies
|
// HTTP Only cookies
|
||||||
ini_set("session.cookie_httponly", True);
|
ini_set("session.cookie_httponly", true);
|
||||||
if ($config_https_only) {
|
if ($config_https_only) {
|
||||||
// Tell client to only send cookie(s) over HTTPS
|
// Tell client to only send cookie(s) over HTTPS
|
||||||
ini_set("session.cookie_secure", True);
|
ini_set("session.cookie_secure", true);
|
||||||
}
|
}
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -18,9 +18,7 @@ $invoices_sql = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_clie
|
|||||||
<div class="col-md-1 text-center">
|
<div class="col-md-1 text-center">
|
||||||
<?php if (!empty($session_contact_photo)) { ?>
|
<?php if (!empty($session_contact_photo)) { ?>
|
||||||
<img src="<?php echo "../uploads/clients/$session_company_id/$session_client_id/$session_contact_photo"; ?>" alt="..." height="50" width="50" class="img-circle img-responsive">
|
<img src="<?php echo "../uploads/clients/$session_company_id/$session_client_id/$session_contact_photo"; ?>" alt="..." height="50" width="50" class="img-circle img-responsive">
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<span class="fa-stack fa-2x rounded-left">
|
<span class="fa-stack fa-2x rounded-left">
|
||||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||||
<span class="fa fa-stack-1x text-white"><?php echo $session_contact_initials; ?></span>
|
<span class="fa fa-stack-1x text-white"><?php echo $session_contact_initials; ?></span>
|
||||||
@@ -107,9 +105,8 @@ $invoices_sql = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_clie
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['login'])) {
|
|||||||
if ($row['contact_auth_method'] == 'local') {
|
if ($row['contact_auth_method'] == 'local') {
|
||||||
if (password_verify($password, $row['contact_password_hash'])) {
|
if (password_verify($password, $row['contact_password_hash'])) {
|
||||||
|
|
||||||
$_SESSION['client_logged_in'] = TRUE;
|
$_SESSION['client_logged_in'] = true;
|
||||||
$_SESSION['client_id'] = $row['contact_client_id'];
|
$_SESSION['client_id'] = $row['contact_client_id'];
|
||||||
$_SESSION['contact_id'] = $row['contact_id'];
|
$_SESSION['contact_id'] = $row['contact_id'];
|
||||||
$_SESSION['company_id'] = $row['company_id'];
|
$_SESSION['company_id'] = $row['company_id'];
|
||||||
|
|||||||
@@ -61,8 +61,11 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
|
|||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $token_grant_url);
|
curl_setopt($ch, CURLOPT_URL, $token_grant_url);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS,
|
curl_setopt(
|
||||||
http_build_query($params));
|
$ch,
|
||||||
|
CURLOPT_POSTFIELDS,
|
||||||
|
http_build_query($params)
|
||||||
|
);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
#curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // DEBUG ONLY - WAMP
|
#curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // DEBUG ONLY - WAMP
|
||||||
|
|
||||||
@@ -95,7 +98,7 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
|
|||||||
$row = mysqli_fetch_array($sql);
|
$row = mysqli_fetch_array($sql);
|
||||||
if ($row['contact_auth_method'] == 'azure') {
|
if ($row['contact_auth_method'] == 'azure') {
|
||||||
|
|
||||||
$_SESSION['client_logged_in'] = TRUE;
|
$_SESSION['client_logged_in'] = true;
|
||||||
$_SESSION['client_id'] = $row['contact_client_id'];
|
$_SESSION['client_id'] = $row['contact_client_id'];
|
||||||
$_SESSION['contact_id'] = $row['contact_id'];
|
$_SESSION['contact_id'] = $row['contact_id'];
|
||||||
$_SESSION['company_id'] = $row['company_id'];
|
$_SESSION['company_id'] = $row['company_id'];
|
||||||
|
|||||||
+26
-8
@@ -61,10 +61,19 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
|||||||
$subject = "Password reset for $company_name ITFlow Portal";
|
$subject = "Password reset for $company_name ITFlow Portal";
|
||||||
$body = "Hello, $name<br><br>Someone (probably you) has requested a new password for your account on $company_name's ITFlow Client Portal. <br><br><b>Please <a href='$url'>click here</a> to reset your password.</b> <br><br>Alternatively, copy and paste this URL into your browser:<br> $url<br><br><i>If you didn't request this change, you can safely ignore this email.</i><br><br>~<br>$company_name<br>Support Department<br>$config_mail_from_email";
|
$body = "Hello, $name<br><br>Someone (probably you) has requested a new password for your account on $company_name's ITFlow Client Portal. <br><br><b>Please <a href='$url'>click here</a> to reset your password.</b> <br><br>Alternatively, copy and paste this URL into your browser:<br> $url<br><br><i>If you didn't request this change, you can safely ignore this email.</i><br><br>~<br>$company_name<br>Support Department<br>$config_mail_from_email";
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_mail_from_email, $config_mail_from_name,
|
$config_smtp_host,
|
||||||
$email, $name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_mail_from_email,
|
||||||
|
$config_mail_from_name,
|
||||||
|
$email,
|
||||||
|
$name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
if ($mail !== true) {
|
if ($mail !== true) {
|
||||||
@@ -112,10 +121,19 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
|||||||
$body = "Hello, $name<br><br>Your password for your account on $company_name's ITFlow Client Portal was successfully reset. You should be all set! <br><br><b>If you didn't reset your password, please get in touch ASAP.</b><br><br>~<br>$company_name<br>Support Department<br>$config_mail_from_email";
|
$body = "Hello, $name<br><br>Your password for your account on $company_name's ITFlow Client Portal was successfully reset. You should be all set! <br><br><b>If you didn't reset your password, please get in touch ASAP.</b><br><br>~<br>$company_name<br>Support Department<br>$config_mail_from_email";
|
||||||
|
|
||||||
|
|
||||||
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
|
$mail = sendSingleEmail(
|
||||||
$config_mail_from_email, $config_mail_from_name,
|
$config_smtp_host,
|
||||||
$email, $name,
|
$config_smtp_username,
|
||||||
$subject, $body);
|
$config_smtp_password,
|
||||||
|
$config_smtp_encryption,
|
||||||
|
$config_smtp_port,
|
||||||
|
$config_mail_from_email,
|
||||||
|
$config_mail_from_name,
|
||||||
|
$email,
|
||||||
|
$name,
|
||||||
|
$subject,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
if ($mail !== true) {
|
if ($mail !== true) {
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ if(isset($_POST['edit_profile'])){
|
|||||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||||
$new_password = trim($_POST['new_password']);
|
$new_password = trim($_POST['new_password']);
|
||||||
$existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name'])));
|
$existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name'])));
|
||||||
$logout = FALSE;
|
$logout = false;
|
||||||
$extended_log_description = '';
|
$extended_log_description = '';
|
||||||
|
|
||||||
// Email notification when password or email is changed
|
// Email notification when password or email is changed
|
||||||
@@ -367,7 +367,7 @@ if(isset($_POST['edit_profile'])){
|
|||||||
mysqli_query($mysqli,"UPDATE users SET user_password = '$new_password', user_specific_encryption_ciphertext = '$user_specific_encryption_ciphertext' WHERE user_id = $user_id");
|
mysqli_query($mysqli,"UPDATE users SET user_password = '$new_password', user_specific_encryption_ciphertext = '$user_specific_encryption_ciphertext' WHERE user_id = $user_id");
|
||||||
|
|
||||||
$extended_log_description .= ", password changed";
|
$extended_log_description .= ", password changed";
|
||||||
$logout = TRUE;
|
$logout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable extension access, only if it isn't already setup (user doesn't have cookie)
|
// Enable extension access, only if it isn't already setup (user doesn't have cookie)
|
||||||
@@ -377,7 +377,7 @@ if(isset($_POST['edit_profile'])){
|
|||||||
mysqli_query($mysqli, "UPDATE users SET user_extension_key = '$extension_key' WHERE user_id = $user_id");
|
mysqli_query($mysqli, "UPDATE users SET user_extension_key = '$extension_key' WHERE user_id = $user_id");
|
||||||
|
|
||||||
$extended_log_description .= ", extension access enabled";
|
$extended_log_description .= ", extension access enabled";
|
||||||
$logout = TRUE;
|
$logout = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4788,19 +4788,19 @@ if(isset($_POST["import_client_contacts_csv"])){
|
|||||||
|
|
||||||
$client_id = intval($_POST['client_id']);
|
$client_id = intval($_POST['client_id']);
|
||||||
$file_name = $_FILES["file"]["tmp_name"];
|
$file_name = $_FILES["file"]["tmp_name"];
|
||||||
$error = FALSE;
|
$error = false;
|
||||||
|
|
||||||
//Check file is CSV
|
//Check file is CSV
|
||||||
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
||||||
$allowed_file_extensions = array('csv');
|
$allowed_file_extensions = array('csv');
|
||||||
if(in_array($file_extension,$allowed_file_extensions) === false){
|
if(in_array($file_extension,$allowed_file_extensions) === false){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file extension";
|
$_SESSION['alert_message'] = "Bad file extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check file isn't empty
|
//Check file isn't empty
|
||||||
elseif($_FILES["file"]["size"] < 1){
|
elseif($_FILES["file"]["size"] < 1){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4808,7 +4808,7 @@ if(isset($_POST["import_client_contacts_csv"])){
|
|||||||
$f = fopen($file_name, "r");
|
$f = fopen($file_name, "r");
|
||||||
$f_columns = fgetcsv($f, 1000, ",");
|
$f_columns = fgetcsv($f, 1000, ",");
|
||||||
if(!$error & count($f_columns) != 8) {
|
if(!$error & count($f_columns) != 8) {
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad column count.";
|
$_SESSION['alert_message'] = "Bad column count.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4818,7 +4818,7 @@ if(isset($_POST["import_client_contacts_csv"])){
|
|||||||
fgetcsv($file, 1000, ","); // Skip first line
|
fgetcsv($file, 1000, ","); // Skip first line
|
||||||
$row_count = 0;
|
$row_count = 0;
|
||||||
$duplicate_count = 0;
|
$duplicate_count = 0;
|
||||||
while(($column = fgetcsv($file, 1000, ",")) !== FALSE){
|
while(($column = fgetcsv($file, 1000, ",")) !== false){
|
||||||
$duplicate_detect = 0;
|
$duplicate_detect = 0;
|
||||||
if(isset($column[0])){
|
if(isset($column[0])){
|
||||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
||||||
@@ -5209,19 +5209,19 @@ if(isset($_POST["import_client_locations_csv"])){
|
|||||||
|
|
||||||
$client_id = intval($_POST['client_id']);
|
$client_id = intval($_POST['client_id']);
|
||||||
$file_name = $_FILES["file"]["tmp_name"];
|
$file_name = $_FILES["file"]["tmp_name"];
|
||||||
$error = FALSE;
|
$error = false;
|
||||||
|
|
||||||
//Check file is CSV
|
//Check file is CSV
|
||||||
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
||||||
$allowed_file_extensions = array('csv');
|
$allowed_file_extensions = array('csv');
|
||||||
if(in_array($file_extension,$allowed_file_extensions) === false){
|
if(in_array($file_extension,$allowed_file_extensions) === false){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file extension";
|
$_SESSION['alert_message'] = "Bad file extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check file isn't empty
|
//Check file isn't empty
|
||||||
elseif($_FILES["file"]["size"] < 1){
|
elseif($_FILES["file"]["size"] < 1){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5229,7 +5229,7 @@ if(isset($_POST["import_client_locations_csv"])){
|
|||||||
$f = fopen($file_name, "r");
|
$f = fopen($file_name, "r");
|
||||||
$f_columns = fgetcsv($f, 1000, ",");
|
$f_columns = fgetcsv($f, 1000, ",");
|
||||||
if(!$error & count($f_columns) != 7) {
|
if(!$error & count($f_columns) != 7) {
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad column count.";
|
$_SESSION['alert_message'] = "Bad column count.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5239,7 +5239,7 @@ if(isset($_POST["import_client_locations_csv"])){
|
|||||||
fgetcsv($file, 1000, ","); // Skip first line
|
fgetcsv($file, 1000, ","); // Skip first line
|
||||||
$row_count = 0;
|
$row_count = 0;
|
||||||
$duplicate_count = 0;
|
$duplicate_count = 0;
|
||||||
while(($column = fgetcsv($file, 1000, ",")) !== FALSE){
|
while(($column = fgetcsv($file, 1000, ",")) !== false){
|
||||||
$duplicate_detect = 0;
|
$duplicate_detect = 0;
|
||||||
if(isset($column[0])){
|
if(isset($column[0])){
|
||||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
||||||
@@ -5519,19 +5519,19 @@ if(isset($_POST["import_client_assets_csv"])){
|
|||||||
|
|
||||||
$client_id = intval($_POST['client_id']);
|
$client_id = intval($_POST['client_id']);
|
||||||
$file_name = $_FILES["file"]["tmp_name"];
|
$file_name = $_FILES["file"]["tmp_name"];
|
||||||
$error = FALSE;
|
$error = false;
|
||||||
|
|
||||||
//Check file is CSV
|
//Check file is CSV
|
||||||
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
||||||
$allowed_file_extensions = array('csv');
|
$allowed_file_extensions = array('csv');
|
||||||
if(in_array($file_extension,$allowed_file_extensions) === false){
|
if(in_array($file_extension,$allowed_file_extensions) === false){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file extension";
|
$_SESSION['alert_message'] = "Bad file extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check file isn't empty
|
//Check file isn't empty
|
||||||
elseif($_FILES["file"]["size"] < 1){
|
elseif($_FILES["file"]["size"] < 1){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5539,7 +5539,7 @@ if(isset($_POST["import_client_assets_csv"])){
|
|||||||
$f = fopen($file_name, "r");
|
$f = fopen($file_name, "r");
|
||||||
$f_columns = fgetcsv($f, 1000, ",");
|
$f_columns = fgetcsv($f, 1000, ",");
|
||||||
if(!$error & count($f_columns) != 8) {
|
if(!$error & count($f_columns) != 8) {
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad column count.";
|
$_SESSION['alert_message'] = "Bad column count.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5549,7 +5549,7 @@ if(isset($_POST["import_client_assets_csv"])){
|
|||||||
fgetcsv($file, 1000, ","); // Skip first line
|
fgetcsv($file, 1000, ","); // Skip first line
|
||||||
$row_count = 0;
|
$row_count = 0;
|
||||||
$duplicate_count = 0;
|
$duplicate_count = 0;
|
||||||
while(($column = fgetcsv($file, 1000, ",")) !== FALSE){
|
while(($column = fgetcsv($file, 1000, ",")) !== false){
|
||||||
$duplicate_detect = 0;
|
$duplicate_detect = 0;
|
||||||
if(isset($column[0])){
|
if(isset($column[0])){
|
||||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
||||||
@@ -6163,19 +6163,19 @@ if(isset($_POST["import_client_logins_csv"])){
|
|||||||
|
|
||||||
$client_id = intval($_POST['client_id']);
|
$client_id = intval($_POST['client_id']);
|
||||||
$file_name = $_FILES["file"]["tmp_name"];
|
$file_name = $_FILES["file"]["tmp_name"];
|
||||||
$error = FALSE;
|
$error = false;
|
||||||
|
|
||||||
//Check file is CSV
|
//Check file is CSV
|
||||||
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
|
||||||
$allowed_file_extensions = array('csv');
|
$allowed_file_extensions = array('csv');
|
||||||
if(in_array($file_extension,$allowed_file_extensions) === false){
|
if(in_array($file_extension,$allowed_file_extensions) === false){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file extension";
|
$_SESSION['alert_message'] = "Bad file extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check file isn't empty
|
//Check file isn't empty
|
||||||
elseif($_FILES["file"]["size"] < 1){
|
elseif($_FILES["file"]["size"] < 1){
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
$_SESSION['alert_message'] = "Bad file size (empty?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6183,7 +6183,7 @@ if(isset($_POST["import_client_logins_csv"])){
|
|||||||
$f = fopen($file_name, "r");
|
$f = fopen($file_name, "r");
|
||||||
$f_columns = fgetcsv($f, 1000, ",");
|
$f_columns = fgetcsv($f, 1000, ",");
|
||||||
if(!$error & count($f_columns) != 4) {
|
if(!$error & count($f_columns) != 4) {
|
||||||
$error = TRUE;
|
$error = true;
|
||||||
$_SESSION['alert_message'] = "Bad column count.";
|
$_SESSION['alert_message'] = "Bad column count.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6193,7 +6193,7 @@ if(isset($_POST["import_client_logins_csv"])){
|
|||||||
fgetcsv($file, 1000, ","); // Skip first line
|
fgetcsv($file, 1000, ","); // Skip first line
|
||||||
$row_count = 0;
|
$row_count = 0;
|
||||||
$duplicate_count = 0;
|
$duplicate_count = 0;
|
||||||
while(($column = fgetcsv($file, 1000, ",")) !== FALSE){
|
while(($column = fgetcsv($file, 1000, ",")) !== false){
|
||||||
$duplicate_detect = 0;
|
$duplicate_detect = 0;
|
||||||
if(isset($column[0])){
|
if(isset($column[0])){
|
||||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $column[0])));
|
||||||
|
|||||||
+12
-11
@@ -1,4 +1,5 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -10,10 +11,13 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 products LEFT JOIN categories ON product_category_id = category_id
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM products LEFT JOIN categories ON product_category_id = category_id
|
||||||
WHERE products.company_id = $session_company_id
|
WHERE products.company_id = $session_company_id
|
||||||
AND (product_name LIKE '%$q%' OR product_description LIKE '%$q%' OR category_name LIKE '%$q%' OR product_price LIKE '%$q%')
|
AND (product_name LIKE '%$q%' OR product_description LIKE '%$q%' OR category_name LIKE '%$q%' OR product_price LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
@@ -93,7 +97,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("product_edit_modal.php");
|
require("product_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,15 +106,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("product_add_modal.php");
|
require_once("product_add_modal.php");
|
||||||
include("category_quick_add_modal.php");
|
require_once("category_quick_add_modal.php");
|
||||||
|
require_once("footer.php");
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
+8
-10
@@ -1,4 +1,5 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -212,8 +213,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("quote_edit_modal.php");
|
require("quote_edit_modal.php");
|
||||||
include("quote_copy_modal.php");
|
require("quote_copy_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,15 +223,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("quote_add_modal.php");
|
require_once("quote_add_modal.php");
|
||||||
include("category_quick_add_modal.php");
|
require_once("category_quick_add_modal.php");
|
||||||
|
require_once("footer.php");
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<?php require_once("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (isset($_GET['recurring_id'])) {
|
if (isset($_GET['recurring_id'])) {
|
||||||
|
|
||||||
$recurring_id = intval($_GET['recurring_id']);
|
$recurring_id = intval($_GET['recurring_id']);
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM recurring
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM recurring
|
||||||
LEFT JOIN clients ON recurring_client_id = client_id
|
LEFT JOIN clients ON recurring_client_id = client_id
|
||||||
LEFT JOIN locations ON primary_location = location_id
|
LEFT JOIN locations ON primary_location = location_id
|
||||||
LEFT JOIN contacts ON primary_contact = contact_id
|
LEFT JOIN contacts ON primary_contact = contact_id
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -201,7 +202,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("recurring_invoice_edit_modal.php");
|
require("recurring_invoice_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -209,15 +210,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("recurring_invoice_add_modal.php");
|
require_once("recurring_invoice_add_modal.php");
|
||||||
include("category_quick_add_modal.php");
|
require_once("category_quick_add_modal.php");
|
||||||
|
require_once("footer.php");
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("inc_all_reports.php");
|
require_once("inc_all_reports.php");
|
||||||
validateAccountantRole();
|
validateAccountantRole();
|
||||||
|
|
||||||
if (isset($_GET['year'])) {
|
if (isset($_GET['year'])) {
|
||||||
@@ -58,9 +58,7 @@ $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE company_id = $s
|
|||||||
|
|
||||||
$amount_paid = floatval($row['amount_paid']);
|
$amount_paid = floatval($row['amount_paid']);
|
||||||
|
|
||||||
if ($amount_paid > 599) {
|
if ($amount_paid > 599) { ?>
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $vendor_name; ?></td>
|
<td><?php echo $vendor_name; ?></td>
|
||||||
|
|||||||
+24
-8
@@ -67,7 +67,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 1; $month<=3; $month++) {
|
for($month = 1; $month<=3; $month++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -91,7 +93,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 4; $month <= 6; $month ++) {
|
for($month = 4; $month <= 6; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -115,7 +119,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 7; $month <= 9; $month ++) {
|
for($month = 7; $month <= 9; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -139,7 +145,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 10; $month <= 12; $month ++) {
|
for($month = 10; $month <= 12; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -176,7 +184,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 1; $month <= 3; $month ++) {
|
for($month = 1; $month <= 3; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -199,7 +209,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 4; $month <= 6; $month ++) {
|
for($month = 4; $month <= 6; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -222,7 +234,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 7; $month <= 9; $month ++) {
|
for($month = 7; $month <= 9; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
@@ -245,7 +259,9 @@ $sql_tax = mysqli_query($mysqli, "SELECT * FROM taxes WHERE company_id = $sessio
|
|||||||
|
|
||||||
for($month = 10; $month <= 12; $month ++) {
|
for($month = 10; $month <= 12; $month ++) {
|
||||||
|
|
||||||
$sql_tax_collected = mysqli_query($mysqli, "SELECT SUM(item_tax) AS tax_collected_for_month
|
$sql_tax_collected = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SUM(item_tax) AS tax_collected_for_month
|
||||||
FROM invoices, invoice_items
|
FROM invoices, invoice_items
|
||||||
WHERE item_invoice_id = invoice_id
|
WHERE item_invoice_id = invoice_id
|
||||||
AND invoice_status LIKE 'Paid'
|
AND invoice_status LIKE 'Paid'
|
||||||
|
|||||||
-19
@@ -65,26 +65,7 @@
|
|||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
public static function generateRandomClue($length = 16) {
|
|
||||||
$b32 = "234567QWERTYUIOPASDFGHJKLZXCVBNM";
|
|
||||||
$s = "";
|
|
||||||
for ($i = 0; $i < $length; $i++)
|
|
||||||
$s .= $b32[rand(0,31)];
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function hotp_tobytestream($key) {
|
|
||||||
$result = array();
|
|
||||||
$last = strlen($key);
|
|
||||||
for ($i = 0; $i < $last; $i = $i + 2) {
|
|
||||||
$x = $key[$i] + $key[$i + 1];
|
|
||||||
$x = strtoupper($x);
|
|
||||||
$x = hexdec($x);
|
|
||||||
$result = $result.chr($x);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
private static function oath_hotp ($key, $counter, $debug=false) {
|
private static function oath_hotp ($key, $counter, $debug=false) {
|
||||||
$result = "";
|
$result = "";
|
||||||
$orgcounter = $counter;
|
$orgcounter = $counter;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
include("inc_all.php");
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -11,7 +11,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
// SQL
|
// SQL
|
||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
||||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||||
WHERE scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
WHERE scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||||
@@ -104,12 +106,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php require_once('pagination.php'); ?>
|
||||||
include('pagination.php');
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("scheduled_ticket_edit_modal.php");
|
require_once("scheduled_ticket_edit_modal.php");
|
||||||
include("footer.php");
|
require_once("footer.php");
|
||||||
|
|||||||
+3
-1
@@ -11,7 +11,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 api_keys
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
||||||
LEFT JOIN clients on api_keys.api_key_client_id = clients.client_id
|
LEFT JOIN clients on api_keys.api_key_client_id = clients.client_id
|
||||||
WHERE (api_key_name LIKE '%$q%')
|
WHERE (api_key_name LIKE '%$q%')
|
||||||
AND api_keys.company_id = $session_company_id
|
AND api_keys.company_id = $session_company_id
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php include("inc_all_settings.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once("inc_all_settings.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
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 {
|
} else {
|
||||||
@@ -11,11 +11,14 @@ if(!empty($_GET['sb'])){
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 software
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM software
|
||||||
LEFT JOIN logins ON login_software_id = software_id
|
LEFT JOIN logins ON login_software_id = software_id
|
||||||
WHERE software_template = 1
|
WHERE software_template = 1
|
||||||
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
|
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
@@ -98,7 +101,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("client_software_template_edit_modal.php");
|
require("client_software_template_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -106,10 +109,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("client_software_template_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("client_software_template_add_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
+12
-11
@@ -1,4 +1,5 @@
|
|||||||
<?php require_once("inc_all_settings.php");
|
<?php
|
||||||
|
require_once("inc_all_settings.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -9,7 +10,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 tags
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM tags
|
||||||
WHERE tag_name LIKE '%$q%'
|
WHERE tag_name LIKE '%$q%'
|
||||||
AND company_id = $session_company_id
|
AND company_id = $session_company_id
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||||
@@ -19,7 +22,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
if ($num_rows > 0) {
|
if ($num_rows > 0) {
|
||||||
//Colors Used
|
//Colors Used
|
||||||
$sql_colors_used = mysqli_query($mysqli, "SELECT tag_color FROM tags
|
$sql_colors_used = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT tag_color FROM tags
|
||||||
WHERE tag_archived_at IS NULL
|
WHERE tag_archived_at IS NULL
|
||||||
AND company_id = $session_company_id"
|
AND company_id = $session_company_id"
|
||||||
);
|
);
|
||||||
@@ -102,7 +107,7 @@ if ($num_rows > 0) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("settings_tag_edit_modal.php");
|
require("settings_tag_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,14 +116,10 @@ if ($num_rows > 0) {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("settings_tag_add_modal.php");
|
||||||
include("settings_tag_add_modal.php");
|
require_once("footer.php");
|
||||||
|
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
+9
-10
@@ -1,4 +1,5 @@
|
|||||||
<?php require_once("inc_all_settings.php");
|
<?php
|
||||||
|
require_once("inc_all_settings.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -9,7 +10,9 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM taxes
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM taxes
|
||||||
WHERE tax_archived_at IS NULL
|
WHERE tax_archived_at IS NULL
|
||||||
AND company_id = $session_company_id
|
AND company_id = $session_company_id
|
||||||
ORDER BY $sb $o"
|
ORDER BY $sb $o"
|
||||||
@@ -64,11 +67,11 @@ $num_rows = mysqli_num_rows($sql);
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("settings_tax_edit_modal.php");
|
require("settings_tax_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($num_rows == 0) {
|
if ($num_rows == 0) {
|
||||||
echo "<center><h3 class='text-secondary mt-3'>No Records Here</h3></center>";
|
echo "<h3 class='text-secondary mt-3' style='text-align: center'>No Records Here</h3>";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -81,9 +84,5 @@ $num_rows = mysqli_num_rows($sql);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("settings_tax_add_modal.php");
|
||||||
include("settings_tax_add_modal.php");
|
require_once("footer.php");
|
||||||
|
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php include("inc_all_settings.php"); ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once("inc_all_settings.php");
|
||||||
|
|
||||||
if (isset($_GET['q'])) {
|
if (isset($_GET['q'])) {
|
||||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||||
//Phone Numbers
|
//Phone Numbers
|
||||||
@@ -23,9 +23,12 @@ if (!empty($_GET['sb'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 vendors
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||||
WHERE vendor_template = 1
|
WHERE vendor_template = 1
|
||||||
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%') ORDER BY $sb $o LIMIT $record_from, $record_to");
|
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%') 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()"));
|
||||||
|
|
||||||
@@ -123,23 +126,17 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
} else {
|
} else {
|
||||||
echo $vendor_contact_name_display;
|
echo $vendor_contact_name_display;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?php
|
if (!empty($vendor_phone)) { ?>
|
||||||
if (!empty($vendor_phone)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php }
|
||||||
}
|
|
||||||
?>
|
if (!empty($vendor_email)) { ?>
|
||||||
<?php
|
|
||||||
if (!empty($vendor_email)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<div class="dropdown dropleft text-center">
|
||||||
@@ -159,7 +156,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("vendor_template_edit_modal.php");
|
require("vendor_template_edit_modal.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -167,10 +164,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("vendor_template_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("vendor_template_add_modal.php");
|
||||||
<?php include("footer.php"); ?>
|
require_once("footer.php");
|
||||||
|
|||||||
+10
-9
@@ -1,9 +1,12 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (isset($_GET['ticket_id'])) {
|
if (isset($_GET['ticket_id'])) {
|
||||||
$ticket_id = intval($_GET['ticket_id']);
|
$ticket_id = intval($_GET['ticket_id']);
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM tickets
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM tickets
|
||||||
LEFT JOIN clients ON ticket_client_id = client_id
|
LEFT JOIN clients ON ticket_client_id = client_id
|
||||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||||
@@ -374,7 +377,7 @@ if (isset($_GET['ticket_id'])) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("ticket_reply_edit_modal.php");
|
require("ticket_reply_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,17 +620,15 @@ if (isset($_GET['ticket_id'])) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("ticket_edit_modal.php");
|
require("ticket_edit_modal.php");
|
||||||
include("ticket_merge_modal.php");
|
require("ticket_merge_modal.php");
|
||||||
include("ticket_invoice_add_modal.php");
|
require("ticket_invoice_add_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
require_once("footer.php");
|
||||||
|
|
||||||
<?php include_once("footer.php");
|
|
||||||
|
|
||||||
if ($ticket_status !== "Closed") { ?>
|
if ($ticket_status !== "Closed") { ?>
|
||||||
<!-- Ticket Time Tracking JS -->
|
<!-- Ticket Time Tracking JS -->
|
||||||
|
|||||||
@@ -97,7 +97,9 @@
|
|||||||
<option value="0">Not Assigned</option>
|
<option value="0">Not Assigned</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT users.user_id, user_name FROM users
|
||||||
LEFT JOIN user_companies ON users.user_id = user_companies.user_id
|
LEFT JOIN user_companies ON users.user_id = user_companies.user_id
|
||||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||||
WHERE user_companies.company_id = $session_company_id
|
WHERE user_companies.company_id = $session_company_id
|
||||||
|
|||||||
@@ -70,7 +70,9 @@
|
|||||||
<option value="0">Not Assigned</option>
|
<option value="0">Not Assigned</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql_assign_to_select = mysqli_query($mysqli,"SELECT users.user_id, user_name FROM users
|
$sql_assign_to_select = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT users.user_id, user_name FROM users
|
||||||
LEFT JOIN user_companies ON users.user_id = user_companies.user_id
|
LEFT JOIN user_companies ON users.user_id = user_companies.user_id
|
||||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||||
WHERE user_companies.company_id = $session_company_id
|
WHERE user_companies.company_id = $session_company_id
|
||||||
|
|||||||
+11
-7
@@ -1,4 +1,6 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
//Column Sortby Filter
|
//Column Sortby Filter
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
@@ -55,7 +57,9 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS transfer_created_at, expense_date AS transfer_date, expense_amount AS transfer_amount, expense_account_id AS transfer_account_from, revenue_account_id AS transfer_account_to, transfer_expense_id, transfer_revenue_id , transfer_id, transfer_notes FROM transfers, expenses, revenues
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS transfer_created_at, expense_date AS transfer_date, expense_amount AS transfer_amount, expense_account_id AS transfer_account_from, revenue_account_id AS transfer_account_to, transfer_expense_id, transfer_revenue_id , transfer_id, transfer_notes FROM transfers, expenses, revenues
|
||||||
WHERE transfer_expense_id = expense_id
|
WHERE transfer_expense_id = expense_id
|
||||||
AND transfer_revenue_id = revenue_id
|
AND transfer_revenue_id = revenue_id
|
||||||
AND transfers.company_id = $session_company_id
|
AND transfers.company_id = $session_company_id
|
||||||
@@ -177,7 +181,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("transfer_edit_modal.php");
|
require("transfer_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,10 +190,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include("transfer_add_modal.php"); ?>
|
<?php
|
||||||
|
require_once("transfer_add_modal.php");
|
||||||
<?php include("footer.php");
|
require_once("footer.php");
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||||
@@ -56,7 +57,9 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 trips
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||||
LEFT JOIN clients ON trip_client_id = client_id
|
LEFT JOIN clients ON trip_client_id = client_id
|
||||||
LEFT JOIN users ON trip_user_id = user_id
|
LEFT JOIN users ON trip_user_id = user_id
|
||||||
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR trip_miles LIKE '%$q%' OR client_name LIKE '%$q%' OR user_name LIKE '%$q%')
|
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR trip_miles LIKE '%$q%' OR client_name LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content bg-dark">
|
<div class="modal-content bg-dark">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-building"></i> Company access: <strong><?php echo $user_name; ?></strong></h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-building"></i> Company access:
|
||||||
|
<strong><?php echo $user_name; ?></strong></h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -29,8 +30,16 @@
|
|||||||
?>
|
?>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="checkbox" class="form-check-input" name="companies[]" value="<?php echo $company_id_select; ?>" <?php if (in_array("$company_id_select",$user_company_access_array)) { echo "checked"; } ?> <?php if ($user_default_company == $company_id_select) { echo "disabled"; } ?>>
|
<input type="checkbox" class="form-check-input" name="companies[]"
|
||||||
<label class="form-check-label ml-2"><?php echo $company_name_select; ?> <?php if ($user_default_company == $company_id_select) { echo "<small>(Default Company)</small>"; } ?></label>
|
value="<?php echo $company_id_select; ?>" <?php if (in_array("$company_id_select", $user_company_access_array)) {
|
||||||
|
echo "checked";
|
||||||
|
} ?> <?php if ($user_default_company == $company_id_select) {
|
||||||
|
echo "disabled";
|
||||||
|
} ?>>
|
||||||
|
<label
|
||||||
|
class="form-check-label ml-2"><?php echo $company_name_select; ?><?php if ($user_default_company == $company_id_select) {
|
||||||
|
echo "<small>(Default Company)</small>";
|
||||||
|
} ?></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -43,7 +52,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||||
<button type="submit" name="edit_user_companies" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
<button type="submit" name="edit_user_companies" class="btn btn-primary text-bold"><i
|
||||||
|
class="fa fa-check"></i> Save
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+27
-9
@@ -2,7 +2,8 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content bg-dark">
|
<div class="modal-content bg-dark">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-user-edit"></i> Editing user: <strong><?php echo $user_name; ?></strong></h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-user-edit"></i> Editing user:
|
||||||
|
<strong><?php echo $user_name; ?></strong></h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $user_name; ?>" required>
|
<input type="text" class="form-control" name="name" placeholder="Full Name"
|
||||||
|
value="<?php echo $user_name; ?>" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -40,7 +42,8 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $user_email; ?>" required>
|
<input type="email" class="form-control" name="email" placeholder="Email Address"
|
||||||
|
value="<?php echo $user_email; ?>" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -50,7 +53,8 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="password" class="form-control" data-toggle="password" name="new_password" placeholder="Leave Blank For No Password Change" autocomplete="new-password">
|
<input type="password" class="form-control" data-toggle="password" name="new_password"
|
||||||
|
placeholder="Leave Blank For No Password Change" autocomplete="new-password">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,7 +76,10 @@
|
|||||||
$company_id_select = $row['company_id'];
|
$company_id_select = $row['company_id'];
|
||||||
$company_name_select = htmlentities($row['company_name']);
|
$company_name_select = htmlentities($row['company_name']);
|
||||||
?>
|
?>
|
||||||
<option <?php if ($company_id_select == $user_default_company) { echo "selected"; } ?> value="<?php echo $company_id_select; ?>"><?php echo $company_name_select; ?></option>
|
<option <?php if ($company_id_select == $user_default_company) {
|
||||||
|
echo "selected";
|
||||||
|
} ?>
|
||||||
|
value="<?php echo $company_id_select; ?>"><?php echo $company_name_select; ?></option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -89,9 +96,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="role" required>
|
<select class="form-control select2" name="role" required>
|
||||||
<option value="">- Role -</option>
|
<option value="">- Role -</option>
|
||||||
<option <?php if ($user_role == 3) { echo "selected"; } ?> value="3">Administrator</option>
|
<option <?php if ($user_role == 3) {
|
||||||
<option <?php if ($user_role == 2) { echo "selected"; } ?> value="2">Technician</option>
|
echo "selected";
|
||||||
<option <?php if ($user_role == 1) { echo "selected"; } ?> value="1">Accountant</option>
|
} ?> value="3">Administrator
|
||||||
|
</option>
|
||||||
|
<option <?php if ($user_role == 2) {
|
||||||
|
echo "selected";
|
||||||
|
} ?> value="2">Technician
|
||||||
|
</option>
|
||||||
|
<option <?php if ($user_role == 1) {
|
||||||
|
echo "selected";
|
||||||
|
} ?> value="1">Accountant
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -121,7 +137,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||||
<button type="submit" name="edit_user" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
<button type="submit" name="edit_user" class="btn btn-primary text-bold"><i class="fa fa-check"></i>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,9 +38,8 @@
|
|||||||
?>
|
?>
|
||||||
<option value="<?php echo $company_id; ?>"><?php echo $company_name; ?></option>
|
<option value="<?php echo $company_id; ?>"><?php echo $company_name; ?></option>
|
||||||
|
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -91,7 +91,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
$user_initials = htmlentities(initials($user_name));
|
$user_initials = htmlentities(initials($user_name));
|
||||||
|
|
||||||
$sql_last_login = mysqli_query($mysqli, "SELECT * FROM logs
|
$sql_last_login = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT * FROM logs
|
||||||
WHERE log_user_id = $user_id AND log_type = 'Login'
|
WHERE log_user_id = $user_id AND log_type = 'Login'
|
||||||
ORDER BY log_id DESC LIMIT 1"
|
ORDER BY log_id DESC LIMIT 1"
|
||||||
);
|
);
|
||||||
|
|||||||
+23
-34
@@ -1,4 +1,6 @@
|
|||||||
<?php include("inc_all.php");
|
<?php
|
||||||
|
|
||||||
|
require_once("inc_all.php");
|
||||||
|
|
||||||
if (isset($_GET['q'])) {
|
if (isset($_GET['q'])) {
|
||||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||||
@@ -31,14 +33,17 @@ if (!empty($_GET['dtf'])) {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
$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 vendors
|
$sql = mysqli_query(
|
||||||
|
$mysqli,
|
||||||
|
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||||
WHERE vendor_client_id = 0
|
WHERE vendor_client_id = 0
|
||||||
AND vendor_template = 0
|
AND vendor_template = 0
|
||||||
AND DATE(vendor_created_at) BETWEEN '$dtf' AND '$dtt'
|
AND DATE(vendor_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||||
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%')
|
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%')
|
||||||
AND vendor_archived_at IS NULL
|
AND vendor_archived_at IS NULL
|
||||||
AND company_id = $session_company_id
|
AND company_id = $session_company_id
|
||||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
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()"));
|
||||||
|
|
||||||
@@ -127,44 +132,32 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?><a>
|
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?><a>
|
||||||
<?php
|
<?php if (!empty($vendor_account_number)) { ?>
|
||||||
if (!empty($vendor_account_number)) {
|
|
||||||
?>
|
|
||||||
<br>
|
<br>
|
||||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</th>
|
</th>
|
||||||
<td><?php echo $vendor_description_display; ?></td>
|
<td><?php echo $vendor_description_display; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($vendor_contact_name)) {
|
if (!empty($vendor_contact_name)) { ?>
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name; ?>
|
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php } else {
|
||||||
}else{
|
|
||||||
echo $vendor_contact_name_display;
|
echo $vendor_contact_name_display;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?php
|
if (!empty($vendor_phone)) { ?>
|
||||||
if (!empty($vendor_phone)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?> <?php if (!empty($vendor_extension)) { echo "x$vendor_extension"; } ?>
|
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?> <?php if (!empty($vendor_extension)) { echo "x$vendor_extension"; } ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php }
|
||||||
}
|
|
||||||
?>
|
if (!empty($vendor_email)) { ?>
|
||||||
<?php
|
|
||||||
if (!empty($vendor_email)) {
|
|
||||||
?>
|
|
||||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<div class="dropdown dropleft text-center">
|
||||||
@@ -182,7 +175,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("vendor_edit_modal.php");
|
require("vendor_edit_modal.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,14 +184,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php require_once("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
require_once("vendor_add_modal.php");
|
||||||
include("vendor_add_modal.php");
|
require_once("footer.php");
|
||||||
|
|
||||||
include("footer.php");
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user