<?php /*if ( $USER_ID == "" || $PASSWORD == "" ) { echo _( "201#|#用户名或密码为空" ); exit( ); } if ( $USER_ID != "OfficeTask" ) { echo _( "205#|#用户名错误" ); exit( ); }*/ include_once( "../inc/conn.php" ); include_once( "../inc/utility.php" ); $query = "SELECT M1.MR_NAME AS MEETNAME,RIGHT(T.M_START,8) AS MEETIME,M.MR_NAME,U.USER_NAME, TIME_FORMAT(TIMEDIFF(T.M_END,NOW()),'%H%i') AS DIFF,T.* FROM meeting T,USER U,MEETING_ROOM M,MEETING_ROOM M1 WHERE T.M_DESC=M1.MR_ID AND M.MR_ID=T.M_ROOM AND T.M_ROOM=8 AND T.M_PROPOSER=U.USER_ID AND T.M_STATUS='1' AND T.M_NOTE IS NULL AND UNIX_TIMESTAMP(T.M_END) >= UNIX_TIMESTAMP(NOW()) ORDER BY DIFF DESC"; $cursor = exequery( $connection, $query ); if ( $ROW = mysql_fetch_array( $cursor ) ) { do { $GL_DIFF=$ROW['DIFF']; $GL_ID=$ROW['M_ID']; //echo $GL_DIFF."<br />"; $GL_TIME=substr($GL_DIFF,0,strlen($GL_DIFF)-2); $GL_TIME = intval($GL_TIME); //echo $GL_TIME."<br />"; if ($GL_TIME == 1) { //通知发出并标记 //$file_contents = //$file_get_content("http://plugin.XXXX.com/IMAPI.PHP?SEND=陈桂林&RECEIVE=胡欣&MSG=SDFSDFSDFSD","r"); //$content= file_get_content("http://plugin.XXXX.com/IMAPI.PHP?SEND=陈桂林&RECEIVE=胡欣&MSG=SDFSDFSDFSD","r"); $MSGSTR="您好!".$ROW['USER_NAME']."【".$ROW['MEETIME']."】申请使用投影仪,请安排安装在:".$ROW['MEETNAME']."!"; //echo $MSGSTR; vita_get_url_content("http://plugin.XXXX.com/IMAPI.PHP?SEND=陈桂林&RECEIVE=胡欣&MSG=胡欣,".$MSGSTR); vita_get_url_content("http://plugin.XXXX.com/IMAPI.PHP?SEND=陈桂林&RECEIVE=林启明&MSG=林启明,".$MSGSTR); vita_get_url_content("http://plugin.XXXX.com/IMAPI.PHP?SEND=陈桂林&RECEIVE=陈桂林&MSG=陈桂林,".$MSGSTR); //echo $file_contents."-----"; exequery($connection, "UPDATE MEETING T SET T.M_NOTE=1 WHERE T.M_ID=".$GL_ID); //echo "UPDATE MEETING T SET T.NOTE=1 WHERE T.M_ID=".$GL_ID."<br />"; } } while($ROW = mysql_fetch_array( $cursor )); } else { echo "202#|#".$USER_ID; exit( ); } //echo intval('000'); echo "+OK"; function vita_get_url_content($url) { if(function_exists('file_get_contents')) { $file_contents = file_get_contents($url); } else { $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); } return $file_contents; } ?>