1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
<% @language="JScript" %>
<%
Response.Buffer = true;
Response.ContentType = "text/html"
Response.Charset = "iso-8859-1"
var isRep = (Request.Cookies("status") == "OK")? true : false;
//this is for http print
if (!isRep) {
var _isrep = Request.Querystring("isRep");
if (_isrep == "true") { isRep = true; }
}
function getReferer()
{
return Request.ServerVariables("HTTP_REFERER")
}
function getFileName(str)
{
var rgx = /.*\/(.*)$/
return rgx.exec(str);
}
%>
<%
var arrPrintTags;
var strReferer = new String(Request.ServerVariables("HTTP_REFERER"));
var startpos;
var endpos;
try{
// var XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var XmlHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");
XmlHttp.open("GET", strReferer + "?print=" + Request.Form("print"), false );
XmlHttp.send();
/*var rgxPrintTag = /<print>[\w\W]*<\/print>/ig;*/
arrPrintTags = XmlHttp.responseText;
}
catch(e) {
arrPrintTags = null
}
finally {
XmlHttp = null;
}
%>
<html>
<head>
<title>- Print</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"; charset=iso-8859-1">
<script language="JavaScript">
function main()
{
window.focus();
openAllContents(); // If we have dynamic content, this will open everything.
if (window.print) window.print();
window.location.href = ('<%Response.Write(Request.ServerVariables("HTTP_REFERER"))%>')
}
window.onload=main;
</script>
<script language="JavaScript" type="text/JavaScript" src="/script/script.js"></script>
<script language="JavaScript" src="/script/DynamicContent.js"></script>
<LINK REL="stylesheet" TYPE="text/css" MEDIA="print" HREF="script/print.css">
<link href="/script/style.css" rel="stylesheet" type="text/css">
<!--[if IE]>
<link href="script/iedebug_cam.css" rel="stylesheet" type="text/css">
<LINK REL="stylesheet" TYPE="text/css" MEDIA="print" HREF="script/print.css">
<![endif]-->
<style type="text/css">
/*\*//*/
@import "/script/iedebug_cam.css";
/**/
</style>
</head>
<%
if (arrPrintTags != null)
{
/* for (var i = 0; i< arrPrintTags.length; i++)
{*/
startpos = 0;
while(startpos != -1)
{
startpos = arrPrintTags.indexOf('<!--<Print>-->');
endpos = arrPrintTags.indexOf('<!--</Print>-->');
if (startpos != -1)
{
Response.Write(arrPrintTags.substring(startpos + 14,endpos));
arrPrintTags = arrPrintTags.substring(endpos + 15);
}
}
/* }*/
}
%>
</html> |
Partager