<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <!--#include file="conn.asp"--> <style type="text/css"> <!-- @import url("../SITE.CSS"); --> </style>
<% if Request("action") = "addhw" then call addhw() elseif request("action") = "savehw" then call savehw() elseif request("action") = "delhw" then call delhw() elseif request("action") = "edithw" then call edithw() elseif request("action") = "saveedithw" then call saveedithw() end if %> <%sub addhw()%> <br> <table width="95%" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center"> <form action="qiche.asp?action=savehw" method=POST name=addhw> <tr bgcolor="#CCCCCC"> <td colspan="6" align="center"><font color=blue><strong>发 货</strong></font></td> </tr> <tr bgcolor="#ffffff"> <td colspan="6" height="5"></td> </tr> <tr bgcolor=#eeeeee> <td colspan="6" align=right><div align="left"> 运输方式: <input name="yshfsh" type="text" id="yshfsh" value="汽车" readonly> </div></td> </tr> <tr bgcolor=#eeeeee> <td width="13%" align=right>托运日期:</td> <td colspan="2"><select name=fhyear id="fhyear"> <option value=""></option> <%for i=2000 to 2015%> <option value="<%=i%>" <%if cint(year(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 年 <select name=fhmonth id="fhmonth"> <option value=""></option> <%for i=1 to 12%> <option value="<%=i%>" <%if cint(month(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 月 <select name=fhday id="fhday"> <option value=""></option> <%for i=1 to 31%> <option value="<%=i%>" <%if cint(day(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 日</td> <td width="15%"><div align="right">计划到达日期:</div></td> <td colspan="2"><select name=jhyear id="jhyear"> <option value=""></option> <%for i=2000 to 2015%> <option value="<%=i%>" <%if cint(year(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 年 <select name=jhmonth id="jhmonth"> <option value=""></option> <%for i=1 to 12%> <option value="<%=i%>" <%if cint(month(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 月 <select name=jhday id="jhday"> <option value=""></option> <%for i=1 to 31%> <option value="<%=i%>" <%if cint(day(date()))=cint(i) then response.write "selected"%>> <%=i%></option> <%next%> </select> 日</td> </tr> <tr bgcolor=#eeeeee> <td rowspan="3" align=right>发货单位:</td> <td width="9%">名 称:</td> <td width="27%"><select name="fhname" size="1" onChange=bb(this.options[this.selectedIndex].value)> <option >请选择</option> <%set rs = server.CreateObject ("Adodb.recordset") sql = "select * from [fhdw] order by fhdwid desc" rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<option value=>请先添加来源</option>" else do while not rs.EOF%> <option value=<%=rs("fhdwid")%>><%=rs("fhname")%></option> <%rs.MoveNext loop end if rs.Close set rs=nothing%> </select> </td> <td rowspan="3"><div align="right">收货单位:</div></td> <td width="7%">名称:</td> <td width="29%"><input name="shhname" type="text" id="shhname"></td> </tr> <tr bgcolor=#eeeeee> <td>地 址:</td> <td><input name="fhaddr" type="text" id="fhaddr"></td> <td>地址:</td> <td><input name="shhaddr" type="text" id="shhaddr"></td> </tr> <tr bgcolor=#eeeeee> <td>电 话:</td> <td><input name="fhtel" type="text" id="fhtel"></td> <td>电话:</td> <td><input name="shhtel" type="text" id="shhtel"></td> </tr> <tr bgcolor=#eeeeee> <td rowspan="3" align=right>承运单位:</td> <td>名 称:</td> <td><input name="chyname" type="text" id="chyname"></td> <td rowspan="3"> </td> <td colspan="2" rowspan="3"> </td> </tr> <tr bgcolor=#eeeeee> <td>联系人:</td> <td><input name="chyperson" type="text" id="chyperson"></td> </tr> <tr bgcolor=#eeeeee> <td>电 话:</td> <td><input name="chytel" type="text" id="chytel"></td> </tr> <tr bgcolor="#ffffff"> <td colspan="6" height="5"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>车号:</td> <td colspan="2"><input name="qchno" type="text" id="qchno"></td> <td><div align="right">车型:</div></td> <td colspan="2"><input name="chx" type="text" id="chx"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>发货地点:</td> <td colspan="2"><input name="addr" type="text" id="addr"></td> <td><div align="right">到货地点:</div></td> <td colspan="2"><input name="dhaddr" type="text" id="dhaddr"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>司机姓名:</td> <td colspan="2"><input name="driver" type="text" id="driver"></td> <td><div align="right">身份证号:</div></td> <td colspan="2"><input name="shfnum" type="text" id="shfnum"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>联系电话:</td> <td colspan="2"><input name="tel" type="text" id="tel"></td> <td> </td> <td colspan="2"> </td> </tr> <tr bgcolor="#ffffff"> <td colspan="6" height="5"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>货物名称:</td> <td colspan="2"><input name="hwname" type="text" id="hwname"> </td> <td><div align="right">件数:</div></td> <td colspan="2"><input name="jsh" type="text" id="jsh"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>重量(吨):</td> <td colspan="2"><input name="weight" type="text" id="weight"></td> <td><div align="right">批号:</div></td> <td colspan="2"><input name="ph" type="text" id="ph"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>包型:</td> <td colspan="2"><input name="bx" type="text" id="bx"></td> <td><div align="right">质量标识:</div></td> <td colspan="2"><input name="zhlbzh" type="text" id="zhlbzh"></td> </tr> <tr bgcolor=#eeeeee> <td align=right>产地:</td> <td colspan="2"><input name="chd" type="text" id="chd"></td> <td><div align="right">加工单位:</div></td> <td colspan="2"><input name="jgdw" type="text" id="jgdw"></td> </tr> <tr bgcolor=#eeeeee> <td align=right> </td> <td colspan="2"> </td> <td> </td> <td colspan="2"> </td> </tr> <tr bgcolor=#eeeeee> <td align=right> </td> <td colspan="2"> </td> <td> </td> <td colspan="2"> </td> </tr> <tr bgcolor=#eeeeee> <td align=right>备 注:</td> <td colspan="5"><textarea name="other" cols="40" rows="5" id="other"></textarea></td> </tr> <tr bgcolor=#eeeeee> <td colspan="6"><div align="center"> <input type="submit" name="Submit" value="确定"> <input type="Reset" name="Reset" value="重填"> </div></td> </tr> </form> </table> <br> <%end sub%> <script language="JavaScript"> function bb(num){ dw = new Array(); //读数据库生成数组 <%set rs=server.CreateObject("adodb.recordset") sql = "select fhdwid,fhname,fhaddr,fhtel from [fhdw] order by fhdwid desc" rs.open sql,conn,1,1 do while not rs.eof%> dw[<%=rs("fhdwid")%>]= new Array("<%=rs("fhaddr")%>","<%=rs("fhtel")%>","<%=rs(0)%>"); <%rs.movenext loop rs.close%> addhw.fhaddr.value=dw[num][1]; addhw.fhtel.value=dw[num][1]; } </script> <script language="JavaScript"> <!-- function Dofromsite(addfromsite) { var fromsite = document.form1.addfromsite.value; document.form1.fromsite.value=fromsite; document.form1.fromsite.focus(); return; } //--> </script>
<!---保存添加的货物信息---> <%addhw sub savehw()%> <%if request("hwname")="" then%> <script language=javascript> alert( "错误:请输入货物名称!" ); location.href = "javascript:history.back()" </script> <%elseif request("jsh")="" then%> <script language=javascript> alert( "错误:请输入件数!" ); location.href = "javascript:history.back()" </script> <%elseif request("weight")="" then%> <script language=javascript> alert( "错误:请输入重量!" ); location.href = "javascript:history.back()" </script> <%elseif request("bx")="" then%> <script language=javascript> alert( "错误:请选择包型!" ); location.href = "javascript:history.back()" </script> <%elseif request("jgdw")="" then%> <script language=javascript> alert( "错误:请输入加工单位!" ); location.href = "javascript:history.back()" </script> <%else%> <%dim fhrq dim jhddrq fhrq=trim(Request.Form("fhyear"))&"-"&trim(Request.Form("fhmonth"))&"-"&trim(Request.Form("fhday")) jhddrq=trim(Request.Form("jhyear"))&"-"&trim(Request.Form("jhmonth"))&"-"&trim(Request.Form("jhday")) %> <% set rs = server.CreateObject ("adodb.recordset") sql = "select * from huowu" rs.Open sql,conn,1,3 rs.AddNew rs("yshfsh") = Request("yshfsh") rs("fhrq") = fhrq rs("jhddrq") = jhddrq rs("fhname") = Request("fhname") rs("fhaddr") = Request("fhaddr") rs("fhtel") = Request("fhtel") rs("shhname") = Request("shhname") rs("shhaddr") = Request("shhaddr") rs("shhtel") = Request("shhtel") rs("chyname") = Request("chyname") rs("chyperson") = Request("chyperson") rs("chytel") = Request("chytel") rs("qchno") = Request("qchno") rs("chx") = Request("chx") rs("fhdd") = Request("fhdd") rs("dhdd") = Request("dhdd") rs("driver") = Request("driver") rs("shfnum") = Request("shfnum") rs("tel") = Request("tel") rs("hwname") = Request("hwname") rs("jsh") = Request("jsh") rs("weight") = Request("weight") rs("ph") = Request("ph") rs("bx") = Request("bx") rs("zhlbzh") = Request("zhlbzh") rs("chd") = Request("chd") rs("jgdw") = Request("jgdw") rs("zhuangtai") = "2" rs("addtime") = now() rs.Update rs.Close set rs=nothing %> <%response.write "<p>" response.write "<div align=center><br><br><br><font color=red>信息添加成功</font><p><a href='javascript:history.go(-1)'>继续添加</a></div>" %> <%end if%> <%end sub%>