<!DOCTYPE html>
<html>
	<head>
	<title><?php echo $type_name;?></title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="themes/jquery/css/themes/default/jquery.mobile-1.4.5.min.css">
	<link rel="stylesheet" href="themes/home/css/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="themes/home/css/ui-box.css">
    <link rel="stylesheet" href="themes/home/css/ui-base.css">
    <link rel="stylesheet" href="themes/home/css/ui-color.css">
    <link rel="stylesheet" href="themes/home/css/icon.css">
    <link rel="stylesheet" href="themes/home/css/control.css">
    <link rel="stylesheet" href="themes/home/css/main.css">
	<script src="themes/jquery/js/jquery.js"></script>
	<script src="themes/jquery/js/jquery.mobile-1.4.5.min.js"></script>
</head>
<body class="um-vp c-wh " ontouchstart>
	<div data-role="page" data-quicklinks="true" class="ub ub-ver ">
      <div data-role="header" id="header" data-position="fixed" data-fullscreen="true" data-tap-toggle="false" >
	  <div class="uh bc-text-head ub bc-head">
                <div class="nav-btn" id="nav-left" onClick="javascript:window.location='index.php?ac=apps&fileurl=plugin'">
                    <div class="fa fa-angle-left fa-2x"></div>
                </div>
                <h1 class="ut ub-f1 ulev-3 ut-s tx-c" tabindex="0">公文监控</h1>
				
                <div class="nav-btn nav-bt" id="nav-right">
                    <!--<div class="ub-img icon-edit umw2 umh4"></div>  -->
                </div>
				
       </div>
	  <div id="error" style="display:none; ">流程信息审批成功！</div>
</div>
		<!-- /header -->
  <div data-role="content" id="content">
  		<?php 
		if(!$result){
			echo '<div id="error-bg"></div>';
		}
		?>
		<div style="padding-left:5px; padding-right:5px;">
				<ul>
				<?php
				foreach ($result as $row) {
				$sql = "SELECT * FROM ".DB_TABLEPRE."app_personnel  WHERE appid = '".$row['id']."'  and (pertype=0 or pertype=2 or pertype=4 or pertype=5) order by perid desc";
				$per = $db->fetch_one_array($sql);
				$url="index.php?ac=apps&fileurl=plugin&do=views&appsid=".$row['id']."&tpltype=".$tpltype."&type=3";
				?>
				<li class="ubb ub bc-border t-bla ub-ac lis" data-index="0"  onClick="javascript:window.location='<?php echo $url;?>'">
					<ul class="ub-f1 ub ub-pj ub-ac">
						<ul class="ub-f1 ub ub-ver marg-l">
							<li class="bc-text ub ub-ver ut-m line1"><?php echo $row['title']?></li>
							<li class="ulev-1 sc-text1 uinn3">
								<div class="ub">
								<?php
								if($row['type']==1){
								   echo '<div class="c-orange  bc-text-head uinn3 uc-a-list1">流程己撤消</div>';
							    }else{
									  $perkey=$per['pertype'];
									  if($per['pertype']==5){
										  echo '<div class="c-red-oa  bc-text-head uinn3 uc-a-list1">流程结束</div>';
									  }elseif($per['pertype']==2){
										  echo '<div class="c-orange  bc-text-head uinn3 uc-a-list1">流程被拒绝</div>';
									  }else{
										  $sql = "SELECT * FROM ".DB_TABLEPRE."app_flow  WHERE fid = '".$per['flowid']."' order by fid desc";
										  $flow = $db->fetch_one_array($sql);
										  if($flow['flownum']!=''){
											  echo '<div class="c-green  bc-text-head uinn3 uc-a-list1">第<span style="font-size:18px; font-weight:bold;">'.$flow['flownum'].'</span>步：'.$flow['flowname'].'</b>';
											  echo '<br>办理人：'.$per['name'].'</div>';
										  }
									  }
								  }
								  ?>
									<!--<div class="c-orange  bc-text-head uinn3 uc-a-list1">审批中</div> -->
								</div>
							</li>
						</ul>
						<li class="fa fa-angle-right ulev2"></li>
					</ul>
				</li>
				<?php } ?>
				
				</ul>
		</div>
  </div>


	</div><!-- /page -->
 <script type="text/javascript"> 
    window.onload = function(){ 
        var heg=document.getElementById("header").offsetHeight;
		var content=document.getElementById("content"); 
		content.style.cssText="margin-top:"+heg+"px;";
		<?php if($_GET['error']!=''){?>
		$("#error").fadeIn("slow");
		window.setTimeout('$("#error").hide();',2000);
		<?php }?>
    }
</script> 
</body>
</html>
