Este es el siguiente codigo que de la misma forma quiero que respete la condición inmobiliaria_inmobiliaria = 7
<?php
$users = [];
if (
!empty($_GET["estatus_id"])
|| !empty($_GET["kind_id"])
|| !empty($_GET["priority_id"])
|| !empty($_GET["start_at"])
|| !empty($_GET["finish_at"])
) {
$sql = "select * from v_cita_completo ";
$where = [];
if (!empty(["estatus_id"])) {
$where[] = "estatus_id = '" . mysqli_real_escape_string($con, $_GET["estatus_id"]) ."'";
}
if (!empty(["kind_id"])) {
$where[] = "kind_id = '" . mysqli_real_escape_string($con, $_GET["kind_id"]) . "'";
}
if (!empty($_GET["priority_id"])) {
$where[] = " priority_id = '" . mysqli_real_escape_string($con, $_GET["priority_id"]) . "'";
}
if (!empty($_GET["start_at"]) && !empty($_GET["finish_at"])) {
$where[] = "created_at BETWEEN '"
. mysqli_real_escape_string($con, $_GET["start_at"])
. " 00:00:00' AND '"
. mysqli_real_escape_string($con, $_GET["finish_at"])
. " 23:59:59'"
;
}
if (count($where) > 0) {
$sql .= ' WHERE ' . implode(' AND ', $where);
}
$users = mysqli_query($con, $sql);
} else {
$users = mysqli_query($con, "select * from v_cita_completo where inmobiliaria_inmobiliaria = 7");
}
if ($users === false) {
die('Error SQL: ' . mysqli_error($con));
}
if(@mysqli_num_rows($users)>0){
// si hay reportes
$_SESSION["report_data"] = $users;
?>