<!--#include file="../../fy.Function.asp"-->
<!--#include file="../../../fy_inc/cls_pageview.asp"-->
 <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>订单系统管理-By fycms</title>
<link href="../../Images/style.css" rel="stylesheet" type="text/css">
  <link href="../../../fy_inc/js/time/skin/default.css" rel="stylesheet" type="text/css">
</head>
<body>
 <% 
	If Not fycms.fycms_QXYZ(0,"order","") Then   Call fycms.Alert("对不起，你没有操作权限！","") 
 	Dim ModeID,rs,rs1,iftrue:iftrue=false
 	ModeID = ChkNumeric(Request("ModeID"))
	if ModeID=0 or ModeID="" Then ModeID=1
 	if request("A")="Save" then 
 		set rs=fycms.actexe("select * from orderconfig_fy")
		if rs.eof then 
		conn.execute("insert Into orderconfig_fy(price,numbers,stocks,ModeID) values ("&ChkNumeric(Request("price"))&","&ChkNumeric(Request("numbers"))&","&ChkNumeric(Request("stocks"))&","&ChkNumeric(Request("ModeID"))&")")

 		else 
 	 	conn.execute("Update orderconfig_fy set price="&ChkNumeric(Request("price"))&" ,numbers="&ChkNumeric(Request("numbers"))&" ,stocks="&ChkNumeric(Request("stocks"))&" ,ModeID="&ChkNumeric(Request("ModeID"))&" ")
		end if 
	response.Redirect "?ModeID="&ModeID
	end if 
	
	
	
  %>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td  class="bg_tr"><strong>您现在的位置：系统中心 &gt;&gt; 插件管理 &gt;&gt;<a href="?">订单管理  </td>
  </tr>
  <tr>
    <td >
		<%
	Dim MX_Sys,ii
	MX_Sys=fycms.Act_MX_Sys_Arr()
	If IsArray(MX_Sys) Then
		For iI=0 To Ubound(MX_Sys,2)
		response.write "<a href=""?ModeID="&MX_Sys(0,Ii)&""">"&MX_Sys(1,Ii)&"系统</a> ┆" 
		Next
	End If
	%><strong><a href="?Action=add">订单</a>选项：</strong><strong><a href="?Action=add">新建订单</a></strong>
 	┆<strong><a href="?">查看订单</a></strong>
	该订单绑定的是<%= fycms.ACT_C(ModeID,1) %>模型
    
    
    </td>
    </tr>
</table>

 
    <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
      <form name="form1" method="post" action="?A=Save&ModeID=<%= ModeID %>"> <tr>
        <td width="265" align="center" class="bg_tr">订单名称</td>
        <td width="944" colspan="2" align="center" class="bg_tr">绑定字段</td>
      </tr>
      <tr >
        <td align="center"  >产品单价：</td>
        <td align="center"  >
        <select name="price" id="select"> <% 
	   Set Rs =fycms.ACTEXE("SELECT * FROM Table_fy Where fycms=1 and  ModeID=" & ModeID & " order by OrderID desc,ID Desc")
	 If Rs.EOF  Then
	 	Response.Write	"<option value=>没有字段</option>"
	 Else
		 %>  
          <% Do While Not Rs.EOF	
		  set rs1=fycms.actexe("select * from orderconfig_fy")
 		  if not rs1.eof then 
		  iftrue=true %> 
           <option value="<%= Rs("id") %>"  
             <% if rs("id")=rs1("price") then response.Write " selected=""selected""" %>
             
             ><%= Rs("title") %></option>	  
              <% 
			  else
			  
			   %>
          <option value="<%= Rs("id") %>"   ><%= Rs("title") %></option>	
			<% end if   
			 %>   
		<%	  
			  Rs.movenext
		Loop
	End if	
 	if iftrue=false then response.Write "<option value=0  selected=""selected"">没有绑定字段</option>"
    iftrue=false%>    </select>        </td>
      </tr>
      <tr >
        <td align="center"  >订购数量：</td>
        <td align="center"  >   <select name="numbers" id="select"> <% 
	   Set Rs =fycms.ACTEXE("SELECT * FROM Table_fy Where fycms=1 and  ModeID=" & ModeID & " order by OrderID desc,ID Desc")
	 If Rs.EOF  Then
	 	Response.Write	"<option value=>没有字段</option>"
	 Else
		 %>  
          <% Do While Not Rs.EOF	
		   set rs1=fycms.actexe("select * from orderconfig_fy")
 		  if not rs1.eof then 
		  iftrue=true %> 
           <option value="<%= Rs("id") %>"  
             <% if rs("id")=rs1("numbers") then response.Write " selected=""selected""" %>
             
             ><%= Rs("title") %></option>	  
              <% 
			  else
			  
			   %>
          <option value="<%= Rs("id") %>"   ><%= Rs("title") %></option>	
			<% end if   
			 
			  Rs.movenext
		Loop
	End if	
 	if iftrue=false then response.Write "<option value=0  selected=""selected"">没有绑定字段</option>"
    iftrue=false%>    </select></td>
      </tr>
      <tr >
        <td align="center"  >产品库存：</td>
        <td align="center"  ><select name="stocks" id="select"> <% 
	   Set Rs =fycms.ACTEXE("SELECT * FROM Table_fy Where fycms=1 and  ModeID=" & ModeID & " order by OrderID desc,ID Desc")
	 If Rs.EOF  Then
	 	Response.Write	"<option value=>没有字段</option>"
	 Else
		 %>  
          <% Do While Not Rs.EOF	
		  set rs1=fycms.actexe("select * from orderconfig_fy")
 		  if not rs1.eof then 
		  iftrue=true %> 
           <option value="<%= Rs("id") %>"  
             <% if rs("id")=rs1("stocks") then response.Write " selected=""selected""" %>
             
             ><%= Rs("title") %></option>	  
              <% 
			  else
			  
			   %>
          <option value="<%= Rs("id") %>"   ><%= Rs("title") %></option>	
			<% end if   
			   
			  Rs.movenext
		Loop
	End if	
 	if iftrue=false then response.Write "<option value=0  selected=""selected"">没有绑定字段</option>"
    iftrue=false%>    </select></td>
      </tr>
      <tr >
        <td height="25" colspan="3" align="center" >
        <input type=button onclick=CheckForm() class="btn btn_primary"  name=Submit1 value="  保存  " />
      &nbsp;&nbsp; <input type="reset" class="btn btn_primary" name="Submit2" value="  重置  ">      </td>
      </tr>
    </form> </table>
   
<p>
  <script language="javascript">
 //CSS背景控制
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg1"
		Obj.bgColor="";
	}
	
}
function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg";
		Obj.bgColor="";
	}
}
</script>
  
<script language="javascript">
 	
function CheckForm()
{ var form=document.form1;
	 if (form.title.value=='')
		{ alert("请输入订单名称!");   
		  form.title.focus();    
		   return false;
		} 
	 
		form.Submit1.value="正在提交数据,请稍等...";
		form.Submit1.disabled=true;
		form.Submit2.disabled=true;		
	    form.submit();
        return true;
	}</script> 

</body>
</html>

