Example #1
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $stt = M('stt');
     $fldint = '-sttid-sttnm-sttcprt-sttads-sttrspnm-sttrsptlp-sttrspcp-sttactvt-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-sttid ASC-';
     $lmtint = 20;
     $jn = '';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($stt, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['sttactvt'] == 1) {
             $v['sttactvt'] = '是';
         } else {
             $v['sttactvt'] = '否';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $this->assign('title', '浏览站点列表');
     $this->assign('theme', '站点管理');
     $this->display('query');
 }
Example #2
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Zzmm'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $zzmm = M('zzmm');
     $fldint = '-zzmmid-zzmmnm-';
     $cdtint = "-sp-";
     $spzzmmdtint = '-sp-';
     ////
     $odrint = '-zzmmid ASC-';
     $lmtint = 20;
     $jn = '';
     //$jn='tb_zzmm ON f_zzmmid=zzmmid-jn-tb_atc ON f_zzmmid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($zzmm, $fldint, $cdtint, $spzzmmdtint, $odrint, $lmtint, $jn);
     ////
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spzzmmdt', $arr['spzzmmdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $this->assign('title', '浏览微信列表');
     $this->assign('theme', '政治面貌管理');
     $this->display('query');
 }
 public function output()
 {
     //先去数据库找出你要让哪些数据出来
     header("Content-Type:text/html; charset=utf-8");
     $mk = $_POST['mk'];
     if ($mk == 'usr') {
         $jn = '';
         $fldint = '-usrid-usrnm-usrnn-usraddtm-usrmdftm-usrcp-usrml-usrps-usrvw-';
         $jsn = array('usrnm' => '用户名', 'usrnn' => '用户昵称', 'usraddtm' => '添加时间', 'usrmdftm' => '修改时间', 'usrcp' => '用户手机', 'usrml' => '用户邮箱', 'usrps' => '是否通过', 'usrvw' => '是否查看');
     }
     if ($mk == 'cstmusr') {
         $jn = '';
         $fldint = '-cstmusrid-cstmusrnm-cstmusrnn-cstmusraddtm-cstmusrmdftm-cstmusrcp-cstmusrml-cstmusrps-cstmusrvw-';
         $jsn = array('usrnm' => '客户用户名', 'usrnn' => '客户用户昵称', 'usraddtm' => '客户添加时间', 'usrmdftm' => '客户修改时间', 'usrcp' => '客户用户手机', 'usrml' => '客户用户邮箱', 'usrps' => '客户是否通过', 'usrps' => '客户是否查看');
     }
     //NB初始化,开始
     $m = M($mk);
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     $odrint = '-';
     $lmtint = 20;
     //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
     $fld = $arr['fld'];
     //去 f_...//先拆开,后结合的方式
     $fldu = explode('-', $fld);
     $fldnw = '-';
     for ($i = 1; $i < count($fldu) - 1; $i++) {
         if (!preg_match('/f_/', $fldu[$i])) {
             $fldnw = $fldnw . $fldu[$i] . '-';
         }
     }
     $fld = $fldnw;
     $mlsall = $arr['mlsforcount'];
     for ($i = 0; $i < count($mlsall); $i++) {
         $mlsall[$i]['usrps'] = $mlsall[$i]['usrps'] == 1 ? '是' : '否';
     }
     import('@.ORG.PHPExcel');
     // Create new PHPExcel object
     $objPHPExcel = new PHPExcel();
     // Set properties
     $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
     // set table header content列是从0开始,行是从1开始
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
     $sheet = $objPHPExcel->setActiveSheetIndex(0);
     $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '序号');
     $fldu = explode('-', $fld);
     for ($i = 2; $i < count($fldu) - 1; $i++) {
         $sheet = $sheet->setCellValueByColumnAndRow($i - 1, 1, $jsn[$fldu[$i]]);
     }
     //Miscellaneous glyphs, UTF-8
     for ($j = 0; $j < count($mlsall); $j++) {
         $m = $mlsall[$j];
         $sheet = $sheet->setCellValueByColumnAndRow(0, $j + 2, $j + 1);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 1, $j + 2, $m[$fldu[$i]] . ' ');
         }
     }
     //  sheet命名
     //$objPHPExcel->getActiveSheet()->setTitle('订单汇总表');
     // Set active sheet index to the first sheet, so Excel opens this as the first sheet
     $objPHPExcel->setActiveSheetIndex(0);
     // excel头参数
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename=" . $_POST['xlsnm'] . date("Ymd-His") . ".xls");
     //日期为文件名后缀
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     //excel5为xls格式,excel2007为xlsx格式
     $objWriter->save('php://output');
 }
Example #4
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Std'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $std = M($grdo['grdnm'] . '_std')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqdm ON f_stdxqdm_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     // 		$stdls=$std->select();
     $fldint = '-stdid-bxxsnm-sttnm-f_std_grdid-grdnm-f_stdxqcls_xqid-xqnm-f_stdxqcls_clsid-clsnm-stdno-stdnm-sexnm-mjnm-statnm-';
     //$cdtint="-sp-f_std_ccid-eq-3-sp-f_std_xxxsid-eq-2-sp-f_std_zsfwid-eq-2-sp-f_std_xzid-eq-2-sp-f_std_sttid-eq-1-sp-f_std_statid-eq-5-sp-";
     //默认学期,
     $xq = M('xq');
     $xqo = $xq->where('xqdq=1')->find();
     $xqid = $xqo['xqid'];
     if ($athofnstt['aths'] == 1) {
         $f_usr_sttid = 1;
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     } else {
         $f_usr_sttid = $usro['f_usr_sttid'];
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     }
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-';
     $lmtint = 20;
     $jn = 'tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_dm ON f_stdxqdm_dmid=dmid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($std, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
     $mls = $arr['mls'];
     $bzr = M($grdo['grdnm'] . '_bzr');
     $mlsfn = array();
     foreach ($mls as $v) {
         $bzro = $bzr->where('f_bzr_clsid=' . $v['f_stdxqcls_clsid'])->find();
         if ($athofn['aths'] == 1 || session('usridss') == $bzro['f_bzr_usrid']) {
             //aths==1说明是教务的人或者是管理员
             $v['mdf'] = 1;
         } else {
             $v['mdf'] = 0;
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $bxxs = M('bxxs');
     $bxxsls = $bxxs->select();
     $this->assign('bxxsls', $bxxsls);
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的学生阔能还在,因此要保留站点
     if ($athofnstt['aths'] == 1) {
         $sttls = $stt->select();
     } else {
         $sttls = $stt->where('sttid=' . $usro['f_usr_sttid'])->select();
     }
     $this->assign('sttls', $sttls);
     //q特殊
     $cc = M('cc');
     $ccls = $cc->select();
     $this->assign('ccls', $ccls);
     //q特殊
     $kl = M('kl');
     $klls = $kl->select();
     $this->assign('klls', $klls);
     //q特殊
     $xxxs = M('xxxs');
     $xxxsls = $xxxs->select();
     $this->assign('xxxsls', $xxxsls);
     //q特殊
     $zsfw = M('zsfw');
     $zsfwls = $zsfw->select();
     $this->assign('zsfwls', $zsfwls);
     //q特殊
     $xz = M('xz');
     $xzls = $xz->select();
     $this->assign('xzls', $xzls);
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $xq = M('xq');
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     } else {
         $xqls = $xq->order('xqnm DESC')->select();
     }
     $this->assign('xqls', $xqls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_cls_sttid=' . $tmp[0];
     } else {
         if ($athofnstt['aths'] == 1) {
             $where = $where . ' AND f_cls_sttid=1';
         } else {
             $where = $where . ' AND f_cls_sttid=' . $usro['f_usr_sttid'];
         }
     }
     $where = $where . " AND clsxqu LIKE '%-" . $xqid . "-%'";
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid;
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where)->order('clsnm ASC')->select();
     array_push($clsls, array('clsid' => 0, 'clsnm' => '未分班'));
     $this->assign('clsls', $clsls);
     //q特殊
     $dm = M('dm');
     $dmls = $dm->select();
     $this->assign('dmls', $dmls);
     //q特殊
     $sex = M('sex');
     $sexls = $sex->select();
     $this->assign('sexls', $sexls);
     //q特殊
     $rc = M('rc');
     $rcls = $rc->select();
     $this->assign('rcls', $rcls);
     //q特殊
     $zzmm = M('zzmm');
     $zzmmls = $zzmm->select();
     $this->assign('zzmmls', $zzmmls);
     //q特殊
     $xl = M('xl');
     $xlls = $xl->select();
     $this->assign('xlls', $xlls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_mj_bxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_bxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_bxxsid=' . $tmp[0];
     }
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_grdid=' . $tmp[0];
     }
     if (preg_match('/f_mj_ccid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_ccid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_ccid=' . $tmp[0];
     }
     if (preg_match('/f_mj_klid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_klid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_klid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xxxsid=' . $tmp[0];
     }
     if (preg_match('/f_mj_zsfwid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_zsfwid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_zsfwid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xzid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xzid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xzid=' . $tmp[0];
     }
     $mj = M($grdo['grdnm'] . '_mj');
     $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->where($where)->order('f_mj_bxxsid ASC,mjdm ASC')->select();
     $tmpls = array();
     foreach ($mjls as $v) {
         if (preg_match('/技能/', $v['bxxsnm'])) {
             $v['bxxsnm'] = '技能';
         } else {
             if (preg_match('/自考/', $v['bxxsnm'])) {
                 $v['bxxsnm'] = '自考';
             } else {
                 $v['bxxsnm'] = '普通';
             }
         }
         array_push($tmpls, $v);
     }
     $this->assign('mjls', $tmpls);
     //q特殊
     $stat = M('stat');
     $statls = $stat->where("statactvt=1 AND statmk='jw'")->select();
     $this->assign('statls', $statls);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //q特殊
     $this->assign('title', '浏览学生列表');
     $this->assign('theme', '学生管理');
     $this->display('query');
 }
 function notify()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cstmusr'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cstmusr = M('cstmusr');
     $fldint = '-cstmusrid-cstmusrnm-cstmusrnn-cstmusraddtm-cstmusrmdftm-cstmusrcp-cstmusrml-cstmusrps-cstmusrvw-';
     $cdtint = "-sp-cstmusrvw-eq-0-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-cstmusraddtm DESC-';
     $lmtint = 20;
     $jn = '';
     //$jn='tb_ath ON f_cstmusr_athid=athid-jn-tb_atc ON f_cstmusr_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmusr, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($cstmusr,$fldint,$cdtint,$odrint,$lmtint,$jn);
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['cstmusrps'] == 1) {
             $v['cstmusrps'] = '是';
         } else {
             $v['cstmusrps'] = '否';
         }
         if ($v['cstmusrvw'] == 1) {
             $v['cstmusrvw'] = '是';
         } else {
             $v['cstmusrvw'] = '否';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $this->assign('title', '浏览客户用户列表');
     $this->assign('theme', '未查看客户用户');
     $this->display('notify');
 }
Example #6
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cls'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_cls_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cls_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $cls = M($grdo['grdnm'] . '_cls');
     $fldint = '-clsid-sttnm-f_cls_grdid-grdnm-clsnm-clsxhprx-clsactvt-clsxqu-';
     if ($athofnstt['aths'] == 1) {
         $sttidforxq = 1;
         //默认以本部站点为例
         $cdtint = "-sp-f_cls_grdid-eq-" . $grdid . '-sp-';
     } else {
         $sttidforxq = $usro['f_usr_sttid'];
         //默认以用户所在站点为例
         $cdtint = "-sp-f_cls_sttid-eq-" . $usro['f_usr_sttid'] . "-sp-f_cls_grdid-eq-" . $grdid . '-sp-';
     }
     $spccdtint = '-sp-';
     ////
     $odrint = '-clsid ASC-';
     $lmtint = 20;
     $jn = 'tb_stt ON f_cls_sttid=sttid-jn-tb_grd ON f_cls_grdid=grdid';
     //$jn='tb_stt ON f_cls_sttid=sttid-jn-tb_atc ON f_cls_sttid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cls, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     //适应一些站点用一二三
     import('@.XQ.XQAction');
     $xqw = new XQAction();
     //外来的学期
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['clsactvt'] == 1) {
             $v['clsactvt'] = '是';
         } else {
             if ($v['clsactvt'] == 0) {
                 $v['clsactvt'] = '否';
             }
         }
         if ($v['clsxqu']) {
             $clsxqu = explode('-', $v['clsxqu']);
             $xqnmu = '';
             for ($i = 1; $i < count($clsxqu) - 1; $i++) {
                 $xqid = $clsxqu[$i];
                 $xqnm = $xqw->getxqnm($grdid, $sttidforxq, $xqid);
                 $xqnmu = $xqnmu . $xqnm . '<br>';
             }
         }
         $v['clsxqu'] = $xqnmu;
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $stt = M('stt');
     $sttls = $stt->select();
     $this->assign('sttls', $sttls);
     $grd = M('grd');
     $grdls = $grd->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $this->assign('title', '浏览班级列表');
     $this->assign('theme', '班级管理');
     $this->display('query');
 }
Example #7
0
 public function outputschq()
 {
     $mk = $_GET['mk'];
     //先去数据库找出你要让哪些数据出来
     header("Content-Type:text/html; charset=utf-8");
     $zssz = M('zssz');
     $zsszo = $zssz->where('zsszid=1')->find();
     $xqid = $zsszo['f_zssz_xqid'];
     $grd = M('grd');
     $grdo = $grd->where('grdid=' . $zsszo['f_zssz_grdid'])->find();
     $grdnm = $grdo['grdnm'];
     $jn = 'tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdnm . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdnm . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_dm ON f_stdxqdm_dmid=dmid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     $fldint = '-zspxhid-bxxsnm-stdno-stdnm-sexnm-mjnm-stdidcd-';
     $jsn = array('bxxsnm' => '办学形式', 'sttnm' => '站点', 'grdnm' => '年级', 'stdaplno' => '报名号', 'stdno' => '学号', 'stdupfnctm' => '上传财务时间', 'stdnm' => '姓名', 'clsnm' => '班级', 'dmnm' => '寝室', 'sexnm' => '性别', 'rcnm' => '民族', 'zzmmnm' => '政治面貌', 'stdnp' => '籍贯', 'stdbtd' => '出生日期', 'xnl' => '是否小年龄', 'stdsol' => '文理科', 'stdcee' => '高考成绩', 'stdsog' => '毕业学校', 'stdqq' => 'QQ', 'xlnm' => '最高学历', 'stdidcd' => '身份证号码', 'stdcp' => '手机号码', 'stdrlta' => '家长一', 'stdrltanm' => '家长一姓名', 'stdrltaocpt' => '家长一职业', 'stdrltacp' => '家长一手机号', 'stdrltb' => '家长二', 'stdrltbnm' => '家长二姓名', 'stdrltbocpt' => '家长二职业', 'stdrltbcp' => '家长二手机号', 'stdhb' => '爱好', 'mjnm' => '专业', 'statnm' => '状态', 'stdpst' => '邮编', 'stdads' => '家庭地址', 'stdmdftm' => '修改时间', 'stdaddtm' => '添加时间', 'stdtlp' => '固话', 'stdpertm' => '预录取时间', 'stdertm' => '录取时间', 'stdicbc' => '工行卡号', 'stdrcmdnm' => '推荐人姓名', 'stdrcmdcp' => '推荐人手机号', 'stdpnttm' => '信息打印时间', 'xqnm' => '学期');
     //NB初始化,开始
     $m = M($grdo['grdnm'] . '_zspxh');
     $m->join('tb_' . $grdo['grdnm'] . '_std ON f_zspxh_stdid=stdid')->join('inner join tb_' . $grdnm . '_stdxqdm ON stdid=f_stdxqdm_stdid')->join('inner join tb_' . $grdnm . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdnm . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     $cdtint = "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . "-sp-";
     if ($mk == 'all') {
         $spccdtint = "-sp-f_std_statid<>9-sp-stdno<>''-sp-zspxhschqtm=''-sp-";
     } else {
         if ($mk == 'zp') {
             $spccdtint = "-sp-f_std_statid<>9-sp-stdno<>''-sp-zspxhschqtm=''-sp-(stdpt NOT LIKE '%-default-%')-sp-";
         }
     }
     $odrint = '-mjnm ASC-stdno ASC-';
     $lmtint = 20;
     //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
     $fld = $arr['fld'];
     //去 f_...//先拆开,后结合的方式
     $fldu = explode('-', $fld);
     $fldnw = '-';
     for ($i = 1; $i < count($fldu) - 1; $i++) {
         if (!preg_match('/f_/', $fldu[$i])) {
             $fldnw = $fldnw . $fldu[$i] . '-';
         }
     }
     $fld = $fldnw;
     $mlsall = $arr['mlsforcount'];
     $fld = str_replace('-stdbtd-', '-stdbtd-xnl-', $fld);
     $zssz = M('zssz');
     $zsszo = $zssz->where('zsszid=1')->find();
     $tmp = explode(' ', $zsszo['zsszxnltm']);
     $zsszxnltm = $tmp[0];
     $mlsallfn = array();
     foreach ($mlsall as $stdv) {
         if ($stdv['stdbtd'] < $zsszxnltm) {
             $stdv['xnl'] = '否';
         } else {
             $stdv['xnl'] = '是';
         }
         array_push($mlsallfn, $stdv);
     }
     $mlsall = $mlsallfn;
     //对每个学生设置上传时间
     $tm = date("Y-m-d H:i:s", time());
     $zspxh = M($grdo['grdnm'] . '_zspxh');
     foreach ($mlsall as $zspxhv) {
         $dt = array('zspxhschqtm' => $tm);
         $zspxh->where('zspxhid=' . $zspxhv['zspxhid'])->setField($dt);
     }
     $zm = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
     import('@.ORG.PHPExcel');
     // Create new PHPExcel object
     $objPHPExcel = new PHPExcel();
     // Set properties
     $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
     $objPHPExcel->getSheet(0)->setTitle('继续教育学院饭卡制作名单');
     $objActSheet = $objPHPExcel->getSheet(0);
     //指定sheet
     $objActSheet->getColumnDimension('A')->setWidth(4.77);
     $objActSheet->getColumnDimension('B')->setWidth(18.99);
     $objActSheet->getColumnDimension('C')->setWidth(15.2);
     $objActSheet->getColumnDimension('D')->setWidth(7.7);
     $objActSheet->getColumnDimension('E')->setWidth(4.63);
     $objActSheet->getColumnDimension('F')->setWidth(19.7);
     $objActSheet->getColumnDimension('G')->setWidth(20.4);
     $objActSheet->getColumnDimension('H')->setWidth(10.27);
     // set table header content列是从0开始,行是从1开始
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
     $sheet = $objPHPExcel->setActiveSheetIndex(0);
     $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '序号');
     $objBorder = $objPHPExcel->getActiveSheet()->getStyle('A1')->getBorders();
     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $fldu = explode('-', $fld);
     for ($i = 2; $i < count($fldu) - 1; $i++) {
         $sheet = $sheet->setCellValueByColumnAndRow($i - 1, 1, $jsn[$fldu[$i]]);
         $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 1] . '1')->getBorders();
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     }
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
     $sheet = $objPHPExcel->setActiveSheetIndex(0);
     $sheet = $sheet->setCellValueByColumnAndRow(7, 1, '所在分院');
     $objBorder = $objPHPExcel->getActiveSheet()->getStyle('H1')->getBorders();
     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     //Miscellaneous glyphs, UTF-8
     for ($j = 0; $j < count($mlsall); $j++) {
         $m = $mlsall[$j];
         $sheet = $sheet->setCellValueByColumnAndRow(0, $j + 2, $j + 1);
         $objBorder = $objPHPExcel->getActiveSheet()->getStyle('A' . ($j + 2))->getBorders();
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 1, $j + 2, $m[$fldu[$i]] . ' ');
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 1] . '' . ($j + 2))->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         $sheet = $sheet->setCellValueByColumnAndRow(7, $j + 2, '成教学院');
         $objBorder = $objPHPExcel->getActiveSheet()->getStyle('H' . ($j + 2))->getBorders();
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     }
     //  sheet命名
     //$objPHPExcel->getActiveSheet()->setTitle('订单汇总表');
     // Set active sheet index to the first sheet, so Excel opens this as the first sheet
     $objPHPExcel->setActiveSheetIndex(0);
     // excel头参数
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename=" . '上传后勤制作饭卡' . date("Ymd-His") . ".xls");
     //日期为文件名后缀
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     //excel5为xls格式,excel2007为xlsx格式
     $objWriter->save('php://output');
 }
