select("user", ["id", "hours_array", "phonenumber", "available", "emailnot", "pusho_tok", "push_notifications", "chat_dep", "username", "name", "lastactivity"], ["AND" => ["OR" => ["id" => $opcacheid, "opid" => $opcacheid], "id[!]" => $_GET['userid'], "access" => 1]]); if (isset($result) && !empty($result)) { foreach ($result as $row) { if (time() > ($row['lastactivity'] + $timeout)) { $jakdb->update("user", ["available" => 0], ["id" => $row['userid']]); } if ($row["chat_dep"] == 0) { $udep = $jkl['g105']; } else { if (isset($HD_DEPARTMENTS) && is_array($HD_DEPARTMENTS)) foreach($HD_DEPARTMENTS as $z) { if (in_array($z["id"], explode(',', $row["chat_dep"]))) { $udepl[] = $z["title"]; } } } if (!empty($udepl) && is_array($udepl)) $departmentlist = join(", ", $udepl); if (isset($departmentlist) && $departmentlist) $udep = $jkl['m9'].': '.$departmentlist; $oponline = false; // Operator is available if ($row["available"] == 1) { $operator .= ''; $oponline = true; } // Now let's check if we have a time available if (!$oponline && JAK_base::jakAvailableHours($row["hours_array"], date('Y-m-d H:i:s')) && ($row["phonenumber"] || $row["emailnot"] || JAK_NATIVE_APP_TOKEN || $row["pusho_tok"] || $row["push_notifications"])) { $operator .= ''; } } } if ($operator) { $oselect = $operator; $showbutton = '
'; } else { $oselect = ''; $showbutton = ''; } echo ' '; } ?>