예제 #1
0
 public function listBaobiao()
 {
     //报表列表
     $paicha_id = intval($_REQUEST['paicha_id']);
     //学校筛选
     $lianxiao = trim(urldecode($_GET['lianxiao']));
     $xiangzhen = trim(urldecode($_GET['xiangzhen']));
     if ($_SESSION['roleid'] == '11') {
         $xiangzhen = getXiangzhenByUserid($_SESSION['userid']);
     }
     //乡镇管理员只能查看本乡镇学校
     $type = trim(urldecode($_GET['type']));
     $school_name = trim(urldecode($_GET['school_name']));
     if ($lianxiao || $xiangzhen || $type || $school_name !== '') {
         $where = '';
         if ($lianxiao) {
             $where .= ($where ? ' AND ' : '') . " lianxiao='{$lianxiao}' ";
         }
         if ($xiangzhen) {
             $where .= ($where ? ' AND ' : '') . " lianxiao='{$xiangzhen}' ";
         }
         if ($type) {
             $where .= ($where ? ' AND ' : '') . " type='{$type}' ";
         }
         if ($school_name) {
             $where .= ($where ? ' AND ' : '') . " name LIKE '%{$school_name}%' ";
         }
         $M = M('safe_school');
         $school_list = $M->select($where, 'id', '', 'id ASC');
         $school_ids = array();
         foreach ($school_list as $v) {
             $school_ids[] = $v['id'];
         }
         if (!empty($school_ids)) {
             $school_ids = implode(',', $school_ids);
         } else {
             $school_ids = '-1';
         }
     }
     //报表列表
     $page = intval($_GET['page']) ? intval($_GET['page']) : 1;
     $M = M('safe_school_baobiao');
     $where = '';
     $where .= ($where ? ' AND ' : '') . " paicha_id='{$paicha_id}' ";
     if ($school_ids) {
         $where .= ($where ? ' AND ' : '') . " school_id IN ({$school_ids}) ";
     }
     $status = trim(urldecode($_GET['status']));
     //状态筛选
     if ($status) {
         if ($status == '1' || $status == '3' || $status == '5') {
             //未排查,整改中,疑难问题
             $where .= ($where ? ' AND ' : '') . " status{$status}>0 ";
             //只要一项满足条件就行
         } elseif ($status == '2') {
             //已排查
             $where .= ($where ? ' AND ' : '') . " status1=0 AND status3=0 AND status4=0 AND status5=0 ";
             //需要所有项都满足条件
         } elseif ($status == '4') {
             //已整改
             $where .= ($where ? ' AND ' : '') . " status1=0 AND status2=0 AND status3=0 AND status5=0 ";
             //需要所有项都满足条件
         } elseif ($status == '6') {
             $where .= ($where ? ' AND ' : '') . " updatetime='' ";
         }
     }
     $size = 40;
     $list = $M->listinfo($where, 'id DESC', $page, $size);
     foreach ($list as $k => $v) {
         $list[$k]['school_name'] = getSchoolName($v['school_id']);
     }
     $pages = $this->getPagesArr($M->number, $size, $page);
     $this->jsonResult(array('list' => $list, 'pages' => $pages, 'currentPage' => $page));
 }
예제 #2
0
?>
</h1>
    	<div class="control yahei">
        	<a class="t0" hideFocus>
            	<?php 
if ($_SESSION['roleid'] == 10) {
    ?>
                <?php 
    echo getSchoolnameByUserid($_SESSION['userid']);
    ?>
&nbsp;的&nbsp;管理员:
                <?php 
} elseif ($_SESSION['roleid'] == 11) {
    ?>
                <?php 
    echo getXiangzhenByUserid($_SESSION['userid']);
    ?>
&nbsp;的&nbsp;管理员:
                <?php 
} else {
    ?>
                <?php 
}
?>
            	<?php 
echo $admin_username;
?>
,&nbsp;欢迎您
            </a>
        	<a class="t1" hideFocus ms-click="menuClick($event,'my')"><s></s>个人中心</a>
            <?php