{"TITLE":"Devices Online","DESCRIPTION":"Devices Online Callback","TYPE_EVENT":"9","ENABLE":"1","CODE":"if (strripos($callback, 'DevicesOnline') > -1) {\r\n\t$confirm_emoji = \t\thex2bin('E29C85');\r\n\t$cross_emoji =  \t\thex2bin('E29D8C');\r\n\t$refresh_emoji =\t\thex2bin('E299BB');\r\n\t$radio_emoji= \t\t\thex2bin('F09F93BB');\r\n\t$script_emoji = \t\thex2bin('F09F9384');\r\n\tswitch(explode('*', $callback)[1]) {\r\n    \tcase \"Show\":\r\n    \t\t$this->sendAction($chat_id,\"typing\");\r\n    \t\t$rec = SQLSelect(\"SELECT * FROM pinghosts;\");\r\n\t\t\t$total = count($rec);\r\n\t\t\t$devicesonline = \"Hosts:\";\r\n\t\t\tfor($i = 0; $i < $total; $i++) {\r\n\t\t\t\t$devicesonline = $devicesonline.\"\\n\".strval($rec[$i]['HOSTNAME']).\":  \".(($rec[$i]['STATUS'] != 1) ? $cross_emoji : $confirm_emoji);\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $refresh_emoji.\"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\", \"\", \"DevicesOnline*Refresh\");\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $script_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n\t\t\t$count_row = 1;\r\n\t\t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, $count_row));\r\n\t\t\t$this->sendContent(array('chat_id' => $chat_id, 'text' => $devicesonline, 'reply_markup' => $keyb));\r\n\t\t\t$this->sendAnswerCallbackQuery($callback_id, $confirm_emoji.\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n    \t\tbreak;\r\n    \tcase \"Refresh\":\r\n    \t\t$this->sendAction($chat_id,\"typing\");\r\n    \t\t$rec = SQLSelect(\"SELECT * FROM pinghosts;\");\r\n\t\t\t$total = count($rec);\r\n\t\t\t$devicesonline = \"Hosts:\";\r\n\t\t\tfor($i = 0; $i < $total; $i++) {\r\n\t\t\t\t$devicesonline = $devicesonline.\"\\n\".strval($rec[$i]['HOSTNAME']).\":  \".(($rec[$i]['STATUS'] != 1) ? $cross_emoji : $confirm_emoji);\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $refresh_emoji.\"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\", \"\", \"DevicesOnline*Refresh\");\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $script_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n\t\t\t$count_row = 1;\r\n\t\t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, $count_row));\r\n\t\t\t$this->editMessage($chat_id, $message_id, $devicesonline, $keyb);\r\n\t\t\t$this->sendAnswerCallbackQuery($callback_id, $confirm_emoji.\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n    \t\tbreak;\r\n    }\r\n}"}