Fixed more php errors empty vars updated more ui search headers

This commit is contained in:
johnny@pittpc.com
2021-02-04 17:42:21 -05:00
parent 17710cf6b8
commit f8166bdc81
62 changed files with 696 additions and 722 deletions

View File

@@ -1,9 +1,5 @@
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
//Paging
if(isset($_GET['p'])){
$p = intval($_GET['p']);
@@ -40,21 +36,24 @@ if(isset($_GET['o'])){
$disp = "DESC";
}
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets
WHERE client_id = $client_id
AND (asset_name LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-desktop"></i> Assets</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addAssetModal"><i class="fa fa-plus"></i></button>
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetModal"><i class="fas fa-fw fa-plus"></i> New Asset</button>
</div>
</div>
<div class="card-body">
<form autocomplete="off">
@@ -67,6 +66,7 @@ $total_pages = ceil($total_found_rows / 10);
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table border table-hover">
<thead class="thead-light <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
@@ -164,7 +164,7 @@ $total_pages = ceil($total_found_rows / 10);
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
<div class="modal-dialog modal-sm">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $asset_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
@@ -205,21 +205,21 @@ $total_pages = ceil($total_found_rows / 10);
<td><?php echo $location_name; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
<i class="fas fa-ellipsis-h"></i>
</button>
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
</div>
</div>
<?php include("edit_domain_modal.php"); ?>
</td>
</tr>
<?php include("edit_asset_modal.php"); ?>
<?php
include("edit_asset_modal.php");
}
?>
</tbody>