<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="train_info.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	End If
		
	set rs=server.createobject("adodb.recordset")
	sql="select * from train_join where tid="&Request.Cookies("admin_train_id")&" and ttype=1 and zhuangtai=0"
	rs.open sql,conn,1,1
	aspnum=rs.recordcount
	if aspnum="" then aspnum=0
	rs.close                                                                    
	set rs=nothing
	
	set rs=server.createobject("adodb.recordset")
	sql="select * from train_join where tid="&Request.Cookies("admin_train_id")&" and ttype=0 and zhuangtai=0"
	rs.open sql,conn,1,1
	joinnum=rs.recordcount
	if joinnum="" then joinnum=0
	rs.close                                                                    
	set rs=nothing
	
	action=Trim(Request.QueryString("action"))
	if action="del" then
		tid=ReplaceBadChar(int(Request.Cookies("admin_train_id")))
		type1=Trim(Request.QueryString("type"))
		id=ReplaceBadChar(int(Trim(Request.QueryString("id"))))
		conn.Execute "delete from train_join where id="&id&" and tid="&tid&""
		response.write"<SCRIPT language=JavaScript>alert('您的操作已经完成，现在为您返回');"
		response.write"this.location.href='sign.asp?type="&type1&"';</SCRIPT>"
		response.end
	end if
%>
<!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><%=homename%>--机构管理中心首页</title>
<link href="images/Style_company.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    <!--
    var Browser_isIE = window.ActiveXObject ? true : false;
    var GpArray = new Array("index.asp","manage.asp", "pwd.asp", "publish_new.asp", "whkc.asp", "sign.asp?type=ask", "sign.asp?type=join", "tmoney.asp", "mail_box.asp", "../html/train/<%=Request.Cookies("admin_train_id")%>/","pay_list.asp","Card_list.asp", "login_out.asp");
    function MO_0(obj)
    {
        obj.className = "menu_td2";
    }
    
    function MU_0(obj)
    {
        obj.className = "menu_td";
    }
    function Gp(pIndex)
    {
        location.href = GpArray[pIndex];
    }
    function Gout()
    {
        if(confirm("提示：确定要退出系统？")){ location.href = "login_out.asp";}
    }
    //-->
</script>
<style type="text/css">
    .menu_span {line-height:31px;padding:12px 5px 12px 48px; margin-left:15px;}
