mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Code deduplication/tidying
- Move default pagination/sort/search query variable mapping to pagination_head.php - Remove user_logs.php
This commit is contained in:
@@ -29,42 +29,12 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM as
|
||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||
$other_count = $row['count'];
|
||||
|
||||
//Paging
|
||||
if(isset($_GET['p'])){
|
||||
$p = intval($_GET['p']);
|
||||
$record_from = (($p)-1)*$_SESSION['records_per_page'];
|
||||
$record_to = $_SESSION['records_per_page'];
|
||||
}else{
|
||||
$record_from = 0;
|
||||
$record_to = $_SESSION['records_per_page'];
|
||||
$p = 1;
|
||||
}
|
||||
|
||||
if(isset($_GET['q'])){
|
||||
$q = mysqli_real_escape_string($mysqli,$_GET['q']);
|
||||
}else{
|
||||
$q = "";
|
||||
}
|
||||
|
||||
if(!empty($_GET['sb'])){
|
||||
$sb = mysqli_real_escape_string($mysqli,$_GET['sb']);
|
||||
}else{
|
||||
$sb = "asset_name";
|
||||
}
|
||||
|
||||
if(isset($_GET['o'])){
|
||||
if($_GET['o'] == 'ASC'){
|
||||
$o = "ASC";
|
||||
$disp = "DESC";
|
||||
}else{
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
}
|
||||
}else{
|
||||
$o = "ASC";
|
||||
$disp = "DESC";
|
||||
}
|
||||
|
||||
//Asset Type from GET
|
||||
if(isset($_GET['type']) && ($_GET['type']) == 'workstation'){
|
||||
$type_query = "asset_type = 'desktop' OR asset_type = 'laptop'";
|
||||
|
||||
Reference in New Issue
Block a user