<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*,java.text.*,java.util.*,java.sql.*,DBstep.iDBManager2000.*" %>
<%@ page import="net.sz600.organize.SzUserHelp" %>
<%@ include file="/sessionInfo.jsp"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<script language="javascript">
function ConfirmDel(FileUrl){
	if (confirm('是否确定删除该印签！')){
		location.href=FileUrl;
	}
}
</script>
</head>
<%
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sql = "select SignatureID,UserName,MarkName,MarkType,MarkSize from Signature where GSID=" + szCOMPANY_SESSION;
    if (sType.equals("1")) {
    	//个人印章
    	sql += " AND UserName = '" + iDLID_SESSION + "' ";
    } else  {
    	//不是管理员,不能查看
    	if (!isBarManager_SESSION){
    		sql += " AND 1<>1 ";
    	} else {
    		sql += " AND UserName = ''";
    	}
    }
    sql += " order by SignatureID desc";
%>
<body bgcolor="#ffffff">
<% if (!sType.equals("1")) {%>
<%@ include file="/share/title.jsp"%>
<% } else { %>
<%@ include file="/share/title.jsp"%>
<% } %>
<table width="100%">
  <form name="formBar" method="post">
  <tr>
    <td>
    <% out.println(SzPageHelp.button("增加签章","javascript:location.href='SignatureAddFrm.jsp?type=" + sType + "'")); %>    
    </td>
  </tr>
  </form>
</table>
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">
  <tr class="trClassTitle">
    <td>编号</td>   
    <td>用户名称</td>
    <td>签章名称</td>
    <td>签章类型</td>
    <td>签章大小</td>
    <td width="40">操作</td>
  </tr>
	<%
          DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();
	      String mSignatureID = "";
	      String sName = "";
	      String sId = "";
           if (DbaObj.OpenConnection())
           {
             try
             {
               ResultSet result=DbaObj.ExecuteQuery(sql) ;
               while ( result.next() )
               {
                mSignatureID=result.getString("SignatureID");
                sId = result.getString("UserName");
                sName = "";
                if (!sId.equals("") && !sId.equals("0")) {
                	sName = SzUserHelp.getLoginName(sId);              	
                }
        %>
	<tr>
		<td class="TDStyle"><%=mSignatureID%>&nbsp;</td>
		<td class="TDStyle"><%=sName%>&nbsp;</td>
		<td class="TDStyle"><%=result.getString("MarkName")%>&nbsp;</td>
		<td class="TDStyle"><%=result.getString("MarkType")%>&nbsp;</td>
		<td class="TDStyle"><%=result.getString("MarkSize")%>&nbsp;</td>
		<td class="TDStyle" width=148 nowrap>
		  <%=SzPageHelp.button("修改","javascript:location.href='SignatureEditFrm.jsp?type=" + sType + "&SignatureID=" + mSignatureID + "';") %>
		  <%=SzPageHelp.button("删除","javascript:ConfirmDel('SignatureDel.jsp?type=" + sType + "&SignatureID=" + mSignatureID + "');") %>
		</td>
	</tr>
	<%
              }
          result.close() ;
             }
             catch(Exception e)
             {
               System.out.println(e.toString());
             }
             DbaObj.CloseConnection() ;
           }
           else
           {
             out.println("OpenDatabase Error") ;
           }

        %>
</table>
</body>
</html>