</style>
</head>
<body>
    <div id="body">
    <div id="top">
    <div class="top_logo"></div>
    <div class="top_gochat"><img src="images/c_chat.gif" /> <font id="KfChatState" color="white">您的帐号状态(<b><% If hideuser=0 Then Response.Write("公开") else Response.Write("隐藏")%></b>)</font><font color="white"> 审核状态(<b><% If zhuangtai=1 Then Response.Write("已审核") else Response.Write("未审核")%></b>)</font></div>
    <div class="top_userinfo">用户名：<u><%= Request.Cookies("admin_train_name") %></u>　　机构名称：<u><%= Request.Cookies("train_name") %></u>　　登陆次数：<%= dlnum %></div>
    <div class="img_logout"><input type="button" value="" class="btn_out" onclick="Gout()" title="退出" /></div>
    </div>
    <div id="main">
    <div id="left">
    <div id="left_menu" class="m_c">
    <div class="part_title">功 能 菜 单</div>
    <div style="width:100%;line-height:18px; margin-bottom:5px;">
    <table cellpadding="0" cellspacing="4" border="0" width="95%" style="text-align:left; margin:0 auto;">
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(0)">
            <span class="menu_span" style="background:url(images/c_menu_def_s.gif) 0px 6px no-repeat;">管理首页</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(1)">
            <span class="menu_span" style="background:url(images/c_menu_0_s.gif) 0px 6px no-repeat;">基本设置</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(2)">
            <span class="menu_span" style="background:url(images/c_menu_1_s.gif) 0px 6px no-repeat;">帐号维护</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(3)">
        <span class="menu_span" style="background:url(images/c_menu_lw_s.gif) 0px 6px no-repeat;">发布课程</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(4)">
        <span class="menu_span" style="background:url(images/c_menu_addr_s.gif) 0px 6px no-repeat;">课程管理</span></td>
    </tr>
    <tr>
        <td style="background-color:#F0F0F0;" height="1"></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(5)">
            <span class="menu_span" style="background:url(images/c_menu_2_s.gif) 0px 6px no-repeat;<% If Trim(Request.QueryString("type"))="ask" Then Response.Write("color:#C33;")%>">咨询列表</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(6)">
            <span class="menu_span" style="background:url(images/c_menu_3_s.gif) 0px 6px no-repeat;<% If Trim(Request.QueryString("type"))="join" Then Response.Write("color:#C33;")%>">报名列表</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(7)">
            <span class="menu_span" style="background:url(images/c_menu_4_s.gif) 0px 6px no-repeat;">帐户管理</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(8)">
            <span class="menu_span" style="background:url(images/c_menu_5_s.gif) 0px 6px no-repeat;">站内信箱</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(9)">
            <span class="menu_span" style="background:url(images/c_menu_style_s.gif) 0px 6px no-repeat;">机构预览</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(10)">
            <span class="menu_span" style="background:url(images/new_1.jpg) 0px 6px no-repeat;">支付记录</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(11)">
            <span class="menu_span" style="background:url(images/new_2.jpg) 0px 6px no-repeat;">购卡记录</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(12)">
            <span class="menu_span" style="background:url(images/c_menu_6_s.gif) 0px 6px no-repeat;">退出系统</span></td>
    </tr>
    </table>
    </div>
    </div>
    <div style="margin-top:10px;">技术支持：<a href="http://www.wishcn.com" target="_blank" title="网愿科技">网愿科技</a></div>
    </div>
    <div id="right">
        
<script type="text/javascript">
function showwelcome()
{
    var welcomeTxt = ""; //var day = new Date(); day.getHours();
    var time = 14;
　　if ((time >= 0) && (time < 7))  
　　　　welcomeTxt="早上好，";
　　else if ((time >= 7) && (time < 12))  
　　　　welcomeTxt="上午好，";
　　else if ((time >= 12) && (time < 14))  
　　　　welcomeTxt="中午好，";
　　else if ((time >= 14) && (time < 18))  
　　　　welcomeTxt="下午好，";
　　else if ((time >= 18) && (time < 24))  
　　　　welcomeTxt="晚上好，";
    document.write(welcomeTxt);
}
</script>
<div class="part_title">&nbsp; >> <%= Request.Cookies("admin_train_name") %> 欢迎进入-培训会员管理中心首页</div>
<div style="width:100%;text-align:center;padding:1px;">
<div style="width:100%;text-align:left; border-bottom: solid 5px #69c; line-height:30px;">
<div style="float:left; margin-left:10px;"><span style="font-size:14px; color:#369; font-weight:bold;">
<script>showwelcome();</script><span id="ctl00_CPH1_Label_name" style="color:#CC3333;"><%= Request.Cookies("admin_train_name") %></span></span>
，咨询信息共有 <span style="color:#C33; font-weight:bold;"><%= aspnum %></span> 条未读，报名信息共有 <span style="color:#C33; font-weight:bold;"><%= joinnum %></span> 条未读</div>
<div style="float:right; margin-right:10px; color:#666; background: url(images/chat_date.gif) left 8px no-repeat; padding-left:20px;"> <div id="jnkc">
</div>
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script></div>
<div style="clear:both;"></div>
</div>
    <script type="text/javascript">
    function showMenuTxt(id)
    {
        var menutxtObj = document.getElementById("menuIntroduce");
        if (!id) menutxtObj.innerHTML = '显示功能简要说明';
        else menutxtObj.innerHTML = document.getElementById("menutxt_"+id).innerHTML;
    }
    </script>
    <table cellpadding="3" cellspacing="0" border="1" rules="all" bordercolor="#6699cc" width="100%" class="tde">
    <thead>
    <tr class="tde_head">
        <td align="left" height="27px">&nbsp;课程管理</td>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>
            <table width="100%" cellspacing="0" cellpadding="3" border="0">
            <tr>
			<td width="5%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">编号</td>
            <td width="20%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">课程名称</td>
            <td width="10%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">咨询者</td>
            <td width="16%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">联系电话</td>
            <td width="27%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">咨询内容</td>
            <td width="8%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">状态</td>
            <td width="14%" align="center" style="background-color:#F2F2F2;border: solid 1px #F0F0F0;">操作</td>
            </tr>
