<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="req.aspx.cs" Inherits="JuSNS.Web.home.friend.req" %>
<!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>
<title id="ptitle" runat="server">好友请求管理</title>
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>
<link href="../../template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css" id="skinpath" type="text/css" rel="stylesheet" />
<script src="../../js/friend.js" charset="gb2312" type="text/javascript" language="javascript"></script>
<script language="javascript" type="text/javascript">
<!--
//接受好友
function frdagree(rid,uid,unm)
{
    var param='rid='+escape(rid)+'&uid='+uid+'&unm='+escape(unm);
    ShowMsgBox('reqfrd_widonwbill','400','230','friend/AgreeFriend',param);
}

function frdaccept(rid,uid,unm)
{
    var cID=document.getElementById("getSetProClassID").value;
    var  options={
        method:'post',
        parameters:"Option=Accept&ClassID="+cID+"&RID="+ rid,
        onComplete:
            function(transport)
	        {
	            var retv =transport.responseText;
	            closediv($('reqfrd_widonwbill')); 
	            onaccept(retv,uid,unm);
	        } 
	}
	new  Ajax.Request('../../inc/ajax/friend/friendAjax.aspx',options);
}

function onaccept(ret,uid,unm)
{
    if(parseInt(ret) == 1)
    {
        var html= '<li><strong>你和 <a href="../../user/?r='+ uid +'">'+ unm +'</a> 成为了好朋友</strong></li>';
        html+='<li><img src="../../template/<%=JuSNS.Config.UiConfig.SkinStyle %>/images/site/req/home.gif" align="absmiddle" /> <a href="../../user/?r='+ uid +'" target=\"_blank\">查看'+ unm +'的个人空间</a></li>';
        html+='<li><img src="../../template/<%=JuSNS.Config.UiConfig.SkinStyle %>/images/site/req/book.gif" align="absmiddle" /> <a href="../../home/gbook/?r='+ uid +'" target=\"_blank\">给'+ unm +'留言</a></li>';
        //html+='<li><img src="../../template/<%=JuSNS.Config.UiConfig.SkinStyle %>/images/site/req/tuijian.gif" align="absmiddle" /> <a href="javascript:ShowShareDiv(6,"'+ uid +'",'+unm+',"","",<%=myUid %>);">把'+ unm +'推荐给我的好友</a></li>';
        document.getElementById('div_'+ uid).innerHTML = '<ul>'+html+'</ul>';
    }
    else
    {
        alert('系统错误,请稍后再试!');
    }
}
//拒绝
function frdrefuse(rid,uid,unm)
{
    var  options={
        method:'post',
        parameters:"Option=Refuse&RID="+ rid,
        onComplete:
            function(transport)
	        {
	            var retv =transport.responseText;
	            onrefuse(retv,uid,unm);
	        } 
	}
	new  Ajax.Request('../../inc/ajax/friend/friendAjax.aspx',options);
}

function onrefuse(ret,uid,unm)
{
    if(parseInt(ret) == 1)
    {
        document.getElementById('div_'+ uid).innerHTML = '你忽略了 <a href="../../user/?r='+ uid +'">'+ unm +'</a> 的好友请求';
    }
    else
    {
        alert('系统错误,请稍后再试!');
    }
}
//-->
</script>
</head>
<body>
<!--头部-->
<%=this.GetHtmlShort()%>
<div id="divhead">
    <%=this.GetHtmlHead()%>
</div>

<div id="divbody">
    <div id="body_first">
        <div class="body_menu"> 
        <%=this.GetHtmlLeft()%>
        </div>
    </div>
    <div id="body_sec">
            <div id="body_mid"> 
                <div class="body_frame"> 
                 <!--主题内容中-->    
                   <div class="body_frame_otherinfo">
	                        <div class="title">
                                <div class="l"><img src="../../template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/req.gif" align="absmiddle" /> <span class="shenlan bold font14 ocolor">好友请求管理</span></div>
                                <div class="r"><a href="javascript:window.history.back();" title="返回上一页">返回上一页</a></div>
                                <div class="c"></div>
                            </div>
            		       
                            <div class="nav-menu">
                                <ul>
                                     <li><a href="../group/req.aspx">群组邀请</a></li>
                                     <li class="current"><a href="../friend/req.aspx">好友请求</a></li>
                                 </ul>
                            </div>        
                     </div>     
                    <div class="body_sec_all">
                            <div id="reqs">
                            <div class="content" id="reqs-detail" req:type="好友描述请求">
                                <div class="font14 bold">
                                    <asp:Literal runat="server" ID="LtrTitle"></asp:Literal>
                                 </div>
                                 <div class="content nl s98">
                                    <asp:Repeater runat="server" ID="RptData">
                                    <HeaderTemplate>
                                            <ol>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <li>
                                            <div class="spline"></div>
                                            <div  id="div_<%# DataBinder.Eval(Container.DataItem, "Demander")%>">
                                                <div class="body-2m-left nl img">
                                                        <a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "Demander")+"")%>"><img src="<%# GetHeadPic(DataBinder.Eval(Container.DataItem, "Demander"))%>" style="width:48px;height:48px;" alt="<%# DataBinder.Eval(Container.DataItem, "UserName")%>" /></a>
                                                </div>
                                                <div class="body-2m-right nr">
                                                        <div class="hdtitle s99 nl">
                                                            <strong><a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "Demander")+"")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a></strong> <span class="network">(<%# DataBinder.Eval(Container.DataItem, "Name")%>)</span> 请求加你为好友。
                                                        </div>
                                                       <div>
                                                            <%# getSchool(DataBinder.Eval(Container.DataItem, "Demander"))%>
                                                       </div> 
                                                       <div>
                                                            <%# getDesc(DataBinder.Eval(Container.DataItem, "ID"))%>
                                                       </div>
                                                        <div class="pstr nl  s99 spline">
                                                            <input type="button" value="同意成为好友" class="f-button" onclick="frdagree('<%# DataBinder.Eval(Container.DataItem, "ID")%>','<%# DataBinder.Eval(Container.DataItem, "Demander")%>','<%# DataBinder.Eval(Container.DataItem, "UserName")%>');" />
                                                            <input type="button" value="忽略请求" class="f-button" onclick="frdrefuse(<%# DataBinder.Eval(Container.DataItem, "ID")%>,<%# DataBinder.Eval(Container.DataItem, "Demander")%>,'<%# DataBinder.Eval(Container.DataItem, "UserName")%>');" />

                                                     </div> 
                                                </div>
                                            </div>
                                            <div class="spline"></div>
                                        </li>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </ol></FooterTemplate>
                                </asp:Repeater>                                 
                                 </div>
                                 <div class="content">
                                    <div class="pagination" runat="server" id="DivPage"></div>
                                 </div>
                            </div>
                            </div>
                    </div>
                    


                    </div>
                  <!--底部-->
                 <div class="divbottom">
                  <%=this.GetHtmlFoot()%>
                  </div>
            </div>
        </div>
</div>
                    
</body>
</html>

