<!-- #include file="include/config.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<%
dim rssum,nummer,page,thepages,viewpage,pageurl,types,topic,tim,pic_temp,vvt
rssum=0:thepages=0:viewpage=1:nummer=dim_num(0)
pageurl="?action="&action&"&"

select case action
case "news"
  tit="查看我发布的新闻"
case "down"
  tit="查看我添加的软件"
case "paste"
  tit="查看我上传的贴图"
case "flash"
  tit="查看我上传的Flash"
case "web"
  tit="查看我推荐的网站"
case "video"
  tit="查看我添加的影片"
case "flea"
  tit="查看我发布的信息"
case "shop"
  tit="查看我的订单"
case else
  action="art"
  tit="查看我发表的文章"
end select

call web_head(2,0,0,0,0)
'----------------------------左边 开始----------------------------
call user_left(3)
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td colspan=7>&nbsp;<%response.write img_skin("m_user")&tit%></td></tr>
<tr class=trb><td height=30 colspan=7>
  <table border=0 align=center>
  <tr>
  <td><%response.write img_skin("m_")%><a href='?action=art'<%if action="art" or action="" then response.write " class=red"%>>文章</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=news'<%if action="news" then response.write " class=red"%>>新闻</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=down'<%if action="down" then response.write " class=red"%>>软件</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=paste'<%if action="paste" then response.write " class=red"%>>贴图</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=flash'<%if action="flash" then response.write " class=red"%>>Flash</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=web'<%if action="web" then response.write " class=red"%>>网站</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=flea'<%if action="flea" then response.write " class=red"%>>信息</a></td>
  <td width=5></td>
  <td><%response.write img_skin("m_")%><a href='?action=shop'<%if action="shop" then response.write " class=red"%>>我的订单</a></td>
  </tr>
  </table>
</td></tr>
<%
select case action
case "news"
  sql="select id,topic,tim,counter from news where username='"&login_username&"' and hidden=1 order by id desc"
case "down"
  sql="select id,name,tim,counter from down where username='"&login_username&"' and hidden=1 order by id desc"
case "flea"
  sql="select id,name,tim,counter from flea where username='"&login_username&"' and hidden=1 order by id desc"
case "paste","flash"
    nummer=9
  sql="select * from gallery where hidden=1 and types='"&action&"' and username='"&login_username&"' order by id desc"
case "web"
  sql="select id,name,tim,counter from website where username='"&login_username&"' and hidden=1 order by id desc"
case "shop"
  sql="select * from shop_orders where username='"&login_username&"' order by id desc"
case else
  sql="select id,topic,tim,counter from article where username='"&login_username&"' and hidden=1 order by id desc"
end select

set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
  rssum=rs.recordcount
end if
call format_pagecute()
%>
<tr><td align=center height=30 colspan=7 class=tr>
  <table border=0 width='98%' cellspacing=0 cellpadding=0>
  <tr align=center valign=bottom><td width='30%'>
现在有<font class=red><%response.write rssum%></font>条记录┋
每页<font class=red><%response.write nummer%></font>个
  </td><td width='70%'>
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font> 分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
  </td></tr>
  </table>
</td></tr>
<%

select case action
case "news"
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_news()
case "down"
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_down()
case "flea"
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_flea()
case "paste"
  vvt=1
  call putview_gallery(action)
case "flash"
  vvt=2
  call putview_gallery(action)
case "shop"
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_shop()
case "web"
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_website()
case else
if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
  call putview_article()
end select

rs.close:set rs=nothing
%>
</table>
<br>
<%
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub putview_news()
%>
<tr align=center>
<td width='6%' class=td><b>序号</b></td>
<td width='84%' class=td><b>新闻标题</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("topic"):tim=rs("tim")
    response.write vbcrlf&"<tr><td align=center class=trb>"&(viewpage-1)*nummer+i&".</td><td class=tr><a target=_blank href='../news/view.asp?id="&rs("id")&"' alt='新闻标题："&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,50)&"</a>&nbsp;<font class=tims>("&joekoe_cms.time_type(tim,4)&"，<font class=blue>"&rs("counter")&"</font>次)</font></td></tr>"
    rs.movenext
  next
end sub

sub putview_article()
%>
<tr align=center>
<td width='6%' class=td><b>序号</b></td>
<td width='84%' class=td><b>文章标题</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("topic"):tim=rs("tim")
    response.write vbcrlf&"<tr><td align=center class=trb>"&(viewpage-1)*nummer+i&".</td><td class=tr><a target=_blank href='../article/view.asp?id="&rs("id")&"' alt='文章标题："&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,50)&"</a>&nbsp;<font class=tims>("&joekoe_cms.time_type(tim,4)&"，<font class=blue>"&rs("counter")&"</font>次)</font></td></tr>"
    rs.movenext
  next
