mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed loading.... issue when no data returned
This commit is contained in:
@@ -39,6 +39,7 @@ if (isset($_POST['sort']) && is_array($_POST['sort'])) {
|
|||||||
}
|
}
|
||||||
$searchPhrase = mres($_POST['searchPhrase']);
|
$searchPhrase = mres($_POST['searchPhrase']);
|
||||||
$id = mres($_POST['id']);
|
$id = mres($_POST['id']);
|
||||||
|
$response = array();
|
||||||
|
|
||||||
if (isset($id)) {
|
if (isset($id)) {
|
||||||
if (file_exists("includes/table/$id.inc.php")) {
|
if (file_exists("includes/table/$id.inc.php")) {
|
||||||
|
@@ -28,6 +28,9 @@ if ($_POST['search_type'] == 'ipv4') {
|
|||||||
$count_sql = "SELECT COUNT(`port_id`) $sql";
|
$count_sql = "SELECT COUNT(`port_id`) $sql";
|
||||||
}
|
}
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = '`hostname` ASC';
|
$sort = '`hostname` ASC';
|
||||||
|
@@ -20,6 +20,9 @@ if (isset($searchPhrase) && !empty($searchPhrase)) {
|
|||||||
|
|
||||||
$count_sql = "SELECT COUNT(`E`.`id`) $sql";
|
$count_sql = "SELECT COUNT(`E`.`id`) $sql";
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = 'time_logged DESC';
|
$sort = 'time_logged DESC';
|
||||||
|
@@ -15,6 +15,9 @@ $sql = " FROM `alerts` LEFT JOIN `devices` ON `alerts`.`device_id`=`devices`.`de
|
|||||||
|
|
||||||
$count_sql = "SELECT COUNT(`alerts`.`id`) $sql";
|
$count_sql = "SELECT COUNT(`alerts`.`id`) $sql";
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = 'timestamp DESC';
|
$sort = 'timestamp DESC';
|
||||||
|
@@ -20,6 +20,9 @@ if (is_numeric($_POST['device_id'])) {
|
|||||||
$count_sql = "SELECT COUNT(`M`.`port_id`) $sql";
|
$count_sql = "SELECT COUNT(`M`.`port_id`) $sql";
|
||||||
|
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = '`hostname` ASC';
|
$sort = '`hostname` ASC';
|
||||||
|
@@ -39,6 +39,9 @@ if( !empty($_POST['group']) ) {
|
|||||||
$count_sql = "SELECT COUNT(`device_id`) $sql";
|
$count_sql = "SELECT COUNT(`device_id`) $sql";
|
||||||
|
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = '`hostname` DESC';
|
$sort = '`hostname` DESC';
|
||||||
|
@@ -27,6 +27,9 @@ if (isset($searchPhrase) && !empty($searchPhrase)) {
|
|||||||
|
|
||||||
$count_sql = "SELECT COUNT(datetime) $sql";
|
$count_sql = "SELECT COUNT(datetime) $sql";
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = 'datetime DESC';
|
$sort = 'datetime DESC';
|
||||||
|
@@ -43,6 +43,9 @@ if (isset($_POST['device']) && is_numeric($_POST['device'])) {
|
|||||||
|
|
||||||
$count_sql = "SELECT COUNT(`entPhysical_id`) $sql";
|
$count_sql = "SELECT COUNT(`entPhysical_id`) $sql";
|
||||||
$total = dbFetchCell($count_sql,$param);
|
$total = dbFetchCell($count_sql,$param);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = '`hostname` DESC';
|
$sort = '`hostname` DESC';
|
||||||
|
@@ -18,6 +18,9 @@ if (!isset($sort) || empty($sort)) {
|
|||||||
|
|
||||||
$count_sql = "SELECT COUNT(`D`.`device_id`) $sql";
|
$count_sql = "SELECT COUNT(`D`.`device_id`) $sql";
|
||||||
$total = dbFetchCell($count_sql);
|
$total = dbFetchCell($count_sql);
|
||||||
|
if (empty($total)) {
|
||||||
|
$total = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " AND D.status ='1' AND D.ignore='0' AND D.disabled='0' ORDER BY $sort";
|
$sql .= " AND D.status ='1' AND D.ignore='0' AND D.disabled='0' ORDER BY $sort";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user