</div>
<%
'-------------------------------------------------------------
' 1.ประกาศตัวแปร
Dim CO_CODE, Customby
Dim rs, sql, aCustomer
'-------------------------------------------------------------
' 2.เก็บข้อมูลจากหน้า
CO_CODE = Trim(Request.QueryString("CO_CODE"))
If CO_CODE = "" Then
Response.Write "<br><br><center><font size=+2 color=red face=MS Sans Serif, Microsoft Sans Serif><b>ไม่พบข้อมูล กรุณาเลือกอีกครั้ง<br>"
Response.Write "<a href=# onClick='history.back()'>ย้อนกลับ</a>"
Response.End
End If
'-------------------------------------------------------------
' 3.ติดต่อฐานข้อมูลเพื่อดึงข้อมูล
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=SQLOLEDB; DATA SOURCE=192.168.1.1;INITIAL CATALOG=shipping_report; USER ID=sa; PASSWORD=sa"
sql = "select * from contact_new " & _
"where CO_CODE="& CO_CODE &""
Set rs = Conn.Execute(sql)
If rs.BOF Or rs.EOF Then
Response.Write "<br><br><center><font size=+2 color=red face=MS Sans Serif, Microsoft Sans Serif><b>ไม่พบข้อมูล กรุณาเลือกอีกครั้ง<br>"
Response.Write "<a href=# onClick='history.back()'>ย้อนกลับ</a>"
Response.End
End If
aCustomer = rs.GetRows()
rs.Close
%>
<table width="900" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#A4CBFB">
<tr>
<td><form name="tstest" action="" method="get"><table width="900" border="0" align="center" cellspacing="1" cellpadding="0">
<tr class="tablehead">
<td colspan="4" align="center" bgcolor="#A4CBFB" class="tablelink"><div align="left" class="style2"><font face="Microsoft Sans Serif, MS Sans Serif, sans-serif" class="text_black_Bold">:::: NEW CONTRACT::::</font><br>
</div></td>
</tr>
<tr>
<td width="17%" class="tabledetail"><div align="right"> <span class="text_black"><strong class="text_black">Contact Number </strong>:</span> </div></td>
<td width="33%" class="tabledetail1"> <font face="MS Sans Serif, Microsoft Sans Serif" size="-1"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<input name="Contract_No" type="text" class="style3" id="Contract_No" value="<%=aCustomer(1,0)%>" size="40" maxlength="100">
</font></font></td>
<td valign="top" class="tabledetail1">
<div align="right" class="text_black"><strong><br>
Contact Sight Date:
</strong></div></td>
<td width="35%" valign="top" class="tabledetail1"><input type="Text" name="dateP" value="<%=aCustomer(3,0)%>" size="8" maxlength="10"readonly>
<a href="#" onClick="showCal('Calendar1')">[ปฎิทิน]</a><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<br></td>
</tr>
<tr>
<td valign="top" class="tabledetail"><div align="right" class="text_black">
<strong> Contact Name: </strong>
</div></td>
<td class="tabledetail1"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<select name="Contract_Name">
<option value="">---เลือก Contract_Name---
<%
Dim rs2, sql2, Conn2
Set Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open "PROVIDER=SQLOLEDB; DATA SOURCE=192.168.1.1;INITIAL CATALOG=shipping_report; USER ID=sa; PASSWORD=sa"
sql2 = "select * from CUSTOMER order by CU_CODE"
Set rs2 = Conn2.Execute(sql2)
If Not rs2.EOF Then
Do While Not rs2.EOF
%>
<option value="<%=rs2(1)%>" <%=selected(rs2(1),aCustomer(4,0))%>><%=rs2(2)%>
<%
rs2.MoveNext
Loop
End If
rs2.Close
%>
</select>
<select name="ClearanceBy">
<option value="">---เลือก ClearanceBy---
<%
Dim rs7, sql7, Conn7
Set Conn7 = Server.CreateObject("ADODB.Connection")
Conn7.Open "PROVIDER=SQLOLEDB; DATA SOURCE=192.168.1.1;INITIAL CATALOG=shipping_report; USER ID=sa; PASSWORD=sa"
sql7 = "select * from ClearanceBy order by CU_NUM"
Set rs7 = Conn7.Execute(sql7)
If Not rs7.EOF Then
Do While Not rs7.EOF
%>
<option value="<%=rs7(1)%>" <%=selected(rs7(1),aCustomer(10,0))%>><%=rs7(2)%>
<%
rs7.MoveNext
Loop
End If
rs7.Close
%>
</select>
</span></td>
<td width="21%" bgcolor="#FFFFFF"><div align="right"><span class="tabledetail1"><strong> Transportation By : </strong></span></div></td>
<td width="35%" bgcolor="#FFFFFF"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<select name="TranBy">
<option value="">---เลือก TranBy---
<%
Dim rs5, sql5, Conn5
Set Conn5 = Server.CreateObject("ADODB.Connection")
Conn5.Open "PROVIDER=SQLOLEDB; DATA SOURCE=192.168.1.1;INITIAL CATALOG=shipping_report; USER ID=sa; PASSWORD=sa"
sql5 = "select * from TransportationBy order by CU_NUM"
Set rs5 = Conn5.Execute(sql5)
If Not rs5.EOF Then
Do While Not rs5.EOF
%>
<option value="<%=rs5(1)%>" <%=selected(rs5(1),aCustomer(11,0))%>><%=rs5(2)%>
<%
rs5.MoveNext
Loop
End If
rs5.Close
%>
</select>
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right">
<p><strong><br>
Guarantee Period :</strong></p>
<p><br>
<br>
</p>
</div></td>
<td colspan="3" bgcolor="#FFFFFF"><span class="tabledetail1"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<textarea name="textarea" cols="100" rows="3" id="textarea"><%=aCustomer(12,0)%><%=aCustomer(13,0)%></textarea>
</font></span></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" class="tabledetail"></td>
</tr>
<tr>
<td colspan="4"><div align="center"><span class="tablehead"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<input type="submit" name="action" value="Update" onClick="return confirm('Update ข้อมูล ' );" class="button">
<span class="tabledetail"><font face="MS Sans Serif, Microsoft Sans Serif" size="-1">
<input type="submit" name="action2" value="Cancel" onClick="return confirm('ยกเลิกการแก้ไข ');" class="button">
</font></span></font></span></div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>