From 2fe105303c92e58394fbd6ad9346b3d3560adc47 Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Fri, 15 Jan 2021 19:38:04 -0500 Subject: [PATCH] Fixed asset so you can see all assets to all clients also started the addition of records per page --- assets.php | 86 +++++++----------------------------------------- get_settings.php | 2 ++ pagination.php | 2 +- 3 files changed, 15 insertions(+), 75 deletions(-) diff --git a/assets.php b/assets.php index b917580e..516e0b9a 100644 --- a/assets.php +++ b/assets.php @@ -7,11 +7,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*10; - $record_to = 10; + $record_from = (($p)-1)*$config_records_per_page; + $record_to = $config_records_per_page; }else{ $record_from = 0; - $record_to = 10; + $record_to = $config_records_per_page; $p = 1; } @@ -56,7 +56,7 @@ if(!empty($_GET['dtf'])){ $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 (asset_name LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_mac LIKE '%$q%') AND DATE(asset_created_at) BETWEEN '$dtf' AND '$dtt' AND client_id = 0 AND company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets, clients WHERE (asset_name LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_mac LIKE '%$q%' OR client_name LIKE '%$q%') AND DATE(asset_created_at) BETWEEN '$dtf' AND '$dtt' AND assets.client_id = clients.client_id AND assets.company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); @@ -65,7 +65,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
Assets
-
@@ -81,12 +80,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); "> - + - + @@ -105,6 +104,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $asset_purchase_date = $row['asset_purchase_date']; $asset_warranty_expire = $row['asset_warranty_expire']; $asset_notes = $row['asset_notes']; + $client_id = $row['client_id']; + $client_name = $row['client_name']; $vendor_id = $row['vendor_id']; $location_id = $row['location_id']; $contact_id = $row['contact_id']; @@ -137,79 +138,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); }else{ $device_icon = "tag"; } - - $sql_logins = mysqli_query($mysqli,"SELECT *, AES_DECRYPT(login_password, '$config_aes_key') AS login_password FROM logins WHERE asset_id = $asset_id"); - $row = mysqli_fetch_array($sql_logins); - $login_id = $row['login_id']; - $login_username = $row['login_username']; - $login_password = $row['login_password']; - $asset_id_relation = $row['asset_id']; ?> - - + + + - + 'On Reciept', '7'=>'7 Days', diff --git a/pagination.php b/pagination.php index da2b6613..b66e8b93 100644 --- a/pagination.php +++ b/pagination.php @@ -1,7 +1,7 @@ 10) { $i=0;
Type NameType Make Model SerialActionClient
- - - - - - - - - - - - - - -