Replace is_array with !empty
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
$sql .= " ) \n";
|
$sql .= " ) \n";
|
||||||
$sql .= " and (missed_call = true or bridge_uuid is null) ";
|
$sql .= " and (missed_call = true or bridge_uuid is null) ";
|
||||||
$sql .= " and hangup_cause <> 'LOSE_RACE' ";
|
$sql .= " and hangup_cause <> 'LOSE_RACE' ";
|
||||||
if (is_array($assigned_extensions) && sizeof($assigned_extensions) != 0) {
|
if (!empty($assigned_extensions)) {
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) {
|
foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) {
|
||||||
$sql_where_array[] = "extension_uuid = :assigned_extension_uuid_".$x;
|
$sql_where_array[] = "extension_uuid = :assigned_extension_uuid_".$x;
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
$parameters['destination_number_'.$x] = $assigned_extension;
|
$parameters['destination_number_'.$x] = $assigned_extension;
|
||||||
$x++;
|
$x++;
|
||||||
}
|
}
|
||||||
if (is_array($sql_where_array) && sizeof($sql_where_array) != 0) {
|
if (!empty($sql_where_array)) {
|
||||||
$sql .= "and (".implode(' or ', $sql_where_array).") \n";
|
$sql .= "and (".implode(' or ', $sql_where_array).") \n";
|
||||||
}
|
}
|
||||||
unset($sql_where_array);
|
unset($sql_where_array);
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
if (!isset($database)) { $database = new database; }
|
if (!isset($database)) { $database = new database; }
|
||||||
$result = $database->select($sql, $parameters, 'all');
|
$result = $database->select($sql, $parameters, 'all');
|
||||||
$num_rows = is_array($result) ? sizeof($result) : 0;
|
$num_rows = !empty($result) ? sizeof($result) : 0;
|
||||||
|
|
||||||
//define row styles
|
//define row styles
|
||||||
$c = 0;
|
$c = 0;
|
||||||
@@ -189,4 +189,4 @@
|
|||||||
echo "<span class='hud_expander' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
|
echo "<span class='hud_expander' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user