用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - php代码库

PHP在线教育系统 基于brophp框架开发

2013-07-11 作者: 免费源代码下载整理举报

[php]代码库

<?php
/**
 *author:qds
 *data:2011-7-28
 *功能描述:后台页面的展示
 */
class Index {
    /*
     *frame框架调用所用。主页模板
     *
     * */
    function index(){
        $this->display();
    }
    /*
     *frame框架头部调用所用。
     *不显示debug调试模式
     * */
    function top(){
        $GLOBALS["debug"]=0;
        $this->display();
    }
    /*
     *frame框架左侧调用所用 menu菜单。
     *不显示debug调试模式
     * */
    function left(){
        $GLOBALS["debug"]=0;
        //($_SESSION);
        switch ($_SESSION['user']['limit']){
            case 1:
                $this->display('index/adminleft');
                break;
            case 2:
                $this->display('index/tealeft');
                break;
            case 3:
                $this->display('index/stuleft');
                break;
                     
                     
                     
        }
 
             
    }
    /*
     *frame框架右侧侧调用所用 所有的显示部分都在此显示。
     *$notice 为公告显示
     *$randp 为奖惩信息的显示
     * */
    function right(){
        //p($_SESSION);
        //调用公告表  提取最新10条信息
        $notice=D('notice');
        $noticedate=$notice->order('addtime desc')->limit(10)->select();
        $notic='<ul>';
        foreach($noticedate as $v){
            $notic.='<li>';
            $notic.='['.substr($v['addtime'],0,10);
            $notic.=']&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$GLOBALS['app'].'notice_manage/info/nid/'.$v['nid'].'">'.$v['title'].'</a>';
            $notic.='</li>';
                 
        }
        $notic.='</ul>';
        //调用奖惩表  提取最新十条信息
        $randp=D('randp');
        $randpdate=$randp->order('rptime desc')->limit(10)->select();
        $rpinfo='<ul>';
        foreach($randpdate as $v){
            $rpinfo.='<li>';
            $rpinfo.='['.$v['rptime'];
            switch($v['type']){
                case 1:
                    $rpinfo.=']&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$GLOBALS['app'].'randp_manage/info/rpid/'.$v['rpid'].'/type/1">'.mb_substr($v['rpcontent'],0,20,"UTF8").'...</a>';
                    break;
                case 2:
                    $rpinfo.=']&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$GLOBALS['app'].'randp_manage/info/rpid/'.$v['rpid'].'/type/2">'.mb_substr($v['rpcontent'],0,20,"UTF8").'...</a>';
                    break;
 
            }
            $rpinfo.='</li>';
                 
        }
        $rpinfo.='</ul>';
        //个人信息
        $sex=$_SESSION['user']['ssex']?'男':'女';
        switch($_SESSION['user']['limit']){
            case 1:
 
                $user = '<ul>';
                $user .='<li>管理员:'.$_SESSION['user']['name'].'</li>';
                     
                $user .= '</ul>';
                break;
            case 2:
                $ct = D('classtype');
                $row = $ct->where(array('id'=>$_SESSION['user']['blg_series']))->find();
                $user = '<ul>';
                $user .='<li>老师:'.$_SESSION['user']['name'].'</li>';
                $user .='<li>性别:'.$sex.'</li>';
                $user .='<li>系别:'.$row['title'].'</li>';
                $user .='<li>毕业院校:'.$_SESSION['user']['grad_school'].'</li>';
                $user .='<li>籍贯:'.$_SESSION['user']['native'].'</li>';
                $user .= '</ul>';
                break;
            case 3:
                $ct = D('classtype');
                $row = $ct->where(array($_SESSION['user']['series'],$_SESSION['user']['specialty'],$_SESSION['user']['class']))->select();
                $user = '<ul>';
                $user .='<li>学生:'.$_SESSION['user']['name'].'</li>';
                $user .='<li>性别:'.$sex.'</li>';
                $user .='<li>系别:'.$row['0']['title'].'</li>';
                $user .='<li>专业:'.$row['1']['title'].'</li>';
                $user .='<li>班级:'.$row['2']['title'].'</li>';
                $user .= '</ul>';
                break;
        }
        $this->assign('user',$user);
        $this->assign('randp',$rpinfo);
        $this->assign('notic',$notic);
        $this->display();
    }
}

[源代码打包下载]




网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...