{"SCRIPTS":[{"TITLE":"Set\u0421hoiceAlarmClock","DESCRIPTION":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430","CODE":"$clock = $_GET['clock'];\r\n\/\/$clock = \"02\";\r\nif (gg('AlarmClock'.$clock.'.method')=='script') {\r\n $check='1';\r\n}\r\n else if (gg('AlarmClock'.$clock.'.method')=='sound') {\r\n  $check='0';\r\n }\r\n\r\n$perform=gg('AlarmClock'.$clock.'.code');\r\n$scode = $scode. '<option id=\"opt'.$clock.'\" value=\"'.$perform.'\">'.$perform.'<\/option>';\r\n\r\n$sel = $_GET['sel'];\r\n\/\/$sel = \"script\";\r\nif ($sel == 'script') {\r\n\t\t\t\t\t\t$cat_id = SQLSelect(\"SELECT ID FROM script_categories WHERE TITLE LIKE '\u0411\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0438'\");\r\n\t\t\t\t\t\t$cat_id = current($cat_id);\r\n\t\t\t\t\t\t$cat_id = current($cat_id);\r\n\t\t\t\t\t\t$script = SQLSelect(\"SELECT TITLE FROM scripts WHERE CATEGORY_ID = '$cat_id' ORDER BY TITLE ASC\");\r\n\t\t\t\t\t\tforeach ($script as $obj => $val) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$html = $html.  '<option id=\"opt'.$clock.'\" value=\"'.$val['TITLE'].'\">'.$val['TITLE'].'<\/option>';\r\n\t\t\t\t\t\t\t\t  \t\t\t\t\t\t}\r\n\t\t\t\t\t }\r\nelseif ($sel == 'sound') {\r\n\t\t\t\t\t\t\t$folder = '.\/cms\/sounds';\r\n\t\t\t\t\t\t\t$list = scandir($folder);\r\n\t\t\t\t\t\t\tforeach ($list as $item) {\r\n    \t\t\t\t\t\t\t\t\t\t\t\tif(stripos($item,'.mp3') === false) {\r\n       \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t$html = $html. '<option id=\"opt'.$clock.'\" value=\"'.$item.'\">'.$item.'<\/option>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t  \t\t\t\t\t}\r\n\r\n$options=array(\r\n\"stcode\"=>$scode,\r\n\"status\"=>$check,\r\n\"HTML\"=>$html,\r\n\"mysel\"=>$sel,\r\n );\r\necho json_encode($options, JSON_UNESCAPED_UNICODE);\r\n","RUN_PERIODICALLY":"0","RUN_DAYS":"","RUN_TIME":"00:00","AUTO_LINK":"0","LINKED_OBJECT":"","LINKED_PROPERTY":"","CATEGORY_TITLE":"Scenarios"}]}