<?php
/*
		[FuShow.cn] (C) 2013-2014 HXWY Inc.
		FuShow Friend V3.0				Id: getpeerid.php
		Email <service@fushow.cn>		http://fushow.cn/
*/

include_once('../common.php');
$uid=$_GET['uid'];
$query=$_SGLOBAL['db']->query( "SELECT workerid,clientid,isAudio from ".tname('avcall')." WHERE clientid='$uid'");
if($query){
	while ($rs = $_SGLOBAL['db']->fetch_array($query)) {
		$ua =$rs['workerid'];
		if ($rs['isAudio'] =="1"){
			//接受邀请
			$url1 = "uump.php?ac=audio&postid=".$rs['workerid']."&receiveid=".$rs['clientid']."&audio=".$rs['isAudio'];
			//拒绝邀请
			$url2 = "uump.php?ac=audio&postid=".$rs['workerid']."&receiveid=".$rs['clientid']."&audio=".$rs['isAudio']."&myClose=TheEnd";
			echo " <ul class='simple'>";
			echo "<li>用户[".$ua."]邀请您语音:";
			echo "<img border='0' align='bottom' alt='接受语音' src='images/aaa.png' onclick=openwinA('".$url1."','".$url2."') />&nbsp;";
		}else{
			//接受邀请
			$url1 = "uump.php?ac=video&postid=".$rs['workerid']."&receiveid=".$rs['clientid']."&audio=".$rs['isAudio'];
			//拒绝邀请
			$url2 = "uump.php?ac=video&postid=".$rs['workerid']."&receiveid=".$rs['clientid']."&audio=".$rs['isAudio']."&myClose=TheEnd";
			echo " <ul class='simple'>";
			echo "<li>用户[".$ua."]邀请您视频:";
			echo "<img border='0' align='bottom' alt='接受视频' src='images/vvv.png' onclick=openwin('".$url1."','".$url2."') />&nbsp;";
		}
		echo "<img border='0' align='bottom' alt='关闭邀请'  src='images/no.png' onclick=vClose('".$url2."') /></li>";
		echo "</ul>";
	}
}
?>