<!--#include virtual="/incs/config.asp"-->
<!--#include virtual="/incs/top.asp"-->
<% chk_log()%>
<%
chk_newpwr 4,18,1
c_cls=SafeRequest("c_cls")
					ptid=SafeRequest("ptid")

if chk_int(c_cls)=false then
call errorpage(-2,"对不起，请选择所要查看的价格等级！")
end if
if chk_int(ptid)=false then
ptid=-1
end if
conn.open constr

%>
 
<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>价格修改</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 class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <%
			  query="select * from clslst where c_cls="&c_cls
			  rs.open query,conn,1,1
			 if rs.eof then
			 call errorpage(-2,"对不起，该价格等级不存在！")
			 end if
			 
			  %>
    <td  colspan=2 valign="top" height="28"> 
      <div align="center"> 
        <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td height=12> 
              <div align="center"><font color="#002E73"><b><%=trim(rs("c_nme"))%>(<%=trim(rs("c_inf"))%>)</b></font></div>
            </td>
          </tr>
          <tr> 
            <td height=12>&nbsp; </td>
          </tr>
          <tr> 
            <td height=12> 
              <table cellspacing=0 cellpadding=0  border=0 bordercolordark="#FFFFFF" height="24" align="center" width=95%>
                <tbody> 
                <tr align=center bgcolor="#FFFFFF"> 
                  <td height="22"  align=center bgcolor="#FFFFFF"> 
                    <%rs.close
						  query="select * from pdttpe where pt_shw=1 order by pt_odr"
						  rs.open query,conn,1,1
						  if not rs.eof then
						  fstptid=rs("pt_id")
						  while not rs.eof  
              response.write "<A class=commonface style='text-decoration:underline;' href='prc_adv.asp?c_cls="&c_cls&"&ptid="&rs("pt_id")&"'>"
						  if clng(rs("pt_id"))=clng(ptid) then
                             response.write "<font color=#ff0000>"&rs("pt_nme")&"</font>"
						   else
                             response.write rs("pt_nme")
						   end if	 
			  response.write "</A> | "
      
						  rs.movenext
						  
						  wend
						  end if
						  rs.close
  %>
                    <a href="prc_adv.asp?c_cls=<%=c_cls%>&ptid=0" class=commonface  style="text-decoration:underline;">所有产品</a>&nbsp;</td>
                </tr>
                </tbody> 
              </table>
            </td>
          </tr>
          <tr> 
            <td height=25> 
              <div align="center"> <A class=commonface style='text-decoration:underline;' href='prc_edt.asp?c_cls=<%=c_cls%>&ptid=<%=ptid%>'><b>（返回标准定价）</b></a> 
              </div>
            </td>
          </tr>
        </table>
        <% 
					if  ptid<0 then
					ptid=fstptid
					end if
					if ptid=0 then
					query="select * from v_prclst  where (p_tmetpe>=5 and p_yar>5) or (p_tmetpe<5 and p_yar>2) order by pt_odr,pc_odr,g_odr,c_cls"
					else
					query="select * from v_prclst where ((p_tmetpe>=5 and p_yar>5) or (p_tmetpe<5 and p_yar>2)) and  pt_id="&ptid&"  order by pt_odr,pc_odr,g_odr"
					end if
					rs.open query,conn,1,1
	%>
        <table border=0 cellpadding=0 
                        cellspacing=0 width="100%" bordercolordark="#FFFFFF" align="center" class=datalist>
          <tbody> 
          <tr> 
            <th width="6%" class=datalistheader height=20 > 序号 </th>
            <th width="10%" class=datalistheader > 编号 </th>
            <th width="18%" class=datalistheader > 产品名称 </th>
            <th width="15%" class=datalistheader > 价格等级</th>
            <th width="15%" class=datalistheader > 期限</th>
            <th width="15%" align="center" class=datalistheader >价格</th>
            <th  class=datalistheader > 操作
            </th>
          </tr>
          <%
	tpenme=""					
  i=1
     do while not rs.eof
	 if  tpenme<>trim(rs("pt_nme")) then
	 %>
          <tr  > 
            <td  align=center colspan=7 class=datalistgridb  HEIGHT=25><font color=#ff0000><b><%=trim(rs("pt_nme"))%></b></font></td>
          </tr>
          <% end if %>
          <form action=prc_mng.asp method=post name=price<%=i%>>
            <tr > 
              <td  align=center  class=datalistgridb ><%=i%></td>
              <td  align=center  class=datalistgridb ><%=trim(rs("g_prd"))%></td>
              <td  align=center  class=datalistgridb ><a /href="javascript:showurl('/master/sysmng/pdt_mng/pdt_edt.asp?g_prd=<%=rs("g_prd")%>');"> 
                <% if trim(rs("g_err"))="" then
						  response.write "<font color=#293954>"&rs("g_nme")&"</font>"
						  else
						  response.write "<br>"&rs("g_nme")&"</b>"
						  end if %>
                </a><input type=hidden name="p_prd" value="<%=trim(rs("g_prd"))%>"> </td>
              <td  class=datalistgridb > 
                <div align="center"> 
                  <select name="p_cls">
                    <%
				query="select * from clslst order by c_cls"
				rs1.open query,conn,1,1
				while not rs1.eof
				response.write "<option value='"&rs1("c_cls")&"' "
				if cint(rs1("c_cls"))=cint(rs("c_cls")) then
				response.write " selected  style='background:#958471'  "
				else
                response.write "  style='background:#BBB0A4' "
				end if
				response.write " >"&trim(rs1("c_nme"))&"</option>"

				rs1.movenext
				wend
				rs1.close
				%>
                  </select>
                </div>
              </td>
              <td  class=datalistgridb > 

                <input type="text" name="p_yar"  size="6" value="<%=rs("p_yar")%>" style="background:#CFCAC2">
                <%call tmelst("p_tmetpe",rs("p_tmetpe"))%>
              </td>
              <td  class=datalistgridb align="center" > 
                <input type="text" name="p_prc"  size="10" value="<%=rs("p_prc")%>" style="background:#CFCAC2">
              </td>
              <td  align=center  class=datalistgridb > 
                <input type=submit name=okit value="修 改" class=btxx onclick="javascript:return confirmit();">
                <input type=hidden name=c_cls value="<%=c_cls%>" >
                <input type=hidden name=ptid value="<%=ptid%>" >
                <input type=hidden name=module value="prc_adv_edt" >
                <input type=hidden name=pid value="<%=rs("p_id")%>" >
                <input type=button name=okit2 value="删 除" class=btxx onclick="javascript:return tourl('prc_mng.asp?module=prc_adv_del&pid=<%=rs("p_id")%>&c_cls=<%=c_cls%>&ptid=<%=ptid%>');">
              </td>
            </tr>
            <%
						tpenme=trim(rs("pt_nme"))
  rs.movenext
  
