mirror of https://github.com/itflow-org/itflow
Services is now in global view
This commit is contained in:
parent
713bd0dab7
commit
fe68a1f641
|
|
@ -64,6 +64,12 @@
|
|||
<p><strong>ALL</strong> Certificates</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="services.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "services.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-stream"></i>
|
||||
<p><strong>ALL</strong> Services</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@
|
|||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_services.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_services.php") { echo "active"; } ?>">
|
||||
<a href="services.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "services.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-stream"></i>
|
||||
<p>
|
||||
Services
|
||||
|
|
|
|||
|
|
@ -1,214 +0,0 @@
|
|||
<div class="modal" id="addServiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-white"><i class="fa fa-fw fa-stream mr-2"></i>New Service</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="pill" href="#pills-overview">Overview</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-general">General</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-assets">Assets</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<!-- //TODO: The multiple selects won't play nicely with the icons or just general formatting. I've just added blank <p> tags to format it better for now -->
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-overview">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Name of Service" maxlength="200" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="description" placeholder="Description of Service" maxlength="200" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- //TODO: Integrate with company wide categories: /categories.php -->
|
||||
<div class="form-group">
|
||||
<label>Category</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-info"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="category" placeholder="Category" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Importance</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="importance" required>
|
||||
<option>Low</option>
|
||||
<option>Medium</option>
|
||||
<option>High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Backup</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-hdd"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="backup" placeholder="Backup strategy" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="3" placeholder="Enter some notes" name="note"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-general">
|
||||
<div class="form-group">
|
||||
<label for="contacts">Select related Contacts</label>
|
||||
<select class="form-control select2" id="contacts" name="contacts[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
echo "<option value=\"$contact_id\">$contact_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="vendors">Select related vendors</label>
|
||||
<select class="form-control select2" id="vendors" name="vendors[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 0 AND vendor_archived_at IS NULL AND vendor_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
echo "<option value=\"$vendor_id\">$vendor_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="documents">Select related documents</label>
|
||||
<select class="form-control select2" id="documents" name="documents[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
echo "<option value=\"$document_id\">$document_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- TODO: Services related to other services -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-assets">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="assets">Select related assets</label>
|
||||
<select class="form-control select2" id="assets" name="assets[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logins">Select related logins</label>
|
||||
<select class="form-control select2" id="logins" name="logins[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_archived_at IS NULL AND login_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = intval($row['login_id']);
|
||||
$login_name = nullable_htmlentities($row['login_name']);
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="domains">Select related domains</label>
|
||||
<select class="form-control select2" id="domains" name="domains[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="certificates">Select related certificates</label>
|
||||
<select class="form-control select2" id="certificates" name="certificates[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$cert_id = intval($row['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row['certificate_name']);
|
||||
$cert_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
echo "<option value=\"$cert_id\">$cert_name ($cert_domain)</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_service" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
<div class="modal" id="addServiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-white"><i class="fa fa-fw fa-stream mr-2"></i>New Service</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
<?php if ($client_url) { ?>
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="pill" href="#pills-overview">Overview</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-general">General</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-assets">Assets</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<!-- //TODO: The multiple selects won't play nicely with the icons or just general formatting. I've just added blank <p> tags to format it better for now -->
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-overview">
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="client_id" required>
|
||||
<option value="">- Select Client -</option>
|
||||
<?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)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Name of Service" maxlength="200" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="description" placeholder="Description of Service" maxlength="200" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- //TODO: Integrate with company wide categories: /categories.php -->
|
||||
<div class="form-group">
|
||||
<label>Category</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-info"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="category" placeholder="Category" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Importance</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="importance" required>
|
||||
<option>Low</option>
|
||||
<option>Medium</option>
|
||||
<option>High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Backup</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-hdd"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="backup" placeholder="Backup strategy" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="3" placeholder="Enter some notes" name="note"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
|
||||
<div class="tab-pane fade" id="pills-general">
|
||||
<div class="form-group">
|
||||
<label for="contacts">Select related Contacts</label>
|
||||
<select class="form-control select2" id="contacts" name="contacts[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
echo "<option value=\"$contact_id\">$contact_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="vendors">Select related vendors</label>
|
||||
<select class="form-control select2" id="vendors" name="vendors[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 0 AND vendor_archived_at IS NULL AND vendor_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
echo "<option value=\"$vendor_id\">$vendor_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="documents">Select related documents</label>
|
||||
<select class="form-control select2" id="documents" name="documents[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
echo "<option value=\"$document_id\">$document_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- TODO: Services related to other services -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-assets">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="assets">Select related assets</label>
|
||||
<select class="form-control select2" id="assets" name="assets[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logins">Select related logins</label>
|
||||
<select class="form-control select2" id="logins" name="logins[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_archived_at IS NULL AND login_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = intval($row['login_id']);
|
||||
$login_name = nullable_htmlentities($row['login_name']);
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="domains">Select related domains</label>
|
||||
<select class="form-control select2" id="domains" name="domains[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="certificates">Select related certificates</label>
|
||||
<select class="form-control select2" id="certificates" name="certificates[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$cert_id = intval($row['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row['certificate_name']);
|
||||
$cert_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
echo "<option value=\"$cert_id\">$cert_name ($cert_domain)</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_service" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -26,7 +26,7 @@ $sql = mysqli_query(
|
|||
"SELECT SQL_CALC_FOUND_ROWS * FROM networks
|
||||
LEFT JOIN clients ON client_id = network_client_id
|
||||
LEFT JOIN locations ON location_id = network_location_id
|
||||
WHERE network_archived_at IS NULL
|
||||
WHERE network_$archive_query
|
||||
AND (network_name LIKE '%$q%' OR network_description LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_subnet LIKE '%$q%' OR network_primary_dns LIKE '%$q%' OR network_secondary_dns LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$client_query
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
|
|
|
|||
|
|
@ -4,20 +4,27 @@
|
|||
$sort = "service_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_client.php";
|
||||
// If client_id is in URI then show client Side Bar and client header
|
||||
if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND service_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
}
|
||||
|
||||
// Perms
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
// Overview SQL query
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM services
|
||||
WHERE service_client_id = '$client_id'
|
||||
AND (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%')
|
||||
LEFT JOIN clients ON client_id = service_client_id
|
||||
WHERE (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$client_query
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
@ -37,7 +44,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="card-body">
|
||||
|
||||
<form autocomplete="off">
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
|
|
@ -60,10 +69,33 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark">Name</a></th>
|
||||
<th><a class="text-dark">Category</a></th>
|
||||
<th><a class="text-dark">Importance</a></th>
|
||||
<th><a class="text-dark">Updated</a></th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=service_name&order=<?php echo $disp; ?>">
|
||||
Name <?php if ($sort == 'service_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=service_category&order=<?php echo $disp; ?>">
|
||||
Category <?php if ($sort == 'service_category') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=service_importance&order=<?php echo $disp; ?>">
|
||||
Importance <?php if ($sort == 'service_importance') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=service_updated_at&order=<?php echo $disp; ?>">
|
||||
Updated <?php if ($sort == 'service_updated_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -71,6 +103,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
$service_description = nullable_htmlentities($row['service_description']);
|
||||
|
|
@ -106,6 +140,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<td><?php echo $service_category ?></td>
|
||||
<td><?php echo $service_importance ?></td>
|
||||
<td><?php echo $service_updated_at ?></td>
|
||||
<?php if (!$client_url) { ?>
|
||||
<td><a href="services.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Action -->
|
||||
<td>
|
||||
|
|
@ -144,5 +181,5 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<?php
|
||||
require_once "modals/client_service_add_modal.php";
|
||||
require_once "modals/service_add_modal.php";
|
||||
require_once "includes/footer.php";
|
||||
Loading…
Reference in New Issue