Example #8
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Kc'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_kc_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_kc_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $kc = M($grdo['grdnm'] . '_kc');
     $fldint = '-kcid-f_kc_grdid-grdnm-kcnm-kcsfts-';
     $cdtint = "-sp-f_kc_grdid-eq-" . $grdid . '-sp-';
     $spccdtint = '-sp-';
     ////
     $odrint = '-kcid ASC-';
     $lmtint = 20;
     $jn = 'tb_grd ON f_kc_grdid=grdid';
     //$jn='tb_stt ON f_kc_sttid=sttid-jn-tb_atc ON f_kc_sttid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($kc, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['kcsfts'] == 1) {
             $v['kcsfts'] = '是';
         } else {
             $v['kcsfts'] = '否';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $grd = M('grd');
     $grdls = $grd->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $this->assign('title', '浏览课程列表');
     $this->assign('theme', '课程管理');
     $this->display('query');
 }
Example #9
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Zsf'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_zsf_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_zsf_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $zsf = M($grdo['grdnm'] . '_zsf');
     $fldint = '-zsfid-grdnm-dmnm-zsfsm-';
     $cdtint = "-sp-f_zsf_grdid-eq-" . $grdo['grdid'] . "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-';
     $lmtint = 20;
     $jn = 'tb_grd ON f_zsf_grdid=grdid-jn-tb_dm ON f_zsf_dmid=dmid';
     //$jn='tb_ath ON f_zsf_athid=athid-jn-tb_atc ON f_zsf_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($zsf, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     $dm = M('dm');
     $dmls = $dm->order('dmnm DESC')->select();
     $this->assign('dmls', $dmls);
     //q特殊
     $this->assign('title', '浏览住宿费列表');
     $this->assign('theme', '住宿费管理');
     $this->display('query');
 }
