<!DOCTYPE html>
<html>
	<head>
	<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>
<form name="save" method="post" action="index.php?ac=workflow&do=personnel&fileurl=plugin&modid=<?php echo $modid?>&tplid=<?php echo $tplid?>">
	<input type="hidden" name="view" value="edit" />
	<input type="hidden" name="title" value="<?php echo $row['title']?>" />
	<input type="hidden" name="workid" value="<?php echo $row['id']?>" />
	<input type="hidden" name="typeid" value="<?php echo $row['typeid']?>" />
	<input type="hidden" name="oldappkey" value="<?php echo $per['appkey']?>" />
	<input type="hidden" name="oldappkey1" value="<?php echo $per['appkey1']?>" />
	<input type="hidden" name="perid" value="<?php echo $per['perid']?>" />
	<input type="hidden" name="oldappflow" value="<?php echo $per['flowid']?>" />
	<input type="hidden" name="pkey" value="3" />
	<input type="hidden" name="views" value="3" />
	<input type="hidden" name="viewsuser" id="viewsuser" value="" />
<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=workclass&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; margin-top:100px;">流程信息审批成功！</div>
	</div>
	<!-- /header -->
	<div data-role="content" id="content">
		<div class="ub ub-ver">
			<div id="info">
				<div class="uinn-a6 sc-text  ulev-app1">
					
					<fieldset data-role="controlgroup">
    <legend>请选择退回步骤</legend>
	<?php
	$sqlu = "SELECT * FROM ".DB_TABLEPRE."workclass_flow WHERE fid in(".substr($per['flowkey4'], 0, -1).") order by fid asc";
	$results = $db->query($sqlu);
	$n=0;
	while ($upfid = $db->fetch_array($results)) {
	$n++;
	if($flowid=='undefined'){
		if($n==1){
			$flowid=$upfid['fid'];
		}
	}
	//$sqlpers = "SELECT * FROM ".DB_TABLEPRE."workclass_personnel where workid='".$workid."' and flowid='".$upfid['fid']."'  order by perid asc";
	//$pers = $db->fetch_one_array($sqlpers);
	?>
	<input name="updatefid" id="updatefid<?php echo $upfid['fid']?>" type="radio" value="<?php echo $upfid['fid']?>" onClick="user_show(<?php echo $upfid['fid']?>);">
        <label for="updatefid<?php echo $upfid['fid']?>">第<?php echo $upfid['flownum']?>步:<?php echo $upfid['flowname']?></label>
   <?php }?>

</fieldset>
				<div id="ajaxuser"></div>
				</div>
				<div class="uinn-a6 sc-text  ulev-app1">
					退回意见
					<textarea id="contents" cols="40" rows="8" style="height:20em;" name="content" placeholder="输入内容"></textarea>
				</div>
					
			</div>
		</div>
		<div class="c-wh uinn ub-ver">
				<div class="uinn" onclick="sendForm();">
                    <div class="btn ub ub-ac bc-text-head ub-pc bc-btn uc-a1">
                        确认回退
                    </div>
                </div>
            </div>
	</div>

</div><!-- /page -->
</form>
 <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;";
    }
	function ckeditor(){
	   if(document.save.viewsuser.value==""){
	     alert("退回步骤不能为空！");
		 return (false);
	   }
	  if(document.save.content.value==""){
	     alert("退回理由不能为空！");
		 document.save.content.focus();
		 return (false);
	   }
	   return true;
	}
	function sendForm()
	{
	   if(ckeditor())
		  document.save.submit();
	}
	//user_show();
	function user_show(flowid){
		document.getElementById("viewsuser").value='1';
	   jQuery.ajax({
		  type: 'GET',
		  url: 'index.php?ac=workflow&fileurl=plugin&do=upajax&workid=<?php echo $workid;?>&flowid='+flowid+'&'+new Date(),
		  success: function(data){
			  if(data!=''){
				  $("#ajaxuser").html(data);
			  }
		  }
	   });
	   //window.setTimeout(filenumber_show,120*10);
	}

</script>
</body>
</html>