i=i+1
  loop 
  %>
          </form>
          </tbody> 
        </table>
        <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td height=8></td>
          </tr>
        </table>
        <div align="center"><b><br>
          添加特殊定价</b><br>
          <br>
          <table border=0 cellpadding=0 
                        cellspacing=0 width="100%" bordercolordark="#FFFFFF" align="center" class=datalist>
            <tbody> 
            <tr> 
              <th width="6%" class=datalistheader height=20 > 序号 </th>
              <th width="10%" class=datalistheader > 编号 </th>
              <th width="18%" class=datalistheader > 产品名称 </th>
              <th width="15%" class=datalistheader > 价格等级</th>
              <th width="15%" class=datalistheader > 期限</th>
              <th width="15%" align="center" class=datalistheader >价格</th>
              <th  class=datalistheader > 操作 
              </th>
            </tr>
            <form action=prc_mng.asp method=post name=priceadd>
              <tr > 
                <td  align=center  class=datalistgridb ><%=i%></td>
                <td  align=center  class=datalistgridb >&nbsp; </td>
                <td  align=center  class=datalistgridb > 
                  <select name="p_prd">
                    <%
				query="select * from v_pdtlst order by pt_odr,pc_odr,g_odr"
				rs1.open query,conn,1,1
				while not rs1.eof
				response.write "<option value='"&rs1("g_prd")&"' "
                response.write "  style='background:"&rs1("pt_clr")&"' "
				response.write " >"&trim(rs1("g_nme"))&"</option>"

				rs1.movenext
				wend
				rs1.close
				%>
                  </select>
                </td>
                <td  class=datalistgridb > 
                  <div align="center"> 
                    <select name="p_cls">
                      <%
				query="select * from clslst order by c_cls"
				rs1.open query,conn,1,1
				while not rs1.eof
				response.write "<option value='"&rs1("c_cls")&"' "
				if cint(rs1("c_cls"))=cint(c_cls) then
				response.write " selected  style='background:#958471'  "
				else
                response.write "  style='background:#BBB0A4' "
				end if
				response.write " >"&trim(rs1("c_nme"))&"</option>"

				rs1.movenext
				wend
				rs1.close
				%>
                    </select>
                  </div>
                </td>
                <td  class=datalistgridb > 
                  <input type="text" name="p_yar"  size="6" style="background:#CFCAC2">
                  <%call tmelst("p_tmetpe",5)%>
                </td>
                <td  class=datalistgridb align="center" > 
                  <input type="text" name="p_prc"  size="10" style="background:#CFCAC2">
                </td>
                <td  align=center  class=datalistgridb > 
                      <input type=hidden name=module value="prc_adv_add">
                      <input type=hidden name=c_cls value="<%=c_cls%>">
                      <input type=hidden name=ptid value="<%=ptid%>">
            <input type=submit name=okit22 value="添 加" class=btxx onclick="javascript:return confirmit();">
                </td>
              </tr>
            </form>
            </tbody> 
          </table>
          <br>
        </div>
      </div>
    </td>
  </tr>
  </tbody> 
</table>
<!--#include virtual="/incs/bottom.asp"-->

