1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- $action = $_REQUEST['action'];
- $accid = $_REQUEST['accid'];
- $pid = $_REQUEST['pid'];
- $taskid = $_REQUEST['taskid'];
- $status = $_REQUEST['status'];
- //
- //$local = "http://грибовы.рф";
- //$data = "Скрипт обработки выбора фильтра абонентом";
- //$key="woeudhцукацук цук пупркеркеуенakcslerug;er";
- $host="127.0.0.1";
- $port = 85;
- //$head = "GET / HTTP/1.1"."\r\n".
- // "Upgrade: WebSocket"."\r\n".
- // "Connection: Upgrade"."\r\n".
- // "Origin: $local"."\r\n".
- // "Host: $host"."\r\n".
- // "Sec-WebSocket-Key: asd245345235d6asd6as7d"."\r\n".
- // "Content-Length: ".strlen($data)."\r\n"."\r\n";
- //echo "hello!";
- //fwrite($sock, $head ) or die('error:'.$errno.':'.$errstr);
- if ($action == "check")
- {
- $cc = CheckConnection();
- if ($cc)
- echo "true";
- else
- echo "false";
- }
- function CheckConnection()
- {
- global $host, $port;
- return fsockopen($host, $port, $errno, $errstr, 0.5);
- }
- function OCScleartasks($accid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/cleartasks?accid=$accid");
- }
- function OCStaskstatus($taskid, $status, $accid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/taskstatus?taskid=$taskid&status=$status&accid=$accid");
- }
- function OCSnewproject($pid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/newproject?pid=$pid");
- }
- function OCSremoveproject($pid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/removeproject?pid=$pid");
- }
- function OCSlogoff($accid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/logoff?accid=$accid");
- }
- function OCSlogin($accid)
- {
- global $host, $port;
- if (CheckConnection())
- readfile("http://$host:$port/Home/logon?accid=$accid");
- }
- function OCSgetvideo($taskid)
- {
- global $host, $port;
- if (CheckConnection())
- return file_get_contents("http://$host:$port/Home/getvideo?taskid=$taskid");
- }
|