การแสดงข้อมูลส่งต่ออีกหน้าครับ....ผมจะส่งค่าไปแสดงอีกหน้าครับโดยที่ดึงค่าใน database มาแสดงก่อนตามรูปครับ
เอา Code หน้า Design ของคุณมาดูหน่อยครับ
Date :
2012-01-27 09:05:39
By :
webmaster
หน้าที่แสดงข้อมูลนะครับ
Code (ASP)
<table width="615" border="1" cellpadding="0" cellspacing="0">
<tr bgcolor="#666666">
<td width="166" height="41"><div align="center" class="style17"><span class="style13">Customer</span></div></td>
<td width="91"><div align="center"><strong><span class="style14">Docnum</span></strong></div></td>
<td width="86"><div align="center"><strong><span class="style15">Post Date</span></strong></div></td>
<td width="262"><div align="center"><strong><span class="style16">Balance Due</span></strong></div></td>
</tr>
</table>
<%
dim chkVol
For Each chkVol in Request.Form("doc")
strSQL = " select distinct o.docnum,o.cardname,o.docdate,o.doctotal,r.objtype,r.address from oinv o inner join inv1 i on o.docentry=i.docentry inner join ocrd r on o.cardcode=r.cardcode "
strSQL = strSQL & " where o.docstatus='o' and o.docnum= '"&chkVol&"' "
''response.Write(strSQL)
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
%>
</p>
<table width="615" border="1" cellpadding="0" cellspacing="0">
<%
While Not objRec.EOF
if codeline<>objRec.Fields(2).Value then
codeline = objRec.Fields(2).Value
%>
<tr onMouseOver="show(this)" onMouseOut="move(this)" class="even">
<td width="191"><%=objRec.Fields(1).Value%></td>
<td width="100"><div align="center"><%=objRec.Fields(0).Value%></div></td>
<td width="88"><div align="center"><%=objRec.Fields(2).Value%></div></td>
<td width="294">
<div align="right"><font color="#CC3300">
</font> <%
response.write(formatnumber(objRec.Fields(3).Value))
pvsum=cdbl(pvsum)+cdbl(objRec.Fields(3).Value)
%></div></td>
</tr>
<%
else
%>
<%
End if
objRec.MoveNext
Wend
%>
</table>
<div align="center">
<%
Next
%>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
Date :
2012-01-27 09:07:58
By :
e_tawee
คุณไปออกแบบพวก textbox และใส่ checkbox ก่อนครับ แล้วค่อยเอามาให้ดูครับ
Date :
2012-01-27 09:10:58
By :
webmaster
นี้ code ของหน้านี้ครับ
Code (ASP)
<form action="show_incoming.asp" method="post" name="form" target="_blank">
<table width="658" border="1" cellpadding="0" cellspacing="0">
<tr bgcolor="#666666">
<th width="21"> </th>
<th width="165"><span class="style9">Customer</span></th>
<th width="87" height="47"><span class="style9">Docnum</span></th>
<th width="95"><span class="style9">Post Date</span></th>
<th width="132"><span class="style9">Balance Due</span></th>
<th width="144"><span class="style9">Paid</span></th>
</tr>
<%
While Not objRec.EOF
if codeline<>objRec.Fields(2).Value then
codeline = objRec.Fields(2).Value
%>
<tr onMouseOver="show(this)" onMouseOut="move(this)" class="even">
<td>
<label>
<input type="checkbox" name="doc" id="checkbox" value="<%=objRec.Fields(0).Value%>">
</label> </td>
<td><%=objRec.Fields(1).Value%></td>
<td><div align="center"><%=objRec.Fields(0).Value%></div></td>
<td><div align="center"><%=objRec.Fields(2).Value%></div></td>
<td>
<div align="right"><font color="#CC3300">
</font> <%
response.write(formatnumber(objRec.Fields(3).Value))
dim tr,tr1,tr2
tr=objRec.Fields(1).Value
tr1=objRec.Fields(5).Value
tr2=objRec.Fields(0).Value
%></div></td>
<td><label>
<input name="paid" type="text" id="textfield" maxlength="20" value="<%=objRec.Fields(3).Value%>">
</label></td>
</tr>
<%
dim pvsum
pvsum=cdbl(pvsum)+cdbl(objRec.Fields(3).Value)
else
End if
objRec.MoveNext
Wend
%>
</table>
<div align="center"><table width="372" border="0">
<tr>
<th width="366" scope="col">
<div align="right">
<table width="323" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="152" height="35" scope="col"><div align="right">Total BalanceDue :: </div></th>
<th width="109" scope="col"><div align="right">
<font color="#FF0000">
<%
response.write(formatnumber(pvsum))
%>
</font></div></th>
</tr>
</table></div></th>
</tr>
</table></div>
<table width="522" border="0" cellpadding="0" cellspacing="0">
<td width="350"><div align="right">
<input name="customer" type="hidden" value="<%response.Write(tr)%>">
<input name="address" type="hidden" value="<%response.Write(tr1)%>">
<input name="docnum" type="hidden" value="<%response.Write(tr2)%>">
<input type="submit" value=" Show ">
</div></td>
</table>
</form>
Date :
2012-01-27 09:17:10
By :
e_tawee
Code (ASP)
<form action="show_incoming.asp" method="post" name="form" target="_blank">
<table width="658" border="1" cellpadding="0" cellspacing="0">
<tr bgcolor="#666666">
<th width="21"> </th>
<th width="165"><span class="style9">Customer</span></th>
<th width="87" height="47"><span class="style9">Docnum</span></th>
<th width="95"><span class="style9">Post Date</span></th>
<th width="132"><span class="style9">Balance Due</span></th>
<th width="144"><span class="style9">Paid</span></th>
</tr>
<%
Dim i
i = 0
While Not objRec.EOF
if codeline<>objRec.Fields(2).Value then
codeline = objRec.Fields(2).Value
i = 1 + 1
%>
<tr onMouseOver="show(this)" onMouseOut="move(this)" class="even">
<td>
<label>
<input type="checkbox" name="doc<%=i%>" id="doc<%=i%>" value="<%=objRec.Fields(0).Value%>">
</label> </td>
<td><%=objRec.Fields(1).Value%></td>
<td><div align="center"><%=objRec.Fields(0).Value%></div></td>
<td><div align="center"><%=objRec.Fields(2).Value%></div></td>
<td>
<div align="right"><font color="#CC3300">
</font> <%
response.write(formatnumber(objRec.Fields(3).Value))
dim tr,tr1,tr2
tr=objRec.Fields(1).Value
tr1=objRec.Fields(5).Value
tr2=objRec.Fields(0).Value
%></div></td>
<td><label>
<input name="paid<%=i%>" type="text" id="paid<%=i%>" maxlength="20" value="<%=objRec.Fields(3).Value%>">
</label></td>
</tr>
<%
dim pvsum
pvsum=cdbl(pvsum)+cdbl(objRec.Fields(3).Value)
else
End if
objRec.MoveNext
Wend
%>
<input type="hidden" name="line" value="<%=i%>">
</table>
<div align="center"><table width="372" border="0">
<tr>
<th width="366" scope="col">
<div align="right">
<table width="323" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="152" height="35" scope="col"><div align="right">Total BalanceDue :: </div></th>
<th width="109" scope="col"><div align="right">
<font color="#FF0000">
<%
response.write(formatnumber(pvsum))
%>
</font></div></th>
</tr>
</table></div></th>
</tr>
</table></div>
<table width="522" border="0" cellpadding="0" cellspacing="0">
<td width="350"><div align="right">
<input name="customer" type="hidden" value="<%response.Write(tr)%>">
<input name="address" type="hidden" value="<%response.Write(tr1)%>">
<input name="docnum" type="hidden" value="<%response.Write(tr2)%>">
<input type="submit" value=" Show ">
</div></td>
</table>
</form>
Code (show_incoming.asp)
<%
Dim i
For i = 1 To Cint(Request.Form("line"))
IF Request.Form("doc" & i ) <> "" Then
Response.write Request.Form("paid" & i ) & "<br>"
End IF
Next
%>
ผมเขียนสด ลองดู Syntax ด้วยครับ เผื่อจะผิด
Date :
2012-01-27 09:27:11
By :
webmaster
ไม่เห็ฯมีไรเลยครับไม่ออกมาสักตัวเลยครับ
Date :
2012-01-27 15:41:02
By :
e_tawee
Load balance : Server 04