end sub

sub putview_down()
%>
<tr align=center>
<td width='6%' class=td><b>序号</b></td>
<td width='84%' class=td><b>软件名称</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("name"):tim=rs("tim")
    response.write vbcrlf&"<tr><td align=center class=trb>"&(viewpage-1)*nummer+i&".</td><td class=tr><a target=_blank href='../down/view.asp?id="&rs("id")&"' alt='软件名称："&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,50)&"</a>&nbsp;<font class=tims>("&joekoe_cms.time_type(tim,4)&"，<font class=blue>"&rs("counter")&"</font>次)</font></td></tr>"
    rs.movenext
  next
end sub

sub putview_flea()
%>
<tr align=center>
<td width='6%' class=td><b>序号</b></td>
<td width='84%' class=td><b>信息名称</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("name"):tim=rs("tim")
    response.write vbcrlf&"<tr><td align=center class=trb>"&(viewpage-1)*nummer+i&".</td><td class=tr><a target=_blank href='../flea/view.asp?id="&rs("id")&"' alt='信息名称："&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,50)&"</a>&nbsp;<font class=tims>("&joekoe_cms.time_type(tim,4)&"，<font class=blue>"&rs("counter")&"</font>次)</font></td></tr>"
    rs.movenext
  next
end sub

sub putview_website()
%>
<tr align=center>
<td width='6%' class=td><b>序号</b></td>
<td width='84%' class=td><b>网站名称</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("name"):tim=rs("tim")
    response.write vbcrlf&"<tr><td align=center class=trb>"&(viewpage-1)*nummer+i&".</td><td class=tr><a target=_blank href='../vouch/website_view.asp?id="&rs("id")&"' alt='网站名称："&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,50)&"</a>&nbsp;<font class=tims>("&joekoe_cms.time_type(tim,4)&"，<font class=blue>"&rs("counter")&"</font>次)</font></td></tr>"
    rs.movenext
  next
end sub

sub putview_gallery(types)
  'call joekoe_cms.js_type("style/web_emoney.js",4)
  dim j,k,kn,pic,name,nnum:nnum=1
  response.write vbcrlf&"<tr><td align=center class=tr><table border=0 width='100%'><tr><td height=10></td></tr>"
  kn=3
  if nummer mod kn > 0 then
    k=nummer\kn+1
  else
    k=nummer\kn
  end if
  
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  
  for i=1 to k
    'if rs.eof then exit for
    response.write "<tr align=center>"
    for j=1 to kn
      if rs.eof or nnum>nummer then exit for
      pic=rs("spic"):name=rs("name")
      response.write "<td align=center><table border=0>"
	  response.write "<tr><td align=center>"&pic_fk(pic,1,"../vouch/gallery_view.asp?types="&types&"&id="&rs("id")&"")&"</td></tr>" & _
	         vbcrlf&"<tr><td align=center><b><a href='../vouch/gallery_view.asp?types="&types&"&id="&rs("id")&"' alt='"& joekoe_cms.code_js(name,1)&"'>"&joekoe_cms.code_js(joekoe_cms.code_html(name,1,15),0)&"</a></b></td></tr>"
      if vvt>0 then 
	     response.write "<tr><td align=center>"&joekoe_cms.web_unit&"：<font class=red2>"&rs("emoney")&"</font>  人气：<font class=red>"&rs("counter")&"</font></td></tr>"
         if vvt>1 then response.write "<tr><td align=center>"&format_emoney_power(rs("emoney"),rs("power"),0)&"</td></tr>"   
      end if
	  response.write "</table></td>"
      rs.movenext
      nnum=nnum+1
    next
    response.write "</tr><tr><td height=10></td></tr>"
  next
  
  response.write "</table></td></tr>"
end sub

