<%@ 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_PROCESS"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.flowengine.service.FlowMonitor"%>



<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
FLOW_RUNTIME_PROCESS[] flow = null;
FlowMonitor fm = new FlowMonitor();
SysPreperty syspr = new SysPreperty();
String DataBaseType = syspr.getProperty().DataBaseType;//数据库类型
%>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="author" content="FamousThemes" />
<meta name="description" content="Get in the spotlight" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>

<script LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"/>
<script LANGUAGE="JavaScript" src="../../DatePicker/WdatePicker.js"/>
<!--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>
<link rel="stylesheet" type="text/css" href="../../ZrPhoneEngine/css/style.css" media="screen" />
<script type="text/javascript" src="../../ZrPhoneEngine/js/jquery.min.js"></script>
<script type="text/javascript">
var $ = jQuery.noConflict();
	$(function() {
		$('#activator').click(function(){
				$('#box').animate({'top':'65px'},500);
		});
		$('#boxclose').click(function(){
				$('#box').animate({'top':'-400px'},500);
		});
		$('#activator_share').click(function(){
				$('#box_share').animate({'top':'65px'},500);
		});
		$('#boxclose_share').click(function(){
				$('#box_share').animate({'top':'-400px'},500);
		});

	});
	$(document).ready(function(){
	$(".toggle_container").hide(); 
	$(".trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false;
	});
	
	});
</script>
<!-- Hide Mobiles Browser Navigation Bar -->
<script type="text/javascript">
	window.addEventListener("load",function() {
	// Set a timeout...
	setTimeout(function(){
	// Hide the address bar!
	window.scrollTo(0, 1);
	}, 0);
	});
</script>
</head>



 <%
     String currentPage = request.getParameter("page");
  if(currentPage == null)
  {currentPage = "1";}


  String FCODE = request.getParameter("FCODE");
  if(FCODE == null)
  {FCODE = "";}

  String FDATE1 = request.getParameter("FDATE1");
  if(FDATE1 == null)
  {FDATE1 = "";}

  String FDATE2 = request.getParameter("FDATE2");
  if(FDATE2 == null)
  {FDATE2 = "";}

  String strw1 = " 1=1 ";
  String strw2 = " 1=1 ";


  if (FDATE1.length()>0 && FDATE2.length()>0)
  {
     if (DataBaseType.equals("1") || DataBaseType.equals("3"))
     {
        strw1 = strw1 +" and CREATEDATE >= to_date('"+FDATE1+" 00:00:00','yyyy-mm-dd  hh24:mi:ss') AND CREATEDATE <= to_date('"+FDATE2+" 23:59:59','yyyy-mm-dd  hh24:mi:ss')";
        strw2 = strw2 +" and B.CREATEDATE >= to_date('"+FDATE1+" 00:00:00','yyyy-mm-dd  hh24:mi:ss') AND B.CREATEDATE <= to_date('"+FDATE2+" 23:59:59','yyyy-mm-dd  hh24:mi:ss')";
     }
     if (DataBaseType.equals("2"))
     {
        strw1 = strw1 +" and CREATEDATE >= '"+FDATE1+" 00:00:00' AND CREATEDATE <= '"+FDATE2+" 23:59:59'";
        strw2 = strw2 +" and B.CREATEDATE >= '"+FDATE1+" 00:00:00' AND B.CREATEDATE <= '"+FDATE2+" 23:59:59'";
     }
  }





  String sqlStr = "",sqlCount = "";
  sqlCount = "Select  count(*) as RCount From FLOW_RUNTIME_PROCESS where STATE<>'2' and STATE<>'3' and STATE<>'4' and ACCEPTPSN like '%" + user.getUserID() + "%' and "+strw1;
    //得到查询的记录集
     flow = fm.GetFlowTransactList2(user.getUserID(),Integer.parseInt(currentPage),20,strw2);
     


%>


<body>
<div  id="main_container" class="divForm" align="center" style="width: 100%;height: 100%">
<form name="recordfrm" action="List.jsp">
<input type="hidden" name="page"/>
<div class="header">
    <a href="javaScript:history.go(-1);" class="left_bt">返回</a>
    <!--  
    <a href="List.jsp" class="left_bt">处理流程</a>
   
    
    <a href="#" onclick="JavaScript:edit2();" class="left_bt">委托办理</a>
    <a href="#" onclick="JavaScript:edit3();" class="left_bt">移交办理</a>
   
-->
    <a href="#" class="right_bt" id="activator"><img src="../css/images/search.png" alt="" title="" border="0" /></a>
      
    </div>
    
    
<div class="box" id="box">
        	<div class="box_content">
            	<div class="box_content_tab">搜索</div>
                
                <div class="box_content_center">
                <div class="form_content">
                <form name="recordfrm" action="List.jsp">
创建日期:&nbsp;&nbsp;从<input type="text" class="form_input_box" name="FDATE1" value="<%=FDATE1%>" >
   
   &nbsp;&nbsp;到<input type="text" class="form_input_box" name="FDATE2" value="<%=FDATE2%>" >
   
                <a class="boxclose" id="boxclose">关闭</a>
                <input type="button" onClick="JavaScript:recordfrm.page.value='1';recordfrm.submit();" class="form_submit" value="提交" />
                </form>
                </div> 
                
              <div class="clear"></div>
                </div>
            
           </div>
        </div>
    
<div class="content">
   <%if (flow!=null && flow.length>0){
         for(int i=0;i<flow.length;i++){%>
          <div class="corner_wrap">
        	<div class="date">
                <span class="month"><%=flow[i].getCREATEDATE().toString().substring(5,7) %></span>
                <span class="day"><%=flow[i].getCREATEDATE().toString().substring(8,10) %></span>
                <span class="year"><%=flow[i].getCREATEDATE().toString().substring(0,4) %></span>
            </div>
            <h2><a href="Edit1.jsp?SelectedItems=<%=flow[i].getID()%>">流程名称/当前步骤:<%=flow[i].getNAME()%></a></h2>
            <div class="clear"></div>
        </div>
        <div class="shadow_wrap"></div>
         
   <%      }
   } %>
 
</div>



 
  </form>
  </div>

<script language="JavaScript" type="text/JavaScript">


function edit1(){
var allvalue = mygrid.getSelectedRecords()+",0";
   var strID = allvalue.split(",")[0];

    if (strID==null||strID=="")
    {alert("请先选择处理的流程!");
    }else
    {
      var w,h,s;
      var MenuWindow = null;
      w = screen.availWidth - 4;
      h = screen.availHeight - 43;
      s = "directories=no,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + w + ",height=" + h;
      MenuWindow = window.open("Edit.jsp?SelectedItems="+strID,"MailWindow",s);
      MenuWindow.moveTo(-4,-4);
      MenuWindow.focus();
    }

}
function edit2(){
var allvalue = mygrid.getSelectedRecords()+",0";
   var strID = allvalue.split(",")[0];
   if (strID==null||strID=="")
    {alert("请先选择委托办理的流程!");
    }else
    {location.href="WTEdit.jsp?SelectedItems="+strID;}
    }

function edit3(){
var allvalue = mygrid.getSelectedRecords()+",0";
   var strID = allvalue.split(",")[0];
     if (strID==null||strID=="")
    {alert("请先选择移交办理的流程!");
    }else
    {location.href="YJEdit.jsp?SelectedItems="+strID;}
}
//-->
</script>
</body>
</html>
<%
//清空相关对象
user = null;
userUI = null;
flow = null;
fm = null;
%>