Example #10
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cw'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $cw = M($grdo['grdnm'] . '_cw')->join('tb_' . $grdo['grdnm'] . '_std ON f_cw_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqdm ON stdid=f_stdxqdm_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     // 		$stdls=$std->select();
     $fldint = '-cwid-bxxsnm-sttnm-f_std_grdid-grdnm-f_cw_xnid-xnnm-f_stdxqcls_clsid-clsnm-stdno-stdnm-sexnm-dmnm-mjnm-statnm-cwyjxfsm-cwyjjckwfsm-cwyjzsfsm-cwsjxfsm-cwsjjckwfsm-cwsjzsfsm-';
     //$cdtint="-sp-f_std_ccid-eq-3-sp-f_std_xxxsid-eq-2-sp-f_std_zsfwid-eq-2-sp-f_std_xzid-eq-2-sp-f_std_sttid-eq-1-sp-f_std_statid-eq-5-sp-";
     //说明:每年的收学费都是 比如 2014-2015学年,那么收费就是2014-2015学年 第1学期 进行注册初始化 注册时候为第1学期 财务的年级、站点 专业的办学形式 层次 科类 决定该学年的收费标准执行
     ////而显示的专业则为,如果他是2014-2015学年第1学期注册的,那么就是顺延到下面一个学期,这两个学期他的最终专业班级为准,毕竟我们看的时候他那一年的终极版本。如果偶尔有人转专业,呵呵,就手动改哈~~ 因此这里需要引入一个学年的概念
     //默认学年 就是 所选的的学年
     //通过学年=》涉及的两个学期,通过站点=》可能注册的学期节点,通过相交,可以找出那个学年的注册学期
     //然后通过当前学期进行判断 显示财务当年最终专业班级的最终学期的学期ID,从而获得学期ID
     //由于和stt有关系,因此,我们xqid的产生也将在下面的stt判断中一并产生,见谅
     $xn = M('xn');
     $xno = $xn->where('xndq=1')->find();
     if ($athofnstt['aths'] == 1) {
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqid = $xqw->getcwxqid($grdid, $xno['xnid'], 1);
         $f_usr_sttid = 1;
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         //if($xqid<$sttintxqo['f_sttintxq_xqid']){$xqid=$sttintxqo['f_sttintxq_xqid'];}//①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_cw_xnid-eq-" . $xno['xnid'] . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     } else {
         $f_usr_sttid = $usro['f_usr_sttid'];
         $xqid = $xqw->getcwxqid($grdid, $xno['xnid'], $f_usr_sttid);
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         //if($xqid<$sttintxqo['f_sttintxq_xqid']){$xqid=$sttintxqo['f_sttintxq_xqid'];}//①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     }
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-';
     $lmtint = 20;
     $jn = 'tb_xn ON f_cw_xnid=xnid-jn-tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_dm ON f_stdxqdm_dmid=dmid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cw, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         //设置对相应的该生是否具有修改权限
         //计算应缴总额和实缴总额
         $v['cwyjze'] = $v['cwyjxfsm'] + $v['cwyjjckwfsm'] + $v['cwyjzsfsm'];
         $v['cwsjze'] = $v['cwsjxfsm'] + $v['cwsjjckwfsm'] + $v['cwsjzsfsm'];
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $bxxs = M('bxxs');
     $bxxsls = $bxxs->select();
     $this->assign('bxxsls', $bxxsls);
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的财务阔能还在,因此要保留站点
     if ($athofnstt['aths'] == 1) {
         $sttls = $stt->select();
     } else {
         $sttls = $stt->where('sttid=' . $usro['f_usr_sttid'])->select();
     }
     $this->assign('sttls', $sttls);
     //q特殊
     $cc = M('cc');
     $ccls = $cc->select();
     $this->assign('ccls', $ccls);
     //q特殊
     $kl = M('kl');
     $klls = $kl->select();
     $this->assign('klls', $klls);
     //q特殊
     $xxxs = M('xxxs');
     $xxxsls = $xxxs->select();
     $this->assign('xxxsls', $xxxsls);
     //q特殊
     $zsfw = M('zsfw');
     $zsfwls = $zsfw->select();
     $this->assign('zsfwls', $zsfwls);
     //q特殊
     $xz = M('xz');
     $xzls = $xz->select();
     $this->assign('xzls', $xzls);
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $xq = M('xq');
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     } else {
         $xqls = $xq->order('xqnm DESC')->select();
     }
     $this->assign('xqls', $xqls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_cls_sttid=' . $tmp[0];
     } else {
         if ($athofnstt['aths'] == 1) {
             $where = $where . ' AND f_cls_sttid=1';
         } else {
             $where = $where . ' AND f_cls_sttid=' . $usro['f_usr_sttid'];
         }
     }
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid;
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where)->order('clsnm ASC')->select();
     array_push($clsls, array('clsid' => 0, 'clsnm' => '未分班'));
     $this->assign('clsls', $clsls);
     //q特殊
     $xn = M('xn');
     $xnls = $xn->where('xnnm>=' . $grdo['grdnm'])->order('xnid DESC')->select();
     $this->assign('xnls', $xnls);
     //q特殊
     $dm = M('dm');
     $dmls = $dm->select();
     $this->assign('dmls', $dmls);
     //q特殊
     $sex = M('sex');
     $sexls = $sex->select();
     $this->assign('sexls', $sexls);
     //q特殊
     $rc = M('rc');
     $rcls = $rc->select();
     $this->assign('rcls', $rcls);
     //q特殊
     $zzmm = M('zzmm');
     $zzmmls = $zzmm->select();
     $this->assign('zzmmls', $zzmmls);
     //q特殊
     $xl = M('xl');
     $xlls = $xl->select();
     $this->assign('xlls', $xlls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_std_bxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_bxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_bxxsid=' . $tmp[0];
     }
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_grdid=' . $tmp[0];
     }
     if (preg_match('/f_mj_ccid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_ccid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_ccid=' . $tmp[0];
     }
     if (preg_match('/f_mj_klid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_klid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_klid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xxxsid=' . $tmp[0];
     }
     if (preg_match('/f_mj_zsfwid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_zsfwid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_zsfwid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xzid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xzid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xzid=' . $tmp[0];
     }
     $mj = M($grdo['grdnm'] . '_mj');
     $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->where($where)->order('f_mj_bxxsid ASC,mjdm ASC')->select();
     $tmpls = array();
     foreach ($mjls as $v) {
         if (preg_match('/技能/', $v['bxxsnm'])) {
             $v['bxxsnm'] = '技能';
         } else {
             if (preg_match('/自考/', $v['bxxsnm'])) {
                 $v['bxxsnm'] = '自考';
             } else {
                 $v['bxxsnm'] = '普通';
             }
         }
         array_push($tmpls, $v);
     }
     $this->assign('mjls', $tmpls);
     //q特殊
     $stat = M('stat');
     $statls = $stat->select();
     $this->assign('statls', $statls);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //q特殊
     $this->assign('title', '浏览财务列表');
     $this->assign('theme', '财务管理');
     $this->display('query');
 }
Example #11
0
 function gtxpg()
 {
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     $x = $_GET['x'];
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Xk'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], $x);
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     if ($x == 'clsjtxk') {
         //NB初始化,开始
         $cdt = $_GET['cdt'];
         $grd = M('grd');
         if (preg_match('/f_cjzx_grdid/', $cdt)) {
             //获取该键的值
             $tmp = explode('f_cjzx_grdid', $cdt);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $grdid = $tmp[0];
         } else {
             //默认grdid
             $grdo = $grd->order('grdid DESC')->find();
             $grdid = $grdo['grdid'];
         }
         $this->assign('grdiddft', $grdid);
         $grdo = $grd->where('grdid=' . $grdid)->find();
         $cjzx = clone M($grdo['grdnm'] . '_cjzx');
         $cjzxforcls = clone M($grdo['grdnm'] . '_cjzx');
         $cjzx->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
         // 		$cjzxls=$cjzx->select();
         $fldint = '-cjzxid-f_cjzx_grdid-stdno-stdnm-sexnm-pkzkkm-cjzxpsf-cjzxsftj-cjzxxk-cjzxqk-xqnm-f_cjzx_pkid-f_cjzx_xqid-kcnm-tcrnn-';
         if (preg_match('/f_cjzx_sttid/', $cdt)) {
             //获取该键的值
             $tmp = explode('f_cjzx_sttid', $cdt);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $sttid = $tmp[0];
         } else {
             //默认sttid
             if ($athofnstt['aths'] == 1) {
                 $sttid = 1;
             } else {
                 $sttid = $usro['f_usr_sttid'];
             }
         }
         $this->assign('sttiddft', $sttid);
         if (preg_match('/f_cjzx_xqid/', $cdt)) {
             //获取该键的值
             $tmp = explode('f_cjzx_xqid', $cdt);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $xqid = $tmp[0];
         } else {
             $xq = M('xq');
             $xqo = $xq->where('xqdq=1')->find();
             $xqid = $xqo['xqid'];
             $sttintxq = M($grdo['grdnm'] . '_sttintxq');
             $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $sttid)->find();
             if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
                 $xqid = $sttintxqo['f_sttintxq_xqid'];
             }
             //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         }
         $this->assign('xqiddft', $xqid);
         $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
         $spccdtint = '-sp-';
         ////
         $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-pkzkkm ASC-kcnm ASC-';
         $lmtint = 100;
         $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
         import('@.NB.NBAction');
         $NB = new NBAction();
         $cls = M($grdo['grdnm'] . '_cls');
         $clsls = $cls->where('clsactvt=1 AND f_cls_sttid=' . $sttid)->order('clsnm ASC')->select();
         $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
         $clslsfn = array();
         foreach ($clsls as $v) {
             $clsid = $v['clsid'];
             //找学生代表//万一这个学生代表有些课没选咋办?所以要采用高大上的DISTINCT
             $pkidls = $cjzxforcls->Distinct(true)->field('pkid')->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $v['clsid'])->select();
             $where = '1=2';
             foreach ($pkidls as $vI) {
                 $where = $where . ' OR pkid=' . $vI['pkid'];
             }
             $pk = m($grdo['grdnm'] . '_pk');
             $pkls = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where($where)->order('pkzkkm ASC,kcnm ASC')->select();
             // 				$stdo=$stdxqcls->join('tb_'.$grdo['grdnm'].'_std ON f_stdxqcls_stdid=stdid')->where('f_stdxqcls_xqid='.$xqid.' AND f_stdxqcls_clsid='.$clsid.' AND f_std_statid=5')->order('stdno ASC')->find();
             // 				$cdtintII=$cdtint.'stdid-eq-'.$stdo['stdid'].'-sp-';
             // 				$arr=$NB->NB($cjzx,$fldint,$cdtintII,$spccdtint,$odrint,$lmtint,$jn,'n','n');////
             // 				$v['pkls']=$arr['mls'];
             $v['pkls'] = $pkls;
             array_push($clslsfn, $v);
         }
         //为了确保有NB过程,所以我们不管是有没有班级,统一NB一次,反正得到的ARR也不用,且却得到很多必要参数
         $arr = $NB->NB($cjzx, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'n', 'n');
         ////
         $this->assign('fstrw', $arr['fstrw']);
         $this->assign('sqlstc', $arr['sqlstc']);
         $this->assign('fld', $arr['fld']);
         $this->assign('cdt', $arr['cdt']);
         $this->assign('spccdt', $arr['spccdt']);
         ////
         $this->assign('odr', $arr['odr']);
         $this->assign('lmt', $arr['lmt']);
         $this->assign('count', $arr['count']);
         $this->assign('clsls', $clslsfn);
         $grdls = $grd->order('grdnm DESC')->select();
         $this->assign('grdls', $grdls);
         $stt = M('stt');
         $sttls = $stt->order('sttid ASC')->select();
         $this->assign('sttls', $sttls);
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
         $this->assign('xqls', $xqls);
         $this->assign('title', '班级集体选课');
         $this->assign('theme', '班级集体选课');
         $this->display('clsjtxk');
     } else {
         if ($x == 'clsjtxksz') {
             $grdid = $_GET['grdid'];
             $sttid = $_GET['sttid'];
             $xqid = $_GET['xqid'];
             $clsid = $_GET['clsid'];
             $grd = M('grd');
             $grdo = $grd->where('grdid=' . $grdid)->find();
             $this->assign('grdo', $grdo);
             $stt = M('stt');
             $stto = $stt->where('sttid=' . $sttid)->find();
             $this->assign('stto', $stto);
             $xq = M('xq');
             $xqo = $xq->where('xqid=' . $xqid)->find();
             $this->assign('xqo', $xqo);
             $cls = M($grdo['grdnm'] . '_cls');
             $clso = $cls->where('clsid=' . $clsid)->find();
             $this->assign('clso', $clso);
             //用高大上的方式看看整个班整体选了那几门课,然后可以在下面剔除掉这些课,避免重复选
             $cjzx = M($grdo['grdnm'] . '_cjzx');
             $pkidls = $cjzx->Distinct(true)->field('pkid')->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $clsid)->select();
             $where = '1=2';
             foreach ($pkidls as $vI) {
                 $where = $where . ' OR pkid=' . $vI['pkid'];
             }
             $pk = m($grdo['grdnm'] . '_pk');
             $pklsyx = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where($where)->order('pkzkkm ASC,kcnm ASC')->select();
             $where = '';
             foreach ($pklsyx as $v) {
                 $where = $where . ' AND pkid<>' . $v['pkid'];
             }
             $pk = M($grdo['grdnm'] . '_pk');
             $pkls = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('f_pk_grdid=' . $grdid . ' AND f_pk_sttid=' . $sttid . ' AND f_pk_xqid=' . $xqid . $where)->select();
             $pklsfn = array();
             foreach ($pkls as $v) {
                 if ($v['pkzkkm'] == 1) {
                     $v['pkzkkm'] = '【自考科目】';
                 } else {
                     $v['pkzkkm'] = '';
                 }
                 array_push($pklsfn, $v);
             }
             $this->assign('pkls', $pklsfn);
             $this->assign('title', '班级集体选课实战');
             $this->assign('theme', '班级集体选课实战');
             $this->assign('btnvl', '确认选课');
             $this->display('clsjtxksz');
         } else {
             if ($x == 'stdgrxk') {
                 //NB初始化,开始
                 $cdt = $_GET['cdt'];
                 $grd = M('grd');
                 if (preg_match('/f_cjzx_grdid/', $cdt)) {
                     //获取该键的值
                     $tmp = explode('f_cjzx_grdid', $cdt);
                     $tmp = explode('-eq-', $tmp[1]);
                     $tmp = explode('-sp-', $tmp[1]);
                     $grdid = $tmp[0];
                 } else {
                     //默认grdid
                     $grdo = $grd->order('grdid DESC')->find();
                     $grdid = $grdo['grdid'];
                 }
                 $this->assign('grdiddft', $grdid);
                 $grdo = $grd->where('grdid=' . $grdid)->find();
                 $cjzx = clone M($grdo['grdnm'] . '_cjzx');
                 $cjzxforstd = clone M($grdo['grdnm'] . '_cjzx');
                 $cjzx->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
                 // 		$cjzxls=$cjzx->select();
                 $fldint = '-cjzxid-f_cjzx_grdid-stdno-stdnm-sexnm-pkzkkm-cjzxpsf-cjzxsftj-cjzxxk-cjzxqk-xqnm-f_cjzx_pkid-f_cjzx_xqid-kcnm-tcrnn-';
                 if (preg_match('/f_cjzx_sttid/', $cdt)) {
                     //获取该键的值
                     $tmp = explode('f_cjzx_sttid', $cdt);
                     $tmp = explode('-eq-', $tmp[1]);
                     $tmp = explode('-sp-', $tmp[1]);
                     $sttid = $tmp[0];
                 } else {
                     //默认sttid
                     if ($athofnstt['aths'] == 1) {
                         $sttid = 1;
                     } else {
                         $sttid = $usro['f_usr_sttid'];
                     }
                 }
                 $this->assign('sttiddft', $sttid);
                 if (preg_match('/f_cjzx_xqid/', $cdt)) {
                     //获取该键的值
                     $tmp = explode('f_cjzx_xqid', $cdt);
                     $tmp = explode('-eq-', $tmp[1]);
                     $tmp = explode('-sp-', $tmp[1]);
                     $xqid = $tmp[0];
                 } else {
                     $xq = M('xq');
                     $xqo = $xq->where('xqdq=1')->find();
                     $xqid = $xqo['xqid'];
                     $sttintxq = M($grdo['grdnm'] . '_sttintxq');
                     $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $sttid)->find();
                     if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
                         $xqid = $sttintxqo['f_sttintxq_xqid'];
                     }
                     //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
                 }
                 $this->assign('xqiddft', $xqid);
                 $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
                 if (preg_match('/f_stdxqcls_clsid/', $cdt)) {
                     //获取该键的值
                     $tmp = explode('f_stdxqcls_clsid', $cdt);
                     $tmp = explode('-eq-', $tmp[1]);
                     $tmp = explode('-sp-', $tmp[1]);
                     $clsid = $tmp[0];
                     $cdtint = $cdtint . 'f_stdxqcls_clsid-eq-' . $clsid . '-sp-';
                 }
                 $this->assign('clsiddft', $clsid);
                 if (preg_match('/stdid/', $cdt)) {
                     //获取该键的值
                     $tmp = explode('stdid', $cdt);
                     $tmp = explode('-eq-', $tmp[1]);
                     $tmp = explode('-sp-', $tmp[1]);
                     $stdid = $tmp[0];
                     $cdtint = $cdtint . 'stdid-eq-' . $stdid . '-sp-';
                 }
                 $this->assign('stdiddft', $stdid);
                 $spccdtint = '-sp-';
                 ////
                 $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-pkzkkm ASC-kcnm ASC-';
                 $lmtint = 100;
                 $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
                 import('@.NB.NBAction');
                 $NB = new NBAction();
                 $cls = M($grdo['grdnm'] . '_cls');
                 $clsls = $cls->where('clsactvt=1 AND f_cls_sttid=' . $sttid)->order('clsnm ASC')->order('clsnm ASC')->select();
                 if ($stdid) {
                     //获取学生信息
                     $std = M($grdo['grdnm'] . '_std');
                     $stdo = $std->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  stdid=" . $stdid)->find();
                     $pkls = $cjzxforstd->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where("f_cjzx_grdid=" . $grdid . " AND f_cjzx_sttid=" . $sttid . " AND f_cjzx_xqid=" . $xqid . " AND f_cjzx_stdid=" . $stdid)->order('pkzkkm ASC,kcnm ASC')->select();
                     $this->assign('stdo', $stdo);
                     $this->assign('pkls', $pkls);
                 }
                 //为了确保有NB过程,所以我们不管是有没有班级,统一NB一次,反正得到的ARR也不用,且却得到很多必要参数
                 $arr = $NB->NB($cjzx, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'n', 'n');
                 ////
                 $this->assign('fstrw', $arr['fstrw']);
                 $this->assign('sqlstc', $arr['sqlstc']);
                 $this->assign('fld', $arr['fld']);
                 $this->assign('cdt', $arr['cdt']);
                 $this->assign('spccdt', $arr['spccdt']);
                 ////
                 $this->assign('odr', $arr['odr']);
                 $this->assign('lmt', $arr['lmt']);
                 $this->assign('count', $arr['count']);
                 $grdls = $grd->order('grdnm DESC')->select();
                 $this->assign('grdls', $grdls);
                 $stt = M('stt');
                 $sttls = $stt->order('sttid ASC')->select();
                 $this->assign('sttls', $sttls);
                 import('@.XQ.XQAction');
                 $xqw = new XQAction();
                 //外来的学期
                 $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
                 $this->assign('xqls', $xqls);
                 $cls = M($grdo['grdnm'] . '_cls');
                 $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where('f_cls_grdid=' . $grdid . ' AND f_cls_sttid=' . $sttid)->select();
                 $this->assign('clsls', $clsls);
                 $std = M($grdo['grdnm'] . '_std');
                 $stdls = $std->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_std_sttid=" . $sttid . ' AND f_stdxqcls_clsid=' . $clsid)->order('f_mj_bxxsid ASC,mjid ASC,stdno ASC')->select();
                 $this->assign('stdls', $stdls);
                 $this->assign('title', '学生个人选课');
                 $this->assign('theme', '学生个人选课');
                 $this->display('stdgrxk');
             } else {
                 if ($x == 'stdgrxksz') {
                     $grdid = $_GET['grdid'];
                     $sttid = $_GET['sttid'];
                     $xqid = $_GET['xqid'];
                     $clsid = $_GET['clsid'];
                     $stdid = $_GET['stdid'];
                     $grd = M('grd');
                     $grdo = $grd->where('grdid=' . $grdid)->find();
                     $this->assign('grdo', $grdo);
                     $stt = M('stt');
                     $stto = $stt->where('sttid=' . $sttid)->find();
                     $this->assign('stto', $stto);
                     $xq = M('xq');
                     $xqo = $xq->where('xqid=' . $xqid)->find();
                     $this->assign('xqo', $xqo);
                     $cls = M($grdo['grdnm'] . '_cls');
                     $clso = $cls->where('clsid=' . $clsid)->find();
                     $this->assign('clso', $clso);
                     //用高大上的办法看看他所在班都选了那几门课,并看看他自己选了哪几门课,万一已选就算蛋
                     $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
                     $stdo = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_std ON f_stdxqcls_stdid=stdid')->where('f_stdxqcls_xqid=' . $xqid . ' AND f_stdxqcls_clsid=' . $clsid . ' AND f_std_statid=5 AND stdid=' . $stdid)->find();
                     $this->assign('stdo', $stdo);
                     $cjzx = M($grdo['grdnm'] . '_cjzx');
                     //获取班级选课信息 以及学生选课信息,进行比对,留下学生未选的哪些课程
                     $pkidls = $cjzx->Distinct(true)->field('pkid')->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $clsid)->select();
                     $pklsstd = $cjzx->where("f_cjzx_grdid=" . $grdid . " AND f_cjzx_sttid=" . $sttid . " AND f_cjzx_xqid=" . $xqid . " AND f_cjzx_stdid=" . $stdid)->select();
                     $pkidlsfn = array();
                     foreach ($pkidls as $v) {
                         $duishangflg = 0;
                         //对上
                         foreach ($pklsstd as $vI) {
                             if ($v['pkid'] == $vI['f_cjzx_pkid']) {
                                 $duishangflg = 1;
                                 break;
                             }
                         }
                         if ($duishangflg == 0) {
                             array_push($pkidlsfn, $v);
                         }
                     }
                     //得出已选的PKLS
                     $where = '1=2';
                     foreach ($pkidlsfn as $v) {
                         $where = $where . ' OR pkid=' . $v['pkid'];
                     }
                     $pk = M($grdo['grdnm'] . '_pk');
                     $pkls = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where($where)->select();
                     $pklsfn = array();
                     foreach ($pkls as $v) {
                         if ($v['pkzkkm'] == 1) {
                             $v['pkzkkm'] = '【自考科目】';
                         } else {
                             $v['pkzkkm'] = '';
                         }
                         array_push($pklsfn, $v);
                     }
                     $this->assign('pkls', $pklsfn);
                     $this->assign('title', '学生个人选课实战');
                     $this->assign('theme', '学生个人选课实战');
                     $this->assign('btnvl', '确认选课');
                     $this->display('stdgrxksz');
                 } else {
                     if ($x == 'vw') {
                         $grdid = $_GET['grdid'];
                         $xkid = $_GET['xkid'];
                         $grd = M('grd');
                         $grdo = $grd->where('grdid=' . $grdid)->find();
                         $xk = M($grdo['grdnm'] . '_xk');
                         $mo = $xk->join('tb_stt ON f_xk_sttid=sttid')->join('tb_grd ON f_xk_grdid=grdid')->join('tb_xq ON f_xk_xqid=xqid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_xk_kcid=kcid')->join('tb_tcr ON f_xk_tcrid=tcrid')->where("xkid=" . $xkid)->find();
                         //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西
                         //适应一些站点用一二三
                         import('@.XQ.XQAction');
                         $xqw = new XQAction();
                         //外来的学期
                         $xqnm = $xqw->getxqnm($grdid, $mo['f_xk_sttid'], $mo['f_xk_xqid']);
                         $mo['xqnm'] = $xqnm;
                         $this->assign('mo', $mo);
                         $this->assign('title', '查看');
                         $this->assign('theme', '查看详细');
                         $this->display('view');
                     } else {
                         if ($x == 'updt') {
                             $grdid = $_GET['grdid'];
                             $xkid = $_GET['xkid'];
                             $usr = M('usr');
                             $usro = $usr->where('usrid=' . session('usridss'))->find();
                             //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
                             $mdII = M('md');
                             $mdo = $mdII->where("mdmk='Stt'")->find();
                             import('@.IDTATH.IdtathAction');
                             $Idtath = new IdtathAction();
                             $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
                             if ($xkid == 0) {
                                 $mo['xkid'] = 0;
                                 //默认年级是当前年级
                                 $grd = M('grd');
                                 $grdo = $grd->order('grdnm DESC')->find();
                                 $grdid = $grdo['grdid'];
                                 $mo['f_xk_grdid'] = $grdid;
                                 //默认站点,有主的找有主的,没主的找本部
                                 if ($athofnstt['aths'] != 1) {
                                     $mo['f_xk_sttid'] = $usro['f_usr_sttid'];
                                 } else {
                                     $mo['f_xk_sttid'] = 1;
                                 }
                                 //默认学期 为XX年级XX站点的起始学期
                                 $xq = M('xq');
                                 $xqo = $xq->where('xqdq=1')->find();
                                 $xqid = $xqo['xqid'];
                                 $sttintxq = M($grdo['grdnm'] . '_sttintxq');
                                 $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $mo['f_xk_sttid'])->find();
                                 if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
                                     $xqid = $sttintxqo['f_sttintxq_xqid'];
                                 }
                                 //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
                                 $mo['f_xk_xqid'] = $xqid;
                                 $this->assign('title', '添加');
                                 $this->assign('theme', '添加:');
                                 $this->assign('btnvl', '添加');
                             } else {
                                 $grd = M('grd');
                                 $grdo = $grd->where('grdid=' . $grdid)->find();
                                 $xk = M($grdo['grdnm'] . '_xk');
                                 $mo = $xk->join('tb_stt ON f_xk_sttid=sttid')->join('tb_grd ON f_xk_grdid=grdid')->join('tb_xq ON f_xk_xqid=xqid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_xk_kcid=kcid')->join('tb_tcr ON f_xk_tcrid=tcrid')->where("xkid=" . $xkid)->find();
                                 $this->assign('title', '修改');
                                 $this->assign('theme', '修改:');
                                 $this->assign('btnvl', '修改');
                             }
                             $this->assign('mo', $mo);
                             //q特殊
                             $where = '1=1';
                             if ($athofnstt['aths'] != 1) {
                                 $where = $where . ' AND sttid=' . $usro['f_usr_sttid'];
                             }
                             $stt = M('stt');
                             $sttls = $stt->where($where)->select();
                             $this->assign('sttls', $sttls);
                             //q特殊
                             $grd = M('grd');
                             $grdls = $grd->order('grdnm DESC')->select();
                             $this->assign('grdls', $grdls);
                             import('@.XQ.XQAction');
                             $xqw = new XQAction();
                             //外来的学期
                             $xqls = $xqw->getxqls($grdo['grdid'], $mo['f_xk_sttid'], 'DESC');
                             $this->assign('xqls', $xqls);
                             //课程
                             //q特殊
                             $kc = M($grdo['grdnm'] . '_kc');
                             $kcls = $kc->where('f_kc_grdid=' . $grdo['grdid'])->select();
                             $this->assign('kcls', $kcls);
                             //教师
                             //q特殊
                             $tcr = M('tcr');
                             $tcrls = $tcr->where('f_tcr_sttid=' . $mo['f_xk_sttid'])->select();
                             $this->assign('tcrls', $tcrls);
                             $this->display('update');
                         }
                     }
                 }
             }
         }
     }
 }
