<?php
	session_start();
	include "inc/chec.php";
	include "conn/conn.php";
	include "inc/func.php";

$query=mysql_query("select * from tb_sortlist where id=1");
if($rs=mysql_fetch_array($query)){
   	$sort=$rs['sort'];
}
$sort_arr=explode(",",$sort);
$len=count($sort_arr);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="marquee, jquery" />
<title>主页</title>
<link href="css/style.css" rel="stylesheet" />
<style type="text/css">
#module_list{margin-left:4px}
.modules{
	float:left;
	width:380px;
	height:200px;
	margin:10px;
	overflow:hidden;
	border:1px solid #acc6e9;
	background:#e8f5fe
}
.m_title{height:24px; line-height:24px; background:#afc6e9}
#loader{height:24px; text-align:center}
.clear{
	clear:both;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type='text/javascript' src='js/jquery-ui.min.js'></script>
<script type="text/javascript" src="idrag.js"></script>
<script type="text/javascript"> 
var jQuery=$; 
</script>
<SCRIPT language=javascript src="dedeajax2.js"></SCRIPT>
<script src="js/client_js.js"></script>
<SCRIPT language=javascript src="js/ck.js"></SCRIPT>
</head>

<body>
<div id="main">
  <div id="loader"></div>
  <div id="module_list">
    <input type="hidden" id="orderlist" value="<?php echo $sort;?>"/>
    <?php 
     for($i=0;$i<4;$i++){
		 if($sort_arr[$i] == 1){
		$biaoti = "企业公告";
		}else if($sort_arr[$i] == 2){
			$biaoti = "活动安排";
			}else if($sort_arr[$i] == 3){
				$biaoti = "个人计划";
				}else if($sort_arr[$i] == 4){
				$biaoti = "审核批示";
				}
   ?>
    <div class="modules" title="<?php echo $sort_arr[$i]; ?>">
      <h3 class="m_title"><?php echo $biaoti; ?></h3>
      <?php
	  $query=mysql_query("select * from tb_sortlist where id=1");
	  if($rs=mysql_fetch_array($query)){
   	$sort=$rs['sort'];
}
$sort_arr=explode(",",$sort);
$len=count($sort_arr);
	    if($sort_arr[$i] == 1){
		$sqlstr = "select * from tb_person where u_id = 9 order by id limit 0,5";
		}else if($sort_arr[$i] == 2){
			$sqlstr = "select * from tb_person where u_id = 10 order by id limit 0,5";
			}else if($sort_arr[$i] == 3){
				$sqlstr = "select * from tb_plan where p_id = ".$_SESSION[id]." order by id limit 0,5";
				}else if($sort_arr[$i] == 4){
				$sqlstr = "select * from tb_iss where p_id = ".$_SESSION[id]." order by id limit 0,5";
				}
		$result = mysql_query($sqlstr,$conn);
		while($rows = mysql_fetch_row($result)){
?> 
      <table width="359" border="0">
        <tr>
          <td width="132"><?php echo $rows[3]; ?></td>
          <td width="217"><span style="text-indent: 30px;"><a onclick=AlertMsg<?php echo $sort_arr[$i]; ?>('<?php echo $rows[1]; ?>','<?php echo $rows[0]; ?>')  href='javascript:';><?php echo substr($rows[1],0,20); ?></a></span></td>
        </tr>
      </table>
<tr>
        <td height=30 align=center valign=middle>&nbsp;</td>
        <td align="center" valign="middle" style='text-indent: 30px;'>&nbsp;</td>
      </tr>
      <?php
		}
?>
    </div>
    <?php } ?>
    <div class="clear"></div>
  </div>
</div>
</body>
</html>