<!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" 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='news.php?type=<?php echo trim($views['type']);?>'">
                    <div class="fa fa-angle-left fa-2x"></div>
                </div>
                <h1 class="ut ub-f1 ulev-3 ut-s tx-c" tabindex="0"><?php echo news_type($views['type']);?></h1>
				
                <div class="nav-btn nav-bt" id="nav-right">
                    <div class="ub-img icon-edit umw2 umh4"></div>
                </div>
				
       </div>
	  <div id="error">你的评论发布成功！</div>
	<div id="note" style="top: 0;left: 0;position: absolute; margin-bottom:10px;" class=" ub-ver ub-fh bc-bg">
            <div class="ub ub-ac">
                <div class="nav-btn" id="nav-left" onClick="display();">
                    <div class="ub-img quxiao umw1 umh1"></div>
                </div>
                <div class=" tx-c bc-text ub-f1 ulev-app1">
                    写评论
                </div>
                <div class="nav-btn" id="nav-left" onClick="add();">
                    <div class="ub-img queding umw1 umh1"></div>
                </div>
            </div>
            <div class="uinn">
                <div class="uba bc-border uinput ub ub-f1">
                    <textarea placeholder="给我写点东西吧..." id="content" type="text" class="ub-f1" style="margin:1em;min-height:22em;font-size:1.5em;"></textarea>
                </div>
            </div>
            
        </div> 
</div>
		<!-- /header -->
  <div data-role="content" style="padding:60px 6px 10px 3px;">
	  <h3 style="text-align:center; padding-bottom:10px;"><?php echo $views['subject'];?></h3>
	  <div class="ui-body ui-body-a ui-corner-all">
		  <p><?php echo $views['content'];?></p>
	  </div>
  </div>
<!-- /content --> 
	<div class="ub ub-ver">
		<?php
		global $db;
		$query = $db->query("SELECT * FROM ".DB_TABLEPRE."bbs_log where bbsid='".$id."' and type='3'  ORDER BY id desc");
		while ($row = $db->fetch_array($query)) {
		$user = $db->fetch_one_array("SELECT pic FROM ".DB_TABLEPRE."user_view  WHERE uid = '".$row['uid']."'");
		if($user['pic']!=''){
			$pic='../'.$user['pic'];
		}else{
			$pic='themes/home/css/myImg/comImg.png';
		}
		?>
		<ul class="ubb ub bc-border lis">
			<li class="uh-app3 uw-app3 uc-a-app2 ub-img mar-ar1" style="background-image:url('<?php echo $pic;?>');"></li>
			<li class="ub-f1 ub ub-ver">
				
				<div class="ub umar-t">
					<div class="ub ub-f1 ub-ac sc-text-active"><?php echo get_realname($row['uid']);?>
					</div>
					<div class="ub ub-pe tx-r">
						<div class="t-gra-comm ufm1 ulev-2 umar-r"><?php echo Sms_Date(strtotime($row['enddate']));?></div>
						<div class="ub-img praise uh-comm2 uw-comm2"></div>
					</div>
				</div>
				<div class="t-bla ulev-4 ub-f1 umar-t"><?php echo trim($row['content']);?></div>
			</li>
		</ul>
	<?php }?>
    </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;";
    }
	$(function(){
		$("#note").hide();
		$("#error").hide();
		$("#nav-right").click(function(){
			$("#note").fadeIn("slow");
		});
	});
	function display(){
		$("#note").hide();
		$("#error").hide();
		location.reload(true);
	}
	function add(){
	   var content=$("#content").val();
	   if(content==''){
		   $("#content").val("请输入内容！");
		   return (false);
	   }
	   jQuery.ajax({
		  type: 'GET',
		  url: 'news.php?do=view&view=add&vid=<?php echo $id;?>&title=<?php echo $views['subject'];?>&content='+content+'&'+new Date(),
		  success: function(data){
			  if(data=='1'){
				  document.getElementById("content").value='';
				  $("#note").hide();
				  $("#error").fadeIn("slow");
				  window.setTimeout(display,5000);
			  }
		  }
	   });
	  // window.setTimeout(filenumber_show,120*10);
	}
</script> 
</body>
</html>
