1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- $action = $_REQUEST['action'];
- $accid = $_REQUEST['accid'];
- $pid = $_REQUEST['pid'];
- $taskid = $_REQUEST['taskid'];
- $status = $_REQUEST['status'];
- $host="127.0.0.1";
- $port = 85;
- 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");
- }
|