<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" %>
<%@ page import = "zr.zrpower.collectionengine.service.CollectionService" %>

<%@ page import="zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%
SessionUser user = (SessionUser) session.getAttribute("userinfo");
String mAID = request.getParameter("AID");
String mDOCID = request.getParameter("DOCID");
int iPageCount = 1;
CollectionService cs = new CollectionService();
iPageCount = cs.getPrintTempletCount(mAID);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>文档打印</title>
<link rel="stylesheet" href="print.css" type="text/css">
<script type='text/javascript' src="PrintFuncs.js"></script>
<script type='text/javascript' src='../../dwr/engine.js'></script>
<script type='text/javascript' src='../../dwr/util.js'></script>
<script type='text/javascript' src='../../dwr/interface/CollServiceBean.js'></script>
<style type="text/css">
<!--
body {
	background-color: #808080;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
@media print{
.noprint{display:none;}
.yesprint{display:block;}
}
-->
</style>
<script language="javascript">
function nomenu(){return false;}document.oncontextmenu=nomenu;
var WshShell = new ActiveXObject("WScript.Shell");
var iiPage = 1;

function remarkno()
{
    parent.PrintMain.doc.focus();
    window.print();
}

function kjprint()
{
       ZRPRINT=getZrprint();
       ZRPRINT.PRINT_INIT("文档打印");
       ZRPRINT.ADD_PRINT_URL(30,20,746,"95%",parent.PrintMain.doc.location);
       ZRPRINT.SET_PRINT_STYLEA(0,"HOrient",3);
       ZRPRINT.SET_PRINT_STYLEA(0,"VOrient",3);
       ZRPRINT.SET_SHOW_MODE("HIDE_PAPER_BOARD",1);

       ZRPRINT.PREVIEW();
}

function savecachetOnClose()
{
    parent.window.close();
}


function setdoc()
{
    parent.PrintMain.doc.document.webshell.ExecWB(8,1);
}
function SelectDoc(page){
   iiPage = page;
   parent.PrintMain.doc.location = "../../collengine.do?coll_mode=3&coll_AID=<%=mAID%>&coll_PKID=<%=mDOCID%>&coll_PAGE="+iiPage;
}

</script>
</head>
<body>
<input type="hidden" name="save" value="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table id="lssel" width="100%"  border="0" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF" class="borderon">
        <tr>
        <td width="5%"><table id=btnn width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr align="left">
        <td class="button" width="10"><img src="icon-bar.gif" width="10" height="26"></td>
        <td width="80" align="center" class="button" onClick="kjprint()"><img src="icon-print.gif" width="24" height="24" align="absmiddle">控件打印</td>
        <td width="80" align="center" class="button" onClick="remarkno()"><img src="icon-print.gif" width="24" height="24" align="absmiddle">网页打印</td>
        <td width="100" align="center" class="button" onClick="setdoc()"><img src="icon-setting.gif" width="24" height="24" align="absmiddle">网页打印设置</td>
        <td width="200" valign="top">&nbsp;&nbsp;总计 <span style="color:#FF0000"><%=iPageCount%></span>  页 当前<select name="sPage" id="sPage" onChange="SelectDoc(this.value)">
		  <%
		    for(int i=1;i<iPageCount+1;i++){
		  %>
		      <option value="<%=i%>">第<%=i%>页</option>
		  <%
			}
		  %>
          </select></td>
        <td>&nbsp;
        </td>
        <td class="button" width="60" onClick="savecachetOnClose();"><img src="icon-close.gif" width="24" height="24" align="absmiddle"> 关闭</td>
        </tr>
        </table></td>
        </tr>
        </table></td>
</tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
 parent.PrintMain.doc.location="../../collengine.do?coll_MODE=3&coll_AID=<%=mAID%>&coll_PKID=<%=mDOCID%>&coll_PAGE="+iiPage;
</script>
<%
//清空相关对象
user = null;
cs = null;
%>
