<%
dim rs5,sql5
set rs5 = createobject("adodb.recordset")
sql5 = "select count(*) from order_wedding o,cusreserve c,borrow_dressw p,product t where p.id like 'Dh%' and t.pro_id='01' and o.user_login=c.user_login and (p.date_start <='"& begin_date &"' and p.date_end >='"& begin_date &"' or p.date_start <='"& end_date &"' and p.date_end >='"& end_date &"') and t.id = p.id and o.sale_id=p.sale_id and p.status_id <> '05' order by p.sale_id "
rs5.Open sql5,conn,1,3
if not rs5.eof then
num5 = rs5(0)
end if
if num5 > 0 then
dim rs6,sql6
set rs6 = createobject("adodb.recordset")
sql6 = "select * from order_wedding o,cusreserve c,borrow_dressw p,product t where p.id like 'Dh%' and t.pro_id='01' and o.user_login=c.user_login and (p.date_start <='"& begin_date &"' and p.date_end >='"& begin_date &"' or p.date_start <='"& end_date &"' and p.date_end >='"& end_date &"') and t.id = p.id and o.sale_id=p.sale_id and p.status_id <> '05' order by p.sale_id "
rs6.Open sql6,conn,1,3
%>
<p align="center"><strong>รายการนำชุดไปใช้ในวันแต่งงาน</strong><br>
<br>
</p>
<div align="left">
<table width="732" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#FF9999">
<tr bordercolor="#FF0000" bgcolor="#FF9999">
<td width="62" ><div align="center">เลขที่ใบเสร็จ</div></td>
<td width="51"><div align="center">รหัสสินค้า</div></td>
<td width="135"><div align="center">ชื่อสินค้า</div></td>
<td width="113"><div align="center">ชื่อลูกค้า</div></td>
<td width="68"><div align="center">วันที่มารับชุด</div></td>
<td width="71"><div align="center">วันที่ส่งคืนชุด</div></td>
<td width="202"><div align="center">ที่อยู่ของลูกค้า</div></td>
</tr>
<%
do while not rs6.eof
session("sale_no") = rs6("sale_no")
session("id") = rs6("id")
user_fname = rs6("user_fname")
user_lname = rs6("user_lname")
%>
<tr align="center" bordercolor=#FF0000 bgcolor="<%=color%>">
<td height="22"> <div align="right"><%=rs6("sale_no")%></div></td>
<td> <div align="left"><%=rs6("id")%> </div></td>
<td> <div align="left"><%=rs6("description")%></div></td>
<td> <div align="left"><%=user_fname%> <%=user_lname%></div></td>
<td> <div align="left"><%=rs6("date_start")%></div></td>
<td> <div align="left"><%=rs6("date_end")%></div></td>
</tr>
<%
rs6.movenext
loop
%>
</table>