Example #12
0
 public function outputylqmd()
 {
     //先去数据库找出你要让哪些数据出来
     header("Content-Type:text/html; charset=utf-8");
     $zssz = M('zssz');
     $zsszo = $zssz->where('zsszid=1')->find();
     $xqid = $zsszo['f_zssz_xqid'];
     $grd = M('grd');
     $grdo = $grd->where('grdid=' . $zsszo['f_zssz_grdid'])->find();
     $grdnm = $grdo['grdnm'];
     $jn = 'tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdnm . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdnm . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_dm ON f_stdxqdm_dmid=dmid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     $fldint = '-stdid-bxxsnm-stdaplno-stdnm-sexnm-stdbtd-mjnm-statnm-';
     $jsn = array('bxxsnm' => '办学形式', 'sttnm' => '站点', 'grdnm' => '年级', 'stdaplno' => '报名号', 'stdno' => '学号', 'stdupfnctm' => '上传财务时间', 'stdnm' => '姓名', 'clsnm' => '班级', 'dmnm' => '寝室', 'sexnm' => '性别', 'rcnm' => '民族', 'zzmmnm' => '政治面貌', 'stdnp' => '籍贯', 'stdbtd' => '出生日期', 'xnl' => '是否小年龄', 'stdsol' => '文理科', 'stdcee' => '高考成绩', 'stdsog' => '毕业学校', 'stdqq' => 'QQ', 'xlnm' => '最高学历', 'stdidcd' => '身份证号码', 'stdcp' => '手机号码', 'stdrlta' => '家长一', 'stdrltanm' => '家长一姓名', 'stdrltaocpt' => '家长一职业', 'stdrltacp' => '家长一手机号', 'stdrltb' => '家长二', 'stdrltbnm' => '家长二姓名', 'stdrltbocpt' => '家长二职业', 'stdrltbcp' => '家长二手机号', 'stdhb' => '爱好', 'mjnm' => '专业', 'statnm' => '状态', 'stdpst' => '邮编', 'stdads' => '家庭地址', 'stdmdftm' => '修改时间', 'stdaddtm' => '添加时间', 'stdtlp' => '固话', 'stdpertm' => '预录取时间', 'stdertm' => '录取时间', 'stdicbc' => '工行卡号', 'stdrcmdnm' => '推荐人姓名', 'stdrcmdcp' => '推荐人手机号', 'stdpnttm' => '信息打印时间', 'xqnm' => '学期');
     //NB初始化,开始
     $m = M($grdo['grdnm'] . '_std');
     $m->join('inner join tb_' . $grdnm . '_stdxqdm ON stdid=f_stdxqdm_stdid')->join('inner join tb_' . $grdnm . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdnm . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     $cdtint = "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . "-sp-f_std_statid-eq-1-sp-";
     $spccdtint = "-sp-stdupfnctm<>''-sp-";
     $odrint = '-stdaddtm DESC-';
     $lmtint = 20;
     //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
     $fld = $arr['fld'];
     //去 f_...//先拆开,后结合的方式
     $fldu = explode('-', $fld);
     $fldnw = '-';
     for ($i = 1; $i < count($fldu) - 1; $i++) {
         if (!preg_match('/f_/', $fldu[$i])) {
             $fldnw = $fldnw . $fldu[$i] . '-';
         }
     }
     $fld = $fldnw;
     $mlsall = $arr['mlsforcount'];
     $fld = str_replace('-stdbtd-', '-stdbtd-xnl-', $fld);
     $zssz = M('zssz');
     $zsszo = $zssz->where('zsszid=1')->find();
     $tmp = explode(' ', $zsszo['zsszxnltm']);
     $zsszxnltm = $tmp[0];
     $mlsallfn = array();
     foreach ($mlsall as $stdv) {
         if ($stdv['stdbtd'] < $zsszxnltm) {
             $stdv['xnl'] = '否';
         } else {
             $stdv['xnl'] = '是';
         }
         array_push($mlsallfn, $stdv);
     }
     $mlsall = $mlsallfn;
     import('@.ORG.PHPExcel');
     // Create new PHPExcel object
     $objPHPExcel = new PHPExcel();
     // Set properties
     $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
     // set table header content列是从0开始,行是从1开始
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
     $sheet = $objPHPExcel->setActiveSheetIndex(0);
     $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '序号');
     $fldu = explode('-', $fld);
     for ($i = 2; $i < count($fldu) - 1; $i++) {
         $sheet = $sheet->setCellValueByColumnAndRow($i - 1, 1, $jsn[$fldu[$i]]);
     }
     //Miscellaneous glyphs, UTF-8
     for ($j = 0; $j < count($mlsall); $j++) {
         $m = $mlsall[$j];
         $sheet = $sheet->setCellValueByColumnAndRow(0, $j + 2, $j + 1);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 1, $j + 2, $m[$fldu[$i]] . ' ');
         }
     }
     //  sheet命名
     //$objPHPExcel->getActiveSheet()->setTitle('订单汇总表');
     // Set active sheet index to the first sheet, so Excel opens this as the first sheet
     $objPHPExcel->setActiveSheetIndex(0);
     // excel头参数
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename=" . '导出录取名单(已经在计财处库里且之前并没有打印邮寄过录取名单且不是已退学的学生)' . date("Ymd-His") . ".xls");
     //日期为文件名后缀
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     //excel5为xls格式,excel2007为xlsx格式
     $objWriter->save('php://output');
 }
Example #13
0
 function collect()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     // 		import('@.NTF.NTFAction');
     // 		$ntf = new NTFAction();
     // 		$ntf->setntf();
     import('@.NV.NVAction');
     $nv = new NVAction();
     $nv->setnv();
     $cstmusrid = session('cstmusridss');
     $atcclct = M('atcclct');
     //$bbb=$atcclct->select();p($bbb);die;
     // 	$aaaa=$atcclct->join('tb_atc ON f_atcclct_atcid=atcid')->join('tb_cstmusr ON f_atcclct_cstmusrid=cstmusrid')->join('tb_bd ON f_atc_bdid=bdid')
     // 	->where("atcps='y' AND atcvw='y' AND cstmusrid=".$cstmusrid)->select();p($aaaa);die;
     //NB初始化,开始
     $cstmusrid = session('cstmusridss');
     $cstmatcclct = M('cstmatcclct');
     $atc = M('atc');
     $fldint = '-atcid-bdnm-atctpc-atcath-atcmdftm-atccnt-atczn-atctc-';
     $cdtint = "-sp-atcps-eq-1-sp-atcvw-eq-1-sp-cstmusrid-eq-" . $cstmusrid . "-sp-";
     $spccdtint = "-sp-";
     ////
     $odrint = '-atctp DESC-atcmdftm DESC-';
     $lmtint = 20;
     $jn = 'tb_atc ON f_cstmatcclct_atcid=atcid-jn-tb_cstmusr ON f_cstmatcclct_cstmusrid=cstmusrid-jn-tb_bd ON f_atc_bdid=bdid';
     //$jn='tb_ath ON f_atc_athid=athid-jn-tb_atc ON f_atc_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmatcclct, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     $atcls = $arr['mls'];
     for ($j = 0; $j < count($atcls); $j++) {
         if (mb_strlen($atcls[$j]['atctpc'], 'utf-8') > 45) {
             $atcls[$j]['atctpcsrk'] = mb_substr($atcls[$j]['atctpc'], 0, 45, 'utf-8') . '...';
         } else {
             $atcls[$j]['atctpcsrk'] = $atcls[$j]['atctpc'];
         }
         $time = strtotime($atcls[$j]['atcmdftm']);
         $atcls[$j]['atcmdftm'] = date("Y/m/d", $time);
         if ($atcls[$j]['atctp'] == 1) {
             $atcls[$j]['atcstyle'] = 'font-weight:bold';
             $atcls[$j]['atcflag'] = 'glyphicon glyphicon-equalizer';
         }
     }
     $this->assign('atcls', $atcls);
     $bdo['bdnm'] = "<h1 class='page-header' style='font-size:30px'>收藏的文章</h1>";
     $this->assign('bdo', $bdo);
     //q特殊
     $this->assign('title', '浏览文章列表');
     $this->assign('theme', '收藏文章');
     $this->display('query');
 }
Example #14
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Zssz'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     $zssz = M('zssz');
     $fldint = '-zsszid-grdnm-xqnm-zsszbxxsu-zsszop-zsszjztm-zsszxnltm-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-';
     $lmtint = 20;
     $jn = 'tb_grd ON f_zssz_grdid=grdid-jn-tb_xq ON f_zssz_xqid=xqid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($zssz, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['zsszop'] == 1) {
             $v['zsszop'] = '是';
         } else {
             $v['zsszop'] = '否';
         }
         //改变bxxsu的具体值
         $bxxs = M('bxxs');
         $tmp = explode('-', $v['zsszbxxsu']);
         $str = '';
         for ($i = 1; $i < count($tmp) - 1; $i++) {
             $bxxso = $bxxs->where('bxxsid=' . $tmp[$i])->find();
             $str = $str . $bxxso['bxxsnm'] . ' ';
         }
         $v['zsszbxxsu'] = $str;
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $this->assign('title', '浏览招生设置列表');
     $this->assign('theme', '招生设置管理');
     $this->display('query');
 }
Example #15
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Lbmd'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $lbmd = M('lbmd');
     $fldint = '-lbmdid-lbnm-mdnm-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '';
     $lmtint = 20;
     $jn = 'tb_lb ON f_lbmd_lbid=lbid-jn-tb_md ON f_lbmd_mdid=mdid';
     //$jn='tb_lb ON f_lbmd_lbid=lbid-jn-tb_atc ON f_lbmd_lbid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($lbmd, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $lb = M('lb');
     $lbls = $lb->select();
     $this->assign('lbls', $lbls);
     //q特殊
     $md = M('md');
     $mdls = $md->select();
     $this->assign('mdls', $mdls);
     //q特殊
     $this->assign('title', '浏览类别-模块列表');
     $this->assign('theme', '类别-模块管理');
     $this->display('query');
 }
