<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/privacy/affair_set.html
 * 如果您的模型要进行修改，请修改 models/modules/privacy/affair_set.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入公共方法
	require("foundation/fcontent_format.php");
	require("foundation/module_users.php");
	require("foundation/module_mypals.php");
	//语言包引入
	$pr_langpackage=new privacylp;
	$user_id=get_sess_userid();
	
	//表声明区
	$t_users=$tablePreStr."users";
	$t_mypals=$tablePreStr."pals_mine";
	
	$dbo=new dbex;
	//读写分离定义函数
	dbtarget('r',$dbServs);
	
	$type_array=array();
	for($def_num=0;$def_num<=6;$def_num++){
		$type_array[]=$pr_langpackage->{'pr_type_'.$def_num};
	}
	
	$mypals = getPals_mine_all($dbo,$t_mypals,$user_id);
	
	$select_items=array('hidden_pals_id','hidden_type_id');
	$whole_type=",1,2,3,4,5,6,";
	$user_row=get_user_info_item($dbo,$select_items,$t_users,$user_id);
	$hidden_p=$user_row['hidden_pals_id'];
	$hidden_t=$user_row['hidden_type_id'];
	$hidden_pals_rs=array();
	$hidden_type_rs=array();
	
	if(!empty($hidden_p) && $hidden_p!=","){
		$cols=preg_replace(array("/^,/","/,$/"),"",$hidden_p);
		$sql="select user_id,user_name from $t_users where user_id in ($cols)";
		$hidden_pals_rs=$dbo->getRs($sql);
	}
	
	if(!empty($hidden_t) && $hidden_t!=","){
		$hidden_type_array=explode(",",$hidden_t);
		foreach($hidden_type_array as $value){
			if($value!=''){
				$hidden_type_rs[$value]=$pr_langpackage->{'pr_type_'.$value};
			}
		}
	}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/iframe.css">
<script language=JavaScript src="skin/default/js/jooyea.js"></script>
<SCRIPT language=JavaScript src="servtools/ajax_client/ajax.js"></SCRIPT>
<script type='text/javascript'>
	function open_div(obj_id){
		if($(obj_id).style.display=='none'){
			$(obj_id).style.display='';
		}else{
			$(obj_id).style.display='none';
		}
	}
	
	function act_hidden(type_id,hidden_value,is_del){
		var xmlhttp=InitAjax();
		xmlhttp.open("GET","do.php?act=pr_affair&type="+type_id+"&hidden_value="+hidden_value+"&is_del="+is_del);
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState==4&&xmlhttp.status==200){
				var return_str=trim(xmlhttp.responseText);
				if(return_str=='success'){
					parent.Dialog.alert_ok('<?php echo $pr_langpackage->pr_handle_suc;?>');
					window.location.reload();
				}else{
					parent.Dialog.alert(return_str);
				}
			}
		}
		xmlhttp.send(null);		
	}
</script>
</head>

<body>
  <div class="main_right_title">
     <span class="main_title_dot11"></span>
     <span class="main_title_txt"><?php echo $pr_langpackage->pr_conf;?></span>
  </div>

<div id="tabsB">
	<ul>
    <li><a href="?app=privacy" title="<?php echo $pr_langpackage->pr_access;?>"><span><?php echo $pr_langpackage->pr_access;?></span></a></li>
    <li><a href="?app=pr_inputmess" title="<?php echo $pr_langpackage->pr_inputmess;?>"><span><?php echo $pr_langpackage->pr_inputmess;?></span></a></li>
    <li><a href="?app=pr_reqcheck" title="<?php echo $pr_langpackage->pr_reqcheck;?>" ><span><?php echo $pr_langpackage->pr_reqcheck;?></span></a></li>
    <li><a href="?app=pr_affair" title="<?php echo $pr_langpackage->pr_set;?>" class="nowbutl"><span class="nowbutr"><?php echo $pr_langpackage->pr_set;?></span></a></li>
  </ul>
</div>

		<div class="container">
			<div class="rs_head"><?php echo $pr_langpackage->pr_forget_sort;?></div>
		</div>

<table class="affair_table" border="0" cellpadding="5" cellspacing="5">
<tr>
	<td>
		<?php echo $pr_langpackage->pr_add_sort;?>：<input class="top_button" type='button' onclick='open_div("hidden_type");' value='<?php echo $pr_langpackage->pr_chose;?>' />
	</td>
	<td>
		<?php echo $pr_langpackage->pr_shield_sort;?>：
	</td>	
</tr>
<tr>
	<td>	
		<div id="hidden_type" style='display:none;'>
			<ul>
			<?php $l=0;?>
			<?php foreach($type_array as $val){?>
				<li><a href="javascript:act_hidden(1,<?php echo $l;?>,0);"><?php echo $val;?></a></li>
			<?php $l++;?>
			<?php }?>
			</ul>
		</div>
	</td>
	<td>
			<ul>
			<?php foreach($hidden_type_rs as $key=>$val){?>
				<li><?php echo $val;?> | <a href="javascript:act_hidden(1,<?php echo $key;?>,1);"><?php echo $pr_langpackage->pr_del;?></a></li>
			<?php }?>				
			</ul>
	</td>
</tr>
</table>
		<div class="container">
			<div class="rs_head"><?php echo $pr_langpackage->pr_forget_list;?></div>
		</div>
<table class="affair_table" border="0" cellpadding="5" cellspacing="5">
	<tr>
		<td>
			<?php echo $pr_langpackage->pr_add_list;?>：<input class="top_button" type='button' onclick='open_div("hidden_pals");' value='<?php echo $pr_langpackage->pr_chose;?>' />
		</td>
		<td>
			<?php echo $pr_langpackage->pr_shield_list;?>：
		</td>
	</tr>
	<tr>
		<td>
			<div id="hidden_pals" style='display:none;'>
					<ul>
					<?php $i=0;?>
					<?php foreach($mypals as $val){?>
						<li><a href="javascript:act_hidden(0,<?php echo $val['pals_id'];?>,0);"><?php echo $val['pals_name'];?></a></li>
					<?php $i++;?>
					<?php }?>
					</ul>
			</div>
		</td>
		<td>
				<ul>
					<?php foreach($hidden_pals_rs as $rs){?>
						<LI><?php echo $rs['user_name'];?> | <A href="javascript:act_hidden(0,<?php echo $rs['user_id'];?>,1);"><?php echo $pr_langpackage->pr_del;?></A></LI>
					<?php }?>
				</ul>
		</td>
	</tr>
</table>
</body>
</html>
