mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 03:14:52 +00:00
replace all instances of mysqli_fetch_array with mysqli_fetch_assoc for better performance and memory usage
This commit is contained in:
@@ -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']);
|
||||
?>
|
||||
|
||||
@@ -53,7 +53,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>
|
||||
@@ -97,7 +97,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = 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)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$location_id_select = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
@@ -165,7 +165,7 @@ ob_start();
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="pills-dns">
|
||||
<div class="form-group">
|
||||
<label>Primary DNS</label>
|
||||
|
||||
@@ -5,8 +5,8 @@ require_once '../../../includes/modal_header.php';
|
||||
$network_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_id = $network_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$network_name = nullable_htmlentities($row['network_name']);
|
||||
$network_description = nullable_htmlentities($row['network_description']);
|
||||
$network_vlan = intval($row['network_vlan']);
|
||||
@@ -84,9 +84,9 @@ ob_start();
|
||||
</div>
|
||||
<select class="form-control select2" name="location">
|
||||
<option value="">- Select Location -</option>
|
||||
<?php
|
||||
<?php
|
||||
$locations_sql = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations WHERE location_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($locations_sql)) {
|
||||
while ($row = mysqli_fetch_assoc($locations_sql)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
|
||||
@@ -8,14 +8,14 @@ $sql = mysqli_query($mysqli, "SELECT invoice_prefix, invoice_number, invoice_cli
|
||||
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']);
|
||||
$client_id = intval($row['invoice_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']);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ $sql = mysqli_query(
|
||||
LIMIT 1"
|
||||
);
|
||||
|
||||
$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']);
|
||||
@@ -27,7 +27,7 @@ $contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
//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;
|
||||
@@ -90,21 +90,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * 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']);
|
||||
|
||||
$account_balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -133,7 +133,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM payment_methods ORDER BY payment_method_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$payment_method_name = nullable_htmlentities($row['payment_method_name']);
|
||||
?>
|
||||
<option <?php if ($config_default_payment_method == $payment_method_name) { echo "selected"; } ?>><?php echo $payment_method_name; ?></option>
|
||||
|
||||
@@ -11,7 +11,7 @@ $sql = mysqli_query(
|
||||
WHERE client_id = $client_id"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$client_currency_code = nullable_htmlentities($row['client_currency_code']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
@@ -19,12 +19,12 @@ $contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
//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']);
|
||||
|
||||
@@ -93,21 +93,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * 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']);
|
||||
|
||||
$account_balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
@@ -136,7 +136,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM payment_methods ORDER BY payment_method_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$payment_method_name = nullable_htmlentities($row['payment_method_name']);
|
||||
?>
|
||||
<option <?php if ($config_default_payment_method == $payment_method_name) { echo "selected"; } ?>><?php echo $payment_method_name; ?></option>
|
||||
|
||||
@@ -68,21 +68,21 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * 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']);
|
||||
|
||||
$account_balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
@@ -6,7 +6,7 @@ $invoice_id = intval($_GET['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']);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
@@ -40,7 +40,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM client_saved_payment_methods WHERE saved_payment_client_id = $client_id ORDER BY saved_payment_description ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$saved_payment_id = intval($row['saved_payment_id']);
|
||||
$saved_payment_description = nullable_htmlentities($row['saved_payment_description']);
|
||||
?>
|
||||
|
||||
@@ -67,7 +67,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL");
|
||||
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']);
|
||||
?>
|
||||
@@ -111,7 +111,7 @@ ob_start();
|
||||
<?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']);
|
||||
|
||||
@@ -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 @@ $product_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM products WHERE product_id = $product_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$product_name = nullable_htmlentities($row['product_name']);
|
||||
$product_type = nullable_htmlentities($row['product_type']);
|
||||
$product_description = nullable_htmlentities($row['product_description']);
|
||||
@@ -51,7 +51,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$product_created_at' OR category_archived_at IS NULL)");
|
||||
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']);
|
||||
?>
|
||||
@@ -94,7 +94,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$taxes_sql = mysqli_query($mysqli, "SELECT * FROM taxes WHERE (tax_archived_at > '$product_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']);
|
||||
|
||||
@@ -30,7 +30,7 @@ ob_start();
|
||||
<input type="text" inputmode="numeric" pattern="[0-9]*" class="form-control" name="qty" placeholder="Units to add" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expense</label>
|
||||
<div class="input-group">
|
||||
@@ -42,11 +42,11 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$expenses_sql = mysqli_query($mysqli, "SELECT expense_id, expense_description, expense_date
|
||||
FROM expenses
|
||||
FROM expenses
|
||||
WHERE expense_archived_at IS NULL ORDER BY expense_date DESC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($expenses_sql)) {
|
||||
|
||||
while ($row = mysqli_fetch_assoc($expenses_sql)) {
|
||||
$expense_id = intval($row['expense_id']);
|
||||
$expense_description = nullable_htmlentities($row['expense_description']);
|
||||
$expense_date = nullable_htmlentities($row['expense_date']);
|
||||
|
||||
@@ -30,7 +30,7 @@ ob_start();
|
||||
<option value="0">- No Client -</option>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * 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']);
|
||||
?>
|
||||
@@ -61,7 +61,7 @@ ob_start();
|
||||
<option value="">- Template -</option>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM project_templates WHERE project_template_archived_at IS NULL ORDER BY project_template_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$project_template_id = intval($row['project_template_id']);
|
||||
$project_template_name = nullable_htmlentities($row['project_template_name']);
|
||||
?>
|
||||
@@ -107,7 +107,7 @@ ob_start();
|
||||
"SELECT user_id, user_name FROM users
|
||||
WHERE user_role_id > 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 value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||
|
||||
@@ -6,7 +6,7 @@ $project_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_id = $project_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$project_prefix = nullable_htmlentities($row['project_prefix']);
|
||||
$project_number = intval($row['project_number']);
|
||||
$project_name = nullable_htmlentities($row['project_name']);
|
||||
@@ -77,7 +77,7 @@ ob_start();
|
||||
"SELECT user_id, user_name FROM users
|
||||
WHERE user_role_id > 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_project_managers_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_project_managers_select)) {
|
||||
$user_id_select = intval($row['user_id']);
|
||||
$user_name_select = nullable_htmlentities($row['user_name']); ?>
|
||||
<option <?php if ($project_manager == $user_id_select) { echo "selected"; } ?> value="<?php echo $user_id_select; ?>"><?php echo $user_name_select; ?></option>
|
||||
@@ -95,7 +95,7 @@ ob_start();
|
||||
<option value="0">- No Client -</option>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * 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)) {
|
||||
$select_client_id = intval($row['client_id']);
|
||||
$select_client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -13,7 +13,7 @@ if ($client_id) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_id = $project_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$project_name = nullable_htmlentities($row['project_name']);
|
||||
|
||||
ob_start();
|
||||
@@ -35,7 +35,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<?php
|
||||
// Show the ticket prefix, or just the tag icon
|
||||
$config_row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_ticket_prefix FROM settings WHERE company_id = 1"));
|
||||
$config_row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT config_ticket_prefix FROM settings WHERE company_id = 1"));
|
||||
$config_ticket_prefix = $config_row['config_ticket_prefix'];
|
||||
if (empty($config_ticket_prefix)) {
|
||||
echo "<span class=\"input-group-text\"><i class=\"fa fa-fw fa-tag\"></i></span>";
|
||||
|
||||
@@ -13,7 +13,7 @@ if ($client_id) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_id = $project_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$project_name = nullable_htmlentities($row['project_name']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
@@ -40,7 +40,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_tickets_select = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients on ticket_client_id = client_id WHERE ticket_project_id = 0 AND ticket_closed_at IS NULL $client_ticket_select_query");
|
||||
while ($row = mysqli_fetch_array($sql_tickets_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_tickets_select)) {
|
||||
$ticket_id_select = intval($row['ticket_id']);
|
||||
$ticket_prefix_select = nullable_htmlentities($row['ticket_prefix']);
|
||||
$ticket_number_select = intval($row['ticket_number']);
|
||||
|
||||
@@ -43,7 +43,7 @@ ob_start();
|
||||
|
||||
//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']);
|
||||
?>
|
||||
@@ -67,7 +67,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']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $quote_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM quotes LEFT JOIN clients ON quote_client_id = client_id WHERE quote_id = $quote_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$quote_prefix = nullable_htmlentities($row['quote_prefix']);
|
||||
$quote_number = intval($row['quote_number']);
|
||||
$client_id = intval($row['client_id']);
|
||||
@@ -37,7 +37,7 @@ ob_start();
|
||||
<select class="form-control select2" name="client" required>
|
||||
<?php
|
||||
$sql_client_select = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
|
||||
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_select = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $quote_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM quotes LEFT JOIN clients ON quote_client_id = client_id WHERE quote_id = $quote_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$quote_id = intval($row['quote_id']);
|
||||
$quote_prefix = nullable_htmlentities($row['quote_prefix']);
|
||||
$quote_number = intval($row['quote_number']);
|
||||
@@ -63,7 +63,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$quote_created_at' OR 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 @@ $quote_id = intval($_GET['quote_id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM quotes WHERE quote_id = $quote_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$quote_prefix = nullable_htmlentities($row['quote_prefix']);
|
||||
$quote_number = intval($row['quote_number']);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql = 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)) {
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $rack_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM racks WHERE rack_id = $rack_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$rack_name = nullable_htmlentities($row['rack_name']);
|
||||
$client_id = intval($row['rack_client_id']);
|
||||
|
||||
@@ -57,7 +57,7 @@ ob_start();
|
||||
|
||||
// Fetch assets not assigned to any rack
|
||||
$sql_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id AND asset_id NOT IN ($assigned_assets_list) ORDER BY asset_name ASC");
|
||||
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']);
|
||||
?>
|
||||
|
||||
@@ -6,7 +6,7 @@ $rack_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM racks WHERE rack_id = $rack_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$rack_name = nullable_htmlentities($row['rack_name']);
|
||||
$rack_description = nullable_htmlentities($row['rack_description']);
|
||||
$rack_model = nullable_htmlentities($row['rack_model']);
|
||||
@@ -138,7 +138,7 @@ ob_start();
|
||||
<?php
|
||||
|
||||
$sql_location_select = 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_location_select)) {
|
||||
while ($row = mysqli_fetch_assoc($sql_location_select)) {
|
||||
$location_id_select = intval($row['location_id']);
|
||||
$location_name_select = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user