Example #16
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Bzr'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_bzr_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_bzr_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $bzr = M($grdo['grdnm'] . '_bzr');
     $fldint = '-bzrid-f_bzr_grdid-grdnm-sttnm-usrnn-clsnm-clsactvt-';
     $cdtint = "-sp-f_bzr_grdid-eq-" . $grdo['grdid'] . "-sp-f_usr_sttid-eq-1-sp-f_cls_sttid-eq-1-sp-clsactvt-eq-1-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-';
     $lmtint = 20;
     $jn = 'tb_grd ON f_bzr_grdid=grdid-jn-tb_usr ON f_bzr_usrid=usrid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_bzr_clsid=clsid-jn-tb_stt ON f_cls_sttid=sttid';
     //$jn='tb_ath ON f_bzr_athid=athid-jn-tb_atc ON f_bzr_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($bzr, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['clsactvt'] == 1) {
             $v['clsactvt'] = '是';
         } else {
             $v['clsactvt'] = '否';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $stt = M('stt');
     $sttls = $stt->select();
     $this->assign('sttls', $sttls);
     //q特殊
     $usr = M('usr');
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_usr_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_usr_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_usr_sttid=' . $tmp[0];
     }
     $rl = M('rl');
     $rlo = $rl->where("rlnm LIKE '%班主任%'")->find();
     $usrrl = M('usrrl');
     $usrrlls = $usrrl->join('tb_usr ON f_usrrl_usrid=usrid')->join('tb_stt ON f_usr_sttid=sttid')->where($where . ' AND f_usrrl_rlid=' . $rlo['rlid'])->order('usrnm ASC')->select();
     $this->assign('usrls', $usrrlls);
     //q特殊
     $cdt = $arr['cdt'];
     $cls = M($grdo['grdnm'] . '_cls');
     $where = '1=1';
     if (preg_match('/f_cls_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cls_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_cls_sttid=' . $tmp[0];
     }
     if (preg_match('/clsactvt/', $cdt)) {
         //获取该键的值
         $tmp = explode('clsactvt', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . " AND clsactvt=" . $tmp[0];
     }
     $clsls = $cls->where($where)->order('clsnm ASC')->select();
     $this->assign('clsls', $clsls);
     //q特殊
     $this->assign('title', '浏览班主任列表');
     $this->assign('theme', '班主任管理');
     $this->display('query');
 }
Example #17
0
 public function outputcjzx()
 {
     //先去数据库找出你要让哪些数据出来
     header("Content-Type:text/html; charset=utf-8");
     $biaoji = $_POST['biaoji'];
     if ($biaoji == 'cj') {
         $mk = $_POST['mk'];
         if ($mk == 'cjzx') {
             $tmp = explode('f_cjzx_grdid', $_POST['cdt']);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $grdid = $tmp[0];
             $grd = M('grd');
             $grdo = $grd->where('grdid=' . $grdid)->find();
             $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
             $fldint = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
             $jsn = array('stdno' => '学号', 'stdnm' => '姓名', 'sexnm' => '性别', 'cjzxzf' => '总成绩', 'cjzxqmf' => '卷面', 'cjzxpsf' => '平时', 'cjzxxtf' => '习题');
         }
         //NB初始化,开始
         $m = M($grdo['grdnm'] . '_cjzx')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
         $cdtint = "-sp-";
         $spccdtint = '-sp-';
         $odrint = '-';
         $lmtint = 100;
         //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
         import('@.NB.NBAction');
         $NB = new NBAction();
         $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
         $fld = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
         $mlsall = $arr['mlsforcount'];
         $mo = $mlsall[0];
         $bxxnm = $mo['bxxsnm'];
         $clsnm = $mo['clsnm'];
         $kcnm = $mo['kcnm'];
         $xqnm = $mo['xqnm'];
         $mjnm = $mo['mjnm'];
         foreach ($mlsall as $v) {
             if (!preg_match('/' . $v['mjnm'] . '/', $mjnm)) {
                 $mjnm = $mjnm . '  ' . $v['mjnm'];
             }
         }
         $zm = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
         import('@.ORG.PHPExcel');
         // Create new PHPExcel object
         $objPHPExcel = new PHPExcel();
         // Set properties
         $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
         //设置边框
         //     	$objExcel = new PHPExcel();
         //     	//$objExcel->setActiveSheetIndex(0);
         //     	$objActSheet = $objExcel->getActiveSheet();
         //     	$objStyleA5 = $objActSheet->getStyle('A5');
         //     	$objBorderA5 = $objStyleA5->getBorders();
         //     	$objBorderA5->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getTop()->getColor()->setARGB('FFFF0000'); // color
         //     	$objBorderA5->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //设置宽度
         $objActSheet = $objPHPExcel->getActiveSheet();
         //$objActSheet->getColumnDimension('A')->setAutoSize();
         $objActSheet->getColumnDimension('A')->setWidth(12);
         $objActSheet->getColumnDimension('B')->setWidth(7);
         $objActSheet->getColumnDimension('C')->setWidth(5);
         $objActSheet->getColumnDimension('D')->setWidth(6);
         $objActSheet->getColumnDimension('E')->setWidth(5);
         $objActSheet->getColumnDimension('F')->setWidth(5);
         $objActSheet->getColumnDimension('G')->setWidth(5);
         $objActSheet->getColumnDimension('H')->setWidth(2);
         $objActSheet->getColumnDimension('I')->setWidth(12);
         $objActSheet->getColumnDimension('J')->setWidth(7);
         $objActSheet->getColumnDimension('K')->setWidth(5);
         $objActSheet->getColumnDimension('L')->setWidth(6);
         $objActSheet->getColumnDimension('M')->setWidth(5);
         $objActSheet->getColumnDimension('N')->setWidth(5);
         $objActSheet->getColumnDimension('O')->setWidth(5);
         for ($i = 5; $i <= 38; $i++) {
             $objActSheet->getRowDimension('' . $i)->setRowHeight(15.55);
         }
         // set table header content列是从0开始,行是从1开始
         $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
         //     	$objBorderA1=$objPHPExcel->getActiveSheet()->getStyle('B8')->getBorders();
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $sheet = $objPHPExcel->setActiveSheetIndex(0);
         $sheet->mergeCells("A1:O1");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '中国计量学院' . $bxxsnm . '考试成绩登记表');
         $sheet->mergeCells("A2:O2");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 2, $mjnm . ' 专业  ' . $clsnm . ' 课程名称 ' . $kcnm);
         $sheet->mergeCells("A3:O3");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 3, '(' . $xqnm . ')');
         //$sheet=$sheet->setCellValueByColumnAndRow(0,1,'序号');
         $fldu = explode('-', $fld);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 2, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i - 2] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i + 6, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i + 6] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         if (count($mlsall) > 33) {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < 33; $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
             for ($j = 33; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i + 6, $j + 6 - 33, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         } else {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         }
         $sheet->mergeCells("A39:O39");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 39, '批卷老师签字:                                              班主任签字:');
         $sheet->mergeCells("A40:O40");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 40, '说明:  1、任课教师应于考试后三天内,登陆http://cjxy.cjlu.edu.cn录入成绩,');
         $sheet->mergeCells("A41:O41");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 41, '                 并将本表卷面成绩、习题分两项认真填写,一式两份,交格致北楼302办公室');
         $sheet->mergeCells("A42:O42");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 42, '            2、卷面成绩占总成绩的70%,平时成绩占总成绩的20%(由班主任评定),习题成绩占总成绩的10%。');
         $sheet->mergeCells("A43:O43");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 43, '                 总成绩=卷面成绩*0.7+平时成绩*0.2+习题成绩*0.1');
         $sheet->mergeCells("A44:O44");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 44, '            3、班主任请在收到此表后三天,将本表平时分项认真填写,一式两份。');
         //设置居中
         //$objActSheet->getStyle('A5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objActSheet->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         // Set active sheet index to the first sheet, so Excel opens this as the first sheet
         $objPHPExcel->setActiveSheetIndex(0);
         // excel头参数
         header('Content-Type: application/vnd.ms-excel');
         header("Content-Disposition: attachment;filename=" . $clsnm . '-' . $kcnm . '成绩单' . date("Ymd-His") . ".xls");
         //日期为文件名后缀
         header('Cache-Control: max-age=0');
         $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
         //excel5为xls格式,excel2007为xlsx格式
         $objWriter->save('php://output');
     }
     if ($biaoji == 'bkcj') {
         $mk = $_POST['mk'];
         if ($mk == 'cjzx') {
             $tmp = explode('f_cjzx_grdid', $_POST['cdt']);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $grdid = $tmp[0];
             $grd = M('grd');
             $grdo = $grd->where('grdid=' . $grdid)->find();
             $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
             $fldint = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-cjzxbkf-';
             $jsn = array('stdno' => '学号', 'stdnm' => '姓名', 'sexnm' => '性别', 'cjzxzf' => '总成绩', 'cjzxqmf' => '卷面', 'cjzxpsf' => '平时', 'cjzxxtf' => '习题', 'cjzxbkf' => '补考成绩');
         }
         //NB初始化,开始
         $m = M($grdo['grdnm'] . '_cjzx')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
         $cdtint = "-sp-";
         $spccdtint = '-sp-';
         $odrint = '-';
         $lmtint = 100;
         //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
         import('@.NB.NBAction');
         $NB = new NBAction();
         $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
         $fld = '-cjzxid-stdno-stdnm-sexnm-cjzxbkf-';
         $mlsall = $arr['mlsforcount'];
         $mo = $mlsall[0];
         $bxxnm = $mo['bxxsnm'];
         $clsnm = $mo['clsnm'];
         $kcnm = $mo['kcnm'];
         $xqnm = $mo['xqnm'];
         $mjnm = $mo['mjnm'];
         foreach ($mlsall as $v) {
             if (!preg_match('/' . $v['mjnm'] . '/', $mjnm)) {
                 $mjnm = $mjnm . '  ' . $v['mjnm'];
             }
         }
         $zm = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
         import('@.ORG.PHPExcel');
         // Create new PHPExcel object
         $objPHPExcel = new PHPExcel();
         // Set properties
         $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
         //设置边框
         //      $objExcel = new PHPExcel();
         //      //$objExcel->setActiveSheetIndex(0);
         //      $objActSheet = $objExcel->getActiveSheet();
         //      $objStyleA5 = $objActSheet->getStyle('A5');
         //      $objBorderA5 = $objStyleA5->getBorders();
         //      $objBorderA5->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA5->getTop()->getColor()->setARGB('FFFF0000'); // color
         //      $objBorderA5->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA5->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA5->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //设置宽度
         $objActSheet = $objPHPExcel->getActiveSheet();
         //$objActSheet->getColumnDimension('A')->setAutoSize();
         $objActSheet->getColumnDimension('A')->setWidth(12);
         $objActSheet->getColumnDimension('B')->setWidth(7);
         $objActSheet->getColumnDimension('C')->setWidth(5);
         $objActSheet->getColumnDimension('D')->setWidth(10);
         $objActSheet->getColumnDimension('E')->setWidth(1);
         $objActSheet->getColumnDimension('F')->setWidth(5);
         $objActSheet->getColumnDimension('G')->setWidth(5);
         $objActSheet->getColumnDimension('H')->setWidth(2);
         $objActSheet->getColumnDimension('I')->setWidth(12);
         $objActSheet->getColumnDimension('J')->setWidth(7);
         $objActSheet->getColumnDimension('K')->setWidth(5);
         $objActSheet->getColumnDimension('L')->setWidth(10);
         $objActSheet->getColumnDimension('M')->setWidth(1);
         $objActSheet->getColumnDimension('N')->setWidth(5);
         $objActSheet->getColumnDimension('O')->setWidth(5);
         for ($i = 5; $i <= 38; $i++) {
             $objActSheet->getRowDimension('' . $i)->setRowHeight(15.55);
         }
         // set table header content列是从0开始,行是从1开始
         $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
         //      $objBorderA1=$objPHPExcel->getActiveSheet()->getStyle('B8')->getBorders();
         //      $objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA1->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA1->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //      $objBorderA1->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $sheet = $objPHPExcel->setActiveSheetIndex(0);
         $sheet->mergeCells("A1:O1");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '中国计量学院' . $bxxsnm . '补考考试成绩登记表');
         $sheet->mergeCells("A2:O2");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 2, $mjnm . ' 专业  ' . $clsnm . ' 课程名称 ' . $kcnm);
         $sheet->mergeCells("A3:O3");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 3, '(' . $xqnm . ')');
         //$sheet=$sheet->setCellValueByColumnAndRow(0,1,'序号');
         $fldu = explode('-', $fld);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 2, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i - 2] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i + 6, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i + 6] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         if (count($mlsall) > 33) {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < 33; $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
             for ($j = 33; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i + 6, $j + 6 - 33, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         } else {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         }
         $sheet->mergeCells("A39:O39");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 39, '批卷老师签字:                                              ');
         $sheet->mergeCells("A40:O40");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 40, '说明:  任课教师应于考试后三天内,登陆http://cjxy.cjlu.edu.cn录入成绩,一式两份,');
         $sheet->mergeCells("A41:O41");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 41, '                 交格致北楼302办公室');
         //设置居中
         //$objActSheet->getStyle('A5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objActSheet->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         // Set active sheet index to the first sheet, so Excel opens this as the first sheet
         $objPHPExcel->setActiveSheetIndex(0);
         // excel头参数
         header('Content-Type: application/vnd.ms-excel');
         header("Content-Disposition: attachment;filename=" . $clsnm . '-' . $kcnm . '补考成绩单' . date("Ymd-His") . ".xls");
         //日期为文件名后缀
         header('Cache-Control: max-age=0');
         $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
         //excel5为xls格式,excel2007为xlsx格式
         $objWriter->save('php://output');
     }
     if ($biaoji == 'qd') {
         $mk = $_POST['mk'];
         if ($mk == 'cjzx') {
             $tmp = explode('f_cjzx_grdid', $_POST['cdt']);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $grdid = $tmp[0];
             $grd = M('grd');
             $grdo = $grd->where('grdid=' . $grdid)->find();
             $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
             $fldint = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
             $jsn = array('stdno' => '学号', 'stdnm' => '姓名', 'sexnm' => '性别', 'cjzxzf' => '总成绩', 'cjzxqmf' => '卷面', 'cjzxpsf' => '平时', 'cjzxxtf' => '习题');
         }
         //NB初始化,开始
         $m = M($grdo['grdnm'] . '_cjzx')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
         $cdtint = "-sp-";
         $spccdtint = '-sp-';
         $odrint = '-';
         $lmtint = 100;
         //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
         import('@.NB.NBAction');
         $NB = new NBAction();
         $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
         $fld = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
         $mlsall = $arr['mlsforcount'];
         $mo = $mlsall[0];
         $bxxnm = $mo['bxxsnm'];
         $clsnm = $mo['clsnm'];
         $kcnm = $mo['kcnm'];
         $xqnm = $mo['xqnm'];
         $mjnm = $mo['mjnm'];
         $mlsallfn = array();
         foreach ($mlsall as $v) {
             if (!preg_match('/' . $v['mjnm'] . '/', $mjnm)) {
                 $mjnm = $mjnm . '  ' . $v['mjnm'];
             }
         }
         $zm = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
         import('@.ORG.PHPExcel');
         // Create new PHPExcel object
         $objPHPExcel = new PHPExcel();
         // Set properties
         $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
         //设置边框
         //     	$objExcel = new PHPExcel();
         //     	//$objExcel->setActiveSheetIndex(0);
         //     	$objActSheet = $objExcel->getActiveSheet();
         //     	$objStyleA5 = $objActSheet->getStyle('A5');
         //     	$objBorderA5 = $objStyleA5->getBorders();
         //     	$objBorderA5->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getTop()->getColor()->setARGB('FFFF0000'); // color
         //     	$objBorderA5->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //设置宽度
         $objActSheet = $objPHPExcel->getActiveSheet();
         //$objActSheet->getColumnDimension('A')->setAutoSize();
         $objActSheet->getColumnDimension('A')->setWidth(12);
         $objActSheet->getColumnDimension('B')->setWidth(7);
         $objActSheet->getColumnDimension('C')->setWidth(5);
         $objActSheet->getColumnDimension('D')->setWidth(18);
         $objActSheet->getColumnDimension('E')->setWidth(1);
         $objActSheet->getColumnDimension('F')->setWidth(1);
         $objActSheet->getColumnDimension('G')->setWidth(1);
         $objActSheet->getColumnDimension('H')->setWidth(2);
         $objActSheet->getColumnDimension('I')->setWidth(12);
         $objActSheet->getColumnDimension('J')->setWidth(7);
         $objActSheet->getColumnDimension('K')->setWidth(5);
         $objActSheet->getColumnDimension('L')->setWidth(18);
         $objActSheet->getColumnDimension('M')->setWidth(1);
         $objActSheet->getColumnDimension('N')->setWidth(1);
         $objActSheet->getColumnDimension('O')->setWidth(1);
         for ($i = 5; $i <= 38; $i++) {
             $objActSheet->getRowDimension('' . $i)->setRowHeight(15.55);
         }
         // set table header content列是从0开始,行是从1开始
         $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
         //     	$objBorderA1=$objPHPExcel->getActiveSheet()->getStyle('B8')->getBorders();
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $sheet = $objPHPExcel->setActiveSheetIndex(0);
         $sheet->mergeCells("A1:O1");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '中国计量学院' . $bxxsnm . '考试签到表');
         $sheet->mergeCells("A2:O2");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 2, $mjnm . ' 专业  ' . $clsnm . ' 课程名称 ' . $kcnm);
         $sheet->mergeCells("A3:O3");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 3, '(' . $xqnm . ')');
         //$sheet=$sheet->setCellValueByColumnAndRow(0,1,'序号');
         $fldu = explode('-', $fld);
         for ($i = 2; $i < count($fldu) - 1 - 4; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 2, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i - 2] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         $sheet = $sheet->setCellValueByColumnAndRow($i - 2, 5, '签名处');
         $objActSheet->getStyle($zm[$i - 2] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '5')->getBorders();
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         for ($i = 2; $i < count($fldu) - 1 - 4; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i + 6, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i + 6] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         $sheet = $sheet->setCellValueByColumnAndRow($i + 6, 5, '签名处');
         $objActSheet->getStyle($zm[$i + 6] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '5')->getBorders();
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         if (count($mlsall) > 33) {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < 33; $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1 - 4; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
                 $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, ' ');
                 $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             }
             for ($j = 33; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1 - 4; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i + 6, $j + 6 - 33, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
                 $sheet = $sheet->setCellValueByColumnAndRow($i + 6, $j + 6 - 33, ' ');
                 $objActSheet->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getBorders();
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             }
         } else {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1 - 4; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
                 $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, ' ');
                 $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             }
         }
         //     		$sheet->mergeCells("A39:O39");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,39,'批卷老师:                                              班主任签字:');
         //     		$sheet->mergeCells("A40:O40");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,40,'说明:  1、任课教师应于考试后三天内,登陆http://cjxy.cjlu.edu.cn录入成绩,');
         //     		$sheet->mergeCells("A41:O41");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,41,'                 并将本表卷面成绩、习题分两项认真填写,一式两份,交格致北楼302办公室');
         //     		$sheet->mergeCells("A42:O42");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,42,'            2、卷面成绩占总成绩的70%,平时成绩占总成绩的20%(由班主任评定),习题成绩占总成绩的10%。');
         //     		$sheet->mergeCells("A43:O43");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,43,'                 总成绩=卷面成绩*0.7+平时成绩*0.2+习题成绩*0.1');
         //     		$sheet->mergeCells("A44:O44");
         //     		$sheet=$sheet->setCellValueByColumnAndRow(0,44,'            3、班主任请在收到此表后三天,将本表平时分项认真填写,一式两份。');
         //设置居中
         //$objActSheet->getStyle('A5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objActSheet->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         // Set active sheet index to the first sheet, so Excel opens this as the first sheet
         $objPHPExcel->setActiveSheetIndex(0);
         // excel头参数
         header('Content-Type: application/vnd.ms-excel');
         header("Content-Disposition: attachment;filename=" . $clsnm . '-' . $kcnm . '成绩单' . date("Ymd-His") . ".xls");
         //日期为文件名后缀
         header('Cache-Control: max-age=0');
         $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
         //excel5为xls格式,excel2007为xlsx格式
         $objWriter->save('php://output');
     }
     if ($biaoji == 'kb') {
         $mk = $_POST['mk'];
         if ($mk == 'cjzx') {
             $tmp = explode('f_cjzx_grdid', $_POST['cdt']);
             $tmp = explode('-eq-', $tmp[1]);
             $tmp = explode('-sp-', $tmp[1]);
             $grdid = $tmp[0];
             $grd = M('grd');
             $grdo = $grd->where('grdid=' . $grdid)->find();
             $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
             $fldint = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
             $jsn = array('stdno' => '学号', 'stdnm' => '姓名', 'sexnm' => '性别', 'cjzxzf' => '总成绩', 'cjzxqmf' => '卷面', 'cjzxpsf' => '平时', 'cjzxxtf' => '习题');
         }
         //NB初始化,开始
         $m = M($grdo['grdnm'] . '_cjzx')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
         $cdtint = "-sp-";
         $spccdtint = '-sp-';
         $odrint = '-';
         $lmtint = 100;
         //$jn='tb_ath ON f_athid=athid-jn-tb_atc ON f_athid=atcid';//若出现多个join
         import('@.NB.NBAction');
         $NB = new NBAction();
         $arr = $NB->NB($m, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'y');
         $fld = '-cjzxid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-';
         $mlsall = $arr['mlsforcount'];
         $mo = $mlsall[0];
         $bxxnm = $mo['bxxsnm'];
         $clsnm = $mo['clsnm'];
         $kcnm = $mo['kcnm'];
         $xqnm = $mo['xqnm'];
         $mjnm = $mo['mjnm'];
         $mlsallfn = array();
         foreach ($mlsall as $v) {
             if (!preg_match('/' . $v['mjnm'] . '/', $mjnm)) {
                 $mjnm = $mjnm . '  ' . $v['mjnm'];
             }
             $v['cjzxzf'] = '';
             $v['cjzxqmf'] = '';
             $v['cjzxpsf'] = '';
             $v['cjzxxtf'] = '';
             array_push($mlsallfn, $v);
         }
         $mlsall = $mlsallfn;
         $zm = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
         import('@.ORG.PHPExcel');
         // Create new PHPExcel object
         $objPHPExcel = new PHPExcel();
         // Set properties
         $objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
         //设置边框
         //     	$objExcel = new PHPExcel();
         //     	//$objExcel->setActiveSheetIndex(0);
         //     	$objActSheet = $objExcel->getActiveSheet();
         //     	$objStyleA5 = $objActSheet->getStyle('A5');
         //     	$objBorderA5 = $objStyleA5->getBorders();
         //     	$objBorderA5->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getTop()->getColor()->setARGB('FFFF0000'); // color
         //     	$objBorderA5->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA5->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //设置宽度
         $objActSheet = $objPHPExcel->getActiveSheet();
         //$objActSheet->getColumnDimension('A')->setAutoSize();
         $objActSheet->getColumnDimension('A')->setWidth(12);
         $objActSheet->getColumnDimension('B')->setWidth(7);
         $objActSheet->getColumnDimension('C')->setWidth(5);
         $objActSheet->getColumnDimension('D')->setWidth(6);
         $objActSheet->getColumnDimension('E')->setWidth(5);
         $objActSheet->getColumnDimension('F')->setWidth(5);
         $objActSheet->getColumnDimension('G')->setWidth(5);
         $objActSheet->getColumnDimension('H')->setWidth(2);
         $objActSheet->getColumnDimension('I')->setWidth(12);
         $objActSheet->getColumnDimension('J')->setWidth(7);
         $objActSheet->getColumnDimension('K')->setWidth(5);
         $objActSheet->getColumnDimension('L')->setWidth(6);
         $objActSheet->getColumnDimension('M')->setWidth(5);
         $objActSheet->getColumnDimension('N')->setWidth(5);
         $objActSheet->getColumnDimension('O')->setWidth(5);
         for ($i = 5; $i <= 38; $i++) {
             $objActSheet->getRowDimension('' . $i)->setRowHeight(15.55);
         }
         // set table header content列是从0开始,行是从1开始
         $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
         //     	$objBorderA1=$objPHPExcel->getActiveSheet()->getStyle('B8')->getBorders();
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         //     	$objBorderA1->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $sheet = $objPHPExcel->setActiveSheetIndex(0);
         $sheet->mergeCells("A1:O1");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 1, '中国计量学院' . $bxxsnm . '考试成绩登记表');
         $sheet->mergeCells("A2:O2");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 2, $mjnm . ' 专业  ' . $clsnm . ' 课程名称 ' . '              ');
         $sheet->mergeCells("A3:O3");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 3, '(' . $xqnm . ')');
         //$sheet=$sheet->setCellValueByColumnAndRow(0,1,'序号');
         $fldu = explode('-', $fld);
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i - 2, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i - 2] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         for ($i = 2; $i < count($fldu) - 1; $i++) {
             $sheet = $sheet->setCellValueByColumnAndRow($i + 6, 5, $jsn[$fldu[$i]]);
             $objActSheet->getStyle($zm[$i + 6] . '5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
             $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '5')->getBorders();
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
             $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         }
         if (count($mlsall) > 33) {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < 33; $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
             for ($j = 33; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i + 6, $j + 6 - 33, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i + 6] . '' . ($j + 6 - 33))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         } else {
             //Miscellaneous glyphs, UTF-8
             for ($j = 0; $j < count($mlsall); $j++) {
                 $m = $mlsall[$j];
                 //$sheet=$sheet->setCellValueByColumnAndRow(0,$j+2,$j+1);
                 for ($i = 2; $i < count($fldu) - 1; $i++) {
                     $sheet = $sheet->setCellValueByColumnAndRow($i - 2, $j + 6, $m[$fldu[$i]] . ' ');
                     $objActSheet->getStyle($zm[$i - 2] . '' . ($j + 6))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                     $objBorder = $objPHPExcel->getActiveSheet()->getStyle($zm[$i - 2] . '' . ($j + 6))->getBorders();
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                     $objBorder->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
                 }
             }
         }
         $sheet->mergeCells("A39:O39");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 39, '批卷老师:                                              班主任签字:');
         $sheet->mergeCells("A40:O40");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 40, '说明:  1、任课教师应于考试后三天内,登陆http://cjxy.cjlu.edu.cn录入成绩,');
         $sheet->mergeCells("A41:O41");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 41, '                 并将本表卷面成绩、习题分两项认真填写,一式两份,交格致北楼302办公室');
         $sheet->mergeCells("A42:O42");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 42, '            2、卷面成绩占总成绩的70%,平时成绩占总成绩的20%(由班主任评定),习题成绩占总成绩的10%。');
         $sheet->mergeCells("A43:O43");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 43, '                 总成绩=卷面成绩*0.7+平时成绩*0.2+习题成绩*0.1');
         $sheet->mergeCells("A44:O44");
         $sheet = $sheet->setCellValueByColumnAndRow(0, 44, '            3、班主任请在收到此表后三天,将本表平时分项认真填写,一式两份。');
         //设置居中
         //$objActSheet->getStyle('A5')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objActSheet->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objActSheet->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         // Set active sheet index to the first sheet, so Excel opens this as the first sheet
         $objPHPExcel->setActiveSheetIndex(0);
         // excel头参数
         header('Content-Type: application/vnd.ms-excel');
         header("Content-Disposition: attachment;filename=" . $clsnm . '-' . $kcnm . '成绩单' . date("Ymd-His") . ".xls");
         //日期为文件名后缀
         header('Cache-Control: max-age=0');
         $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
         //excel5为xls格式,excel2007为xlsx格式
         $objWriter->save('php://output');
     }
 }
