<!--#include virtual="/incs/config.asp"-->
<% chk_log()%>
<%
Chk_newpwr 4,14,1
''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
perpage=SafeRequest("perpage")
if chk_int(perpage)=false then
perpage=20
end if 
perpage=clng(perpage)
if perpage>=100 then
perpage=100
end if
ThePage=0
page=0
rcount=0
thepage=0

''''''''''''''''''''''''''''''''''
k_wrds=trim(SafeRequest("k_wrds"))
k_tpe=trim(SafeRequest("k_tpe"))
k_mod=trim(SafeRequest("k_mod"))
if  k_wrds<>"" and instr(k_wrds,"'")<=0 then
if k_mod="moda" then
keywords=" and o_"&k_tpe&"='"&k_wrds&"'"
else
keywords=" and o_"&k_tpe&" like '%"&k_wrds&"%'"
end if

end if
''''''''''''''''''''''''''''''''''
t_str1=trim(SafeRequest("t_str1"))
t_str2=trim(SafeRequest("t_str2"))
if t_str1<>"" and t_str2<>"" then
if ((not chk_tme(t_str1)) and (not chk_tme(t_str2))) or instr(t_str1,"-")<=0 or instr(t_str2,"-")<=0 then
call errorpage(-2,"对不起，时间格式不正确!")
end if
timestrings=" and (o_addtme>='"&t_str1&"' and o_addtme<='"&t_str2&"')"
end if
''''''''''''''''''''''''''''''''''''''
odr1=trim(SafeRequest("odr1"))
odr2=trim(SafeRequest("odr2"))
if odr1="" or odr2="" then
odr1="a_fsh_a"
odr2="b_addtme_d"
end if
order1="o_"&right(odr1,len(odr1)-2)
odr_a=left(order1,len(order1)-2)
if right(order1,1)="a" then
order1=left(order1,len(order1)-2)
else
order1=left(order1,len(order1)-2)&" desc"
end if
order2="o_"&right(odr2,len(odr2)-2)
odr_b=left(order2,len(order2)-2)
if right(order2,1)="a" then
order2=left(order2,len(order2)-2)
else
order2=left(order2,len(order2)-2)&" desc"
end if


if odr_a=odr_b then
orderstring=order1
else
orderstring=order1&","&order2
end if

