<!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.0.min.css">
	<link rel="stylesheet" href="themes/css/ui-tab.css">
    <link rel="stylesheet" href="themes/css/ui-color.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">
                    <!--<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="javascript:window.location='sms.php?do=user'">
                    <div class="ub-img icon-adduser umw2 umh4"></div>
                </div>
            </div>
	
	</div>
		<!-- /header -->
  <div data-role="content" style="padding:60px 6px 10px 3px;">
	  <div class="ub ub-ver">
		<?php
		foreach ($result as $row) {
			if($row['receiveperson']!='' && $_USER->id!=$row['receiveperson']){
				$content=explode('<a',$row['content']); 
				$content=preg_replace("/\s+/", " ",trim($content[0]));
				$content=str_replace('"', "",$content);
				$content=str_replace("'", "",$content);
				$content=str_replace(",", "，",$content);
				$content=str_replace("<br>", "",$content);
				$rows = $db->fetch_one_array("SELECT uid,pic,name FROM ".DB_TABLEPRE."user_view  WHERE uid = '".trim($row['receiveperson'])."'  ");
				if($rows['pic']!=''){
					$pic='../'.$rows['pic'];
				}else{
					$pic='themes/home/css/myImg/comImg.png';
				}
				?>
				<ul class="ubb ub bc-border lis" onClick="javascript:window.location='sms.php?do=views&receiveperson=<?php echo $row['receiveperson'];?>'">
					<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  $rows['name'];?>
							</div>
							<div class="ub ub-pe tx-r">
								<div class="t-gra-comm ufm1 ulev-2 umar-r"><?php echo Sms_Date(strtotime($row['date']));?></div>
								
							</div>
						</div>
						<div class="t-bla ulev-4 ub-f1 umar-t"><?php echo cut_str($content,50);?></div>
					</li>
				</ul>
		<?php
		}
	}
	?>
    </div>    
  </div>
<!-- /content --> 
	<div data-role="footer"  data-position="fixed" data-tap-toggle="false">
				 <div class="ub c-bla c-m12 tab-b t-wh">
				 	
				 	<div class="ub-f1 ub ub-ver" onClick="javascript:window.location='index.php'">
						<div class="ub-f1 ub-img5 tp-homeon"></div>
						<div class="uinn ulev-2 tx-c">桌面</div>
					</div>
					
					<div class="ub-f1 ub ub-ver"  onClick="javascript:window.location='news.php'">
						<div class="ub-f1 ub-img5 tp-menu"></div>
						<div class="uinn ulev-2 tx-c">通知</div>
					</div>
					<div class="ub-f1 ub ub-ver tab-act" onClick="javascript:window.location='sms.php'">
						<div class="ub-f1 ub-img5 tp-talk"></div>
						<div class="uinn ulev-2 tx-c">微消息</div>
					</div>
					<div class="ub-f1 ub ub-ver" onClick="javascript:window.location='index.php?ac=list&fileurl=user'">
						<div class="ub-f1 ub-img5 tp-info"></div>
						<div class="uinn ulev-2 tx-c">我</div>
					</div>
				 </div>
	    </div><!-- /footer -->


	</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;";
    }
</script> 
</body>
</html>