Example #18
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cstmcmt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cstmcmt = M('cstmcmt');
     $fldint = '-cstmcmtid-cstmusrnn-atctpc-cstmcmttm-cstmcmtctt-cstmcmtzn-cstmcmttc-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-cstmcmttm DESC-';
     $lmtint = 20;
     $jn = 'tb_cstmusr ON f_cstmcmt_cstmusrid=cstmusrid-jn-tb_atc ON f_cstmcmt_atcid=atcid';
     //$jn='tb_cstmusr ON f_cstmcmt_cstmusrid=cstmusrid-jn-tb_atc ON f_cstmcmt_cstmusrid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmcmt, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $cstmusr = M('cstmusr');
     $cstmusrls = $cstmusr->select();
     $this->assign('cstmusrls', $cstmusrls);
     $atc = M('atc');
     $atcls = $atc->select();
     $this->assign('atcls', $atcls);
     //q特殊
     $this->assign('title', '浏览权限列表');
     $this->assign('theme', '权限管理');
     $this->display('query');
 }
Example #19
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cjzx'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以cjzxxqcls cjzxxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_cjzx_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $cjzx = clone M($grdo['grdnm'] . '_cjzx');
     $cjzx->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     // 		$cjzxls=$cjzx->select();
     $fldint = '-cjzxid-f_cjzx_grdid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-cjzxbkf-cjzxsftj-cjzxxk-cjzxqk-cjzxhk-f_stdxqcls_clsid-';
     //默认学期,
     $xq = M('xq');
     $xqo = $xq->where('xqdq=1')->find();
     $xqid = $xqo['xqid'];
     if ($athofnstt['aths'] == 1) {
         $f_usr_sttid = 1;
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $f_usr_sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $f_usr_sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     } else {
         $f_usr_sttid = $usro['f_usr_sttid'];
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $f_usr_sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $f_usr_sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     }
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-';
     $lmtint = 100;
     $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cjzx, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
     $mls = $arr['mls'];
     $bzr = M($grdo['grdnm'] . '_bzr');
     $mlsfn = array();
     $czps = 0;
     foreach ($mls as $v) {
         $bzro = $bzr->where('f_bzr_clsid=' . $v['f_stdxqcls_clsid'])->find();
         if ($athofn['athm'] == 1 || session('usridss') == $bzro['f_bzr_usrid']) {
             //aths==1说明是教务的人或者是管理员
             $v['czps'] = 1;
         } else {
             $v['czps'] = 0;
         }
         $czps = $v['czps'];
         //是否提交的判断
         if ($v['cjzxsftj'] == 1) {
             $v['cjzxsftj'] = '是';
         } else {
             $v['cjzxsftj'] = '否';
         }
         //是否限考的判断
         if ($v['cjzxxk'] == 1) {
             $v['cjzxxk'] = '是';
             $v['xkstr'] = '取消限考';
         } else {
             $v['cjzxxk'] = '否';
             $v['xkstr'] = '设置限考';
         }
         //是否缺考的判断
         if ($v['cjzxqk'] == 1) {
             $v['cjzxqk'] = '是';
             $v['qkstr'] = '取消缺考';
         } else {
             $v['cjzxqk'] = '否';
             $v['qkstr'] = '设置缺考';
         }
         //是否缓考的判断
         if ($v['cjzxhk'] == 1) {
             $v['cjzxhk'] = '是';
             $v['hkstr'] = '取消缓考';
         } else {
             $v['cjzxhk'] = '否';
             $v['hkstr'] = '设置缓考';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('czps', $czps);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $cdt = $arr['cdt'];
     //如果条件含有学生班级和排课信息就可以显示,否则免谈
     if (preg_match('/f_stdxqcls_clsid/', $cdt) && preg_match('/f_cjzx_pkid/', $cdt)) {
         $mls = $mlsfn;
         $cdt = $arr['cdt'];
         $tmp = explode('f_cjzx_pkid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         //取出权重//顺便给query页给出参考
         $rfr = '-';
         $pk = M($grdo['grdnm'] . '_pk');
         $pko = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('pkid=' . $tmp[0])->find();
         //通过学生得到现在是哪个班,在上哪个课
         $this->assign('pknm', $pko['kcnm'] . '-' . $pko['tcrnn']);
         for ($i = 0; $i < count($mls); $i++) {
             $rfr = $rfr . $mls[$i]['cjzxid'] . '-';
             // 				if($mls[$i]['cjzxqmf']==''&&$mls[$i]['cjzxpsf']==''&&$mls[$i]['cjzxxtf']==''){
             // 					$zf='';
             // 				}else{
             // 					if($mls[$i]['cjzxqmf']==''){$cjzxqmf=0;}else{$cjzxqmf=$mls[$i]['cjzxqmf'];}
             // 					if($mls[$i]['cjzxpsf']==''){$cjzxpsf=0;}else{$cjzxpsf=$mls[$i]['cjzxpsf'];}
             // 					if($mls[$i]['cjzxxtf']==''){$cjzxxtf=0;}else{$cjzxxtf=$mls[$i]['cjzxxtf'];}
             // 					//$zf=sprintf("%.1f", $cjzxqmf*$pko['pkwqm']+$cjzxpsf*$pko['pkwps']+$cjzxxtf*$pko['pkwxt']);
             // 					$zf=ceil($cjzxqmf*$pko['pkwqm']+$cjzxpsf*$pko['pkwps']+$cjzxxtf*$pko['pkwxt']);
             // 				}
             // 				$mls[$i]['zcj']=$zf;
         }
         $this->assign('wqm', $pko['pkwqm']);
         $this->assign('wps', $pko['pkwps']);
         $this->assign('wxt', $pko['pkwxt']);
         $this->assign('rfr', $rfr);
         $this->assign('mls', $mls);
         $this->assign('page_method', $arr['page_method']);
     }
     //NB初始化,结束
     if (preg_match('/f_cjzx_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
         $grdo = $grd->where('grdid=' . $grdid)->find();
     } else {
         $grdo = $grd->order('grdnm DESC')->find();
     }
     if (preg_match('/f_cjzx_xqid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_xqid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $xqid = $tmp[0];
     } else {
     }
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的成绩中心阔能还在,因此要保留站点
     if ($athofnstt['aths'] == 1) {
         $sttls = $stt->select();
     } else {
         $sttls = $stt->where('sttid=' . $usro['f_usr_sttid'])->select();
     }
     $this->assign('sttls', $sttls);
     $cdt = $arr['cdt'];
     //q特殊
     $xq = M('xq');
     if (preg_match('/f_cjzx_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     } else {
         $xqls = $xq->order('xqnm DESC')->select();
     }
     $this->assign('xqls', $xqls);
     //q特殊
     $where = '1=1';
     //获取该键的值
     $tmp = explode('f_std_sttid', $cdt);
     $tmp = explode('-eq-', $tmp[1]);
     $tmp = explode('-sp-', $tmp[1]);
     $where = $where . ' AND f_cls_sttid=' . $sttid;
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid;
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where . ' AND clsactvt=1')->order('clsnm ASC')->select();
     $this->assign('clsls', $clsls);
     if (preg_match('/f_stdxqcls_clsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_stdxqcls_clsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $clsid = $tmp[0];
         //找那个班的学生代表看看他选了那些成绩中心
         $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
         $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_std ON f_stdxqcls_stdid=stdid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_xqid=' . $xqid . ' AND f_stdxqcls_clsid=' . $clsid . ' AND f_std_statid=5')->find();
         $cjzx = clone M($grdo['grdnm'] . '_cjzx');
         $pkls = $cjzx->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('f_cjzx_sttid=' . $sttid . ' AND f_cjzx_xqid=' . $xqid . ' AND f_cjzx_stdid=' . $stdxqclso['f_stdxqcls_stdid'])->select();
         $pklsfn = array();
         foreach ($pkls as $v) {
             if ($v['pkzkkm'] == 1) {
                 $v['pkzkkm'] = '【自考科目】';
             } else {
                 $v['pkzkkm'] = '';
             }
             array_push($pklsfn, $v);
         }
     } else {
     }
     $this->assign('pkls', $pklsfn);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //通过学生得到现在是哪个班,在上哪个课
     $this->assign('clsnm', $stdxqclso['clsnm']);
     if ($mls[0]['cjzxsftj'] == '是') {
         $this->assign('tijiao', 1);
     } else {
         $this->assign('tijiao', 0);
     }
     //q特殊
     $this->assign('title', '浏览成绩中心列表');
     $this->assign('theme', '成绩中心管理');
     $this->display('query');
 }
Example #20
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Xf'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_xf_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_xf_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $xf = M($grdo['grdnm'] . '_xf');
     $fldint = '-xfid-grdnm-sttnm-bxxsnm-ccnm-klnm-xfsm-jckwfsm-';
     $cdtint = "-sp-f_xf_grdid-eq-" . $grdo['grdid'] . "-sp-f_xf_sttid-eq-1-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '-';
     $lmtint = 20;
     $jn = 'tb_grd ON f_xf_grdid=grdid-jn-tb_stt ON f_xf_sttid=sttid-jn-tb_bxxs ON f_xf_bxxsid=bxxsid-jn-tb_cc ON f_xf_ccid=ccid-jn-tb_kl ON f_xf_klid=klid';
     //$jn='tb_ath ON f_xf_athid=athid-jn-tb_atc ON f_xf_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($xf, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $stt = M('stt');
     $sttls = $stt->select();
     $this->assign('sttls', $sttls);
     //q特殊
     $bxxs = M('bxxs');
     $bxxsls = $bxxs->select();
     $this->assign('bxxsls', $bxxsls);
     //q特殊
     $cc = M('cc');
     $ccls = $cc->select();
     $this->assign('ccls', $ccls);
     //q特殊
     $kl = M('kl');
     $klls = $kl->select();
     $this->assign('klls', $klls);
     //q特殊
     $this->assign('title', '浏览学费列表');
     $this->assign('theme', '学费管理');
     $this->display('query');
 }
Example #21
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cstmath'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $cstmathofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cstmath = M('cstmath');
     $fldint = '-cstmathid-cstmrlnm-mdnm-cstmatha-cstmathd-cstmathm-cstmathv-cstmaths-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '';
     $lmtint = 20;
     $jn = 'tb_cstmrl ON f_cstmath_cstmrlid=cstmrlid-jn-tb_md ON f_cstmath_mdid=mdid';
     //$jn='tb_cstmrl ON f_cstmath_cstmrlid=cstmrlid-jn-tb_atc ON f_cstmath_cstmrlid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmath, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     //1、0是否化
     $mls = $arr['mls'];
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['cstmatha'] == 1) {
             $v['cstmatha'] = '是';
         } else {
             $v['cstmatha'] = '否';
         }
         if ($v['cstmathd'] == 1) {
             $v['cstmathd'] = '是';
         } else {
             $v['cstmathd'] = '否';
         }
         if ($v['cstmathm'] == 1) {
             $v['cstmathm'] = '是';
         } else {
             $v['cstmathm'] = '否';
         }
         if ($v['cstmathv'] == 1) {
             $v['cstmathv'] = '是';
         } else {
             $v['cstmathv'] = '否';
         }
         if ($v['cstmaths'] == 1) {
             $v['cstmaths'] = '是';
         } else {
             $v['cstmaths'] = '否';
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $cstmrl = M('cstmrl');
     $cstmrlls = $cstmrl->select();
     $this->assign('cstmrlls', $cstmrlls);
     $md = M('md');
     $mdls = $md->select();
     $this->assign('mdls', $mdls);
     //q特殊
     $this->assign('title', '浏览权限列表');
     $this->assign('theme', '权限管理');
     $this->display('query');
 }
Example #22
0
 function collect()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Atc'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     $usrid = session('usridss');
     $atcclct = M('atcclct');
     //$bbb=$atcclct->select();p($bbb);die;
     // 	$aaaa=$atcclct->join('tb_atc ON f_atcclct_atcid=atcid')->join('tb_usr ON f_atcclct_usrid=usrid')->join('tb_bd ON f_atc_bdid=bdid')
     // 	->where("atcps='y' AND atcvw='y' AND usrid=".$usrid)->select();p($aaaa);die;
     //NB初始化,开始
     $usrid = session('usridss');
     $atcclct = M('atcclct');
     $atc = M('atc');
     $fldint = '-atcid-bdnm-atctpc-atcath-atcmdftm-atccnt-';
     $cdtint = "-sp-atcps-eq-1-sp-atcvw-eq-1-sp-usrid-eq-" . $usrid . "-sp-";
     $spccdtint = "-sp-";
     ////
     $odrint = '-atctp DESC-atcmdftm DESC-';
     $lmtint = 20;
     $jn = 'tb_atc ON f_atcclct_atcid=atcid-jn-tb_usr ON f_atcclct_usrid=usrid-jn-tb_bd ON f_atc_bdid=bdid';
     //$jn='tb_ath ON f_atc_athid=athid-jn-tb_atc ON f_atc_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($atcclct, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $this->assign('title', '浏览文章列表');
     $this->assign('theme', '收藏文章');
     $this->display('collect');
 }
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cstmgrpcstmrl'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cstmgrpcstmrl = M('cstmgrpcstmrl');
     $fldint = '-cstmgrpcstmrlid-cstmgrpnm-cstmrlnm-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '';
     $lmtint = 20;
     $jn = 'tb_cstmgrp ON f_cstmgrpcstmrl_cstmgrpid=cstmgrpid-jn-tb_cstmrl ON f_cstmgrpcstmrl_cstmrlid=cstmrlid';
     //$jn='tb_cstmgrp ON f_cstmgrpcstmrl_cstmgrpid=cstmgrpid-jn-tb_atc ON f_cstmgrpcstmrl_cstmgrpid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmgrpcstmrl, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     $cstmgrp = M('cstmgrp');
     $cstmgrpls = $cstmgrp->order('cstmgrpodr ASC')->select();
     //在按照这个顺序前提下,使用tree方法就能有序的得到
     $str = $tree->unlimitedForListSLCT($cstmgrpls, 0, 'cstmgrpid', 'cstmgrpnm', 'cstmgrppid', 'cstmgrpodr');
     $this->assign('tree', $str);
     $cstmrl = M('cstmrl');
     $cstmrlls = $cstmrl->select();
     $this->assign('cstmrlls', $cstmrlls);
     //q特殊
     $this->assign('title', '浏览团队-客户角色列表');
     $this->assign('theme', '团队-客户角色管理');
     $this->display('query');
 }
Example #24
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     // 		//鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     // 		$mdII=M('md');
     // 		$mdo=$mdII->where("mdmk='Cjzx'")->find();
     // 		import('@.IDTATH.IdtathAction');
     // 		$Idtath = new IdtathAction();
     // 		$athofn=$Idtath->identify($mdo['mdid'],'qry');
     // 		import('@.NTF.NTFAction');
     // 		$ntf = new NTFAction();
     // 		$ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     // 		//鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     // 		$mdII=M('md');
     // 		$mdo=$mdII->where("mdmk='Stt'")->find();
     // 		import('@.IDTATH.IdtathAction');
     // 		$Idtath = new IdtathAction();
     // 		$athofnstt=$Idtath->identify($mdo['mdid'],'ntf');
     // 		$usr=M('usr');
     // 		$usro=$usr->where('usrid='.session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以cjzxxqcls cjzxxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     $grdid = $_GET['grdid'];
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $cjzx = clone M($grdo['grdnm'] . '_cjzx');
     $cjzx->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     // 		$cjzxls=$cjzx->select();
     $fldint = '-cjzxid-f_cjzx_grdid-stdno-stdnm-sexnm-cjzxzf-cjzxqmf-cjzxpsf-cjzxxtf-cjzxbkf-cjzxsftj-cjzxxk-cjzxqk-';
     //默认学期,
     $xq = M('xq');
     $xqo = $xq->where('xqdq=1')->find();
     $xqid = $xqo['xqid'];
     $sttid = $_GET['sttid'];
     $sttintxq = M($grdo['grdnm'] . '_sttintxq');
     $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $sttid)->find();
     if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
         $xqid = $sttintxqo['f_sttintxq_xqid'];
     }
     //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
     $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-f_stdxqcls_clsid-eq-' . $_GET['clsid'] . '-sp-f_cjzx_pkid-eq-' . $_GET['pkid'] . '-sp-';
     //接下来产生学期
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-';
     $lmtint = 100;
     $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cjzx, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $mls = $arr['mls'];
     $pkid = $_GET['pkid'];
     //取出权重//顺便给query页给出参考
     $rfr = '-';
     $pk = M($grdo['grdnm'] . '_pk');
     $pko = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('pkid=' . $pkid)->find();
     //通过学生得到现在是哪个班,在上哪个课
     $this->assign('pknm', $pko['kcnm'] . '-' . $pko['tcrnn']);
     for ($i = 0; $i < count($mls); $i++) {
         $rfr = $rfr . $mls[$i]['cjzxid'] . '-';
     }
     $this->assign('wqm', $pko['pkwqm']);
     $this->assign('wps', $pko['pkwps']);
     $this->assign('wxt', $pko['pkwxt']);
     $this->assign('rfr', $rfr);
     $this->assign('mls', $mls);
     $this->assign('page_method', $arr['page_method']);
     $cdt = $arr['cdt'];
     //设定条件
     if (preg_match('/f_cjzx_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
         $grdo = $grd->where('grdid=' . $grdid)->find();
     } else {
         $grdo = $grd->order('grdnm DESC')->find();
     }
     if (preg_match('/f_cjzx_xqid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_xqid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $xqid = $tmp[0];
     } else {
     }
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的成绩中心阔能还在,因此要保留站点
     $sttls = $stt->where('sttid=' . $sttid)->select();
     $this->assign('sttls', $sttls);
     $xq = M('xq');
     if (preg_match('/f_cjzx_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     } else {
         $xqls = $xq->order('xqnm DESC')->select();
     }
     $this->assign('xqls', $xqls);
     //q特殊
     $where = '1=1';
     //获取该键的值
     $tmp = explode('f_std_sttid', $cdt);
     $tmp = explode('-eq-', $tmp[1]);
     $tmp = explode('-sp-', $tmp[1]);
     $where = $where . ' AND f_cls_sttid=' . $sttid;
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid;
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where . ' AND clsactvt=1')->order('clsnm ASC')->select();
     $this->assign('clsls', $clsls);
     if (preg_match('/f_stdxqcls_clsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_stdxqcls_clsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $clsid = $tmp[0];
         //找那个班的学生代表看看他选了那些成绩中心
         $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
         $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_std ON f_stdxqcls_stdid=stdid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_xqid=' . $xqid . ' AND f_stdxqcls_clsid=' . $clsid . ' AND f_std_statid=5')->find();
         $cjzx = clone M($grdo['grdnm'] . '_cjzx');
         $pkls = $cjzx->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('f_cjzx_sttid=' . $sttid . ' AND f_cjzx_xqid=' . $xqid . ' AND f_cjzx_stdid=' . $stdxqclso['f_stdxqcls_stdid'])->select();
     } else {
     }
     $this->assign('pkls', $pkls);
     //结束设定条件
     $cls = M($grdo['grdnm'] . '_cls');
     $clso = $cls->where('clsid=' . $_GET['clsid'])->find();
     $this->assign('clsnm', $clso['clsnm']);
     if ($mls[0]['cjzxsftj'] == 1) {
         $this->assign('tijiao', 1);
     } else {
         $this->assign('tijiao', 0);
     }
     //q特殊
     $this->assign('title', '成绩中心');
     $this->assign('theme', '成绩录入');
     $this->display('query');
 }
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Cstmusrcstmrl'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $cstmusrcstmrl = M('cstmusrcstmrl');
     $fldint = '-cstmusrcstmrlid-cstmusrnm-cstmusrnn-cstmgrpid-cstmgrpnm-cstmrlnm-';
     $cdtint = "-sp-";
     $spccdtint = '-sp-';
     ////
     $odrint = '';
     $lmtint = 20;
     $jn = 'tb_cstmusr ON f_cstmusrcstmrl_cstmusrid=cstmusrid-jn-tb_cstmrl ON f_cstmusrcstmrl_cstmrlid=cstmrlid-jn-tb_cstmgrpcstmrl ON f_cstmusrcstmrl_cstmrlid=f_cstmgrpcstmrl_cstmrlid-jn-tb_cstmgrp ON f_cstmgrpcstmrl_cstmgrpid=cstmgrpid';
     //$jn='tb_cstmusr ON f_cstmusrcstmrl_cstmusrid=cstmusrid-jn-tb_atc ON f_cstmusrcstmrl_cstmusrid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($cstmusrcstmrl, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($u,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $cstmusrcstmgrp = M('cstmusrcstmgrp');
     $cstmusrcstmgrpls = $cstmusrcstmgrp->Distinct(true)->field('cstmusrid,cstmusrnm')->join('tb_cstmusr ON f_cstmusrcstmgrp_cstmusrid=cstmusrid')->join('tb_cstmgrp ON f_cstmusrcstmgrp_cstmgrpid=cstmgrpid')->select();
     $this->assign('cstmusrls', $cstmusrcstmgrpls);
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     $cstmgrp = M('cstmgrp');
     $cstmgrpls = $cstmgrp->order('cstmgrpodr ASC')->select();
     //在按照这个顺序前提下,使用tree方法就能有序的得到
     $str = $tree->unlimitedForListSLCT($cstmgrpls, 0, 'cstmgrpid', 'cstmgrpnm', 'cstmgrppid', 'cstmgrpodr');
     $this->assign('tree', $str);
     //若cstmgrpid 有限制的话,那么cstmrl必须是要 该相应的cstmgrp下面
     //q特殊
     $cdt = $arr['cdt'];
     $cstmgrp = M('cstmgrp');
     $where = '1=1';
     if (preg_match('/cstmgrpid/', $cdt)) {
         //获取该键的值
         $tmp = explode('cstmgrpid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND cstmgrpid=' . $tmp[0];
     }
     $cstmgrpo = $cstmgrp->where($where)->find();
     $cstmgrpcstmrl = M('cstmgrpcstmrl');
     $cstmgrpcstmrlls = $cstmgrpcstmrl->join('tb_cstmgrp ON f_cstmgrpcstmrl_cstmgrpid=cstmgrpid')->join('tb_cstmrl ON f_cstmgrpcstmrl_cstmrlid=cstmrlid')->where($where)->select();
     $this->assign('cstmrlls', $cstmgrpcstmrlls);
     $cstmusr = M('cstmusr');
     $cstmsucstmrls = $cstmusr->join('tb_cstmusrcstmgrp ON cstmusrid=f_cstmusrcstmgrp_cstmusrid')->select();
     $this->assign('cstmusrls', $cstmsucstmrls);
     //q特殊
     $this->assign('title', '浏览客户用户-客户角色列表');
     $this->assign('theme', '客户用户-客户角色管理');
     $this->display('query');
 }
Example #26
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Jq'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //NB初始化,开始
     $jq = M('jq');
     $fldint = '-jqid-sttnm-xqnm-jqqs-jqjs-jqljc-';
     $spccdtint = '-sp-';
     ////
     $odrint = '-xqnm DESC-';
     $lmtint = 20;
     $jn = 'tb_stt ON f_jq_sttid=sttid-jn-tb_xq ON f_jq_xqid=xqid';
     //$jn='tb_ath ON f_jq_athid=athid-jn-tb_atc ON f_jq_athid=atcid';//若出现多个join
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($jq, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     // 		$arr=NB($jq,$fldint,$cdtint,$odrint,$lmtint,$jn);
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $arr['mls']);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     $stt = M('stt');
     $sttls = $stt->where('sttactvt=1')->select();
     $this->assign('sttls', $sttls);
     $xq = M('xq');
     $xqls = $xq->order('xqnm DESC')->select();
     $this->assign('xqls', $xqls);
     //q特殊
     $this->assign('title', '浏览假期列表');
     $this->assign('theme', '假期管理');
     $this->display('query');
 }
Example #27
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Tsqk'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_tsqk_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_tsqk_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $tsqk = M($grdo['grdnm'] . '_tsqk');
     // 		$stdls=$std->select();
     $fldint = '-tsqkid-sttnm-f_tsqk_grdid-grdnm-stdno-stdnm-tsqktm-tsqknr-tsqkorgid-tsqknwid-tsqkjbr-';
     //$cdtint="-sp-f_std_ccid-eq-3-sp-f_std_xxxsid-eq-2-sp-f_std_zsfwid-eq-2-sp-f_std_xzid-eq-2-sp-f_std_sttid-eq-1-sp-f_std_statid-eq-5-sp-";
     if ($athofnstt['aths'] == 1) {
         $f_usr_sttid = 1;
         // ①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_tsqk_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-";
         //接下来产生学期
     } else {
         $f_usr_sttid = $usro['f_usr_sttid'];
         // ①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_tsqk_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-";
         //接下来产生学期
     }
     $spccdtint = '-sp-';
     ////
     $odrint = '-tsqktm DESC-';
     $lmtint = 20;
     $jn = 'tb_' . $grdo['grdnm'] . '_std ON f_tsqk_stdid=stdid-jn-tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($tsqk, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
     $mls = $arr['mls'];
     $bzr = M($grdo['grdnm'] . '_bzr');
     $mlsfn = array();
     foreach ($mls as $mv) {
         //处理异动
         if ($mv['tsqknr'] == 1) {
             $mv['tsqknr'] = '换状态';
             $stat = M('stat');
             //原状态
             $stato = $stat->where('statid=' . $mv['tsqkorgid'])->find();
             $mv['tsqkorgid'] = $stato['statnm'];
             //现状态
             $stato = $stat->where('statid=' . $mv['tsqknwid'])->find();
             $mv['tsqknwid'] = $stato['statnm'];
         } else {
             if ($mv['tsqknr'] == 2) {
                 $mv['tsqknr'] = '换专业';
                 $mj = M($grdo['grdnm'] . '_mj');
                 //原专业
                 $mjo = $mj->where('mjid=' . $mv['tsqkorgid'])->find();
                 $mv['tsqkorgid'] = $stato['mjnm'];
                 //现专业
                 $mjo = $mj->where('mjid=' . $mv['tsqknwid'])->find();
                 $mv['tsqknwid'] = $stato['mjnm'];
             } else {
                 if ($mv['tsqknr'] == 3) {
                     $mv['tsqknr'] = '换班级';
                     $cls = M($grdo['grdnm'] . '_cls');
                     //原班级
                     $clso = $cls->where('clsid=' . $mv['tsqkorgid'])->find();
                     $mv['tsqkorgid'] = $stato['clsnm'];
                     //现班级
                     $clso = $cls->where('clsid=' . $mv['tsqknwid'])->find();
                     $mv['tsqknwid'] = $stato['clsnm'];
                 } else {
                     if ($mv['tsqknr'] == 4) {
                         $mv['tsqknr'] = '换寝室';
                         $dm = M('dm');
                         //原状态
                         $dmo = $dm->where('dmid=' . $mv['tsqkorgid'])->find();
                         $mv['tsqkorgid'] = $dmo['dmnm'];
                         //现状态
                         $dmo = $dm->where('dmid=' . $mv['tsqknwid'])->find();
                         $mv['tsqknwid'] = $dmo['dmnm'];
                     }
                 }
             }
         }
         //设置该生最近的mj
         $stdxqmj = M($grdo['grdnm'] . '_stdxqmj');
         $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $mv['f_tsqk_stdid'])->order('f_stdxqmj_xqid DESC')->find();
         $mv['mjnm'] = $stdxqmjo['mjnm'];
         //设置该生最近的cls
         $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
         $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $mv['f_tsqk_stdid'])->order('f_stdxqcls_xqid DESC')->find();
         $mv['clsnm'] = $stdxqclso['clsnm'];
         //设置该生最近的dm
         $stdxqdm = M($grdo['grdnm'] . '_stdxqdm');
         $stdxqdmo = $stdxqdm->join('tb_' . 'dm ON f_stdxqdm_dmid=dmid')->where('f_stdxqdm_stdid=' . $mv['f_tsqk_stdid'])->order('f_stdxqdm_xqid DESC')->find();
         $mv['dmnm'] = $stdxqdmo['dmnm'];
         array_push($mlsfn, $mv);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //p($arr['mls']);die;
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的学生阔能还在,因此要保留站点
     if ($athofnstt['aths'] == 1) {
         $sttls = $stt->select();
     } else {
         $sttls = $stt->where('sttid=' . $usro['f_usr_sttid'])->select();
     }
     $this->assign('sttls', $sttls);
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //q特殊
     $this->assign('title', '学籍异动(特殊情况)列表');
     $this->assign('theme', '学籍异动(特殊情况)管理');
     $this->display('query');
 }