''''''''''''''''''''''
if chk_int(SafeRequest("oid")) then
keywords=" and o_id="&SafeRequest("oid")
end if
t_usr=SafeRequest("t_usr")
if t_usr<>"" then
keywords=keywords&" and o_unme='"&t_usr&"'"
end if
   if session("sysclass")>=5 then
   query="select * from v_odrlst where  1=1  "&keywords&timestrings&" order by "&orderstring
   else
   query="select * from v_odrlst where  (u_rotnme='"&session("usrname")&"' or (u_rotnme='' and ("&session("sysarestr")&"  or u_myare=0)))   "&keywords&timestrings&" order by "&orderstring
   end if
conn.open constr
rs.open query,conn,3
if rs.RecordCount<=0 then
          ErrMsg="<font color=#ff0000>对不起</font>，没有搜索到符合条件的记录！..."
		
	   else
	      rcount=rs.recordcount
	      rs.pagesize=perpage
		  ThePage=rs.pagecount
		  if Chk_Int(SafeRequest("page"))=false then
		  page=1
		  else
		   page=cint(SafeRequest("page"))
		    if page<=0  then
		       page=1
		    elseif page>ThePage then
		       page=ThePage
		    end if	  
		  end if
		    rs.absolutepage=page
       end if   


%>
<!--#include virtual="/incs/top.asp"-->
<script language="javascript">
<!--

function tofirst()
{searchform.page.value=1;
searchform.submit();
 }
  function toprev()
{searchform.page.value-=1;
searchform.submit();
 }
  function tonext()
{
searchform.page.value=<%=page%>-1+2;
searchform.submit();
 }
  function tolast()
{searchform.page.value=<%=ThePage%>;
searchform.submit();
 }
  function toorder(ordn)
{searchform.odr1.value=ordn;
searchform.page.value=1;
searchform.submit();
 }
function delall()
{
if(confirm("是否确认删除?"))
document.odr_frm.submit();
}
function ifdel(oid)
{
if(confirm("是否确认删除该订单?"))
location.href="odr_mng.asp?module=odr_del&oid="+oid;
}
function odrredo(a_id)
{
if(confirm("如果确定，系统将重交用户的购买请求或完成未完成的操作请求！"))
showurl("odr_redo.asp?page=<%=page%>&k_tpe=<%=k_tpe%>&k_mod=<%=k_mod%>&t_str1=<%=t_str1%>&t_str2=<%=t_str2%>&odr1=<%=odr1%>&odr2=<%=odr2%>&perpage=<%=perpage%>&k_wrds=<%=k_wrds%>&o_id="+a_id);
}
function odrcancel(a_id)
{
if(confirm("如果确定，系统将作废用户的购买请求并且一旦作废不可更改！"))
showurl("odr_mng.asp?module=odr_cancel&page=<%=page%>&k_tpe=<%=k_tpe%>&k_mod=<%=k_mod%>&t_str1=<%=t_str1%>&t_str2=<%=t_str2%>&odr1=<%=odr1%>&odr2=<%=odr2%>&perpage=<%=perpage%>&k_wrds=<%=k_wrds%>&o_id="+a_id);
}

function checkAll()
  {
    for (var i=0;i<document.odr_frm.elements.length;i++)
    {
      var e = document.odr_frm.elements[i];
      var boolValue = document.odr_frm.selectAll.checked;
      if (e.name != 'selectAll')
	  {
        e.checked = boolValue;
	  }
    }
  }
 //-->
 </script>
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><font color="#000000" class=ddropshadow><b><span class=enbold><strong>订单<font color="#000000">列表</font></strong></span></b></font></td>
          <td valign=bottom noWrap align=right 
                        width="75%">&nbsp;</td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2 bgcolor="#5F5F5F"></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="28"> 
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=odr_lst.asp method=post name=searchform2>
          <tr> 
            <td height=20 width="119">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=k_tpe value="<%=k_tpe%>">
                <input type=hidden name=k_mod value="<%=k_mod%>">
                <input type=hidden name=k_wrds value="<%=k_wrds%>">
                <input type=hidden name=t_str1 value="<%=t_str1%>">
                <input type=hidden name=t_str2 value="<%=t_str2%>">
                <input type=hidden name=t_usr value="<%=t_usr%>">
                <input type=hidden name=odr1 value="<%=odr1%>">
                <input type=hidden name=odr2 value="<%=odr2%>">
                <input type=hidden name=perpage value="<%=perpage%>"><%=page_turn%><input type=button name=deldall value="删 除" class=btxx onclick="javascript: delall();">
              </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform2.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <%
				  if right(odr1,2)="_d" then
				  odr1_1="a_ttl_a"
				  odr1_2="a_cnt_a"
				  odr1_3="a_addtme_a"
				  odr1_4="a_fsh_a"
				  odr1_5="a_mgr_a"
				  odr1_6="a_agtnme_a"
				  odr1_7="a_unme_a"
				  odr1_8="a_yarcnt_a"
				  else
				  odr1_1="a_ttl_d"
				  odr1_2="a_cnt_d"
				  odr1_3="a_addtme_d"
				  odr1_4="a_fsh_d"
				  odr1_5="a_mgr_d"
				  odr1_6="a_agtnme_d"
				  odr1_7="a_unme_d"
				  odr1_8="a_yarcnt_d"
				  end if
				  %>
      <table border=0 cellpadding=0 
                        cellspacing=0 class=datalist align="center" width="100%">
        <tbody> 
        <form action=odr_mng.asp method=post name=odr_frm>
          <tr > 
            <th width="5%" align=center class=datalistheader > <b>序号</b> </th>
            <th width="5%" align=center class=datalistheader > 
              <input type="checkbox" name="selectAll" onClick="return checkAll();" value="ON">
              <input type="hidden" NAME="module"  value="odr_delall">
            </th>
            <th width="22%" align=center class=datalistheader ><a href="javascript:toorder('<%=odr1_1%>');" class=commonface ><b>标题</b></a></th>
            <th width="6%" align=center  class=datalistheader ><a href="javascript:toorder('<%=odr1_8%>');" class=commonface ><b>期限</b></a></th>
            <th width="18%" align=center  class=datalistheader ><a href="javascript:toorder('<%=odr1_2%>');" class=commonface ><b>说明</b></a></th>
            <th width="8%"  align=center class=datalistheader ><a href="javascript:toorder('<%=odr1_3%>');" class=commonface ><b>发生时间</b></a></th>
            <th width="4%"  align=center class=datalistheader ><a href="javascript:toorder('<%=odr1_4%>');" class=commonface ><b>状态</b></a></th>
            <th width="10%" align=center class=datalistheader ><a href="javascript:toorder('<%=odr1_5%>');" class=commonface ><b>处理</b></a></th>
            <th align=center width="8%" class=datalistheader ><a href="javascript:toorder('<%=odr1_6%>');" class=commonface ><b>代理</b></a></th>
            <th align=center class=datalistheader > <a href="javascript:toorder('<%=odr1_7%>');"  class=commonface  ><b>用户名</b></a></th>
            <th align=center class=datalistheader > <b>操作</b></th>
          </tr>
          <%
		  i=1
	Do While Not rs.eof 
 if i mod 2=1 then
 classstl="datalistgrida"
 else
 classstl="datalistgridb"
 end if
	%>
          <tr   title="操作IP：<%=trim(rs("o_addip"))%>..." style="cursor:hand;"> 
            <td  align=center class=<%=classstl%> ><%=i+perpage*(page-1)%></td>
            <td  align=center class=<%=classstl%> > 
              <input type="checkbox" name="delid" value="<%=rs("o_id")%>">
            </td>
            <td  align=center class=<%=classstl%> ><a class=commonface href="javascript:showurl('/master/turn.asp?gid=<%=rs("o_prd")%>&pid=<%=rs("o_pid")%>');"><font color=<%=trim(rs("pt_clr"))%>> <%=trim(rs("o_ttl"))%></font></a></td>
            <td  align=center class=<%=classstl%> ><%
		  if isnull(rs("g_tmetpe"))=false then
		  response.write mynum(rs("o_yarcnt"))
		  if  cint(rs("g_tmetpe"))<=5 then
		  response.write "年"
		  else
		  response.write tmenmes(rs("g_tmetpe"))
		  end if
		  else
		  response.write "&nbsp;"
		  end if			%></td>
            <td  align=center class=<%=classstl%> ><%=trim(rs("o_cnt"))%></td>
            <td  align=center class=<%=classstl%> > 
            <%=trim(rs("o_addtme"))%> 
            <td  align=center class=<%=classstl%> > 
              <%
			if rs("o_fsh")=1 then
			response.write "<font class=wordline>完成</a>"
			elseif rs("o_fsh")=2 then
			response.write "<font  color=#939393>作废</a>"
			else
			response.write "<font color=#ff0000><u>未完成</u></font>"
			end if 
			 %>
            </td>
            <td align=center class=<%=classstl%> > 
              <%=trim(rs("o_mgr"))
			%>&nbsp;

            </td>
            <td  align=center class=<%=classstl%> >&nbsp;<%=rs("o_agtnme")%> </td>
            <td  align=center class=<%=classstl%> ><a href="/master/memmng/mem_dtl.asp?unme=<%=trim(rs("o_unme"))%>"><u><%=trim(rs("o_unme"))%></u></a>&nbsp;<img src="/icons/dollar.gif" border=0 style="cursor:hand;"  onclick="javascript:showurl('/master/fncmng/fnc_lst.asp?t_usr=<%=trim(Rs("o_unme"))%>');"  title="查看用户所有财务记录..." width="7" height="13"></td>
             
            <td  class=<%=classstl%>>&nbsp;<img src="/icons/fnc.gif" border=0 style="cursor:hand;" onclick="javascript:showurl('/master/fncmng/fnc_lst.asp?omaid=<%=rs("o_mnyaid")%>&unme=admin&grd=<%=trim(rs("o_prd"))%>&gnme=<%=split(trim(rs("o_cnt")),",")(0)%>&gid=10000001');" title="查看相关付费情况...">&nbsp; 
              <% if (not  isnull(rs("o_str"))) and rs("o_str")<>"" then %>
              <a href="javascript:showurl('odr_dtl.asp?oid=<%=rs("o_id")%>');" class=commonface title="查看API命令执行情况...">API</a> 
              <%end if %>
              &nbsp;</td>
          </tr>
          <%
  rs.movenext
i=i+1
if i>perpage then
exit do
end if

  loop 
  	rs.close
	conn.close
  %>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=odr_lst.asp method=post name=searchform>
          <tr> 
            <td height=20 width="120">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=k_tpe value="<%=k_tpe%>">
                <input type=hidden name=k_mod value="<%=k_mod%>">
                <input type=hidden name=k_wrds value="<%=k_wrds%>">
                <input type=hidden name=t_str1 value="<%=t_str1%>">
                <input type=hidden name=t_str2 value="<%=t_str2%>">
                <input type=hidden name=odr1 value="<%=odr1%>">
                <input type=hidden name=odr2 value="<%=odr2%>">
                <input type=hidden name=t_usr value="<%=t_usr%>">
                <input type=hidden name=perpage value="<%=perpage%>"><%=page_turn%><input type=button name=deldall value="删除" class=btxx onclick="javascript: delall();">
              </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select class=normalform name="page" onChange="javascript:document.searchform.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <br>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=datalist>
        <form action="odr_lst.asp" method=post name="frm_qry">
          <tr align="center"> 
            <th height="22" class=datalistheader >关键字</th>
            <th class=datalistheader >用户</th>
            <th class=datalistheader >时间(yyyy-mm-dd)</th>
            <th class=datalistheader >排序</th>
            <th class=datalistheader >条/页</th>
            <th class=datalistheader >查询</th>
          </tr>
          <tr align="center"> 
            <td height="22"  class=datalistgridb  > 
              <select name="k_tpe" class=normalform >
                <option value="ttl">标题</option>
                <option value="cnt">说明</option>
                <option value="prd">产品</option>
              </select>
              <select name="k_mod" class=normalform >
                <option value="moda" <% if k_mod="moda" then
						  response.write " selected"
						  end if %>>等于</option>
                <option value="modb"  <% if k_mod="modb" then
						  response.write " selected"
						  end if %>>类似</option>
              </select>
              <input name="k_wrds" type="text" size="8" maxlength="50" value="<%=k_wrds%>" class=normalform >
            </td>
            <td  class=datalistgridb > 
              <input name="t_usr" type="text" size="10" maxlength="20" value="<%=t_usr%>" class=normalform >
            </td>
            <td class=datalistgridb > 
              <input name="t_str1" type="text" size="6" maxlength="10" value="<%=t_str1%>" class=normalform >
              到 
              <input name="t_str2" type="text" size="6" maxlength="10" value="<%=t_str2%>" class=normalform >
            </td>
            <td class=datalistgridb > 
              <select name="odr1" class=normalform >
                <option value="a_addtme_a" style="color:#ff0000;" <% if odr1="a_addtme_a" then
						  response.write " selected"
						  end if %> >时间顺</option>
                <option style="color:#ff0000" value="a_addtme_d" <% if odr1="a_addtme_d" then
						  response.write " selected"
						  end if %> >时间倒</option>
                <option style="color:#ff00ff" value="a_fsh_a" <% if odr1="a_fsh_a" then
						  response.write " selected"
						  end if %> >状态顺</option>
                <option style="color:#ff00ff" value="a_fsh_d" <% if odr1="a_fsh_d" then
						  response.write " selected"
						  end if %> >状态倒</option>
                <option style="color:#ff6600" value="a_ttl_a" <% if odr1="a_ttl_a" then
						  response.write " selected"
						  end if %> >标题顺</option>
                <option style="color:#ff6600" value="a_ttl_d" <% if odr1="a_ttl_d" then
						  response.write " selected"
						  end if %> >标题倒</option>
                <option style="color:#000000" value="a_unme_a" <% if odr1="a_unme_a" then
						  response.write " selected"
						  end if %> >用户顺</option>
                <option style="color:#000000" value="a_unme_d" <% if odr1="a_unme_d" then
						  response.write " selected"
						  end if %> >用户倒</option>
                <option style="color:#0000ff" value="a_mgr_a" <% if odr1="a_mgr_a" then
						  response.write " selected"
						  end if %> >管理顺</option>
                <option style="color:#0000ff" value="a_mgr_d" <% if odr1="a_mgr_d" then
						  response.write " selected"
						  end if %> >管理倒</option>
                <option style="color:#006600" value="a_agtnme_a" <% if odr1="a_agtnme_a" then
						  response.write " selected"
						  end if %> >代理顺</option>
                <option style="color:#006600" value="a_agtnme_d" <% if odr1="a_agtnme_d" then
						  response.write " selected"
						  end if %> >代理倒</option>
                <option value="a_prd_a" style="color:#ff0000;" <% if odr1="a_prd_a" then
						  response.write " selected"
						  end if %> >产品顺</option>
                <option style="color:#ff0000" value="a_prd_d" <% if odr1="a_prd_d" then
						  response.write " selected"
						  end if %> >产品倒</option>
              </select>
              <select name="odr2" class=normalform >
                <option style="color:#ff0000" value="b_addtme_a" <% if odr2="b_addtme_a" then
						  response.write " selected"
						  end if %>>时间顺</option>
                <option style="color:#ff0000" value="b_addtme_d" <% if odr2="b_addtme_d" then
						  response.write " selected"
						  end if %>>时间倒</option>
                <option style="color:#ff00ff" value="b_fsh_a" <% if odr2="b_fsh_a" then
						  response.write " selected"
						  end if %>>状态顺</option>
                <option style="color:#ff00ff" value="b_fsh_d" <% if odr2="b_fsh_d" then
						  response.write " selected"
						  end if %>>状态倒</option>
                <option style="color:#ff6600" value="b_ttl_a" <% if odr2="b_ttl_a" then
						  response.write " selected"
						  end if %>>标题顺</option>
                <option style="color:#ff6600" value="b_ttl_d" <% if odr2="b_ttl_d" then
						  response.write " selected"
						  end if %>>标题倒</option>
                <option style="color:#000000" value="b_unme_a" <% if odr2="b_unme_a" then
						  response.write " selected"
						  end if %>>用户顺</option>
                <option style="color:#000000" value="b_unme_d" <% if odr2="b_unme_d" then
						  response.write " selected"
						  end if %>>用户倒</option>
                <option style="color:#0000ff" value="b_mgr_a" <% if odr2="b_mgr_a" then
						  response.write " selected"
						  end if %>>管理顺</option>
                <option style="color:#0000ff" value="b_mgr_d" <% if odr2="b_mgr_d" then
						  response.write " selected"
						  end if %>>管理倒</option>
                <option style="color:#006600" value="b_agtnme_a" <% if odr2="b_agtnme_a" then
						  response.write " selected"
						  end if %>>代理顺</option>
                <option style="color:#006600" value="b_agtnme_d" <% if odr2="b_agtnme_d" then
						  response.write " selected"
						  end if %>>代理倒</option>
                <option value="b_prd_a" style="color:#ff0000;" <% if odr1="b_prd_a" then
						  response.write " selected"
						  end if %> >产品顺</option>
                <option style="color:#ff0000" value="b_prd_d" <% if odr1="b_prd_d" then
						  response.write " selected"
						  end if %> >产品倒</option>
              </select>
            </td>
            <td class=datalistgridb > 
              <input name="perpage" type="text" size="2" maxlength="3" value="<%=perpage%>"  class=normalform  >
            </td>
            <td class=datalistgridb > 
              <input type="submit" name="Submit" value="查 询" class=btxx>
            </td>
          </tr>
        </form>
      </table>
      <br>
      注：您仅能删除5天前的订单记录！<br>
    </td>
  </tr>
  </tbody> 
</table><br><br><br><br><br>
<!--#include virtual="/incs/bottom.asp"-->

