<!--#include file="db.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<style type="text/css">
<!--

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #000000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
@media print {
.noprint {
display: none;
}
}
		/* 弹出窗口样式 */
.popup {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 2px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 9999;
	width:95%;
	text-align:center;
}

/* 关闭按钮样式 */
.close-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    cursor: pointer;
	width:100%;
	height:100%;
}
.STYLE3 {
	font-size: 12px;
	font-weight: bold;
}
    #backButton {
        display:ture;
        position: fixed;
        bottom: 20px;
        right: 20px;
        padding: 15px;
        background-color: #da3226;
        color: #fff;
        border: none;
        border-radius: 15px;
        cursor: pointer;
		font-size:18px;
}
    #PrintButton {
        display:ture;
        position: fixed;
        bottom: 100px;
        right: 20px;
        padding: 15px;
        background-color: #da3226;
        color: #fff;
        border: none;
        border-radius: 15px;
        cursor: pointer;
		font-size:18px;
}
-->
</style>
<%
conn.open Str
sql = "SELECT ticketarticulo.*, articulo.dibujoid " & _
      "FROM ticketarticulo " & _
      "INNER JOIN articulo ON ticketarticulo.ArticuloID = articulo.ArticuloID " & _
      "WHERE ticketarticulo.DocumentoNo = '" & request.QueryString("DocumentoNo") & "'"
set rs = conn.execute(sql)
 %>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"  style="table-layout:fixed;word-wrap:break-word;word-break:break-all"  id="element-to-print">
<tr>
    <td height="60" background="img/bg60.png">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="center"><span  style="font-size:12px"><strong>Albaran:<%= request.QueryString("DocumentoNo") %></strong></span></div></td>
          <td><div align="center"><span  style="font-size:12px"><strong><span class="STYLE3"><%= request.QueryString("FechaEntrada") %></span></strong></span></div></td>
          <td><div align="center"><span class="STYLE3">Total:<%= request.QueryString("Total") %></span></div></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>
		  <div align="center"><span  style="font-size:12px"><strong>
		   <%
sqlcobro = "select * from ticketcobro where documentono='"&request.QueryString("DocumentoNo")&"'"
set rscobro = conn.execute(sqlcobro)
while not rscobro.eof %> 
<%= rscobro("FormaDePago") %>:<%= formatnumber(rscobro("Importe"),2) %><br/> 
<%  rscobro.movenext
  wend
  rscobro.close
  set rscobro=nothing 
%>
</strong></span></div>
		  
		  
		  </td>
        </tr>
      </table>
</td>
</tr>
<tr>
    <td height="60" background="img/bg60.png">
    <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
     <%   
 while not rs.eof  
		%>
      <tr>
        <td width="60" height="60" rowspan="2">
		<a href="img.asp?dibujoid=<%= rs("dibujoid") %>" onclick="showPopup('img.asp?dibujoid=<%= rs("dibujoid") %>'); return false;">
    <img src="img.asp?dibujoid=<%= rs("dibujoid") %>" alt="Thumbnail" style="width:55px; height:55px;" border="0"></a>
			<div id="popup" class="popup">
    <span class="close-btn" onclick="hidePopup()"></span>
    <img id="popupImg" src="img.asp?dibujoid=<%= rs("dibujoid") %>" alt="Sin Photo" style="width:100%;"></div>

<script>
// 显示弹出窗口函数
function showPopup(imageUrl) {
    // 设置弹出窗口中的图片链接
    document.getElementById('popupImg').src = imageUrl;
    // 显示弹出窗口
    document.getElementById('popup').style.display = 'block';
}

// 隐藏弹出窗口函数
function hidePopup() {
    // 隐藏弹出窗口
    document.getElementById('popup').style.display = 'none';
}

// 点击弹出窗口以外的区域关闭弹出窗口
window.onclick = function(event) {
    var popup = document.getElementById('popup');
    if (event.target == popup) {
        hidePopup();
    }
}
</script></td>
        <td height="40" colspan="6"><div align="left"><span style="font-size: 14px"><%= rs("NombreES") %><%= rs("NombreCN") %></span></div></td>
      </tr>
      <tr>
        <td height="20"><span style="font-size: 14px"><%= rs("articuloid") %></span></td>
        <td width="50" height="20"><div align="center"><span style="font-size: 14px"><%= rs("Cantidad") %></span></div></td>
        <td width="50"><div align="center" style="font-size: 14px"><%= formatnumber(rs("Precio"),2,-1,-1,0) %></div></td>
        <td width="50" height="20"><div align="center" style="font-size: 14px"><% if rs("Descuento")<>"0" then response.Write("-"&rs("Descuento")&"%") end if %></div></td>
        <td width="50"><div align="center" style="font-size: 14px"><% if rs("Descuento")<>"0" then response.Write(formatnumber(formatnumber(rs("Precio"),2,-1,-1,0)*(1-formatnumber(rs("Descuento"),2,-1,-1,0)/100),2,-1,-1,0)) end if %></div></td>
        <td width="50" height="20"><div align="right" style="font-size: 14px"><%= formatnumber(formatnumber(rs("Cantidad"),2,-1,-1,0)*formatnumber(formatnumber(rs("Precio"),2,-1,-1,0)*(1-formatnumber(rs("Descuento"),2,-1,-1,0)/100),2,-1,-1,0),2)  %></div></td>
      </tr>
	  
	    <% 	
  rs.movenext
  wend
  rs.close
  conn.close
  set rs=nothing 
   %>
    </table></td>
  </tr>
	
    </table>

<div style="height:30px;" align="center"></a>
<p class="noprint">
<button id="PrintButton" onClick="javascript:window.print();"><img src="img/print.png" width="35px" height="35px" /></button>
<button id="backButton" onClick="goBack()">返回</button>
</p>
<script>
    window.onscroll = function() {
        scrollFunction();
    };

    function scrollFunction() {
        if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
            document.getElementById("backButton").style.display = "block";
        } else {
            document.getElementById("backButton").style.display = "block";
        }
    }

    function goBack() {
        window.history.back();
    }
</script>
</div>

</body>