<?php
	if (!Tourists()){ header('refresh:0;url=index.php?act=olog'); exit; }

	if (!empty ($_GET['qq'])){
		$qq = $_GET['qq'];
		$qqinfo = mysql_fetch_array(mysql_query("SELECT * FROM `qqlist` WHERE `qq`='$qq' and `myqq`='".AnYue_User."'"));
		if ($qqinfo['myqq'] != Null){
			if (!empty ($_POST['xy'])){
				$xy = ($_POST['xy']=='Cellphone') ? 'Cellphone' : '3G';
				Modify_Xy ($qq,$xy);
				$info = '恭喜您，协议修改成功，请关闭此窗口！';
			}
		}else{
			$info = '此QQ不在您的管辖范围内！';
		}
	}else{
		$info = 'QQ号码不得为空！';
	}

	/* 功能函数区 */
	function Modify_Xy ($qq,$xy){
		mysql_query ("UPDATE `qqlist` SET `Agreement`='$xy' WHERE `qq`='$qq' and `myqq`='".AnYue_User."'");
	}

	$AnYue_Smarty -> assign ('qq',$qq);
	$AnYue_Smarty -> assign ('info',$info);
	$AnYue_Smarty -> assign ('qqinfo',$qqinfo);
	$AnYue_Smarty -> display ('AnYueGuaQ_pz.html');
