<!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>
	<div data-role="page" id="showpage" 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=<?php echo $ac;?>&fileurl=plugin&type=<?php echo $type;?>'">
                    <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" onClick="form_add();">
					<div class="ub-img icon-ok umw2 umh4"></div>
                </div>
				
       </div>
	   <div id="error" style="display:none;">你的信息处理成功！</div>
	  
</div>
		<!-- /header -->
  <div data-role="content" id="content">
		<form action="index.php?ac=<?php echo $ac;?>&fileurl=plugin&do=add" method="post" name="formadd">
	    <input type="hidden" name="id" value="<?php echo $row['id'];?>">
		<input type="hidden" name="type" value="<?php echo $row['type'];?>">
		<input type="hidden" name="view" value="add">
		<div class="ub ub-ver">
			<div class="uinn-a6 sc-text  ulev-app1">
				日志类型
				<fieldset data-role="controlgroup" style="text-align:left" data-type="horizontal">
				<input id="radio-choice-h-1a" name="type" value="1" <?php if($row['type']==1){?>CHECKED="checked"<?php }?> type="radio">
				<label for="radio-choice-h-1a">个人日志</label>
				<input id="radio-choice-h-1b" name="type" value="2" <?php if($row['type']==2){?>CHECKED="checked"<?php }?> type="radio">
				<label for="radio-choice-h-1b">工作日志</label>
				</fieldset>
			</div>
			<div class="uinn-a6 sc-text  ulev-app1" id="users">
				共享人员
			   <?php echo mob_select_user('共享人员','user',$row['user']);?>
			</div>
			<div class="uinn-a6 sc-text  ulev-app1">
				日志日期
				<?php echo mob_date('日志日期','workdate',$y,$m,$d);?>
			</div>
			<div class="uinn-a6 sc-text  ulev-app1">
				主题
				<input id="title" name="title" value="<?php echo $row['title'];?>" type="text" placeholder="日志主题">
			</div>
			<div class="uinn-a6 sc-text  ulev-app1">
				内容
				<textarea id="contents" cols="40" rows="8" style="height:20em;" name="content" placeholder="输入内容"><?php echo $row['content'];?></textarea>
			</div>		
		</div>
	  </form>
  </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($formlist!=''){?>
		$("#error").fadeIn("slow");
		$("#nav-right").hide();
		$("#content").hide();
		window.setTimeout(display,4000);
		<?php }?>
    }
	function display(){
		$("#error").hide();
		window.location='index.php?ac=<?php echo $ac;?>&fileurl=plugin&type=<?php echo getGP('type','P');?>';
	}
	$(document).on("tap","#showpage",function(){ 
		  $("#header").fadeIn("slow");
	});
	function form_add(){
		if($("#title").val()==""){
			alert("名称不能为空！");
			return (false);
		}
		if($("#contents").val()==""){
			alert("内容不能为空！");
			return (false);
		}
		document.formadd.submit();
	}
	$(function(){
		<?php if($row['type']==2){?>
		$("#users").fadeIn("slow");
		<?php }else{?>
		$("#users").hide();
		<?php }?>
		$("#radio-choice-h-1a").click(function(){
			$("#users").hide();
		});
		$("#radio-choice-h-1b").click(function(){
			$("#users").fadeIn("slow");
		});
		$("#users").click(function(){
			$("#header").hide();
		});
	});
</script>   
</body>
</html>
