<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/mypals/pals_request.html
 * 如果您的模型要进行修改，请修改 models/modules/mypals/pals_request.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php 
	//必须登录才能浏览该页面
	require("foundation/auser_mustlogin.php");
	
	//引入语言包
	$mp_langpackage=new mypalslp;
	
	//引入公共模块
	require("foundation/module_mypals.php");
		
	//变量区
	$user_id=get_sess_userid();
	
	//数据表定义区
	$t_pals_request=$tablePreStr."pals_request";
	
	$dbo=new dbex;
	dbtarget('r',$dbServs);
	
	$request_rs=array();
	
	$sql="select * from $t_pals_request where user_id='$user_id'";
	$request_rs=$dbo->getRs($sql);
	
	//控制显示
	$isNull=0;
	$isset_data="";
	$none_data="content_none";
	if(empty($request_rs)){
		$isset_data="content_none";
		$none_data="";
		$isNull=1;
	}
	
?>
<!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>
<script type='text/javascript'>
parent.guide("mypals");
</script>
<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">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/user_ico_small.css">
<!--[if lt IE 7]>
<style type="text/css">
.uico_photo_small span { behavior: url(skin/<?php echo $skinUrl;?>/css/ie_png_fix.htc);}
</style>
<![endif]-->
</head>
<body>
  <div class="main_right_title">
     <span class="main_title_dot3"></span>
     <span class="main_title_txt"><?php echo $mp_langpackage->mp_mypals;?></span>
  </div>

<div id="tabsB">
  <ul>
    <li><a href="?app=mypals" title="<?php echo $mp_langpackage->mp_list;?>"><span><?php echo $mp_langpackage->mp_list;?></span></a></li>
    <li><a href="?app=mypals_request" title="<?php echo $mp_langpackage->mp_req;?>" class="nowbutl"><span class="nowbutr"><?php echo $mp_langpackage->mp_req;?></span></a></li>
    <li><a href="?app=mypals_invite" title="<?php echo $mp_langpackage->mp_invite;?>"><span><?php echo $mp_langpackage->mp_invite;?></span></a></li>
    <li><a href="?app=mypals_sort" title="<?php echo $mp_langpackage->mp_m_sort;?>"><span><?php echo $mp_langpackage->mp_m_sort;?></span></a></li>
  </ul>
	  
	<div class="div_but" onclick="location.href='?app=mypals_search'"><?php echo $mp_langpackage->mp_add;?></div>
</div>

<table class="<?php echo $isset_data;?> pals_req">
		<tr height="28" bgcolor="#ecfbff">
			<td width="46"><?php echo $mp_langpackage->mp_del;?></td>
			<td width="80"><?php echo $mp_langpackage->mp_def_ico;?></td>
			<td width="90"><?php echo $mp_langpackage->mp_req_name;?></td>
			<td width="150"><?php echo $mp_langpackage->mp_ctrl;?></td>
			<td width="105"><?php echo $mp_langpackage->mp_req_time;?></td>
		</tr>
	
	<?php foreach($request_rs as $rs){?>

			<tr>
				<td>
					<a href='do.php?act=del_req&req_id=<?php echo $rs['id'];?>&req_uid=<?php echo $rs['req_id'];?>' onclick='return confirm("<?php echo $mp_langpackage->mp_a_del;?>")';><img title="<?php echo $mp_langpackage->mp_del;?>" src="skin/<?php echo $skinUrl;?>/images/rsdelete.gif" /></a>
				</td>
				<td>
					<div class='uico_photo_small hand' style='margin-left:10px'>
						<a href="home.php?h=<?php echo $rs['req_id'];?>" target="_blank"><span></span><img src='<?php echo $rs["req_ico"];?>' height='43px' width='43px' onerror="parent.pic_error(this)" /></a>
					</div>
				</td>
				<td><a href="home.php?h=<?php echo $rs['req_id'];?>" target="_blank"><?php echo $rs["req_name"];?></a></td>
				<td>
					<a href='do.php?act=confirm_both&req_id=<?php echo $rs["id"];?>&req_user_id=<?php echo $rs["req_id"];?>'><?php echo $mp_langpackage->mp_both_pal;?></a>
				  &nbsp;
				  <a href='do.php?act=confirm_other&req_id=<?php echo $rs["id"];?>&req_user_id=<?php echo $rs["req_id"];?>'><?php echo $mp_langpackage->mp_other_pal;?></a>
				  &nbsp;
				  <a href='do.php?act=refuse_req&req_id=<?php echo $rs["id"];?>&req_user_id=<?php echo $rs["req_id"];?>'><?php echo $mp_langpackage->mp_ref_pal;?></a>
			  </td>
			 	<td><?php echo $rs["add_time"];?></td>
			</tr>
			
			<tr>
		  	<th colspan=5 class="bd_th">&nbsp</th>
		  </tr>
		<?php }?>
</table>

	<div class='guide_info <?php echo $none_data;?>'>
		<?php echo $mp_langpackage->mp_no_req;?>
	</div>

</body>
</html>