<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.common.util.DateWork" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.flowengine.mode.monitor.FLOW_RUNTIME_ENTRUSTLOG"%>
<%@ page import="zr.zrpower.entity.sys.BPIP_USER"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.ejb.sys.UserService"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowMonitor"%>
<%@page import="java.util.*"%>



<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
FLOW_RUNTIME_ENTRUSTLOG[] Daily = null;
BPIP_USER[] puser1 = null;
FlowMonitor fm = new FlowMonitor();

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
 <!--WEB组件样式和js-->
<link rel="stylesheet" type="text/css" media="all" href="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-blue.css" >
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/gt_grid.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/vista/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/pink/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/mac/skinstyle.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_msg_en.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_const.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_grid_all.js"></script>
<!--WEB组件样式和js结束-->
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/html5/css/style_tables.css">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/layer/layer.js"></SCRIPT>

</HEAD>
<BODY class="BodyMain">
<%
 String currentPage = request.getParameter("page");
  if(currentPage == null)
  {currentPage = "1";}

  String sqlStr = "";

  //得到查询的记录集
  String strID = request.getParameter("SelectedItems");
  Daily = fm.DailyList(Integer.parseInt(currentPage),200);

   //枚举值1
    Hashtable Hashtable=new Hashtable();
     Hashtable.put("1","重分配权限");
     Hashtable.put("2","个人委托");
     Hashtable.put("3","移交");
     Hashtable.put("4","权限委托");
     String strshow_data="";
     if (Daily!=null && Daily.length>0){

        strshow_data = strshow_data + "[";
        for(int i=0;i<Daily.length;i++){

            strshow_data = strshow_data + "[";

            strshow_data = strshow_data + "\""+Daily[i].getID()+"\",";
            strshow_data = strshow_data + "\""+Daily[i].getSUSERNO()+"\",";
            strshow_data = strshow_data + "\""+Daily[i].getIUSERNO()+"\",";
            strshow_data = strshow_data + "\""+Daily[i].getSDATE()+"\",";
              strshow_data = strshow_data + "\""+Daily[i].getEDATE()+"\",";
                strshow_data = strshow_data + "\""+Hashtable.get(Daily[i].getTYPE())+"\",";
                  strshow_data = strshow_data + "\""+Daily[i].getFLOWNAME()+"\",";
                    strshow_data = strshow_data + "\""+Daily[i].getFLOWID()+"\",";
                     strshow_data = strshow_data + "\""+Daily[i].getFLOWNODE()+"\",";

               if (i <Daily.length-1 )
         {
            strshow_data = strshow_data + "\""+Daily[i].getLOGDATE()+"\"],\r\n";
         }else
         {
            strshow_data = strshow_data + "\""+Daily[i].getLOGDATE()+"\"]";
         }

        }

        strshow_data = strshow_data + "]";
    }else
    {
        strshow_data = "null";
    }
%>
<script type="text/javascript" >
var css = "<%=user.getUserCSS()%>";
var skincss = "vista";

if (css=="Blue.css")
{skincss = "vista";}
if (css=="Public.css")
{skincss = "default";}
if (css=="Window.css" || css=="nBlue.css")
{skincss = "mac";}
if (css=="Yellow.css")
{skincss = "pink";}


var grid_demo_id = "myGrid1" ;
var show_data= <%=strshow_data%>;

var dsOption= {

	fields :[
		{name : 'ID'  },
		{name : 'SUSERNO'  },
		{name : 'IUSERNO'  },
		{name : 'SDATE' },
        {name : 'EDATE'  },
         {name : 'TYPE'  },
          {name : 'FLOWNAME'  },
           {name : 'FLOWID'  },
            {name : 'FLOWNODE'  },
             {name : 'LOGDATE'  }
	],

	recordType : 'array',
	data : show_data
}



var colsOption = [

           {id: 'ID' , header: "<center>流程运转编号</center>" , width :100 , align : 'left'  },
           {id: 'SUSERNO' , header: "<center>委托人</center>" , width :100,  align : 'center'  },
	   {id: 'IUSERNO' , header: "<center>受委托人</center>" , width :100 ,align : 'center'  },
	   {id: 'SDATE' , header: "<center>委托开始时间</center>" , width :100 , align : 'center' },
           {id: 'EDATE' , header: "<center>委托结束时间</center>" , width :100 , align : 'center' },
           {id: 'TYPE' , header: "<center>委托类型</center>" , width :100, align : 'center' },
           {id: 'FLOWNAME' , header: "<center>委托流程名称</center>" , width :100 , align : 'center' },
           {id: 'FLOWID' , header: "<center>委托流程编号</center>" , width :100, align : 'center' },
           {id: 'FLOWNODE' , header: "<center>委托流程步骤</center>" , width :100 , align : 'center' },
           {id: 'LOGDATE' , header: "<center>日志日期</center>" , width :100 , align : 'center' }
];