sub putview_shop()
if trim(request.querystring("shop"))="del" then
dim rs1,u_name,shop_id,shop_num,typess
shop_id=trim(request.querystring("shopid"))
shop_num=trim(request.querystring("shopnum"))
if not(isnumeric(shop_id)) or not(isnumeric(shop_num)) then call format_redirect("user_putview.asp?action=shop"):response.end
set rs1=conn.Execute("select username,types from shop_orders where id="&shop_id)
u_name=rs1("username"):typess=rs1("types")
rs1.close:set rs1=nothing
 if u_name=login_username then
  if typess=0 then
  conn.execute("delete from shop_orders where id="&shop_id)
  conn.execute("delete from shop_oorders where oid="&shop_id)  
  conn.Execute("insert into user_mail(accept_u,send_u,topic,word,tim,types,isread) values('"&web_dim(3)&"','"&login_username&"','撤销订单通知！','用户 <b>"&login_username&"</B> (IP："&user_ip&") 撤销了 "&shop_num&" 订单，特此通知！','"&joekoe_cms.now_time&"',1,0)")
  response.write("<script language=javascript>" & _
     vbcrlf & "alert(""已成功撤销了一条订单！订单号："&shop_num&""");" & _
     vbcrlf & "location='?action=shop'" & _
     vbcrlf & "</script>")
  else
  response.write("<script language=javascript>" & _
     vbcrlf & "alert(""对不起，不能撤销"&shop_num&"订单！就在刚才，管理员处理了此订单！！"");" & _
     vbcrlf & "location='?action=shop'" & _
     vbcrlf & "</script>")
  end if
 else  
  conn.Execute("insert into user_mail(accept_u,send_u,topic,word,tim,types,isread) values('"&web_dim(3)&"','"&login_username&"','非法操作通知！','用户 [B]"&login_username&"[/B] (IP："&user_ip&")，对商品订单进行非法操作，请管理员注意！','"&joekoe_cms.now_time&"',1,0)")
  response.write("<script language=javascript>" & _
     vbcrlf & "alert(""你想干什么？！你的 ID 和 IP 已被记录！！"");" & _
     vbcrlf & "location='?action=shop'" & _
     vbcrlf & "</script>")
 end if
end if
%>
<tr align=center class=bbs_tr>
<td width='7%' class=bbs_td><b>序号</b></td>
<td width='20%' class=bbs_td><b>订单编号</b></td>
<td width='14%' class=bbs_td><b>订购时间</b></td>
<td width='12%' class=bbs_td><b>处理情况</b></td>
<td width='14%' class=bbs_td><b>处理时间</b></td>
<td width='25%' class=bbs_td><b>处理信息</b></td>
<td width='' class=bbs_td><b>操作</b></td>
</tr>
<%
  for i=1 to nummer
    if rs.eof then exit for
 dim id,types,dis_tim,dis_remark,cz
    topic=rs("ordernum"):tim=rs("tim"):id=rs("id"):types=rs("types"):dis_tim=rs("dis_tim"):dis_remark=rs("dis_remark")
 if types=0 then
 types="未处理"
 cz="<a href='javascript:clear_order("&id&","&topic&");'>撤单</a>"
 elseif types=1 then
 types="<font class=blue>有问题</font>"
 cz="★★"
 elseif types=5 then
 types="<font class=blue>已处理</font>"
 cz="★★"
 end if
 if dis_remark<>"" then
 dis_remark=dis_remark
 else
 dis_remark="<font class=gray>没有</font>"
 end if
    response.write vbcrlf&"<tr><td align=center class=bg_td>"&(viewpage-1)*nummer+i&"</td>" & _
     vbcrlf & "<td class=bg_td><a href='/shop/order_view.asp?ordernum="&topic&"' alt='订购时间："&tim&"' target=_blank>"&topic&"</a></td>" & _
     vbcrlf & "<td align=center class=bg_td><font class=tims>"&joekoe_cms.time_type(tim,3)&"</font></td>" & _
     vbcrlf & "<td align=center class=bg_td>"&types&"</td>" & _
     vbcrlf & "<td align=center class=bg_td><font class=tims>"&joekoe_cms.time_type(dis_tim,3)&"</font></td>" & _
     vbcrlf & "<td align=center class=bg_td>"&dis_remark&"</td>" & _
     vbcrlf & "<td align=center class=bg_td>"&cz&"</td></tr>"
    rs.movenext
  next
 %>
<tr>
<td width='6%' height=25 align=center class=bg_tds>说明</td>
<td colspan=6 class=bg_tds><font class=red2> 未处理的订单可以撤单，已处理或有问题的订单则不可以撤单，★★表示不可以撤单。</font></td>
</tr>
<script language=Javascript>
<!--
function clear_order(cv,dv)
{
  if (confirm("此操作将 撤销 "+dv+" 订单！"))
  if (confirm("真的要进行吗？"))
  if (confirm("撤单后将无法恢复！"))
    window.location="?action=shop&shop=del&shopid="+cv+"&shopnum="+dv
}
//-->
</script>
<%
end sub
%>