mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
replace all instances of mysqli_fetch_array with mysqli_fetch_assoc for better performance and memory usage
This commit is contained in:
@@ -59,7 +59,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
@@ -67,15 +67,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$account_notes = nullable_htmlentities($row['account_notes']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
@@ -59,7 +59,7 @@ if (isset($_GET['merge_ticket_get_json_details'])) {
|
||||
echo "No ticket found!";
|
||||
} else {
|
||||
//Return ticket, client and contact details for the given ticket number
|
||||
$response = mysqli_fetch_array($sql);
|
||||
$response = mysqli_fetch_assoc($sql);
|
||||
|
||||
echo json_encode($response);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ if (isset($_POST['contact_set_notes'])) {
|
||||
$sql = mysqli_query($mysqli,"SELECT contact_name, contact_client_id
|
||||
FROM contacts WHERE contact_id = $contact_id"
|
||||
);
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = sanitizeInput($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -111,7 +111,7 @@ if (isset($_POST['asset_set_notes'])) {
|
||||
$sql = mysqli_query($mysqli,"SELECT asset_name, asset_client_id
|
||||
FROM assets WHERE asset_id = $asset_id"
|
||||
);
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = sanitizeInput($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -143,7 +143,7 @@ if (isset($_GET['ticket_query_views'])) {
|
||||
$ticket_id = intval($_GET['ticket_id']);
|
||||
|
||||
$query = mysqli_query($mysqli, "SELECT user_name FROM ticket_views LEFT JOIN users ON view_user_id = user_id WHERE view_ticket_id = $ticket_id AND view_user_id != $session_user_id AND view_timestamp > DATE_SUB(NOW(), INTERVAL 2 MINUTE)");
|
||||
while ($row = mysqli_fetch_array($query)) {
|
||||
while ($row = mysqli_fetch_assoc($query)) {
|
||||
$users[] = $row['user_name'];
|
||||
}
|
||||
|
||||
@@ -198,18 +198,18 @@ if (isset($_GET['share_generate_link'])) {
|
||||
$item_key = randomString(32);
|
||||
|
||||
if ($item_type == "Document") {
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = $item_id AND document_client_id = $client_id LIMIT 1"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = $item_id AND document_client_id = $client_id LIMIT 1"));
|
||||
$item_name = sanitizeInput($row['document_name']);
|
||||
}
|
||||
|
||||
if ($item_type == "File") {
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = $item_id AND file_client_id = $client_id LIMIT 1"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = $item_id AND file_client_id = $client_id LIMIT 1"));
|
||||
$item_name = sanitizeInput($row['file_name']);
|
||||
}
|
||||
|
||||
if ($item_type == "Credential") {
|
||||
$credential = mysqli_query($mysqli, "SELECT credential_name, credential_username, credential_password FROM credentials WHERE credential_id = $item_id AND credential_client_id = $client_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($credential);
|
||||
$row = mysqli_fetch_assoc($credential);
|
||||
|
||||
$item_name = sanitizeInput($row['credential_name']);
|
||||
|
||||
@@ -240,7 +240,7 @@ if (isset($_GET['share_generate_link'])) {
|
||||
}
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM companies WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$company_name = sanitizeInput($row['company_name']);
|
||||
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone'], $row['company_phone_country_code']));
|
||||
|
||||
@@ -298,7 +298,7 @@ if (isset($_GET['get_active_clients'])) {
|
||||
ORDER BY client_accessed_at DESC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($client_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($client_sql)) {
|
||||
$response['clients'][] = $row;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ if (isset($_GET['get_client_contacts'])) {
|
||||
ORDER BY contact_primary DESC, contact_technical DESC, contact_important DESC, contact_name"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($contact_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($contact_sql)) {
|
||||
$response['contacts'][] = $row;
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ if (isset($_GET['get_client_assets'])) {
|
||||
ORDER BY asset_important DESC, asset_name"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($asset_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($asset_sql)) {
|
||||
$response['assets'][] = $row;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ if (isset($_GET['get_client_locations'])) {
|
||||
ORDER BY location_primary DESC, location_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($locations_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($locations_sql)) {
|
||||
$response['locations'][] = $row;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ if (isset($_GET['get_client_vendors'])) {
|
||||
ORDER BY vendor_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($vendors_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($vendors_sql)) {
|
||||
$response['vendors'][] = $row;
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ if (isset($_POST['update_kanban_ticket'])) {
|
||||
LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id
|
||||
WHERE ticket_id = $ticket_id
|
||||
");
|
||||
$row = mysqli_fetch_array($ticket_sql);
|
||||
$row = mysqli_fetch_assoc($ticket_sql);
|
||||
|
||||
$contact_name = sanitizeInput($row['contact_name']);
|
||||
$contact_email = sanitizeInput($row['contact_email']);
|
||||
@@ -521,7 +521,7 @@ if (isset($_POST['update_kanban_ticket'])) {
|
||||
|
||||
// Get Company Info
|
||||
$sql = mysqli_query($mysqli, "SELECT company_name, company_phone, company_phone_country_code FROM companies WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$company_name = sanitizeInput($row['company_name']);
|
||||
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone'], $row['company_phone_country_code']));
|
||||
|
||||
@@ -550,7 +550,7 @@ if (isset($_POST['update_kanban_ticket'])) {
|
||||
// Also Email all the watchers
|
||||
$sql_watchers = mysqli_query($mysqli, "SELECT watcher_email FROM ticket_watchers WHERE watcher_ticket_id = $ticket_id");
|
||||
$body .= "<br><br>----------------------------------------<br>YOU ARE A COLLABORATOR ON THIS TICKET";
|
||||
while ($row = mysqli_fetch_array($sql_watchers)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_watchers)) {
|
||||
$watcher_email = sanitizeInput($row['watcher_email']);
|
||||
|
||||
// Queue Mail
|
||||
@@ -691,7 +691,7 @@ if (isset($_GET['client_duplicate_check'])) {
|
||||
);
|
||||
|
||||
if (mysqli_num_rows($sql_clients) > 0) {
|
||||
while ($row = mysqli_fetch_array($sql_clients)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
$response['message'] = "<i class='fas fa-fw fa-copy mr-2'></i> Potential duplicate: <i>" . nullable_htmlentities($row['client_name']) . "</i> already exists.";
|
||||
}
|
||||
}
|
||||
@@ -713,7 +713,7 @@ if (isset($_GET['contact_email_check'])) {
|
||||
// 1. Duplicate check
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT contact_email FROM contacts WHERE contact_email = '$email' LIMIT 1");
|
||||
if (mysqli_num_rows($sql_contacts) > 0) {
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$response['message'] = "<i class='fas fa-fw fa-copy mr-2'></i> Potential duplicate: <i>" . nullable_htmlentities($row['contact_email']) . "</i> already exists.";
|
||||
}
|
||||
}
|
||||
@@ -734,7 +734,7 @@ if (isset($_GET['ai_reword'])) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM ai_models LEFT JOIN ai_providers ON ai_model_ai_provider_id = ai_provider_id WHERE ai_model_use_case = 'General' LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$model_name = $row['ai_model_name'];
|
||||
$promptText = $row['ai_model_prompt'];
|
||||
$url = $row['ai_provider_api_url'];
|
||||
@@ -805,7 +805,7 @@ if (isset($_GET['ai_create_document_template'])) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM ai_models LEFT JOIN ai_providers ON ai_model_ai_provider_id = ai_provider_id WHERE ai_model_use_case = 'General' LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$model_name = $row['ai_model_name'];
|
||||
$url = $row['ai_provider_api_url'];
|
||||
$key = $row['ai_provider_api_key'];
|
||||
@@ -861,7 +861,7 @@ if (isset($_GET['ai_ticket_summary'])) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM ai_models LEFT JOIN ai_providers ON ai_model_ai_provider_id = ai_provider_id WHERE ai_model_use_case = 'General' LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$model_name = $row['ai_model_name'];
|
||||
$url = $row['ai_provider_api_url'];
|
||||
$key = $row['ai_provider_api_key'];
|
||||
|
||||
@@ -29,7 +29,7 @@ if (isset($_GET['asset_id'])) {
|
||||
|
||||
} else {
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
@@ -122,7 +122,7 @@ if (isset($_GET['asset_id'])) {
|
||||
$asset_tag_name_display_array = array();
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT * FROM asset_tags LEFT JOIN tags ON asset_tag_tag_id = tag_id WHERE asset_tag_asset_id = $asset_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
|
||||
$asset_tag_id = intval($row['tag_id']);
|
||||
$asset_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -517,7 +517,7 @@ if (isset($_GET['asset_id'])) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_related_interfaces)) { ?>
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_related_interfaces)) { ?>
|
||||
<?php
|
||||
$interface_id = intval($row['interface_id']);
|
||||
$interface_name = nullable_htmlentities($row['interface_name']);
|
||||
@@ -626,7 +626,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_credentials)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_credentials)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
@@ -659,7 +659,7 @@ if (isset($_GET['asset_id'])) {
|
||||
$credential_tag_name_display_array = array();
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT * FROM credential_tags LEFT JOIN tags ON credential_tags.tag_id = tags.tag_id WHERE credential_id = $credential_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -758,7 +758,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_software)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_software)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
@@ -775,7 +775,7 @@ if (isset($_GET['asset_id'])) {
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = intval($row['asset_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -784,7 +784,7 @@ if (isset($_GET['asset_id'])) {
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = intval($row['contact_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -844,7 +844,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
@@ -923,7 +923,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
@@ -995,7 +995,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_recurring_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_recurring_tickets)) {
|
||||
$recurring_ticket_id = intval($row['recurring_ticket_id']);
|
||||
$recurring_ticket_subject = nullable_htmlentities($row['recurring_ticket_subject']);
|
||||
$recurring_ticket_priority = nullable_htmlentities($row['recurring_ticket_priority']);
|
||||
@@ -1074,7 +1074,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -1165,7 +1165,7 @@ if (isset($_GET['asset_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_services)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_services)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
$service_description = nullable_htmlentities($row['service_description']);
|
||||
|
||||
@@ -248,7 +248,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
AND ( EXISTS (SELECT 1 FROM assets WHERE asset_location_id = location_id AND $archive_query) OR location_id = $location_filter)
|
||||
ORDER BY location_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_locations_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations_filter)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -275,7 +275,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -303,7 +303,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
GROUP BY tag_id
|
||||
HAVING COUNT(asset_tag_asset_id) > 0 OR tag_id IN ($tag_filter)
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_filter)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']); ?>
|
||||
|
||||
@@ -524,7 +524,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
@@ -630,7 +630,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$asset_tag_name_display_array = array();
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT * FROM asset_tags LEFT JOIN tags ON asset_tag_tag_id = tag_id WHERE asset_tag_asset_id = $asset_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
|
||||
$asset_tag_id = intval($row['tag_id']);
|
||||
$asset_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
|
||||
@@ -27,7 +27,7 @@ if (isset($_GET['calendar_id'])) {
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header py-2">
|
||||
@@ -37,11 +37,11 @@ if (isset($_GET['calendar_id'])) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$calendar_id = intval($row['calendar_id']);
|
||||
$calendar_name = nullable_htmlentities($row['calendar_name']);
|
||||
$calendar_color = nullable_htmlentities($row['calendar_color']);
|
||||
@@ -70,7 +70,7 @@ if (isset($_GET['calendar_id'])) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="card">
|
||||
<div id='calendar'></div>
|
||||
@@ -85,7 +85,7 @@ require_once "modals/calendar/calendar_event_add.php";
|
||||
|
||||
//loop through IDs and create a modal for each
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendar_events LEFT JOIN calendars ON event_calendar_id = calendar_id $client_event_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['event_id']);
|
||||
$event_title = nullable_htmlentities($row['event_title']);
|
||||
$event_description = nullable_htmlentities($row['event_description']);
|
||||
@@ -166,7 +166,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
events: [
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendar_events LEFT JOIN calendars ON event_calendar_id = calendar_id $client_event_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['event_id']);
|
||||
$event_title = json_encode($row['event_title']);
|
||||
$event_start = json_encode($row['event_start']);
|
||||
@@ -180,7 +180,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
//Invoices Created
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN invoices ON client_id = invoice_client_id $client_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['invoice_id']);
|
||||
$scope = strval($row['invoice_scope']);
|
||||
if (empty($scope)) {
|
||||
@@ -195,7 +195,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
//Quotes Created
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN quotes ON client_id = quote_client_id $client_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['quote_id']);
|
||||
$event_title = json_encode($row['quote_prefix'] . $row['quote_number'] . " " . $row['quote_scope']);
|
||||
$event_start = json_encode($row['quote_date']);
|
||||
@@ -210,7 +210,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
$client_query"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['ticket_id']);
|
||||
$ticket_status = intval($row['ticket_status']);
|
||||
$ticket_status_name = strval($row['ticket_status_name']);
|
||||
@@ -244,7 +244,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
LEFT JOIN users ON recurring_ticket_assigned_to = user_id
|
||||
$client_query"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['recurring_ticket_id']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$username = $row['user_name'];
|
||||
@@ -263,13 +263,13 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
}
|
||||
|
||||
//Tickets Scheduled
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients
|
||||
LEFT JOIN tickets ON client_id = ticket_client_id
|
||||
LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
$client_query AND ticket_schedule IS NOT NULL"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['ticket_id']);
|
||||
$username = $row['user_name'];
|
||||
if (empty($username)) {
|
||||
@@ -299,7 +299,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
//Vendors Added Created
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id $client_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['vendor_id']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$event_title = json_encode("Vendor : '" . $row['vendor_name'] . "' created");
|
||||
@@ -311,7 +311,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
if (!isset($_GET['client_id'])) {
|
||||
//Clients Added
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$event_id = intval($row['client_id']);
|
||||
$event_title = json_encode("Client: '" . $row['client_name'] . "' created");
|
||||
$event_start = json_encode($row['client_created_at']);
|
||||
@@ -326,7 +326,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
<?php
|
||||
// User preference for Calendar start day (Sunday/Monday)
|
||||
// Fetch User Dashboard Settings
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT user_config_calendar_first_day FROM user_settings WHERE user_id = $session_user_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT user_config_calendar_first_day FROM user_settings WHERE user_id = $session_user_id"));
|
||||
$user_config_calendar_first_day = intval($row['user_config_calendar_first_day']);
|
||||
?>
|
||||
firstDay: <?php echo $user_config_calendar_first_day ?>,
|
||||
|
||||
@@ -111,7 +111,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -194,7 +194,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$certificate_id = intval($row['certificate_id']);
|
||||
|
||||
@@ -9,13 +9,13 @@ enforceUserPermission('module_sales');
|
||||
require_once 'plugins/stripe-php/init.php';
|
||||
|
||||
// Get Stripe vars
|
||||
$stripe_vars = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_stripe_enable, config_stripe_publishable, config_stripe_secret FROM settings WHERE company_id = 1"));
|
||||
$stripe_vars = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT config_stripe_enable, config_stripe_publishable, config_stripe_secret FROM settings WHERE company_id = 1"));
|
||||
$config_stripe_enable = intval($stripe_vars['config_stripe_enable']);
|
||||
$config_stripe_publishable = nullable_htmlentities($stripe_vars['config_stripe_publishable']);
|
||||
$config_stripe_secret = nullable_htmlentities($stripe_vars['config_stripe_secret']);
|
||||
|
||||
// Get client's StripeID from database
|
||||
$stripe_client_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT * FROM client_stripe WHERE client_id = $client_id LIMIT 1"));
|
||||
$stripe_client_details = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM client_stripe WHERE client_id = $client_id LIMIT 1"));
|
||||
if ($stripe_client_details) {
|
||||
$stripe_id = sanitizeInput($stripe_client_details['stripe_id']);
|
||||
$stripe_pm = sanitizeInput($stripe_client_details['stripe_pm']);
|
||||
|
||||
@@ -19,7 +19,7 @@ $sql_important_contacts = mysqli_query(
|
||||
OR contact_technical = 1
|
||||
OR contact_primary = 1
|
||||
)
|
||||
AND contact_archived_at IS NULL
|
||||
AND contact_archived_at IS NULL
|
||||
ORDER BY contact_primary DESC, contact_name DESC LIMIT 5"
|
||||
);
|
||||
|
||||
@@ -215,7 +215,7 @@ $sql_asset_retired = mysqli_query(
|
||||
<table class="table table-borderless table-sm">
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_important_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_important_contacts)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_title = nullable_htmlentities($row['contact_title']);
|
||||
@@ -301,7 +301,7 @@ $sql_asset_retired = mysqli_query(
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_shared_items)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_shared_items)) {
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_active = nullable_htmlentities($row['item_active']);
|
||||
$item_key = nullable_htmlentities($row['item_key']);
|
||||
@@ -317,17 +317,17 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
if ($item_type == 'Credential') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT credential_name FROM credentials WHERE credential_id = $item_related_id AND credential_client_id = $client_id");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$share_item = mysqli_fetch_assoc($share_item_sql);
|
||||
$item_name = nullable_htmlentities($share_item['credential_name']);
|
||||
$item_icon = "fas fa-key";
|
||||
} elseif ($item_type == 'Document') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = $item_related_id AND document_client_id = $client_id");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$share_item = mysqli_fetch_assoc($share_item_sql);
|
||||
$item_name = nullable_htmlentities($share_item['document_name']);
|
||||
$item_icon = "fas fa-folder";
|
||||
} elseif ($item_type == 'File') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = $item_related_id AND file_client_id = $client_id");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$share_item = mysqli_fetch_assoc($share_item_sql);
|
||||
$item_name = nullable_htmlentities($share_item['file_name']);
|
||||
$item_icon = "fas fa-paperclip";
|
||||
}
|
||||
@@ -377,7 +377,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_domains_expiring)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_domains_expiring)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_expire = nullable_htmlentities($row['domain_expire']);
|
||||
@@ -395,7 +395,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_certificates_expiring)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_certificates_expiring)) {
|
||||
$certificate_id = intval($row['certificate_id']);
|
||||
$certificate_name = nullable_htmlentities($row['certificate_name']);
|
||||
$certificate_expire = nullable_htmlentities($row['certificate_expire']);
|
||||
@@ -413,7 +413,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_asset_warranties_expiring)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_warranties_expiring)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_warranty_expire = nullable_htmlentities($row['asset_warranty_expire']);
|
||||
@@ -433,7 +433,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_asset_retire)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_retire)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_install_date = nullable_htmlentities($row['asset_install_date']);
|
||||
@@ -452,7 +452,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_licenses_expiring)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_licenses_expiring)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_expire = nullable_htmlentities($row['software_expire']);
|
||||
@@ -495,7 +495,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_domains_expired)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_domains_expired)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_expire = nullable_htmlentities($row['domain_expire']);
|
||||
@@ -513,7 +513,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_certificates_expired)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_certificates_expired)) {
|
||||
$certificate_id = intval($row['certificate_id']);
|
||||
$certificate_name = nullable_htmlentities($row['certificate_name']);
|
||||
$certificate_expire = nullable_htmlentities($row['certificate_expire']);
|
||||
@@ -531,7 +531,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_asset_warranties_expired)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_warranties_expired)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_warranty_expire = nullable_htmlentities($row['asset_warranty_expire']);
|
||||
@@ -551,7 +551,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_asset_retired)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_retired)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_install_date = nullable_htmlentities($row['asset_install_date']);
|
||||
@@ -570,7 +570,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_licenses_expired)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_licenses_expired)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_expire = nullable_htmlentities($row['software_expire']);
|
||||
@@ -609,7 +609,7 @@ $sql_asset_retired = mysqli_query(
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_stale_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_stale_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -652,7 +652,7 @@ $sql_asset_retired = mysqli_query(
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_recent_activities)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_recent_activities)) {
|
||||
$log_created_at_time_ago = timeAgo($row['log_created_at']);
|
||||
$log_description = nullable_htmlentities($row['log_description']);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ if (isset($_GET['contact_id'])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
@@ -120,7 +120,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$contact_tag_name_display_array = array();
|
||||
$contact_tag_id_array = array();
|
||||
$sql_contact_tags = mysqli_query($mysqli, "SELECT * FROM contact_tags LEFT JOIN tags ON contact_tags.tag_id = tags.tag_id WHERE contact_id = $contact_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contact_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contact_tags)) {
|
||||
|
||||
$contact_tag_id = intval($row['tag_id']);
|
||||
$contact_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -363,7 +363,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
@@ -412,7 +412,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$asset_tag_name_display_array = array();
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT * FROM asset_tags LEFT JOIN tags ON asset_tag_tag_id = tag_id WHERE asset_tag_asset_id = $asset_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
|
||||
$asset_tag_id = intval($row['tag_id']);
|
||||
$asset_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -531,7 +531,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_credentials)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_credentials)) {
|
||||
$credential_id = intval($row['credentials_credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
@@ -565,7 +565,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$credential_tag_name_display_array = array();
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT * FROM credential_tags LEFT JOIN tags ON credential_tags.tag_id = tags.tag_id WHERE credential_id = $credential_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -666,7 +666,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_software)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_software)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
@@ -683,7 +683,7 @@ if (isset($_GET['contact_id'])) {
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = intval($row['asset_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -692,7 +692,7 @@ if (isset($_GET['contact_id'])) {
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = intval($row['contact_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -741,7 +741,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_recurring_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_recurring_tickets)) {
|
||||
$recurring_ticket_id = intval($row['recurring_ticket_id']);
|
||||
$recurring_ticket_subject = nullable_htmlentities($row['recurring_ticket_subject']);
|
||||
$recurring_ticket_priority = nullable_htmlentities($row['recurring_ticket_priority']);
|
||||
@@ -821,7 +821,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -910,7 +910,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_services)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_services)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
$service_description = nullable_htmlentities($row['service_description']);
|
||||
@@ -969,7 +969,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
@@ -1035,7 +1035,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
@@ -1099,7 +1099,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_notes)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_notes)) {
|
||||
$contact_note_id = intval($row['contact_note_id']);
|
||||
$contact_note_type = nullable_htmlentities($row['contact_note_type']);
|
||||
$contact_note = nl2br(nullable_htmlentities($row['contact_note']));
|
||||
|
||||
@@ -144,7 +144,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
GROUP BY tags.tag_id
|
||||
HAVING COUNT(contact_tags.contact_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_filter)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']); ?>
|
||||
|
||||
@@ -169,7 +169,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
AND ( EXISTS (SELECT 1 FROM contacts WHERE contact_location_id = location_id AND $archive_query) OR location_id = $location_filter)
|
||||
ORDER BY location_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_locations_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations_filter)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -196,7 +196,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -327,7 +327,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$contact_id = intval($row['contact_id']);
|
||||
@@ -445,7 +445,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$contact_tag_name_display_array = array();
|
||||
$contact_tag_id_array = array();
|
||||
$sql_contact_tags = mysqli_query($mysqli, "SELECT * FROM contact_tags LEFT JOIN tags ON contact_tags.tag_id = tags.tag_id WHERE contact_id = $contact_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contact_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contact_tags)) {
|
||||
|
||||
$contact_tag_id = intval($row['tag_id']);
|
||||
$contact_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
|
||||
@@ -161,7 +161,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
GROUP BY tags.tag_id
|
||||
HAVING COUNT(credential_tags.credential_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_filter)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']); ?>
|
||||
|
||||
@@ -180,7 +180,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
$sql_locations_filter = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations_filter)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -207,7 +207,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -301,7 +301,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$credential_id = intval($row['c_credential_id']);
|
||||
@@ -341,7 +341,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$credential_tag_name_display_array = array();
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT * FROM credential_tags LEFT JOIN tags ON credential_tags.tag_id = tags.tag_id WHERE credential_id = $credential_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -390,7 +390,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
LIMIT 1"
|
||||
);
|
||||
if (mysqli_num_rows($sql_shared) > 0) {
|
||||
$row = mysqli_fetch_array($sql_shared);
|
||||
$row = mysqli_fetch_assoc($sql_shared);
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_active = nullable_htmlentities($row['item_active']);
|
||||
$item_key = nullable_htmlentities($row['item_key']);
|
||||
|
||||
@@ -17,7 +17,7 @@ if (isset($_GET['enable_technical'])) {
|
||||
|
||||
// Fetch User Dashboard Settings
|
||||
$sql_user_dashboard_settings = mysqli_query($mysqli, "SELECT * FROM user_settings WHERE user_id = $session_user_id");
|
||||
$row = mysqli_fetch_array($sql_user_dashboard_settings);
|
||||
$row = mysqli_fetch_assoc($sql_user_dashboard_settings);
|
||||
$user_config_dashboard_financial_enable = intval($row['user_config_dashboard_financial_enable']);
|
||||
$user_config_dashboard_technical_enable = intval($row['user_config_dashboard_technical_enable']);
|
||||
|
||||
@@ -52,7 +52,7 @@ $sql_years_select = mysqli_query($mysqli, "
|
||||
|
||||
<label for="year" class="mr-sm-2">Select Year:</label>
|
||||
<select id="year" onchange="this.form.submit()" class="form-control mr-sm-3 col-sm-2 mb-3 mb-sm-0" name="year">
|
||||
<?php while ($row = mysqli_fetch_array($sql_years_select)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_years_select)) {
|
||||
$year_select = $row['all_years'];
|
||||
if (empty($year_select)) {
|
||||
$year_select = date('Y');
|
||||
@@ -88,29 +88,29 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
$largest_income_month = 0;
|
||||
|
||||
$sql_total_payments_to_invoices = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments_to_invoices FROM payments WHERE YEAR(payment_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_total_payments_to_invoices);
|
||||
$row = mysqli_fetch_assoc($sql_total_payments_to_invoices);
|
||||
$total_payments_to_invoices = floatval($row['total_payments_to_invoices']);
|
||||
|
||||
$sql_total_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE YEAR(revenue_date) = $year AND revenue_category_id > 0");
|
||||
$row = mysqli_fetch_array($sql_total_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_total_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$total_income = $total_payments_to_invoices + $total_revenues;
|
||||
|
||||
$sql_total_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_vendor_id > 0 AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_total_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_total_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$sql_invoice_totals = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals FROM invoices WHERE invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable' AND YEAR(invoice_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_invoice_totals);
|
||||
$row = mysqli_fetch_assoc($sql_invoice_totals);
|
||||
$invoice_totals = floatval($row['invoice_totals']);
|
||||
|
||||
$sql_total_payments_to_invoices_all_years = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments_to_invoices_all_years FROM payments");
|
||||
$row = mysqli_fetch_array($sql_total_payments_to_invoices_all_years);
|
||||
$row = mysqli_fetch_assoc($sql_total_payments_to_invoices_all_years);
|
||||
$total_payments_to_invoices_all_years = floatval($row['total_payments_to_invoices_all_years']);
|
||||
|
||||
$sql_invoice_totals_all_years = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals_all_years FROM invoices WHERE invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_invoice_totals_all_years);
|
||||
$row = mysqli_fetch_assoc($sql_invoice_totals_all_years);
|
||||
$invoice_totals_all_years = floatval($row['invoice_totals_all_years']);
|
||||
|
||||
$receivables = $invoice_totals_all_years - $total_payments_to_invoices_all_years;
|
||||
@@ -135,30 +135,30 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
|
||||
// Get recurring invoice totals
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_yearly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'year' AND YEAR(recurring_invoice_created_at) <= $year");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_yearly_total);
|
||||
$recurring_yearly_total = floatval($row['recurring_yearly_total']);
|
||||
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_monthly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'month' AND YEAR(recurring_invoice_created_at) <= $year");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_monthly_total);
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']) + ($recurring_yearly_total / 12);
|
||||
|
||||
// Recurring expenses totals
|
||||
$sql_recurring_expense_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_expense_amount) AS recurring_expense_yearly_total FROM recurring_expenses WHERE recurring_expense_status = 1 AND recurring_expense_frequency = 2 AND YEAR(recurring_expense_created_at) <= $year");
|
||||
$row = mysqli_fetch_array($sql_recurring_expense_yearly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_expense_yearly_total);
|
||||
$recurring_expense_yearly_total = floatval($row['recurring_expense_yearly_total']);
|
||||
|
||||
$sql_recurring_expense_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_expense_amount) AS recurring_expense_monthly_total FROM recurring_expenses WHERE recurring_expense_status = 1 AND recurring_expense_frequency = 1 AND YEAR(recurring_expense_created_at) <= $year");
|
||||
$row = mysqli_fetch_array($sql_recurring_expense_monthly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_expense_monthly_total);
|
||||
$recurring_expense_monthly_total = floatval($row['recurring_expense_monthly_total']) + ($recurring_expense_yearly_total / 12);
|
||||
|
||||
// Get miles driven
|
||||
$sql_miles_driven = mysqli_query($mysqli, "SELECT SUM(trip_miles) AS total_miles FROM trips WHERE YEAR(trip_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_miles_driven);
|
||||
$row = mysqli_fetch_assoc($sql_miles_driven);
|
||||
$total_miles = floatval($row['total_miles']);
|
||||
|
||||
if ($config_module_enable_ticketing && $config_module_enable_accounting) {
|
||||
$sql_unbilled_tickets = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS unbilled_tickets FROM tickets WHERE ticket_closed_at IS NOT NULL AND ticket_billable = 1 AND ticket_invoice_id = 0 AND YEAR(ticket_created_at) = $year");
|
||||
$row = mysqli_fetch_array($sql_unbilled_tickets);
|
||||
$row = mysqli_fetch_assoc($sql_unbilled_tickets);
|
||||
$unbilled_tickets = intval($row['unbilled_tickets']);
|
||||
} else {
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(recurring_invoice_id) AS recurring_invoices_added FROM recurring_invoices WHERE YEAR(recurring_invoice_created_at) = $year"));
|
||||
@@ -421,7 +421,7 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_accounts)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_accounts)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
@@ -430,15 +430,15 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
<td><?php echo $account_name; ?></td>
|
||||
<?php
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -477,7 +477,7 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_latest_invoice_payments)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_latest_invoice_payments)) {
|
||||
$payment_date = nullable_htmlentities($row['payment_date']);
|
||||
$payment_amount = floatval($row['payment_amount']);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
@@ -518,7 +518,7 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_latest_expenses)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_latest_expenses)) {
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
$expense_amount = floatval($row['expense_amount']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
@@ -709,7 +709,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_your_tickets)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_your_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -740,8 +740,8 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
?>
|
||||
<tr class="<?php echo empty($ticket_updated_at) ? 'text-bold' : ''; ?>">
|
||||
<td>
|
||||
<a class="text-dark"
|
||||
href="ticket.php?ticket_id=<?= "$ticket_id$has_client" ?>"><?= "$ticket_prefix$ticket_number" ?>
|
||||
<a class="text-dark"
|
||||
href="ticket.php?ticket_id=<?= "$ticket_id$has_client" ?>"><?= "$ticket_prefix$ticket_number" ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="ticket.php?ticket_id=<?= "$ticket_id$has_client" ?>"><?= $ticket_subject ?></a></td>
|
||||
@@ -795,11 +795,11 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
for ($month = 1; $month <= 12; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payment_invoice_id = invoice_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$payments_for_month = floatval($row['payment_amount_for_month']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$revenues_for_month = floatval($row['revenue_amount_for_month']);
|
||||
|
||||
$income_for_month = $payments_for_month + $revenues_for_month;
|
||||
@@ -825,11 +825,11 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
for ($month = 1; $month <= 12; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payment_invoice_id = invoice_id AND YEAR(payment_date) = $year-1 AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$payments_for_month = floatval($row['payment_amount_for_month']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id > 0 AND YEAR(revenue_date) = $year-1 AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$revenues_for_month = floatval($row['revenue_amount_for_month']);
|
||||
|
||||
$income_for_month = $payments_for_month + $revenues_for_month;
|
||||
@@ -856,7 +856,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
$largest_invoice_month = 0;
|
||||
for ($month = 1; $month <= 12; $month++) {
|
||||
$sql_projected = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amount_for_month FROM invoices WHERE YEAR(invoice_due) = $year AND MONTH(invoice_due) = $month AND invoice_status != 'Cancelled' AND invoice_status != 'Draft' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_projected);
|
||||
$row = mysqli_fetch_assoc($sql_projected);
|
||||
$invoice_for_month = floatval($row['invoice_amount_for_month']);
|
||||
|
||||
if ($invoice_for_month > 0 && $invoice_for_month > $largest_invoice_month) {
|
||||
@@ -882,7 +882,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
$largest_expense_month = 0;
|
||||
for ($month = 1; $month <= 12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND expense_vendor_id > 0");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$expenses_for_month = floatval($row['expense_amount_for_month']);
|
||||
|
||||
if ($expenses_for_month > 0 && $expenses_for_month > $largest_expense_month) {
|
||||
@@ -944,7 +944,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
$largest_trip_miles_month = 0;
|
||||
for ($month = 1; $month <= 12; $month++) {
|
||||
$sql_trips = mysqli_query($mysqli, "SELECT SUM(trip_miles) AS trip_miles_for_month FROM trips WHERE YEAR(trip_date) = $year AND MONTH(trip_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_trips);
|
||||
$row = mysqli_fetch_assoc($sql_trips);
|
||||
$trip_miles_for_month = floatval($row['trip_miles_for_month']);
|
||||
|
||||
if ($trip_miles_for_month > 0 && $trip_miles_for_month > $largest_trip_miles_month) {
|
||||
@@ -991,13 +991,13 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
mysqli_query($mysqli, "CREATE TEMPORARY TABLE TopCategories SELECT category_name, category_id, SUM(invoice_amount) AS total_income FROM categories, invoices WHERE invoice_category_id = category_id AND invoice_status = 'Paid' AND YEAR(invoice_date) = $year GROUP BY category_name, category_id ORDER BY total_income DESC LIMIT 5");
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_name FROM TopCategories");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_name = json_encode($row['category_name']);
|
||||
echo "$category_name,";
|
||||
}
|
||||
|
||||
$sql_other_categories = mysqli_query($mysqli, "SELECT SUM(invoices.invoice_amount) AS other_income FROM categories LEFT JOIN TopCategories ON categories.category_id = TopCategories.category_id INNER JOIN invoices ON categories.category_id = invoices.invoice_category_id WHERE TopCategories.category_id IS NULL AND invoice_status = 'Paid' AND YEAR(invoice_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_other_categories);
|
||||
$row = mysqli_fetch_assoc($sql_other_categories);
|
||||
$other_income = floatval($row['other_income']);
|
||||
if ($other_income > 0) {
|
||||
echo "'Others',";
|
||||
@@ -1008,7 +1008,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
data: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT total_income FROM TopCategories");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$total_income = floatval($row['total_income']);
|
||||
echo "$total_income,";
|
||||
}
|
||||
@@ -1020,7 +1020,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
backgroundColor: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_color FROM TopCategories JOIN categories ON TopCategories.category_id = categories.category_id");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_color = json_encode($row['category_color']);
|
||||
echo "$category_color,";
|
||||
}
|
||||
@@ -1056,13 +1056,13 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
mysqli_query($mysqli, "CREATE TEMPORARY TABLE TopExpenseCategories SELECT category_name, category_id, SUM(expense_amount) AS total_expense FROM categories, expenses WHERE expense_category_id = category_id AND expense_vendor_id > 0 AND YEAR(expense_date) = $year GROUP BY category_name, category_id ORDER BY total_expense DESC LIMIT 5");
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_name FROM TopExpenseCategories");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_name = json_encode($row['category_name']);
|
||||
echo "$category_name,";
|
||||
}
|
||||
|
||||
$sql_other_categories = mysqli_query($mysqli, "SELECT SUM(expenses.expense_amount) AS other_expense FROM categories LEFT JOIN TopExpenseCategories ON categories.category_id = TopExpenseCategories.category_id INNER JOIN expenses ON categories.category_id = expenses.expense_category_id WHERE TopExpenseCategories.category_id IS NULL AND expense_vendor_id > 0 AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_other_categories);
|
||||
$row = mysqli_fetch_assoc($sql_other_categories);
|
||||
$other_expense = floatval($row['other_expense']);
|
||||
if ($other_expense > 0) {
|
||||
echo "'Others',";
|
||||
@@ -1073,7 +1073,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
data: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT total_expense FROM TopExpenseCategories");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$total_expense = floatval($row['total_expense']);
|
||||
echo "$total_expense,";
|
||||
}
|
||||
@@ -1085,7 +1085,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
backgroundColor: [
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_color FROM TopExpenseCategories JOIN categories ON TopExpenseCategories.category_id = categories.category_id");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_color = json_encode($row['category_color']);
|
||||
echo "$category_color,";
|
||||
}
|
||||
@@ -1121,13 +1121,13 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
mysqli_query($mysqli, "CREATE TEMPORARY TABLE TopVendors SELECT vendor_name, vendor_id, SUM(expense_amount) AS total_expense FROM vendors, expenses WHERE expense_vendor_id = vendor_id AND YEAR(expense_date) = $year GROUP BY vendor_name, vendor_id ORDER BY total_expense DESC LIMIT 5");
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_name FROM TopVendors");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_name = json_encode($row['vendor_name']);
|
||||
echo "$vendor_name,";
|
||||
}
|
||||
|
||||
$sql_other_vendors = mysqli_query($mysqli, "SELECT SUM(expenses.expense_amount) AS other_expense FROM vendors LEFT JOIN TopVendors ON vendors.vendor_id = TopVendors.vendor_id INNER JOIN expenses ON vendors.vendor_id = expenses.expense_vendor_id WHERE TopVendors.vendor_id IS NULL AND YEAR(expense_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_other_vendors);
|
||||
$row = mysqli_fetch_assoc($sql_other_vendors);
|
||||
$other_expense = floatval($row['other_expense']);
|
||||
if ($other_expense > 0) {
|
||||
echo "'Others',";
|
||||
@@ -1138,7 +1138,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
data: [
|
||||
<?php
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT total_expense FROM TopVendors");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$total_expense = floatval($row['total_expense']);
|
||||
echo "$total_expense,";
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
backgroundColor: [
|
||||
<?php
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id FROM TopVendors");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
// Generate random color for each vendor
|
||||
echo "'#" . substr(md5(rand()), 0, 6) . "',";
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ if (mysqli_num_rows($sql_document) == 0) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($sql_document);
|
||||
$row = mysqli_fetch_assoc($sql_document);
|
||||
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
@@ -150,7 +150,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$document_version_count = 1; // Initialize the document version counter
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_document_versions)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_document_versions)) {
|
||||
$document_version_id = intval($row['document_version_id']);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_description = nullable_htmlentities($row['document_version_description']);
|
||||
@@ -216,7 +216,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$linked_files = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$folder_id = intval($row['file_folder_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
@@ -249,7 +249,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$linked_contacts = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
||||
@@ -283,7 +283,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$linked_assets = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
@@ -319,7 +319,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$linked_software = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_software)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_software)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
@@ -351,7 +351,7 @@ $page_title = $row['document_name'];
|
||||
|
||||
$associated_vendors = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
@@ -400,7 +400,7 @@ $page_title = $row['document_name'];
|
||||
ORDER BY document_version_created_at DESC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_document_versions)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_document_versions)) {
|
||||
$document_version_id = intval($row['document_version_id']);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_description = nullable_htmlentities($row['document_version_description']);
|
||||
|
||||
@@ -123,7 +123,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -230,7 +230,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_description = nullable_htmlentities($row['domain_description']);
|
||||
|
||||
@@ -145,7 +145,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<?php
|
||||
$sql_vendors_filter = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE EXISTS (SELECT 1 FROM expenses WHERE expense_vendor_id = vendor_id) ORDER BY vendor_name ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_vendors_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors_filter)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -165,7 +165,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
$sql_categories_filter = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND EXISTS (SELECT 1 FROM expenses WHERE expense_category_id = category_id) ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories_filter)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
@@ -185,7 +185,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
$sql_accounts_filter = mysqli_query($mysqli, "SELECT account_id, account_name FROM accounts WHERE EXISTS (SELECT 1 FROM expenses WHERE expense_account_id = account_id) ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_accounts_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_accounts_filter)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
?>
|
||||
@@ -251,7 +251,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$expense_id = intval($row['expense_id']);
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
$expense_amount = floatval($row['expense_amount']);
|
||||
|
||||
@@ -148,7 +148,7 @@ while ($folder_id > 0) {
|
||||
global $mysqli, $get_folder_id, $session_user_role;
|
||||
|
||||
$sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_location = 1 AND folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_folders)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_folders)) {
|
||||
$folder_id = intval($row['folder_id']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
@@ -309,7 +309,7 @@ while ($folder_id > 0) {
|
||||
|
||||
<?php
|
||||
$files = [];
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_reference_name = nullable_htmlentities($row['file_reference_name']);
|
||||
@@ -429,7 +429,7 @@ while ($folder_id > 0) {
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
@@ -480,7 +480,7 @@ while ($folder_id > 0) {
|
||||
);
|
||||
$file_shared = (mysqli_num_rows($sql_shared) > 0) ? true : false;
|
||||
if ($file_shared) {
|
||||
$row = mysqli_fetch_array($sql_shared);
|
||||
$row = mysqli_fetch_assoc($sql_shared);
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_active = nullable_htmlentities($row['item_active']);
|
||||
$item_key = nullable_htmlentities($row['item_key']);
|
||||
|
||||
@@ -28,7 +28,7 @@ if (isset($_GET['query'])) {
|
||||
ORDER BY client_id DESC LIMIT 5"
|
||||
);
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LEFT JOIN clients ON client_id = contact_client_id
|
||||
WHERE contact_archived_at IS NULL
|
||||
AND (contact_name LIKE '%$query%'
|
||||
@@ -179,7 +179,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_clients)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$location_phone_country_code = nullable_htmlentities($row['location_phone_country_code']);
|
||||
@@ -225,7 +225,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_title = nullable_htmlentities($row['contact_title']);
|
||||
@@ -282,7 +282,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
$vendor_description = nullable_htmlentities($row['vendor_description']);
|
||||
$vendor_phone_country_code = nullable_htmlentities($row['vendor_phone_country_code']);
|
||||
@@ -329,7 +329,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_domains)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_domains)) {
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_expiry = nullable_htmlentities($row['domain_expire']);
|
||||
$domain_id = intval($row['domain_id']);
|
||||
@@ -372,7 +372,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_products)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_products)) {
|
||||
$product_name = nullable_htmlentities($row['product_name']);
|
||||
$product_description = nullable_htmlentities($row['product_description']);
|
||||
?>
|
||||
@@ -411,7 +411,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
@@ -456,7 +456,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_reference_name = nullable_htmlentities($row['file_reference_name']);
|
||||
@@ -507,7 +507,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -557,7 +557,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_recurring_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_recurring_tickets)) {
|
||||
$recurring_ticket_id = intval($row['recurring_ticket_id']);
|
||||
$recurring_ticket_subject = nullable_htmlentities($row['recurring_ticket_subject']);
|
||||
$recurring_ticket_frequency = nullable_htmlentities($row['recurring_ticket_frequency']);
|
||||
@@ -607,7 +607,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_credentials)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credentials)) {
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
$credential_client_id = intval($row['credential_client_id']);
|
||||
@@ -659,7 +659,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_quotes)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_quotes)) {
|
||||
$quote_id = intval($row['quote_id']);
|
||||
$quote_prefix = nullable_htmlentities($row['quote_prefix']);
|
||||
$quote_number = intval($row['quote_number']);
|
||||
@@ -710,7 +710,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_invoices)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_invoices)) {
|
||||
$invoice_id = intval($row['invoice_id']);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
@@ -762,7 +762,7 @@ if (isset($_GET['query'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets)) {
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
@@ -843,7 +843,7 @@ if (isset($_GET['query'])) {
|
||||
<?php
|
||||
$last_ticket_id = null; // Track the last ticket ID processed
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_ticket_replies)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_ticket_replies)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
|
||||
// Only output the ticket header if we're at a new ticket
|
||||
|
||||
@@ -41,7 +41,7 @@ if (isset($_GET['client_id'])) {
|
||||
exit;
|
||||
} else {
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$client_is_lead = intval($row['client_lead']);
|
||||
$client_type = nullable_htmlentities($row['client_type']);
|
||||
@@ -84,7 +84,7 @@ if (isset($_GET['client_id'])) {
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_id = $client_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = intval($row['tag_id']);
|
||||
$client_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -104,12 +104,12 @@ if (isset($_GET['client_id'])) {
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_invoice_amounts = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $client_id AND invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
$row = mysqli_fetch_assoc($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = floatval($row['invoice_amounts']);
|
||||
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
$row = mysqli_fetch_assoc($sql_amount_paid);
|
||||
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
@@ -117,13 +117,13 @@ if (isset($_GET['client_id'])) {
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_monthly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'month' AND recurring_invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']);
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_yearly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'year' AND recurring_invoice_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
$row = mysqli_fetch_assoc($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = floatval($row['recurring_yearly_total']) / 12;
|
||||
|
||||
@@ -131,7 +131,7 @@ if (isset($_GET['client_id'])) {
|
||||
|
||||
// Get Credit Balance
|
||||
$sql_credit_balance = mysqli_query($mysqli, "SELECT SUM(credit_amount) AS credit_balance FROM credits WHERE credit_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_credit_balance);
|
||||
$row = mysqli_fetch_assoc($sql_credit_balance);
|
||||
|
||||
$credit_balance = floatval($row['credit_balance']);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
Clients
|
||||
<?php if ($num_active_clients) { ?>
|
||||
<span class="right badge text-light" data-toggle="tooltip" title="Active Clients"><?php echo $num_active_clients; ?></span>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
@@ -195,13 +195,13 @@
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
$sql_custom_links = mysqli_query($mysqli, "SELECT * FROM custom_links WHERE custom_link_location = 1 AND custom_link_archived_at IS NULL
|
||||
ORDER BY custom_link_order ASC, custom_link_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_custom_links)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_custom_links)) {
|
||||
$custom_link_name = nullable_htmlentities($row['custom_link_name']);
|
||||
$custom_link_uri = sanitize_url($row['custom_link_uri']);
|
||||
$custom_link_icon = nullable_htmlentities($row['custom_link_icon']);
|
||||
|
||||
@@ -37,7 +37,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$invoice_id = intval($row['invoice_id']);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
@@ -78,7 +78,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
$page_title = "{$row['invoice_prefix']}{$row['invoice_number']}";
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM companies WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$company_id = intval($row['company_id']);
|
||||
$company_name = nullable_htmlentities($row['company_name']);
|
||||
$company_country = nullable_htmlentities($row['company_country']);
|
||||
@@ -138,14 +138,14 @@ if (isset($_GET['invoice_id'])) {
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE payment_invoice_id = $invoice_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
$row = mysqli_fetch_assoc($sql_amount_paid);
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
$balance = $invoice_amount - $amount_paid;
|
||||
|
||||
// Get Credit Balance
|
||||
$sql_credit_balance = mysqli_query($mysqli, "SELECT SUM(credit_amount) AS credit_balance FROM credits WHERE credit_client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql_credit_balance);
|
||||
$row = mysqli_fetch_assoc($sql_credit_balance);
|
||||
|
||||
$credit_balance = floatval($row['credit_balance']);
|
||||
|
||||
@@ -181,7 +181,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
");
|
||||
|
||||
if (mysqli_num_rows($products_sql) > 0) {
|
||||
while ($row = mysqli_fetch_array($products_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($products_sql)) {
|
||||
$products[] = $row;
|
||||
}
|
||||
$json_products = json_encode($products);
|
||||
@@ -394,7 +394,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
$total_tax = 0.00;
|
||||
$sub_total = 0.00;
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_invoice_items)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_invoice_items)) {
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_name = nullable_htmlentities($row['item_name']);
|
||||
$item_description = nullable_htmlentities($row['item_description']);
|
||||
@@ -467,7 +467,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
<option value="0">No Tax</option>
|
||||
<?php
|
||||
$taxes_sql = mysqli_query($mysqli, "SELECT * FROM taxes WHERE tax_archived_at IS NULL ORDER BY tax_name ASC");
|
||||
while ($row = mysqli_fetch_array($taxes_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($taxes_sql)) {
|
||||
$tax_id = intval($row['tax_id']);
|
||||
$tax_name = nullable_htmlentities($row['tax_name']);
|
||||
$tax_percent = floatval($row['tax_percent']);
|
||||
@@ -591,7 +591,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_history)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_history)) {
|
||||
$history_created_at = $row['history_created_at'];
|
||||
$history_status = nullable_htmlentities($row['history_status']);
|
||||
$history_description = nullable_htmlentities($row['history_description']);
|
||||
@@ -639,7 +639,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_payments)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_payments)) {
|
||||
$payment_id = intval($row['payment_id']);
|
||||
$payment_date = nullable_htmlentities($row['payment_date']);
|
||||
$payment_amount = floatval($row['payment_amount']);
|
||||
@@ -703,7 +703,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_created_at = nullable_htmlentities($row['ticket_created_at']);
|
||||
$ticket_subject = nullable_htmlentities($row['ticket_subject']);
|
||||
|
||||
@@ -37,32 +37,32 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS n
|
||||
$overdue_count = $row['num'];
|
||||
|
||||
$sql_total_draft_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_draft_amount FROM invoices WHERE invoice_status = 'Draft' $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_draft_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_draft_amount);
|
||||
$total_draft_amount = floatval($row['total_draft_amount']);
|
||||
|
||||
$sql_total_sent_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_sent_amount FROM invoices WHERE invoice_status = 'Sent' $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_sent_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_sent_amount);
|
||||
$total_sent_amount = floatval($row['total_sent_amount']);
|
||||
|
||||
$sql_total_viewed_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_viewed_amount FROM invoices WHERE invoice_status = 'Viewed' $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_viewed_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_viewed_amount);
|
||||
$total_viewed_amount = floatval($row['total_viewed_amount']);
|
||||
|
||||
$sql_total_cancelled_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_cancelled_amount FROM invoices WHERE invoice_status = 'Cancelled' $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_cancelled_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_cancelled_amount);
|
||||
$total_cancelled_amount = floatval($row['total_cancelled_amount']);
|
||||
|
||||
$sql_total_partial_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_partial_amount FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_partial_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_partial_amount);
|
||||
$total_partial_amount = floatval($row['total_partial_amount']);
|
||||
$total_partial_count = mysqli_num_rows($sql_total_partial_amount);
|
||||
|
||||
$sql_total_overdue_partial_amount = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_overdue_partial_amount FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' AND invoice_due < CURDATE() $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_overdue_partial_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_overdue_partial_amount);
|
||||
$total_overdue_partial_amount = floatval($row['total_overdue_partial_amount']);
|
||||
|
||||
$sql_total_overdue_amount = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_overdue_amount FROM invoices WHERE invoice_status != 'Draft' AND invoice_status != 'Paid' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable' AND invoice_due < CURDATE() $client_query");
|
||||
$row = mysqli_fetch_array($sql_total_overdue_amount);
|
||||
$row = mysqli_fetch_assoc($sql_total_overdue_amount);
|
||||
$total_overdue_amount = floatval($row['total_overdue_amount']);
|
||||
|
||||
$real_overdue_amount = $total_overdue_amount - $total_overdue_partial_amount;
|
||||
@@ -202,7 +202,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
$sql_categories_filter = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Income' AND EXISTS (SELECT 1 FROM invoices WHERE invoice_category_id = category_id) ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories_filter)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
@@ -313,7 +313,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$invoice_id = intval($row['invoice_id']);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = nullable_htmlentities($row['invoice_number']);
|
||||
|
||||
@@ -130,7 +130,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
GROUP BY tags.tag_id
|
||||
HAVING COUNT(location_tags.location_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_filter)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']); ?>
|
||||
|
||||
@@ -157,7 +157,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$access_permission_query
|
||||
ORDER BY client_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_clients_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients_filter)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -258,7 +258,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$location_id = intval($row['location_id']);
|
||||
@@ -306,7 +306,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$location_tag_name_display_array = array();
|
||||
$location_tag_id_array = array();
|
||||
$sql_location_tags = mysqli_query($mysqli, "SELECT * FROM location_tags LEFT JOIN tags ON location_tags.tag_id = tags.tag_id WHERE location_tags.location_id = $location_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_location_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_location_tags)) {
|
||||
|
||||
$location_tag_id = intval($row['tag_id']);
|
||||
$location_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
|
||||
@@ -6,7 +6,7 @@ $account_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_id = $account_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$account_notes = nullable_htmlentities($row['account_notes']);
|
||||
|
||||
@@ -33,12 +33,12 @@ ob_start();
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $account_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="5" placeholder="Enter some notes" name="notes"><?php echo $account_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="edit_account" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
|
||||
@@ -13,7 +13,7 @@ if ($client_id) {
|
||||
$sql_contact_select = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
} else {
|
||||
$sql_client_select = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
}
|
||||
}
|
||||
|
||||
// OS typeahead suggestions
|
||||
$os_sql = mysqli_query($mysqli, "SELECT DISTINCT asset_os AS label FROM assets WHERE asset_archived_at IS NULL");
|
||||
@@ -85,7 +85,7 @@ ob_start();
|
||||
<option value="">- Select Client -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_client_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_client_select)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?= $client_id_select ?>"><?= $client_name ?></option>
|
||||
@@ -191,7 +191,7 @@ ob_start();
|
||||
<option value="">- Select Network -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_network_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_network_select)) {
|
||||
$network_id = intval($row['network_id']);
|
||||
$network_name = nullable_htmlentities($row['network_name']);
|
||||
$network = nullable_htmlentities($row['network']);
|
||||
@@ -305,7 +305,7 @@ ob_start();
|
||||
<option value="">- Select Location -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_location_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_location_select)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -326,12 +326,12 @@ ob_start();
|
||||
<option value="">- Select Contact -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_contact_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contact_select)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
<option
|
||||
<?php if ($contact_id == $contact_id_select) {
|
||||
<option
|
||||
<?php if ($contact_id == $contact_id_select) {
|
||||
echo "selected"; }
|
||||
?>
|
||||
value="<?= $contact_id_select ?>"><?= $contact_name ?>
|
||||
@@ -374,7 +374,7 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_vendor_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendor_select)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -476,7 +476,7 @@ ob_start();
|
||||
<select class="form-control select2" name="tags[]" data-placeholder="Add some tags" multiple>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -66,7 +66,7 @@ ob_start();
|
||||
<option value="0">- Not Categorized -</option>
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
|
||||
@@ -96,7 +96,7 @@ ob_start();
|
||||
"SELECT user_id, user_name FROM users
|
||||
WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$user_id = intval($row['user_id']);
|
||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||
<option <?php if ($session_user_id == $user_id) { echo "selected"; } ?> value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||
@@ -116,7 +116,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_projects = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_completed_at IS NULL AND project_archived_at IS NULL ORDER BY project_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_projects)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_projects)) {
|
||||
$project_id_select = intval($row['project_id']);
|
||||
$project_name_select = nullable_htmlentities($row['project_name']); ?>
|
||||
<option value="<?php echo $project_id_select; ?>"><?php echo $project_name_select; ?></option>
|
||||
|
||||
@@ -34,7 +34,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
|
||||
@@ -35,7 +35,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
|
||||
@@ -38,7 +38,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 5 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -40,7 +40,7 @@ ob_start();
|
||||
<?php
|
||||
$clients_sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $client_select_query");
|
||||
|
||||
while ($row = mysqli_fetch_array($clients_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($clients_sql)) {
|
||||
$client_id_select = intval($row["client_id"]);
|
||||
$client_name_select = nullable_htmlentities($row["client_name"]);
|
||||
?>
|
||||
|
||||
@@ -4,12 +4,12 @@ require_once '../../../includes/modal_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_id = $asset_id LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
@@ -177,7 +177,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_networks = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_networks)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_networks)) {
|
||||
$network_id_select = intval($row['network_id']);
|
||||
$network_name_select = nullable_htmlentities($row['network_name']);
|
||||
$network_select = nullable_htmlentities($row['network']);
|
||||
@@ -280,7 +280,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations)) {
|
||||
$location_id_select = intval($row['location_id']);
|
||||
$location_name_select = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -302,7 +302,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
@@ -342,7 +342,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
|
||||
@@ -5,15 +5,15 @@ require_once '../../../includes/modal_header.php';
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LEFT JOIN clients ON client_id = asset_client_id
|
||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN clients ON client_id = asset_client_id
|
||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN locations ON asset_location_id = location_id
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
@@ -74,7 +74,7 @@ if ($location_archived_at) {
|
||||
$asset_tag_name_display_array = array();
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT * FROM asset_tags LEFT JOIN tags ON asset_tag_tag_id = tag_id WHERE asset_tag_asset_id = $asset_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
|
||||
$asset_tag_id = intval($row['tag_id']);
|
||||
$asset_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -94,7 +94,7 @@ $asset_tags_display = implode('', $asset_tag_name_display_array);
|
||||
|
||||
// Network Interfaces
|
||||
$sql_related_interfaces = mysqli_query($mysqli, "
|
||||
SELECT
|
||||
SELECT
|
||||
ai.interface_id,
|
||||
ai.interface_name,
|
||||
ai.interface_description,
|
||||
@@ -125,7 +125,7 @@ $sql_related_interfaces = mysqli_query($mysqli, "
|
||||
)
|
||||
LEFT JOIN assets AS connected_assets
|
||||
ON connected_assets.asset_id = connected_interfaces.interface_asset_id
|
||||
WHERE
|
||||
WHERE
|
||||
ai.interface_asset_id = $asset_id
|
||||
AND ai.interface_archived_at IS NULL
|
||||
ORDER BY ai.interface_name ASC
|
||||
@@ -134,7 +134,7 @@ $interface_count = mysqli_num_rows($sql_related_interfaces);
|
||||
|
||||
// Related Credentials Query
|
||||
$sql_related_credentials = mysqli_query($mysqli, "
|
||||
SELECT
|
||||
SELECT
|
||||
credentials.credential_id AS credential_id,
|
||||
credentials.credential_name,
|
||||
credentials.credential_description,
|
||||
@@ -170,7 +170,7 @@ $sql_related_tickets = mysqli_query($mysqli, "
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
// Related Recurring Tickets Query
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
LEFT JOIN recurring_ticket_assets ON recurring_tickets.recurring_ticket_id = recurring_ticket_assets.recurring_ticket_id
|
||||
WHERE recurring_ticket_asset_id = $asset_id OR recurring_ticket_assets.asset_id = $asset_id
|
||||
GROUP BY recurring_tickets.recurring_ticket_id
|
||||
@@ -182,14 +182,14 @@ $recurring_ticket_count = mysqli_num_rows($sql_related_recurring_tickets);
|
||||
$sql_related_documents = mysqli_query($mysqli, "SELECT * FROM asset_documents
|
||||
LEFT JOIN documents ON asset_documents.document_id = documents.document_id
|
||||
LEFT JOIN users ON user_id = document_created_by
|
||||
WHERE asset_documents.asset_id = $asset_id
|
||||
AND document_archived_at IS NULL
|
||||
WHERE asset_documents.asset_id = $asset_id
|
||||
AND document_archived_at IS NULL
|
||||
ORDER BY document_name DESC"
|
||||
);
|
||||
$document_count = mysqli_num_rows($sql_related_documents);
|
||||
|
||||
// Related Files
|
||||
$sql_related_files = mysqli_query($mysqli, "SELECT * FROM asset_files
|
||||
$sql_related_files = mysqli_query($mysqli, "SELECT * FROM asset_files
|
||||
LEFT JOIN files ON asset_files.file_id = files.file_id
|
||||
WHERE asset_files.asset_id = $asset_id
|
||||
AND file_archived_at IS NULL
|
||||
@@ -200,8 +200,8 @@ $file_count = mysqli_num_rows($sql_related_files);
|
||||
// Related Software Query
|
||||
$sql_related_software = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM software_assets
|
||||
LEFT JOIN software ON software_assets.software_id = software.software_id
|
||||
"SELECT * FROM software_assets
|
||||
LEFT JOIN software ON software_assets.software_id = software.software_id
|
||||
WHERE software_assets.asset_id = $asset_id
|
||||
AND software_archived_at IS NULL
|
||||
ORDER BY software_name DESC"
|
||||
@@ -288,7 +288,7 @@ ob_start();
|
||||
<div>
|
||||
<?= $asset_tags_display ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ($asset_type) { ?>
|
||||
<div class="mt-1"><i class="fa fa-fw fa-tag text-secondary mr-2"></i><?php echo $asset_type; ?></div>
|
||||
<?php }
|
||||
@@ -361,7 +361,7 @@ ob_start();
|
||||
if ($contact_mobile) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -369,7 +369,7 @@ ob_start();
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Additional Notes</h5>
|
||||
</div>
|
||||
<textarea class="form-control" rows=6 id="assetNotes" placeholder="Enter quick notes here" onblur="updateAssetNotes(<?php echo $asset_id ?>)"><?php echo $asset_notes ?></textarea>
|
||||
<textarea class="form-control" rows=6 id="assetNotes" placeholder="Enter quick notes here" onblur="updateAssetNotes(<?php echo $asset_id ?>)"><?php echo $asset_notes ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -406,7 +406,7 @@ ob_start();
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($row = mysqli_fetch_array($sql_related_interfaces)) { ?>
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_related_interfaces)) { ?>
|
||||
<?php
|
||||
$interface_id = intval($row['interface_id']);
|
||||
$interface_name = nullable_htmlentities($row['interface_name']);
|
||||
@@ -425,8 +425,8 @@ ob_start();
|
||||
$interface_mac_display = $interface_mac ?: '-';
|
||||
$interface_ip_display = $interface_ip ?: '-';
|
||||
$interface_type_display = $interface_type ?: '-';
|
||||
$network_name_display = $network_name
|
||||
? "<i class='fas fa-fw fa-network-wired mr-1'></i>$network_name"
|
||||
$network_name_display = $network_name
|
||||
? "<i class='fas fa-fw fa-network-wired mr-1'></i>$network_name"
|
||||
: '-';
|
||||
|
||||
// Connected interface details
|
||||
@@ -482,7 +482,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_credentials)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_credentials)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
@@ -515,7 +515,7 @@ ob_start();
|
||||
$credential_tag_name_display_array = array();
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT * FROM credential_tags LEFT JOIN tags ON credential_tags.tag_id = tags.tag_id WHERE credential_id = $credential_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -579,7 +579,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -666,7 +666,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_recurring_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_recurring_tickets)) {
|
||||
$recurring_ticket_id = intval($row['recurring_ticket_id']);
|
||||
$recurring_ticket_subject = nullable_htmlentities($row['recurring_ticket_subject']);
|
||||
$recurring_ticket_priority = nullable_htmlentities($row['recurring_ticket_priority']);
|
||||
@@ -704,7 +704,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_software)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_software)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
@@ -721,7 +721,7 @@ ob_start();
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = intval($row['asset_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -730,7 +730,7 @@ ob_start();
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = intval($row['contact_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
@@ -824,7 +824,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_mime_type = nullable_htmlentities($row['file_mime_type']);
|
||||
@@ -872,7 +872,7 @@ ob_start();
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<div class="modal-body">
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_related_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_documents)) {
|
||||
$related_document_id = intval($row['document_id']);
|
||||
$related_document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
|
||||
@@ -4,12 +4,12 @@ require_once '../../../includes/modal_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_id = $asset_id LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
@@ -44,7 +44,7 @@ $asset_network_id = intval($row['interface_network_id']);
|
||||
$device_icon = getAssetIcon($asset_type);
|
||||
|
||||
// Asset History Query
|
||||
$sql_asset_history = mysqli_query($mysqli, "SELECT * FROM asset_history
|
||||
$sql_asset_history = mysqli_query($mysqli, "SELECT * FROM asset_history
|
||||
WHERE asset_history_asset_id = $asset_id
|
||||
ORDER BY asset_history_id
|
||||
DESC LIMIT 10"
|
||||
@@ -53,7 +53,7 @@ $sql_asset_history = mysqli_query($mysqli, "SELECT * FROM asset_history
|
||||
// Tags
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT asset_tag_tag_id FROM asset_tags WHERE asset_tag_asset_id = $asset_id");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
$asset_tag_tag_id = intval($row['asset_tag_tag_id']);
|
||||
$asset_tag_id_array[] = $asset_tag_tag_id;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_networks = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_id = $asset_network_id OR network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_networks)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_networks)) {
|
||||
$network_id_select = intval($row['network_id']);
|
||||
$network_name_select = nullable_htmlentities($row['network_name']);
|
||||
$network_select = nullable_htmlentities($row['network']);
|
||||
@@ -313,7 +313,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_id = $asset_location_id OR location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations)) {
|
||||
$location_id_select = intval($row['location_id']);
|
||||
$location_name_select = nullable_htmlentities($row['location_name']);
|
||||
$location_archived_at = nullable_htmlentities($row['location_archived_at']);
|
||||
@@ -341,7 +341,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_id = $asset_contact_id OR contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||
$contact_archived_at = nullable_htmlentities($row['contact_archived_at']);
|
||||
@@ -389,7 +389,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_id = $asset_vendor_id OR vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
$vendor_archived_at = nullable_htmlentities($row['vendor_archived_at']);
|
||||
@@ -479,7 +479,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 5 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
@@ -507,7 +507,7 @@ ob_start();
|
||||
<label>Asset History</label>
|
||||
<ul>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_asset_history)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_history)) {
|
||||
$asset_history_description = nullable_htmlentities(($row['asset_history_description']));
|
||||
$asset_history_created_at = nullable_htmlentities(($row['asset_history_created_at']));
|
||||
echo "<li><small class='text-secondary'>$asset_history_created_at</small><br>$asset_history_description</li>";
|
||||
|
||||
@@ -160,7 +160,7 @@ ob_start();
|
||||
<option value="">- Select Network -</option>
|
||||
<?php
|
||||
$sql_network_select = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_network_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_network_select)) {
|
||||
$network_id = $row['network_id'];
|
||||
$network_name = nullable_htmlentities($row['network_name']);
|
||||
$network = nullable_htmlentities($row['network']);
|
||||
@@ -194,7 +194,7 @@ ob_start();
|
||||
ORDER BY asset_name ASC, interface_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_interfaces_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_interfaces_select)) {
|
||||
$interface_id_select = intval($row['interface_id']);
|
||||
$interface_name_select = nullable_htmlentities($row['interface_name']);
|
||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
@@ -40,7 +40,7 @@ ob_start();
|
||||
AND network_client_id = $client_id
|
||||
ORDER BY network_name ASC
|
||||
");
|
||||
while ($net_row = mysqli_fetch_array($sql_network_select)) {
|
||||
while ($net_row = mysqli_fetch_assoc($sql_network_select)) {
|
||||
$network_id_select = intval($net_row['network_id']);
|
||||
$network_name_select = nullable_htmlentities($net_row['network_name']);
|
||||
$network_select = nullable_htmlentities($net_row['network']);
|
||||
|
||||
@@ -4,15 +4,15 @@ require_once '../../../includes/modal_header.php';
|
||||
|
||||
$interface_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM asset_interfaces
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM asset_interfaces
|
||||
LEFT JOIN assets ON asset_id = interface_asset_id
|
||||
LEFT JOIN clients ON client_id = asset_client_id
|
||||
WHERE interface_id = $interface_id LIMIT 1"
|
||||
);
|
||||
|
||||
$interface_count = mysqli_num_rows($sql);
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
$asset_id = intval($row['interface_asset_id']);
|
||||
$network_id = intval($row['interface_network_id']);
|
||||
@@ -58,7 +58,7 @@ ob_start();
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
|
||||
<input type="hidden" name="interface_id" value="<?php echo $interface_id; ?>">
|
||||
|
||||
<div class="modal-body" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
||||
<div class="modal-body" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
@@ -76,7 +76,7 @@ ob_start();
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-interface-details<?php echo $interface_id; ?>">
|
||||
<div class="tab-pane fade show active" id="pills-interface-details<?php echo $interface_id; ?>">
|
||||
|
||||
<!-- Interface Name -->
|
||||
<div class="form-group">
|
||||
@@ -85,11 +85,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="name"
|
||||
placeholder="Interface name or port number"
|
||||
placeholder="Interface name or port number"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_name; ?>"
|
||||
required
|
||||
@@ -109,11 +109,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="description"
|
||||
placeholder="Short Description"
|
||||
placeholder="Short Description"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_description; ?>"
|
||||
>
|
||||
@@ -131,7 +131,7 @@ ob_start();
|
||||
<option value="">- Select Type -</option>
|
||||
<?php foreach($interface_types_array as $interface_type_select) { ?>
|
||||
<option <?php if($interface_type == $interface_type_select) { echo "selected"; } ?>>
|
||||
<?php echo $interface_type_select; ?>
|
||||
<?php echo $interface_type_select; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
@@ -150,11 +150,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="mac"
|
||||
placeholder="MAC Address"
|
||||
placeholder="MAC Address"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_mac; ?>"
|
||||
data-inputmask="'alias': 'mac'"
|
||||
@@ -170,11 +170,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="ip"
|
||||
placeholder="IP Address"
|
||||
placeholder="IP Address"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_ip; ?>"
|
||||
data-inputmask="'alias': 'ip'"
|
||||
@@ -182,9 +182,9 @@ ob_start();
|
||||
>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="dhcp"
|
||||
<input
|
||||
type="checkbox"
|
||||
name="dhcp"
|
||||
value="1"
|
||||
title="Check to mark address as DHCP controlled"
|
||||
<?php if ($interface_ip === 'DHCP') echo "checked"; ?>
|
||||
@@ -201,11 +201,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="nat_ip"
|
||||
placeholder="Nat IP"
|
||||
placeholder="Nat IP"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_nat_ip; ?>"
|
||||
data-inputmask="'alias': 'ip'"
|
||||
@@ -221,11 +221,11 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="ipv6"
|
||||
placeholder="IPv6 Address"
|
||||
placeholder="IPv6 Address"
|
||||
maxlength="200"
|
||||
value="<?php echo $interface_ipv6; ?>"
|
||||
>
|
||||
@@ -249,7 +249,7 @@ ob_start();
|
||||
AND network_client_id = $client_id
|
||||
ORDER BY network_name ASC
|
||||
");
|
||||
while ($net_row = mysqli_fetch_array($sql_network_select)) {
|
||||
while ($net_row = mysqli_fetch_assoc($sql_network_select)) {
|
||||
$network_id_select = intval($net_row['network_id']);
|
||||
$network_name_select = nullable_htmlentities($net_row['network_name']);
|
||||
$network_select = nullable_htmlentities($net_row['network']);
|
||||
@@ -289,7 +289,7 @@ ob_start();
|
||||
)
|
||||
ORDER BY a.asset_name ASC, i.interface_name ASC
|
||||
");
|
||||
while ($row_if = mysqli_fetch_array($sql_interfaces_select)) {
|
||||
while ($row_if = mysqli_fetch_assoc($sql_interfaces_select)) {
|
||||
$iface_id_select = intval($row_if['interface_id']);
|
||||
$iface_name_select = nullable_htmlentities($row_if['interface_name']);
|
||||
$iface_asset_name_select = nullable_htmlentities($row_if['asset_name']);
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<option value="">- Select Network -</option>
|
||||
<?php
|
||||
$sql_network_select = mysqli_query($mysqli, "SELECT network_id, network_name, network FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_network_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_network_select)) {
|
||||
$network_id = $row['network_id'];
|
||||
$network_name = nullable_htmlentities($row['network_name']);
|
||||
$network = nullable_htmlentities($row['network']);
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
AND credentials.credential_archived_at IS NULL
|
||||
ORDER BY credentials.credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -47,7 +47,7 @@ ob_start();
|
||||
AND asset_documents.asset_id IS NULL
|
||||
ORDER BY document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -49,7 +49,7 @@ ob_start();
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
AND service_assets.asset_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
@@ -49,7 +49,7 @@ ob_start();
|
||||
AND software_assets.asset_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
@@ -70,4 +70,4 @@ ob_start();
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$calendar_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars WHERE calendar_id = $calendar_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$calendar_name = nullable_htmlentities($row['calendar_name']);
|
||||
$calendar_color = nullable_htmlentities($row['calendar_color']);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars ORDER BY calendar_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$calendar_id = intval($row['calendar_id']);
|
||||
$calendar_name = nullable_htmlentities($row['calendar_name']);
|
||||
$calendar_color = nullable_htmlentities($row['calendar_color']);
|
||||
@@ -133,7 +133,7 @@
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN contacts ON clients.client_id = contacts.contact_client_id AND contact_primary = 1 ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$event_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendar_events LEFT JOIN calendars ON event_calendar_id = calendar_id WHERE event_id = $event_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$event_title = nullable_htmlentities($row['event_title']);
|
||||
$event_description = nullable_htmlentities($row['event_description']);
|
||||
$event_location = nullable_htmlentities($row['event_location']);
|
||||
@@ -71,7 +71,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_calendars_select = mysqli_query($mysqli, "SELECT * FROM calendars ORDER BY calendar_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_calendars_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_calendars_select)) {
|
||||
$calendar_id_select = intval($row['calendar_id']);
|
||||
$calendar_name_select = nullable_htmlentities($row['calendar_name']);
|
||||
$calendar_color_select = nullable_htmlentities($row['calendar_color']);
|
||||
@@ -156,7 +156,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_clients = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN contacts ON clients.client_id = contacts.contact_client_id AND contact_primary = 1 ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_clients)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name_select = nullable_htmlentities($row['client_name']);
|
||||
$contact_email_select = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
@@ -49,7 +49,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
||||
@@ -92,7 +92,7 @@ ob_start();
|
||||
<option value="">- Domain -</option>
|
||||
<?php
|
||||
$domains_sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id ORDER BY domain_name ASC");
|
||||
while ($domain_row = mysqli_fetch_array($domains_sql)) {
|
||||
while ($domain_row = mysqli_fetch_assoc($domains_sql)) {
|
||||
$domain_id = intval($domain_row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($domain_row['domain_name']);
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
@@ -102,7 +102,7 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-certificate">
|
||||
@@ -172,4 +172,4 @@ ob_start();
|
||||
|
||||
<?php
|
||||
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
@@ -6,7 +6,7 @@ $certificate_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_id = $certificate_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$certificate_name = nullable_htmlentities($row['certificate_name']);
|
||||
$certificate_description = nullable_htmlentities($row['certificate_description']);
|
||||
$certificate_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
@@ -86,7 +86,7 @@ ob_start();
|
||||
<option value="">- Select Domain -</option>
|
||||
<?php
|
||||
$domains_sql = mysqli_query($mysqli, "SELECT domain_id, domain_name FROM domains WHERE domain_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($domains_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($domains_sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
?>
|
||||
@@ -165,7 +165,7 @@ ob_start();
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($history_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($history_sql)) {
|
||||
$certificate_modified_at = nullable_htmlentities($row['certificate_history_modified_at']);
|
||||
$certificate_field = nullable_htmlentities($row['certificate_history_column']);
|
||||
$certificate_before_value = nullable_htmlentities($row['certificate_history_old_value']);
|
||||
|
||||
@@ -8,7 +8,7 @@ if ($client_id) {
|
||||
$sql_location_select = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
} else {
|
||||
$sql_client_select = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
}
|
||||
}
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT tag_id, tag_name FROM tags WHERE tag_type = 3 ORDER BY tag_name ASC");
|
||||
|
||||
@@ -60,7 +60,7 @@ ob_start();
|
||||
<option value="">- Select Client -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_client_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_client_select)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id_select == $client_id) { echo "selected"; } ?> value="<?= $client_id_select ?>"><?= $client_name ?></option>
|
||||
@@ -127,7 +127,7 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Mobile</label>
|
||||
<label>Mobile</label>
|
||||
<div class="form-row">
|
||||
<div class="col-9">
|
||||
<div class="form-group">
|
||||
@@ -166,7 +166,7 @@ ob_start();
|
||||
<option value="">- Select Location -</option>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_location_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_location_select)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -235,7 +235,7 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<label>Roles:</label>
|
||||
<div class="form-row">
|
||||
|
||||
@@ -286,7 +286,7 @@ ob_start();
|
||||
<select class="form-control select2" name="tags[]" data-placeholder="Add some tags" multiple>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id = intval($row['tag_id']);
|
||||
$tag_name = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -33,7 +33,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
|
||||
@@ -38,7 +38,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 3 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once '../../../includes/modal_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LEFT JOIN clients ON client_id = contact_client_id
|
||||
LEFT JOIN locations ON location_id = contact_location_id
|
||||
LEFT JOIN users ON user_id = contact_user_id
|
||||
@@ -12,7 +12,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
@@ -63,7 +63,7 @@ $asset_count = mysqli_num_rows($sql_related_assets);
|
||||
|
||||
// Linked Software Licenses
|
||||
$sql_linked_software = mysqli_query($mysqli, "SELECT * FROM software_contacts, software
|
||||
WHERE software_contacts.contact_id = $contact_id
|
||||
WHERE software_contacts.contact_id = $contact_id
|
||||
AND software_contacts.software_id = software.software_id
|
||||
AND software_archived_at IS NULL
|
||||
ORDER BY software_name ASC"
|
||||
@@ -96,7 +96,7 @@ $sql_related_tickets = mysqli_query($mysqli, "SELECT * FROM tickets
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
// Related Recurring Tickets Query
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
WHERE recurring_ticket_contact_id = $contact_id
|
||||
ORDER BY recurring_ticket_next_run DESC"
|
||||
);
|
||||
@@ -107,7 +107,7 @@ $recurring_ticket_count = mysqli_num_rows($sql_related_recurring_tickets);
|
||||
$contact_tag_name_display_array = array();
|
||||
$contact_tag_id_array = array();
|
||||
$sql_contact_tags = mysqli_query($mysqli, "SELECT * FROM contact_tags LEFT JOIN tags ON contact_tags.tag_id = tags.tag_id WHERE contact_id = $contact_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contact_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contact_tags)) {
|
||||
|
||||
$contact_tag_id = intval($row['tag_id']);
|
||||
$contact_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -131,7 +131,7 @@ $note_count = mysqli_num_rows($sql_related_notes);
|
||||
|
||||
// Linked Services
|
||||
$sql_linked_services = mysqli_query($mysqli, "SELECT * FROM service_contacts, services
|
||||
WHERE service_contacts.contact_id = $contact_id
|
||||
WHERE service_contacts.contact_id = $contact_id
|
||||
AND service_contacts.service_id = services.service_id
|
||||
ORDER BY service_name ASC"
|
||||
);
|
||||
@@ -142,7 +142,7 @@ $linked_services = array();
|
||||
// Linked Documents
|
||||
$sql_linked_documents = mysqli_query($mysqli, "SELECT * FROM contact_documents, documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE contact_documents.contact_id = $contact_id
|
||||
WHERE contact_documents.contact_id = $contact_id
|
||||
AND contact_documents.document_id = documents.document_id
|
||||
AND document_archived_at IS NULL
|
||||
ORDER BY document_name ASC"
|
||||
@@ -153,7 +153,7 @@ $linked_documents = array();
|
||||
|
||||
// Linked Files
|
||||
$sql_linked_files = mysqli_query($mysqli, "SELECT * FROM contact_files, files
|
||||
WHERE contact_files.contact_id = $contact_id
|
||||
WHERE contact_files.contact_id = $contact_id
|
||||
AND contact_files.file_id = files.file_id
|
||||
AND file_archived_at IS NULL
|
||||
ORDER BY file_name ASC"
|
||||
@@ -213,7 +213,7 @@ ob_start();
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ($contact_mobile) { ?>
|
||||
<div>
|
||||
<i class="fas fa-fw fa-mobile-alt text-secondary mt-2"></i>
|
||||
@@ -239,10 +239,10 @@ ob_start();
|
||||
<i class="fas fa-fw fa-map-marker-alt text-secondary fa-2x"></i>
|
||||
<div class="media-body ml-2">
|
||||
<dt><?= $location_name ?></dt>
|
||||
<dd>
|
||||
<dd>
|
||||
<div><?= $location_address ?></div>
|
||||
<div><?= "$location_city $location_state $location_zip" ?></div>
|
||||
<div><?= $location_country ?></div>
|
||||
<div><?= $location_country ?></div>
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
@@ -339,7 +339,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
@@ -387,7 +387,7 @@ ob_start();
|
||||
$asset_tag_name_display_array = array();
|
||||
$asset_tag_id_array = array();
|
||||
$sql_asset_tags = mysqli_query($mysqli, "SELECT * FROM asset_tags LEFT JOIN tags ON asset_tag_tag_id = tag_id WHERE asset_tag_asset_id = $asset_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_asset_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_tags)) {
|
||||
|
||||
$asset_tag_id = intval($row['tag_id']);
|
||||
$asset_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -465,7 +465,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_credentials)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_credentials)) {
|
||||
$credential_id = intval($row['credentials_credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
@@ -499,7 +499,7 @@ ob_start();
|
||||
$credential_tag_name_display_array = array();
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT * FROM credential_tags LEFT JOIN tags ON credential_tags.tag_id = tags.tag_id WHERE credential_id = $credential_id ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_name = nullable_htmlentities($row['tag_name']);
|
||||
@@ -563,7 +563,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_tickets)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -645,7 +645,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_recurring_tickets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_recurring_tickets)) {
|
||||
$recurring_ticket_id = intval($row['recurring_ticket_id']);
|
||||
$recurring_ticket_subject = nullable_htmlentities($row['recurring_ticket_subject']);
|
||||
$recurring_ticket_priority = nullable_htmlentities($row['recurring_ticket_priority']);
|
||||
@@ -683,7 +683,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_software)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_software)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
@@ -700,7 +700,7 @@ ob_start();
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = intval($row['asset_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -709,7 +709,7 @@ ob_start();
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = intval($row['contact_id']);
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
@@ -753,7 +753,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_documents)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
@@ -806,7 +806,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_files)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
@@ -857,7 +857,7 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_notes)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_related_notes)) {
|
||||
$contact_note_id = intval($row['contact_note_id']);
|
||||
$contact_note_type = nullable_htmlentities($row['contact_note_type']);
|
||||
$contact_note = nullable_htmlentities($row['contact_note']);
|
||||
@@ -886,7 +886,7 @@ ob_start();
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -896,7 +896,7 @@ ob_start();
|
||||
<a href="contact_details.php?client_id=<?= $client_id ?>&contact_id=<?= $contact_id ?>" class="btn btn-outline-primary">
|
||||
<i class="fas fa-info-circle mr-2"></i>More Details
|
||||
</a>
|
||||
<a href="#" class="btn btn-secondary ajax-modal"
|
||||
<a href="#" class="btn btn-secondary ajax-modal"
|
||||
data-modal-url="modals/contact/contact_edit.php?id=<?= $contact_id ?>">
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
|
||||
@@ -10,7 +10,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_title = nullable_htmlentities($row['contact_title']);
|
||||
@@ -38,7 +38,7 @@ $contact_user_id = intval($row['contact_user_id']);
|
||||
// Tags
|
||||
$contact_tag_id_array = array();
|
||||
$sql_contact_tags = mysqli_query($mysqli, "SELECT tag_id FROM contact_tags WHERE contact_id = $contact_id");
|
||||
while ($row = mysqli_fetch_array($sql_contact_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contact_tags)) {
|
||||
$contact_tag_id = intval($row['tag_id']);
|
||||
$contact_tag_id_array[] = $contact_tag_id;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Mobile</label>
|
||||
<label>Mobile</label>
|
||||
<div class="form-row">
|
||||
<div class="col-9">
|
||||
<div class="form-group">
|
||||
@@ -169,7 +169,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_id = $contact_location_id OR location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_locations)) {
|
||||
$location_id_select = intval($row['location_id']);
|
||||
$location_name_select = nullable_htmlentities($row['location_name']);
|
||||
$location_archived_at = nullable_htmlentities($row['location_archived_at']);
|
||||
@@ -313,7 +313,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 3 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
@@ -377,4 +377,3 @@ $(document).ready(function() {
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -44,7 +44,7 @@ ob_start();
|
||||
AND asset_archived_at IS NULL
|
||||
ORDER BY asset_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -44,7 +44,7 @@ ob_start();
|
||||
AND credential_archived_at IS NULL
|
||||
ORDER BY credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -47,7 +47,7 @@ ob_start();
|
||||
AND contact_documents.contact_id IS NULL
|
||||
ORDER BY documents.document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -49,7 +49,7 @@ ob_start();
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
AND service_contacts.contact_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
@@ -48,7 +48,7 @@ ob_start();
|
||||
AND software_contacts.contact_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
?>
|
||||
|
||||
@@ -5,7 +5,7 @@ require_once '../../../includes/modal_header.php';
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT contact_name FROM contacts WHERE contact_id = $contact_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
|
||||
@@ -16,7 +16,7 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
@@ -54,7 +54,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
||||
@@ -165,7 +165,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
@@ -192,7 +192,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets LEFT JOIN locations on asset_location_id = location_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$asset_id_select = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_location = nullable_htmlentities($row['location_name']);
|
||||
@@ -231,7 +231,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 4 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -37,7 +37,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 4 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $credential_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM credentials WHERE credential_id = $credential_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['credential_client_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
@@ -27,7 +27,7 @@ $credential_asset_id = intval($row['credential_asset_id']);
|
||||
// Tags
|
||||
$credential_tag_id_array = array();
|
||||
$sql_credential_tags = mysqli_query($mysqli, "SELECT tag_id FROM credential_tags WHERE credential_id = $credential_id");
|
||||
while ($row = mysqli_fetch_array($sql_credential_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_credential_tags)) {
|
||||
$credential_tag_id = intval($row['tag_id']);
|
||||
$credential_tag_id_array[] = $credential_tag_id;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT contact_id, contact_name FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
@@ -199,7 +199,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, location_name FROM assets LEFT JOIN locations on asset_location_id = location_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets)) {
|
||||
$asset_id_select = intval($row['asset_id']);
|
||||
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||
$asset_location_select = nullable_htmlentities($row['location_name']);
|
||||
@@ -235,7 +235,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT tag_id, tag_name FROM tags WHERE tag_type = 4 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$credential_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM credentials WHERE credential_id = $credential_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
$credential_uri = nullable_htmlentities($row['credential_uri']);
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
$sql_files_select = mysqli_query($mysqli, "SELECT * FROM files
|
||||
$sql_files_select = mysqli_query($mysqli, "SELECT * FROM files
|
||||
LEFT JOIN folders ON folder_id = file_folder_id
|
||||
WHERE file_client_id = $client_id ORDER BY folder_name ASC, file_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
@@ -31,7 +31,7 @@ ob_start();
|
||||
<option value="">- Select Template -</option>
|
||||
<?php
|
||||
$sql_document_templates = mysqli_query($mysqli, "SELECT * FROM document_templates WHERE document_template_archived_at IS NULL ORDER BY document_template_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_document_templates)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_document_templates)) {
|
||||
$document_template_id = intval($row['document_template_id']);
|
||||
$document_template_name = nullable_htmlentities($row['document_template_name']);
|
||||
?>
|
||||
@@ -73,7 +73,7 @@ ob_start();
|
||||
<option value="0">/</option>
|
||||
<?php
|
||||
$sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_folders)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_folders)) {
|
||||
$folder_id = intval($row['folder_id']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $document_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
<option value="0">/</option>
|
||||
<?php
|
||||
$sql_folders_select = mysqli_query($mysqli, "SELECT * FROM folders WHERE folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_folders_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_folders_select)) {
|
||||
$folder_id_select = intval($row['folder_id']);
|
||||
$folder_name_select = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_client_visible = intval($row['document_client_visible']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -45,7 +45,7 @@ ob_start();
|
||||
AND asset_documents.asset_id IS NULL
|
||||
ORDER BY asset_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
AND contact_documents.contact_id IS NULL
|
||||
ORDER BY contact_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_contacts_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts_select)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -48,7 +48,7 @@ ob_start();
|
||||
AND document_files.file_id IS NULL
|
||||
ORDER BY folder_name ASC, file_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -47,7 +47,7 @@ ob_start();
|
||||
ORDER BY software_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -46,7 +46,7 @@ ob_start();
|
||||
AND vendor_documents.vendor_id IS NULL
|
||||
ORDER BY vendor_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_vendors_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors_select)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$document_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
$document_folder_id = nullable_htmlentities($row['document_folder_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$document_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ $purifier = new HTMLPurifier($purifier_config);
|
||||
$document_version_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM document_versions WHERE document_version_id = $document_version_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_content = $purifier->purify($row['document_version_content']);
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ $purifier = new HTMLPurifier($purifier_config);
|
||||
$document_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_content = $purifier->purify($row['document_content']);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ ob_start();
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -47,7 +47,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
||||
@@ -94,7 +94,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -115,7 +115,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -136,7 +136,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -157,7 +157,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -187,7 +187,7 @@ ob_start();
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$domain_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_id = $domain_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_description = nullable_htmlentities($row['domain_description']);
|
||||
$domain_expire = nullable_htmlentities($row['domain_expire']);
|
||||
@@ -92,12 +92,12 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
$vendor_sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($vendor_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($vendor_sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
?>
|
||||
<option <?php if ($domain_registrar == $vendor_id) { echo "selected"; } ?> value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -114,12 +114,12 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
$vendor_sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($vendor_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($vendor_sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
?>
|
||||
<option <?php if ($domain_webhost == $vendor_id) { echo "selected"; } ?> value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -136,12 +136,12 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
$vendor_sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($vendor_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($vendor_sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
?>
|
||||
<option <?php if ($domain_dnshost == $vendor_id) { echo "selected"; } ?> value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -158,12 +158,12 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
$vendor_sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($vendor_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($vendor_sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
?>
|
||||
<option <?php if ($domain_mailhost == $vendor_id) { echo "selected"; } ?> value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -254,8 +254,8 @@ ob_start();
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($history_sql)) {
|
||||
<?php
|
||||
while ($row = mysqli_fetch_assoc($history_sql)) {
|
||||
$domain_modified_at = nullable_htmlentities($row['domain_history_modified_at']);
|
||||
$domain_field = nullable_htmlentities($row['domain_history_column']);
|
||||
$domain_before_value = nullable_htmlentities($row['domain_history_old_value']);
|
||||
|
||||
@@ -50,21 +50,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT account_id, account_name, opening_balance FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -90,7 +90,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -135,7 +135,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
@@ -169,7 +169,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -32,21 +32,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT account_id, account_name, opening_balance FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
@@ -38,7 +38,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
|
||||
@@ -37,7 +37,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $expense_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM expenses WHERE expense_id = $expense_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
$expense_amount = floatval($row['expense_amount']);
|
||||
$expense_currency_code = nullable_htmlentities($row['expense_currency_code']);
|
||||
@@ -68,21 +68,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_accounts = mysqli_query($mysqli, "SELECT account_id, account_name, opening_balance FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_accounts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_accounts)) {
|
||||
$account_id_select = intval($row['account_id']);
|
||||
$account_name_select = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -106,7 +106,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -148,7 +148,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_id_select = intval($row['category_id']);
|
||||
$category_name_select = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
@@ -176,7 +176,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_clients)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name_select = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -10,7 +10,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM expenses
|
||||
WHERE expense_id = $expense_id LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
$expense_amount = floatval($row['expense_amount']);
|
||||
$expense_currency_code = nullable_htmlentities($row['expense_currency_code']);
|
||||
@@ -76,7 +76,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_accounts = mysqli_query($mysqli, "SELECT account_id, account_name, opening_balance, account_archived_at FROM accounts WHERE (account_archived_at > '$expense_created_at' OR account_archived_at IS NULL) ORDER BY account_archived_at ASC, account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_accounts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_accounts)) {
|
||||
$account_id_select = intval($row['account_id']);
|
||||
$account_name_select = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
@@ -88,15 +88,15 @@ ob_start();
|
||||
}
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$row = mysqli_fetch_assoc($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$row = mysqli_fetch_assoc($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id_select");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$row = mysqli_fetch_assoc($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -121,7 +121,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND (vendor_archived_at > '$expense_created_at' OR vendor_archived_at IS NULL) ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_select)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -166,7 +166,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND (category_archived_at > '$expense_created_at' OR category_archived_at IS NULL) ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_select)) {
|
||||
$category_id_select = intval($row['category_id']);
|
||||
$category_name_select = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
@@ -200,7 +200,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_clients)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name_select = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -27,7 +27,7 @@ ob_start();
|
||||
|
||||
<?php
|
||||
$sql_accounts_filter = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_accounts_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_accounts_filter)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
?>
|
||||
@@ -51,7 +51,7 @@ ob_start();
|
||||
|
||||
<?php
|
||||
$sql_vendors_filter = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_client_id = 0 ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_vendors_filter)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
?>
|
||||
@@ -75,7 +75,7 @@ ob_start();
|
||||
|
||||
<?php
|
||||
$sql_categories_filter = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Expense' ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories_filter)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_categories_filter)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $expense_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM expenses WHERE expense_id = $expense_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
$expense_amount = floatval($row['expense_amount']);
|
||||
$expense_currency_code = nullable_htmlentities($row['expense_currency_code']);
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
<?php
|
||||
|
||||
$sql_assets_select = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_archived_at IS NULL
|
||||
ORDER BY asset_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
$linked_assets = array();
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$file_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = $file_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['file_client_id']);
|
||||
$file_folder_id = nullable_htmlentities($row['file_folder_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
|
||||
@@ -5,7 +5,7 @@ $file_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = $file_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_id = intval($row['file_client_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$folder_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM folders WHERE folder_id = $folder_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ ob_start();
|
||||
<?php
|
||||
//select unarchived clients
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
@@ -68,7 +68,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<th>Add to Invoice</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php while ($row = mysqli_fetch_array($sql_tickets_billable)) {
|
||||
<?php while ($row = mysqli_fetch_assoc($sql_tickets_billable)) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_subject = nullable_htmlentities($row['ticket_subject']);
|
||||
$ticket_number = intval($row['ticket_number']);
|
||||
@@ -44,7 +44,7 @@
|
||||
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>">
|
||||
<span class="badge badge-pill <?php echo $ticket_status_class?> p-3"><?php echo "$ticket_prefix$ticket_number"; ?></span>
|
||||
</a>
|
||||
</td>
|
||||
</td>
|
||||
<td><?php echo $ticket_subject ?></td>
|
||||
<td><a href='ticket.php?ticket_id=<?php echo $ticket_id?>&invoice_id=<?php echo $invoice_id?>#addInvoiceFromTicketModal'>
|
||||
<i class="fas fa-fw fa-plus-circle"></i></td>
|
||||
@@ -56,4 +56,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $invoice_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM invoices LEFT JOIN clients ON invoice_client_id = client_id WHERE invoice_id = $invoice_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
@@ -23,7 +23,7 @@ ob_start();
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -35,7 +35,7 @@ ob_start();
|
||||
<input type="date" class="form-control" name="date" max="2999-12-31" value="<?php echo date("Y-m-d"); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="add_invoice_copy" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Copy</button>
|
||||
|
||||
@@ -6,7 +6,7 @@ $invoice_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM invoices LEFT JOIN clients ON invoice_client_id = client_id WHERE invoice_id = $invoice_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
$invoice_scope = nullable_htmlentities($row['invoice_scope']);
|
||||
@@ -64,7 +64,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_income_category = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$invoice_created_at' OR category_archived_at IS NULL) ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_income_category)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_income_category)) {
|
||||
$category_id_select = intval($row['category_id']);
|
||||
$category_name_select = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $invoice_id = intval($_GET['invoice_id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_id = $invoice_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ require_once '../../../includes/modal_header.php';
|
||||
$item_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_id = $item_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$item_name = nullable_htmlentities($row['item_name']);
|
||||
$item_description = nullable_htmlentities($row['item_description']);
|
||||
$item_quantity = floatval($row['item_quantity']);
|
||||
@@ -82,7 +82,7 @@ ob_start();
|
||||
<option value="0">No Tax</option>
|
||||
<?php
|
||||
$taxes_sql = mysqli_query($mysqli, "SELECT * FROM taxes WHERE (tax_archived_at > '$item_created_at' OR tax_archived_at IS NULL) ORDER BY tax_name ASC");
|
||||
while ($row = mysqli_fetch_array($taxes_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($taxes_sql)) {
|
||||
$tax_id_select = intval($row['tax_id']);
|
||||
$tax_name = nullable_htmlentities($row['tax_name']);
|
||||
$tax_percent = floatval($row['tax_percent']);
|
||||
|
||||
@@ -7,7 +7,7 @@ $client_id = intval($_GET['client_id'] ?? 0);
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-map-marker-alt mr-2"></i>Creating location</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
@@ -15,7 +15,7 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
@@ -31,7 +31,7 @@ ob_start();
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
@@ -39,7 +39,7 @@ ob_start();
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
|
||||
<?php if ($client_id) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } else { ?>
|
||||
@@ -55,7 +55,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$client_id_select = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?= $client_id_select ?>"><?= $client_name ?></option>
|
||||
@@ -171,7 +171,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
@@ -246,7 +246,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 2 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -37,7 +37,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 2 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $location_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_id = $location_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_description = nullable_htmlentities($row['location_description']);
|
||||
$location_country = nullable_htmlentities($row['location_country']);
|
||||
@@ -31,7 +31,7 @@ $location_primary = intval($row['location_primary']);
|
||||
// Tags
|
||||
$location_tag_id_array = array();
|
||||
$sql_location_tags = mysqli_query($mysqli, "SELECT * FROM location_tags WHERE location_id = $location_id");
|
||||
while ($row = mysqli_fetch_array($sql_location_tags)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_location_tags)) {
|
||||
$location_tag_id = intval($row['tag_id']);
|
||||
$location_tag_id_array[] = $location_tag_id;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ ob_start();
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="location_id" value="<?php echo $location_id; ?>">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
@@ -183,7 +183,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE (contact_archived_at > '$location_created_at' OR contact_archived_at IS NULL) AND contact_client_id = $client_id ORDER BY contact_archived_at ASC, contact_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_contacts)) {
|
||||
$contact_id_select = intval($row['contact_id']);
|
||||
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||
$contact_archived_at = nullable_htmlentities($row['contact_archived_at']);
|
||||
@@ -264,7 +264,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 2 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user