var gridOption={
	id : grid_demo_id,
	width: "99%",
	height: "92%",
	container : 'gridbox',
	replaceContainer : true,
	dataset : dsOption ,
	columns : colsOption,
	pageSize : 2000,
	toolbarContent : null,
        skin : skincss,

        onCellDblClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
          DeleteDaily1();
           DeleteDaily2();
        },

       showIndexColumn : true
};

<%if(!user.getUserWINDOWTYPE().equals("6")){%>
var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad( Sigma.Grid.render(mygrid));
<%}%>
</script>
<form name="recordfrm" action="DailyList.jsp">
<input type="hidden" name="Seat" value="<%=strID%>" >
<input type="hidden" name="page">

<%if(user.getUserWINDOWTYPE().equals("6")){ %>

<TABLE height='31' cellSpacing='0' cellPadding='0' border='0'>
 <TR>
<%=userUI.ClickButton("删除全部日志","JavaScript:DeleteDaily1();","IcoAdd.gif",user.getUserImage())%>
<%=userUI.ClickButton("删除选中日志","JavaScript:DeleteDaily2();","IcoEdit.gif",user.getUserImage())%>
  </tr></table>



  <div id="mianRole" style="height: 90%;overflow: auto;">
  <table class="bordered" id="html5_table">

<thead>
<tr>
<th style="width:10%;">流程运转编号</th>
<th style="width:10%;">委托人</th>
<th style="width:10%;">受委托人</th>
<th style="width:10%;">委托开始时间</th>
<th style="width:10%;">委托结束时间</th>
<th style="width:10%;">委托类型</th>
<th style="width:10%;">委托流程名称</th>
<th style="width:10%;">委托流程编号</th>
<th style="width:10%;">委托流程步骤</th>
<th style="width:10%;">日志日期</th>
</tr>
</thead>

<%
 if (Daily!=null && Daily.length>0){
        for(int i=0;i<Daily.length;i++){

%>
        <tr onclick="click_color(this,'<%=Daily[i].getID()%>');">
        <td style="text-align:center;"><%=Daily[i].getID()%></td>
        <td style="text-align:center;"><%=Daily[i].getSUSERNO()%></td>
        <td style="text-align:center;"><%=Daily[i].getIUSERNO()%></td>
        <td style="text-align:center;"><%=Daily[i].getSDATE()%></td>
        <td style="text-align:center;"><%=Daily[i].getEDATE()%></td>
        <td style="text-align:center;"><%=Hashtable.get(Daily[i].getTYPE())%></td>
        <td style="text-align:center;"><%=Daily[i].getFLOWNAME()%></td>
        <td style="text-align:center;"><%=Daily[i].getFLOWID()%></td>
        <td style="text-align:center;"><%=Daily[i].getFLOWNODE()%></td>
        <td style="text-align:center;"><%=Daily[i].getLOGDATE()%></td>

        </tr>

<%
        }
 }
%>

</table>
<br>
</div>

<%}else{%>




<%=userUI.ShowHeadHtml("流程操作日志",user.getUserImage())%>
<%=userUI.ShowTitleHtml("","","",user.getUserImage())%>

<%=userUI.ClickButton("删除全部日志","JavaScript:DeleteDaily1();","IcoAdd.gif",user.getUserImage())%>
<%=userUI.ClickButton("删除选中日志","JavaScript:DeleteDaily2();","IcoEdit.gif",user.getUserImage())%>
<%=userUI.ShowTitleEndHtml()%>
<%=userUI.ShowBodyStartHtml()%>

<div id="gridbox" style="border:0px solid #cccccc;background-color:#f3f3f3;padding:5px;height:600px;width:800px;" ></div>
<%=userUI.ShowFootHtml()%>

<%}%>

</form>
</BODY>
<script language="JavaScript" type="text/JavaScript">
<!--
var allvalue="";
function clickValue(value){
    allvalue=value;
}
function DeleteDaily1(){
     if (confirm('是否真的要删除全部日志？')){
        location.href="DelDaily.jsp?isdel=no";
         }
    else{
        }
 }
function DeleteDaily2(){
   <%if(user.getUserWINDOWTYPE().equals("6")){ %>
     var strID = allvalue;

   <%}else{%>
     var allvalue = mygrid.getSelectedRecords()+",0";
     var strID = allvalue.split(",")[0];
   <%}%>
    if (strID==null||strID=="")
    {
      <%if(user.getUserWINDOWTYPE().equals("6")){ %>
         layer.alert('请先选择要删除的记录!', {icon: 7});
      <%}else{%>
         alert("请先选择要删除的记录!");
      <%}%>
    }else
    {location.href="DelDaily.jsp?SelectedItems="+strID+"&Seat=<%=strID%>&isdel=yes";}
}
//-->
</script>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
Daily = null;
puser1 = null;
fm = null;
%>
