diff --git a/html/ajax_search.php b/html/ajax_search.php index 7d82a1ac9e..13328fce18 100644 --- a/html/ajax_search.php +++ b/html/ajax_search.php @@ -318,6 +318,17 @@ if (isset($_REQUEST['search'])) { $json = json_encode($device); die($json); + } + else if ($_REQUEST['type'] == 'bill') { + // Device search + if (is_admin() === true || is_read() === true) { + $results = dbFetchRows("SELECT `bills`.bill_id, `bills`.bill_name FROM `bills` WHERE `bill_name` LIKE '%".$search."%' OR `bill_notes` LIKE '%".$search."%' LIMIT 8"); + } + else { + $results = dbFetchRows("SELECT `bills`.bill_id, `bills`.bill_name FROM `bills` INNER JOIN `bill_perms` ON `bills`.bill_id = `bill_perms`.bill_id WHERE `bill_perms`.user_id = ? AND (`bill_name` LIKE '%".$search."%' OR `bill_notes` LIKE '%".$search."%')LIMIT 8", array($_SESSION['user_id'], $_SESSION['user_id'])); + } + $json = json_encode($results); + die($json); }//end if }//end if }//end if diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php index e7cf4b9ed2..87bb883738 100644 --- a/html/includes/common/generic-graph.inc.php +++ b/html/includes/common/generic-graph.inc.php @@ -66,6 +66,8 @@ if( defined('show_settings') || empty($widget_settings) ) { + +
{{name}}
\') + } + }); + switch_'.$unique_id.'($("#select_'.$unique_id.'").val()); } function switch_'.$unique_id.'(data) {