Example #28
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Zsjx'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     $zssz = M('zssz');
     $zsszo = $zssz->find();
     $tmp = explode(' ', $zsszo['zsszxnltm']);
     $zsszo['zsszxnltm'] = $tmp[0];
     $this->assign('zsszo', $zsszo);
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdid = $zsszo['f_zssz_grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $std = M($grdo['grdnm'] . '_std')->join('tb_' . $grdo['grdnm'] . '_zsjx ON f_zsjx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqdm ON stdid=f_stdxqdm_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdo['grdnm'] . '_cw ON stdid=f_cw_stdid');
     //因为2015级他们进来也就一次的信息也不可能有其他的信息,所以,他们是单一的记录,不会重复的
     // 		$stdls=$std->select();
     $fldint = '-stdid-bxxsnm-f_std_grdid-f_stdxqcls_xqid-f_stdxqcls_clsid-stdaplno-stdno-stdnm-stdcp-stdrltacp-stdrltbcp-clsnm-sexnm-stdbtd-mjnm-statnm-zsjxsg-zsjxtz-zsjxxm-stdpt-';
     //$cdtint="-sp-f_std_ccid-eq-3-sp-f_std_xxxsid-eq-2-sp-f_std_zsfwid-eq-2-sp-f_std_xzid-eq-2-sp-f_std_sttid-eq-1-sp-f_std_statid-eq-5-sp-";
     //默认学期,
     // 		$xq=M('xq');
     // 		$xqo=$xq->where('xqdq=1')->find();
     // 		$xqid=$xqo['xqid'];
     $xqid = $zsszo['f_zssz_xqid'];
     $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-1-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . "-sp-f_stdxqdm_xqid-eq-" . $xqid . '-sp-';
     $spccdtint = "-sp-(f_std_statid<>9)-sp-";
     ///只有上传过程亨且没有退学的人才有资格排学号
     $odrint = '-mjnm ASC-stdno ASC-stdaplno ASC-';
     $lmtint = 20;
     $jn = 'tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_dm ON f_stdxqdm_dmid=dmid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($std, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
     $mls = $arr['mls'];
     $bzr = M($grdo['grdnm'] . '_bzr');
     $mlsfn = array();
     foreach ($mls as $v) {
         if ($v['stdbtd'] < $zsszo['zsszxnltm']) {
             $v['xnl'] = '否';
         } else {
             $v['xnl'] = '是';
         }
         if ($athofn['aths'] == 1) {
             //aths==1说明是教务的人或者是管理员
             $v['mdf'] = 1;
         } else {
             $v['mdf'] = 0;
         }
         array_push($mlsfn, $v);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('mls', $mlsfn);
     $this->assign('page_method', $arr['page_method']);
     //NB初始化,结束
     //q特殊
     $tmp = explode('-', $zsszo['zsszbxxsu']);
     $where = '1=2';
     for ($i = 1; $i < count($tmp) - 1; $i++) {
         $where = $where . ' OR bxxsid=' . $tmp[$i];
     }
     $bxxs = M('bxxs');
     $bxxsls = $bxxs->where($where)->select();
     $this->assign('bxxsls', $bxxsls);
     //q特殊
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的学生阔能还在,因此要保留站点
     $sttls = $stt->where('sttid=1')->select();
     $this->assign('sttls', $sttls);
     //q特殊
     $cc = M('cc');
     $ccls = $cc->where('ccid=3')->select();
     $this->assign('ccls', $ccls);
     //q特殊
     $kl = M('kl');
     $klls = $kl->select();
     $this->assign('klls', $klls);
     //q特殊
     $xxxs = M('xxxs');
     $xxxsls = $xxxs->where('xxxsid=2')->select();
     $this->assign('xxxsls', $xxxsls);
     //q特殊
     $zsfw = M('zsfw');
     $zsfwls = $zsfw->where('zsfwid=2')->select();
     $this->assign('zsfwls', $zsfwls);
     //q特殊
     $xz = M('xz');
     $xzls = $xz->where('xzid=2')->select();
     $this->assign('xzls', $xzls);
     //q特殊
     $grd = M('grd');
     $grdls = $grd->where('grdid=' . $zsszo['f_zssz_grdid'])->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     //q特殊
     $xq = M('xq');
     $xqls = $xq->where('xqid=' . $zsszo['f_zssz_xqid'])->order('xqnm DESC')->select();
     $this->assign('xqls', $xqls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_cls_sttid=' . $tmp[0];
     } else {
         if ($athofnstt['aths'] == 1) {
             $where = $where . ' AND f_cls_sttid=1';
         } else {
             $where = $where . ' AND f_cls_sttid=' . $usro['f_usr_sttid'];
         }
     }
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid . ' AND clsactvt=1';
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where)->order('clsnm ASC')->select();
     array_push($clsls, array('clsid' => 0, 'clsnm' => '未分班'));
     $this->assign('clsls', $clsls);
     //q特殊
     $dm = M('dm');
     $dmls = $dm->select();
     $this->assign('dmls', $dmls);
     //q特殊
     $sex = M('sex');
     $sexls = $sex->select();
     $this->assign('sexls', $sexls);
     //q特殊
     $rc = M('rc');
     $rcls = $rc->select();
     $this->assign('rcls', $rcls);
     //q特殊
     $zzmm = M('zzmm');
     $zzmmls = $zzmm->select();
     $this->assign('zzmmls', $zzmmls);
     //q特殊
     $xl = M('xl');
     $xlls = $xl->select();
     $this->assign('xlls', $xlls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_mj_bxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_bxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_bxxsid=' . $tmp[0];
     }
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_grdid=' . $tmp[0];
     }
     if (preg_match('/f_mj_ccid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_ccid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_ccid=' . $tmp[0];
     }
     if (preg_match('/f_mj_klid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_klid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_klid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xxxsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xxxsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xxxsid=' . $tmp[0];
     }
     if (preg_match('/f_mj_zsfwid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_zsfwid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_zsfwid=' . $tmp[0];
     }
     if (preg_match('/f_mj_xzid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_mj_xzid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_mj_xzid=' . $tmp[0];
     }
     $mj = M($grdo['grdnm'] . '_mj');
     $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->where($where)->order('f_mj_bxxsid ASC,mjdm ASC')->select();
     $tmpls = array();
     foreach ($mjls as $v) {
         if (preg_match('/技能/', $v['bxxsnm'])) {
             $v['bxxsnm'] = '技能';
         } else {
             if (preg_match('/自考/', $v['bxxsnm'])) {
                 $v['bxxsnm'] = '自考';
             } else {
                 $v['bxxsnm'] = '普通';
             }
         }
         array_push($tmpls, $v);
     }
     $this->assign('mjls', $tmpls);
     //q特殊
     $stat = M('stat');
     $statls = $stat->where("statactvt=1 AND statmk='zs'")->select();
     $this->assign('statls', $statls);
     $zsjx = M($grdo['grdnm'] . '_zsjx');
     $zsjxtmls = $zsjx->Distinct(true)->field('zsjxtm')->select();
     $this->assign('zsjxtmls', $zsjxtmls);
     $zsjxschqtmls = $zsjx->Distinct(true)->field('zsjxschqtm')->select();
     $this->assign('zsjxschqtmls', $zsjxschqtmls);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //q特殊
     $this->assign('title', '浏览军训列表');
     $this->assign('theme', '军训管理');
     $this->display('query');
 }
Example #29
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Bkjjqk'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_cjzx_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $this->assign('grdiddft', $grdid);
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $cjzx = clone M($grdo['grdnm'] . '_cjzx');
     $cjzxys = clone M($grdo['grdnm'] . '_cjzx');
     //原生成绩中心
     $cjzxforcls = clone M($grdo['grdnm'] . '_cjzx');
     $cjzx->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     // 		$cjzxls=$cjzx->select();
     $fldint = '-cjzxid-f_cjzx_grdid-stdno-stdnm-sexnm-pkzkkm-cjzxpsf-cjzxsftj-cjzxxk-cjzxqk-xqnm-f_cjzx_pkid-f_cjzx_xqid-kcnm-tcrnn-';
     if (preg_match('/f_cjzx_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
     } else {
         //默认sttid
         if ($athofnstt['aths'] == 1) {
             $sttid = 1;
         } else {
             $sttid = $usro['f_usr_sttid'];
         }
     }
     $this->assign('sttiddft', $sttid);
     if (preg_match('/f_cjzx_xqid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_cjzx_xqid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $xqid = $tmp[0];
     } else {
         $xq = M('xq');
         $xqo = $xq->where('xqdq=1')->find();
         $xqid = $xqo['xqid'] - 1;
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
     }
     $this->assign('xqiddft', $xqid);
     $cdtint = "-sp-f_cjzx_grdid-eq-" . $grdid . "-sp-f_cjzx_sttid-eq-" . $sttid . "-sp-f_cjzx_xqid-eq-" . $xqid . '-sp-' . "f_pk_grdid-eq-" . $grdid . "-sp-f_pk_sttid-eq-" . $sttid . "-sp-f_pk_xqid-eq-" . $xqid . '-sp-' . "f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-pkzkkm ASC-kcnm ASC-';
     $lmtint = 100;
     $jn = 'tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid-jn-tb_stt ON f_cjzx_sttid=sttid-jn-tb_grd ON f_cjzx_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid-jn-tb_tcr ON f_pk_tcrid=tcrid-jn-tb_xq ON f_cjzx_xqid=xqid' . '-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->where('clsactvt=1 AND f_cls_sttid=' . $sttid)->order('clsnm ASC')->select();
     $stdxqcls = M($grdo['grdnm'] . '_stdxqcls');
     $clslsfn = array();
     //不管你filed啊JOIN啊,多少东西,一旦搞上了,脱不掉的,但是一旦查询一次后,这些搞上的就统统没了,要查询重新搞
     //简称 搞上 查询掉
     foreach ($clsls as $v) {
         $clsid = $v['clsid'];
         //找学生代表
         //JOIN只能JOIN一次//但是实践发现 for第二轮循环的时候join部分被剥离了。
         $stdls = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_std ON f_stdxqcls_stdid=stdid')->where('f_stdxqcls_xqid=' . $xqid . ' AND f_stdxqcls_clsid=' . $clsid . ' AND f_std_statid=5')->order('stdno ASC')->select();
         //默认第一个学生为学生代表
         $pkidls = $cjzxforcls->Distinct(true)->field('pkid')->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $v['clsid'] . ' AND pkzkkm=0')->select();
         $where = '1=2';
         foreach ($pkidls as $vI) {
             $where = $where . ' OR pkid=' . $vI['pkid'];
         }
         $pk = m($grdo['grdnm'] . '_pk');
         $pkls = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where($where)->order('pkzkkm ASC,kcnm ASC')->select();
         //只需要判断这门课选了的相关学生有一个人被提交了,那么整个班都提交了
         //针对每一个pk,我们要查看教师是否已经提交了//PS:这里的PK实质是cjzx
         $pklsfn = array();
         foreach ($pkls as $vI) {
             //看下有没有需要补考的学生,没的话就不用体现出来了
             $cjzx = M($grdo['grdnm'] . '_cjzx');
             $cjzxnb = $cjzx->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON f_cjzx_stdid=f_stdxqcls_stdid')->where('f_cjzx_sttid=' . $sttid . ' AND f_cjzx_xqid=' . $xqid . ' AND f_stdxqcls_xqid=' . $xqid . ' AND f_cjzx_pkid=' . $vI['pkid'] . ' AND f_stdxqcls_clsid=' . $clsid . ' AND (cjzxhk=1 OR(cjzxzf>30 AND cjzxzf<60))')->count();
             if ($cjzxnb > 0) {
                 //先看任课老师交卷是否妥
                 $jjflg = 0;
                 $jjyiflg = 0;
                 $jjlingflg = 0;
                 //
                 $cjzxnbys = $cjzxys->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $v['clsid'] . ' AND f_cjzx_pkid=' . $vI['pkid'] . ' AND (cjzxhk=1 OR(cjzxzf>30 AND cjzxzf<60))' . " AND (cjzxbkf='' OR cjzxbkf IS NULL)")->count();
                 if ($cjzxnbys == 0) {
                     //都有补考成绩(不来的就是缺考,也算有成绩)
                     $jjflg = 1;
                 }
                 $vI['jjflg'] = $jjflg;
                 array_push($pklsfn, $vI);
             }
         }
         $v['pkls'] = $pklsfn;
         array_push($clslsfn, $v);
     }
     //为了确保有NB过程,所以我们不管是有没有班级,统一NB一次,反正得到的ARR也不用,且却得到很多必要参数
     $arr = $NB->NB($cjzx, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn, 'n', 'n');
     ////
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     $this->assign('clsls', $clslsfn);
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     $stt = M('stt');
     $sttls = $stt->order('sttid ASC')->select();
     $this->assign('sttls', $sttls);
     import('@.XQ.XQAction');
     $xqw = new XQAction();
     //外来的学期
     $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     $this->assign('xqls', $xqls);
     //q特殊
     $this->assign('title', '交卷情况列表');
     $this->assign('theme', '交卷情况管理');
     $this->display('query');
 }
Example #30
0
 function query()
 {
     header("Content-Type:text/html; charset=utf-8");
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Pl'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], 'qry');
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     //鉴权对用户对stt的权限,若为设置权限,说明是教务的人,可以全管,否则只能管自己函授站的 ntf为不用this assign的
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Stt'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofnstt = $Idtath->identify($mdo['mdid'], 'ntf');
     $usr = M('usr');
     $usro = $usr->where('usrid=' . session('usridss'))->find();
     //第几学年 第几学期的班级 第几学年 第几学期的专业 ...
     //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓
     //NB初始化,开始
     $cdt = $_GET['cdt'];
     $grd = M('grd');
     if (preg_match('/f_std_grdid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_grdid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $grdid = $tmp[0];
     } else {
         //默认grdid
         $grdo = $grd->order('grdid DESC')->find();
         $grdid = $grdo['grdid'];
     }
     $grdo = $grd->where('grdid=' . $grdid)->find();
     $this->assign('grdid', $grdid);
     $std = M($grdo['grdnm'] . '_std')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid');
     $fldint = '-stdid-f_std_grdid-grdnm-f_std_sttid-sttnm-f_stdxqcls_xqid-xqnm-f_stdxqcls_clsid-bxxsnm-clsnm-stdno-stdnm-sexnm-';
     //默认学期,
     $xq = M('xq');
     $xqo = $xq->where('xqdq=1')->find();
     $xqid = $xqo['xqid'];
     if ($athofnstt['aths'] == 1) {
         $f_usr_sttid = 1;
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     } else {
         $f_usr_sttid = $usro['f_usr_sttid'];
         $sttintxq = M($grdo['grdnm'] . '_sttintxq');
         $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $f_usr_sttid)->find();
         if ($xqid < $sttintxqo['f_sttintxq_xqid']) {
             $xqid = $sttintxqo['f_sttintxq_xqid'];
         }
         //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期
         $cdtint = "-sp-f_std_grdid-eq-" . $grdid . "-sp-f_std_sttid-eq-" . $f_usr_sttid . "-sp-f_std_statid-eq-5-sp-f_stdxqcls_xqid-eq-" . $xqid . "-sp-f_stdxqmj_xqid-eq-" . $xqid . '-sp-';
         //接下来产生学期
     }
     if (preg_match('/f_stdxqcls_xqid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_stdxqcls_xqid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $xqid = $tmp[0];
     }
     $this->assign('xqid', $xqid);
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
     }
     $this->assign('sttid', $sttid);
     if (preg_match('/f_stdxqcls_clsid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_stdxqcls_clsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $clsid = $tmp[0];
     }
     $this->assign('clsid', $clsid);
     import('@.XQ.XQAction');
     $xqw = new XQAction();
     //外来的学期
     $xqnm = $xqw->getxqnm($grdid, $sttid, $xqid);
     $this->assign('xqnmsx', $xqnm);
     //sx 筛选
     $stt = M('stt');
     $stto = $stt->where('sttid=' . $sttid)->find();
     $this->assign('sttnmsx', $stto['sttnm']);
     $cls = M($grdo['grdnm'] . '_cls');
     $clso = $cls->where('clsid=' . $clsid)->find();
     $this->assign('clsnmsx', $clso['clsnm']);
     $spccdtint = '-sp-';
     ////
     $odrint = '-f_mj_bxxsid ASC-clsid ASC-mjid ASC-stdno ASC-';
     $lmtint = 100;
     $jn = 'tb_stt ON f_std_sttid=sttid-jn-tb_grd ON f_std_grdid=grdid-jn-tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid-jn-tb_bxxs ON f_mj_bxxsid=bxxsid-jn-tb_cc ON f_mj_ccid=ccid-jn-tb_kl ON f_mj_klid=klid-jn-tb_xxxs ON f_mj_xxxsid=xxxsid-jn-tb_zsfw ON f_mj_zsfwid=zsfwid-jn-tb_xz ON f_mj_xzid=xzid-jn-tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid-jn-tb_sex ON f_std_sexid=sexid-jn-tb_rc ON f_std_rcid=rcid-jn-tb_zzmm ON f_std_zzmmid=zzmmid-jn-tb_xl ON f_std_xlid=xlid-jn-tb_stat ON f_std_statid=statid-jn-tb_xq ON f_stdxqcls_xqid=xqid';
     import('@.NB.NBAction');
     $NB = new NBAction();
     $arr = $NB->NB($std, $fldint, $cdtint, $spccdtint, $odrint, $lmtint, $jn);
     ////
     if (preg_match('/f_stdxqcls_clsid/', $arr['cdt'])) {
         $tmp = explode('f_stdxqcls_clsid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $clsid = $tmp[0];
         //判断std所在的班级,当前人员能否修改。。。其实就是看他是教务的还是管理员还是他亲生班主任
         $mls = $arr['mls'];
         $bzr = M($grdo['grdnm'] . '_bzr');
         $mlsfn = array();
         $cjzx = M($grdo['grdnm'] . '_cjzx');
         //获取有多少该班最多有多少门课
         $pkidls = $cjzx->Distinct(true)->field('pkid')->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_' . $grdo['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdo['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_stt ON f_std_sttid=sttid')->join('tb_grd ON f_std_grdid=grdid')->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_cc ON f_mj_ccid=ccid')->join('tb_kl ON f_mj_klid=klid')->join('tb_xxxs ON f_mj_xxxsid=xxxsid')->join('tb_zsfw ON f_mj_zsfwid=zsfwid')->join('tb_xz ON f_mj_xzid=xzid')->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->join('tb_sex ON f_std_sexid=sexid')->join('tb_rc ON f_std_rcid=rcid')->join('tb_zzmm ON f_std_zzmmid=zzmmid')->join('tb_xl ON f_std_xlid=xlid')->join('tb_stat ON f_std_statid=statid')->join('tb_xq ON f_stdxqcls_xqid=xqid')->where("f_cjzx_xqid=" . $xqid . " AND f_stdxqcls_xqid=" . $xqid . " AND f_stdxqmj_xqid=" . $xqid . " AND f_std_statid=5 AND  f_stdxqcls_clsid=" . $clsid)->select();
         $where = '1=2';
         foreach ($pkidls as $vI) {
             $where = $where . ' OR pkid=' . $vI['pkid'];
         }
         $pk = m($grdo['grdnm'] . '_pk');
         $pkls = $pk->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where($where)->order('pkzkkm ASC,kcnm ASC')->select();
         $iforcnt = 0;
         foreach ($mls as $v) {
             $iforcnt++;
             $v['xh'] = $iforcnt;
             $bzro = $bzr->where('f_bzr_clsid=' . $v['f_stdxqcls_clsid'])->find();
             if ($athofn['aths'] == 1 || session('usridss') == $bzro['f_bzr_usrid']) {
                 //aths==1说明是教务的人或者是管理员
                 $v['mdf'] = 1;
             } else {
                 $v['mdf'] = 0;
             }
             $cjzxls = array();
             foreach ($pkls as $vI) {
                 $cjzxo = $cjzx->join('tb_' . $grdo['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->where('f_cjzx_grdid=' . $grdid . ' AND f_cjzx_sttid=' . $sttid . ' AND f_cjzx_xqid=' . $xqid . ' AND f_cjzx_stdid=' . $v['stdid'] . ' AND f_cjzx_pkid=' . $vI['pkid'])->find();
                 if ($cjzxo) {
                     if ($cjzxo['cjzxsftj'] == 0) {
                         if ($cjzxo['cjzxxk'] == 0 && $cjzxo['cjzxqk'] == 0 && $cjzxo['cjzxhk'] == 0) {
                             $cjzxo['cjzxzf'] = '';
                         }
                     }
                 } else {
                     $cjzxo['cjzxzf'] = '未选该课';
                 }
                 array_push($cjzxls, $cjzxo);
             }
             $v['cjzxls'] = $cjzxls;
             //查看是否有评论过
             $pl = M($grdo['grdnm'] . '_pl');
             if ($pl->where('f_pl_grdid=' . $grdid . ' AND f_pl_sttid=' . $sttid . ' AND f_pl_xqid=' . $xqid . ' AND f_pl_stdid=' . $v['stdid'])->find()) {
                 $plo = $pl->where('f_pl_grdid=' . $grdid . ' AND f_pl_sttid=' . $sttid . ' AND f_pl_xqid=' . $xqid . ' AND f_pl_stdid=' . $v['stdid'])->find();
                 $v['plid'] = $plo['plid'];
             } else {
                 $v['plid'] = 0;
             }
             array_push($mlsfn, $v);
         }
         //已最后一个学生选课为例
         $this->assign('pkls', $pkls);
         $this->assign('mls', $mlsfn);
         $this->assign('page_method', $arr['page_method']);
     }
     $this->assign('fstrw', $arr['fstrw']);
     $this->assign('sqlstc', $arr['sqlstc']);
     $this->assign('fld', $arr['fld']);
     $this->assign('cdt', $arr['cdt']);
     $this->assign('spccdt', $arr['spccdt']);
     ////
     $this->assign('odr', $arr['odr']);
     $this->assign('lmt', $arr['lmt']);
     $this->assign('count', $arr['count']);
     //NB初始化,结束
     //q特殊
     $grd = M('grd');
     $grdls = $grd->order('grdnm DESC')->select();
     $this->assign('grdls', $grdls);
     $stt = M('stt');
     //因为你站点可能木有了,但是站点已经招的学生阔能还在,因此要保留站点
     if ($athofnstt['aths'] == 1) {
         $sttls = $stt->select();
     } else {
         $sttls = $stt->where('sttid=' . $usro['f_usr_sttid'])->select();
     }
     $this->assign('sttls', $sttls);
     //q特殊
     $xq = M('xq');
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $sttid = $tmp[0];
         import('@.XQ.XQAction');
         $xqw = new XQAction();
         //外来的学期
         $xqls = $xqw->getxqls($grdo['grdid'], $sttid, 'DESC');
     } else {
         $xqls = $xq->order('xqnm DESC')->select();
     }
     $this->assign('xqls', $xqls);
     //q特殊
     $cdt = $arr['cdt'];
     $where = '1=1';
     if (preg_match('/f_std_sttid/', $cdt)) {
         //获取该键的值
         $tmp = explode('f_std_sttid', $cdt);
         $tmp = explode('-eq-', $tmp[1]);
         $tmp = explode('-sp-', $tmp[1]);
         $where = $where . ' AND f_cls_sttid=' . $tmp[0];
     } else {
         if ($athofnstt['aths'] == 1) {
             $where = $where . ' AND f_cls_sttid=1';
         } else {
             $where = $where . ' AND f_cls_sttid=' . $usro['f_usr_sttid'];
         }
     }
     //之前已经确定过到底是看哪个年级
     $where = $where . ' AND f_cls_grdid=' . $grdid . ' AND clsactvt=1';
     $cls = M($grdo['grdnm'] . '_cls');
     $clsls = $cls->join('tb_stt ON f_cls_sttid=sttid')->where($where)->order('clsnm ASC')->select();
     $this->assign('clsls', $clsls);
     //用于生成xls
     $this->assign('grdnm', $grdo['grdnm']);
     //q特殊
     $this->assign('title', '浏览成绩单列表');
     $this->assign('theme', '成绩管理');
     $this->display('query');
 }