<%
	dim i,intPage,page,pre,last,filepath'定义变量
	keyword=""
	if Trim(Request.QueryString("type"))="ask" then
		keyword=" and train_join.ttype=1"
	else
		keyword=" and train_join.ttype=0"
	end if
	set rs_whzp = server.CreateObject("adodb.recordset")'创建对象
	sql="select train_join.*,train_subject.tsname from train_join,train_subject where train_join.tid="&Request.Cookies("admin_train_id")&" and train_join.sid=train_subject.id "&keyword&"  order by train_join.id desc"'定义SQL语句
	rs_whzp.PageSize =17 '这里设定每页显示的记录数
	rs_whzp.CursorLocation = 3
	rs_whzp.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	zpnum=rs_whzp.recordcount
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs_whzp.PageCount then
				intpage = rs_whzp.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs_whzp.eof then
		rs_whzp.AbsolutePage = intpage
	end if
	if rs_whzp.eof then
%>
<tr align="center">
                <td class="menu_td" colspan="7">暂时还没有您报名咨询的留言</td>
            </tr>
<%
	else
	for i=1 to rs_whzp.PageSize
	if rs_whzp.EOF or rs_whzp.BOF then exit for
%>
            <tr align="center">
                <td class="menu_td"><%= rs_whzp("id") %></td>
                <td class="menu_td"><a href="../html/train/<%= Request.Cookies("admin_train_id") %>/<%= rs_whzp("sid") %>.html" target="_blank"><%= left(rs_whzp("tsname"),10) %></a></td>
                <td class="menu_td"><%= rs_whzp("tname") %></td>
                <td class="menu_td"><%= rs_whzp("phone") %></td>
                <td class="menu_td"><A HREF="#" onClick="window.open('view_join.asp?id=<%= rs_whzp("id") %>','浏览详细信息','height=340, width=480, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')"><%= left(rs_whzp("notice"),10) %>...</A></td>
                <td class="menu_td"><% If rs_whzp("zhuangtai")=1 Then Response.Write("已读") else Response.Write("<font color='#FF0000'>未读</font>")%></td>
                <td class="menu_td"><p><A HREF="#" onClick="window.open('send_mail.asp?id=<%= rs_whzp("id") %>&text=<%= rs_whzp("tsname") %>','回复邮件','height=340, width=480, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')">回复</a> || <a href="?action=del&id=<%= rs_whzp("id") %>&type=<%= Trim(Request.QueryString("type")) %>">删除</a></p>                  </td>
            </tr>
<%
	rs_whzp.movenext
	next
	end if
%>
<tr align="center">
                <td class="menu_td" colspan="7"><table width="99%" border="0" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs_whzp.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs_whzp.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1&type=<%= Trim(Request.QueryString("type")) %>">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>&type=<%= Trim(Request.QueryString("type")) %>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>&type=<%= Trim(Request.QueryString("type")) %>">下页</a> |<%end if%>
<a href="?page=<%=rs_whzp.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs_whzp.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>&type=<%= Trim(Request.QueryString("type")) %>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>&type=<%= Trim(Request.QueryString("type")) %>"><%=i%></option>
<%
	end if
	next
	rs_whzp.close
	set rs_whzp=nothing
	conn.close
	set conn=nothing
%>
</select>页</font></td>
</tr>
</table></td>
            </tr>
            </table>
        </td>
    </tr>
    </tbody>
    </table>
    </div>
    </div>
    <div style="clear:both;"></div>
    </div>
    </div>
</body>
</html>
