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'); }
function gtxpg() { //先给hd设置好些东西,他自身是无法提取的 import('@.SS.SSAction'); $ss = new SSAction(); $usross = $ss->setss(); $x = $_GET['x']; //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处 $mdII = M('md'); $mdo = $mdII->where("mdmk='Std'")->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']); if ($x == 'vw') { $grdid = $_GET['grdid']; $xqid = $_GET['xqid']; $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $this->assign('mo', $mo); //搞推荐人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); } else { $this->assign('ifrcmd', '否'); } //所有的注册信息,哪个学期哪个班哪个专业 //应该具备哪些注册信息 //学期 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC'); //年级确定开始,学制确定过程 $stdxqcls = M($grdo['grdnm'] . '_stdxqcls'); $stdxqmj = M($grdo['grdnm'] . '_stdxqmj'); $stdxqdm = M($grdo['grdnm'] . '_stdxqdm'); for ($i = 0; $i < count($xqls); $i++) { $xqid = $xqls[$i]['xqid']; if ($stdxqcls->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find() && $stdxqmj->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find()) { $xqls[$i]['zcf'] = 'active'; //注册否? $xqls[$i]['zczt'] = '已注册'; } else { $xqls[$i]['zcf'] = 'disabled'; $xqls[$i]['zczt'] = '未注册'; } $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find(); $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find(); $stdxqdmo = $stdxqdm->join('tb_dm ON f_stdxqdm_dmid=dmid')->where('f_stdxqdm_stdid=' . $stdid . ' AND f_stdxqdm_xqid=' . $xqid)->find(); $xqls[$i]['clsnm'] = $stdxqclso['clsnm']; $xqls[$i]['mjnm'] = $stdxqmjo['mjnm']; $xqls[$i]['dmnm'] = $stdxqdmo['dmnm']; } $this->assign('zcls', $xqls); //注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $tsqklsnw = array(); foreach ($tsqkls as $tsqkv) { if ($tsqkv['tsqknr'] == 1) { $tsqkv['tsqknr'] = '换状态'; $stat = M('stat'); //原状态 $stato = $stat->where('statid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['statnm']; //现状态 $stato = $stat->where('statid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['statnm']; } else { if ($tsqkv['tsqknr'] == 2) { $tsqkv['tsqknr'] = '换专业'; $mj = M($grdo['grdnm'] . '_mj'); //原专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['mjnm']; //现专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['mjnm']; } else { if ($tsqkv['tsqknr'] == 3) { $tsqkv['tsqknr'] = '换班级'; $cls = M($grdo['grdnm'] . '_cls'); //原班级 $clso = $cls->where('clsid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['clsnm']; //现班级 $clso = $cls->where('clsid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['clsnm']; } else { if ($tsqkv['tsqknr'] == 4) { $tsqkv['tsqknr'] = '换寝室'; $dm = M('dm'); //原状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $dmo['dmnm']; //现状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $dmo['dmnm']; } } } } array_push($tsqklsnw, $tsqkv); } $this->assign('tsqkls', $tsqklsnw); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $grdid = $_GET['grdid']; $xqid = $_GET['xqid']; $stdid = $_GET['stdid']; $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 ($stdid == 0) { $mo['stdid'] = 0; $mo['stdsol'] = '无'; $mo['stdpt'] = C('PUBLIC') . '/IMG/default.jpg'; //第几学年 第几学期的班级 第几学年 第几学期的专业 ... //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓 //默认年级是当前年级 $grd = M('grd'); $grdo = $grd->order('grdnm DESC')->find(); $grdid = $grdo['grdid']; $mo['f_std_grdid'] = $grdid; $mo['grdnm'] = $grdo['grdnm']; //默认站点,有主的找有主的,没主的找本部 if ($athofnstt['aths'] != 1) { $mo['f_std_sttid'] = $usro['f_usr_sttid']; } else { $mo['f_std_sttid'] = 1; } //默认学期 为XX年级XX站点的起始学期 $sttintxq = M($grdo['grdnm'] . '_sttintxq'); $sttintxqo = $sttintxq->where('f_sttintxq_grdid=' . $grdo['grdid'] . ' AND f_sttintxq_sttid=' . $mo['f_std_sttid'])->find(); $xqid = $sttintxqo['f_sttintxq_xqid']; $mo['f_stdxqcls_xqid'] = $xqid; $mo['f_stdxqmj_xqid'] = $xqid; $this->assign('title', '添加'); $this->assign('theme', '添加:'); $this->assign('btnvl', '添加'); //q特殊 $xq = M('xq'); $xqls = $xq->where('xqid=' . $xqid)->select(); //我TMD就为了一个置顶的xq来了 $this->assign('xqls', $xqls); $where = '1=1'; if ($athofnstt['aths'] != 1) { $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(); $this->assign('clsls', $clsls); $where = '1=1'; if ($athofnstt['aths'] != 1) { $where = $where . " AND mjsttu LIKE '%-" . $usro['f_usr_sttid'] . "-%'"; } //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); } else { $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //q特殊 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdo['grdid'], $mo['f_std_sttid'], 'DESC'); $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=' . $mo['f_std_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(); $this->assign('clsls', $clsls); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-" . $mo['f_std_sttid'] . "-%' AND f_mj_bxxsid=" . $mo['f_mj_bxxsid']; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); //所有的注册信息,哪个学期哪个班哪个专业 //应该具备哪些注册信息 //学期 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC'); //年级确定开始,学制确定过程 $stdxqcls = M($grdo['grdnm'] . '_stdxqcls'); $stdxqmj = M($grdo['grdnm'] . '_stdxqmj'); $stdxqdm = M($grdo['grdnm'] . '_stdxqdm'); for ($i = 0; $i < count($xqls); $i++) { $xqid = $xqls[$i]['xqid']; if ($stdxqcls->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find() && $stdxqmj->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find()) { $xqls[$i]['zcf'] = 'active'; //注册否? $xqls[$i]['zczt'] = '已注册'; } else { $xqls[$i]['zcf'] = 'disabled'; $xqls[$i]['zczt'] = '未注册'; } $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find(); $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find(); $stdxqdmo = $stdxqdm->join('tb_dm ON f_stdxqdm_dmid=dmid')->where('f_stdxqdm_stdid=' . $stdid . ' AND f_stdxqdm_xqid=' . $xqid)->find(); $xqls[$i]['clsnm'] = $stdxqclso['clsnm']; $xqls[$i]['mjnm'] = $stdxqmjo['mjnm']; $xqls[$i]['dmnm'] = $stdxqdmo['dmnm']; } $this->assign('zcls', $xqls); //注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $tsqklsnw = array(); foreach ($tsqkls as $tsqkv) { if ($tsqkv['tsqknr'] == 1) { $tsqkv['tsqknr'] = '换状态'; $stat = M('stat'); //原状态 $stato = $stat->where('statid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['statnm']; //现状态 $stato = $stat->where('statid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['statnm']; } else { if ($tsqkv['tsqknr'] == 2) { $tsqkv['tsqknr'] = '换专业'; $mj = M($grdo['grdnm'] . '_mj'); //原专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['mjnm']; //现专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['mjnm']; } else { if ($tsqkv['tsqknr'] == 3) { $tsqkv['tsqknr'] = '换班级'; $cls = M($grdo['grdnm'] . '_cls'); //原班级 $clso = $cls->where('clsid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['clsnm']; //现班级 $clso = $cls->where('clsid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['clsnm']; } else { if ($tsqkv['tsqknr'] == 4) { $tsqkv['tsqknr'] = '换寝室'; $dm = M('dm'); //原状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $dmo['dmnm']; //现状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $dmo['dmnm']; } } } } array_push($tsqklsnw, $tsqkv); } $this->assign('tsqkls', $tsqklsnw); } // //搞学生照片 // if(file_exists('./Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg')){ // $mo['stdpt']=__ROOT__.'/Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg'; // }else{ // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // } $this->assign('mo', $mo); //q特殊 $bxxs = M('bxxs'); $bxxsls = $bxxs->select(); $this->assign('bxxsls', $bxxsls); //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特殊 $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); $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特殊 $stat = M('stat'); $statls = $stat->where("statactvt=1 AND statmk='jw'")->select(); $this->assign('statls', $statls); //搞介绍人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); $this->assign('rcmdcls', ''); } else { $this->assign('ifrcmd', '否'); $this->assign('rcmdcls', 'readonly'); } $this->display('update'); } else { if ($x == 'mdf') { $grdid = $_GET['grdid']; $xqid = $_GET['xqid']; $stdid = $_GET['stdid']; $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'); $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //q特殊 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdo['grdid'], $mo['f_std_sttid'], 'DESC'); $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=' . $mo['f_std_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(); $this->assign('clsls', $clsls); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-" . $mo['f_std_sttid'] . "-%' AND f_mj_bxxsid=" . $mo['f_mj_bxxsid']; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); //所有的注册信息,哪个学期哪个班哪个专业 //应该具备哪些注册信息 //学期 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC'); //年级确定开始,学制确定过程 $stdxqcls = M($grdo['grdnm'] . '_stdxqcls'); $stdxqmj = M($grdo['grdnm'] . '_stdxqmj'); $stdxqdm = M($grdo['grdnm'] . '_stdxqdm'); for ($i = 0; $i < count($xqls); $i++) { $xqid = $xqls[$i]['xqid']; if ($stdxqcls->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find() && $stdxqmj->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find()) { $xqls[$i]['zcf'] = 'active'; //注册否? $xqls[$i]['zczt'] = '已注册'; } else { $xqls[$i]['zcf'] = 'disabled'; $xqls[$i]['zczt'] = '未注册'; } $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find(); $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find(); $stdxqdmo = $stdxqdm->join('tb_dm ON f_stdxqdm_dmid=dmid')->where('f_stdxqdm_stdid=' . $stdid . ' AND f_stdxqdm_xqid=' . $xqid)->find(); $xqls[$i]['clsnm'] = $stdxqclso['clsnm']; $xqls[$i]['mjnm'] = $stdxqmjo['mjnm']; $xqls[$i]['dmnm'] = $stdxqdmo['dmnm']; } $this->assign('zcls', $xqls); //注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $tsqklsnw = array(); foreach ($tsqkls as $tsqkv) { if ($tsqkv['tsqknr'] == 1) { $tsqkv['tsqknr'] = '换状态'; $stat = M('stat'); //原状态 $stato = $stat->where('statid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['statnm']; //现状态 $stato = $stat->where('statid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['statnm']; } else { if ($tsqkv['tsqknr'] == 2) { $tsqkv['tsqknr'] = '换专业'; $mj = M($grdo['grdnm'] . '_mj'); //原专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['mjnm']; //现专业 $mjo = $mj->where('mjid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['mjnm']; } else { if ($tsqkv['tsqknr'] == 3) { $tsqkv['tsqknr'] = '换班级'; $cls = M($grdo['grdnm'] . '_cls'); //原班级 $clso = $cls->where('clsid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $stato['clsnm']; //现班级 $clso = $cls->where('clsid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $stato['clsnm']; } else { if ($tsqkv['tsqknr'] == 4) { $tsqkv['tsqknr'] = '换寝室'; $dm = M('dm'); //原状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqkorgid'])->find(); $tsqkv['tsqkorgid'] = $dmo['dmnm']; //现状态 $dmo = $dm->where('dmid=' . $tsqkv['tsqknwid'])->find(); $tsqkv['tsqknwid'] = $dmo['dmnm']; } } } } array_push($tsqklsnw, $tsqkv); } $this->assign('tsqkls', $tsqklsnw); // //搞学生照片 // if(file_exists('./Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg')){ // $mo['stdpt']=__ROOT__.'/Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg'; // }else{ // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // } $this->assign('mo', $mo); //q特殊 $bxxs = M('bxxs'); $bxxsls = $bxxs->select(); $this->assign('bxxsls', $bxxsls); //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特殊 $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); $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特殊 $stat = M('stat'); $statls = $stat->where("statactvt=1 AND statmk='jw'")->select(); $this->assign('statls', $statls); //搞介绍人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); $this->assign('rcmdcls', ''); } else { $this->assign('ifrcmd', '否'); $this->assign('rcmdcls', 'readonly'); } $this->display('update'); } else { if ($x = 'stddtfx') { $xq = M('xq'); $xqodq = $xq->where('xqdq=1')->find(); $xqiddq = $xqodq['xqid']; $sttid = 1; $bxxs = M('bxxs'); $bxxsls = $bxxs->select(); $dm = M('dm'); $dmls = $dm->select(); //先分开算再合起来 $grd = M('grd'); $grdls = $grd->order('grdnm DESC')->select(); $grdlsfn = array(); foreach ($grdls as $grdv) { $zl = array(); //资料 $cls = M($grdv['grdnm'] . '_cls'); $clsls = $cls->where('clsactvt=1 AND f_cls_sttid=' . $sttid)->order('clsnm ASC')->select(); $mj = M($grdv['grdnm'] . '_mj'); $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->where("mjsttu LIKE '%-" . $sttid . "-%'")->order('bxxsid ASC,mjnm ASC')->select(); $std = M($grdv['grdnm'] . '_std'); if ($std->where('f_std_statid=5')->count() == 0) { continue; } $zongnb = $std->where('f_std_statid=5')->count(); $zl['zongnb'] = $zongnb; $bynb = $std->where('f_std_statid=5 AND f_std_sexid=1')->count(); $zl['bynb'] = $bynb; $glnb = $std->where('f_std_statid=5 AND f_std_sexid=2')->count(); $zl['glnb'] = $glnb; //查看办学形式 $bxxsarr = array(); foreach ($bxxsls as $bxxsv) { $bxxscnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_mj_bxxsid=' . $bxxsv['bxxsid'] . ' AND f_std_statid=5')->count(); if ($bxxscnt == 0) { continue; } $bxxsv['bxxscnt'] = $bxxscnt; array_push($bxxsarr, $bxxsv); } $zl['bxxs'] = $bxxsarr; //查看住宿 $dmarr = array(); foreach ($dmls as $dmv) { $dmcnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqdm ON stdid=f_stdxqdm_stdid')->where("f_stdxqdm_xqid=" . $xqiddq . ' AND f_stdxqdm_dmid=' . $dmv['dmid'] . ' AND f_std_statid=5')->count(); if ($dmcnt == 0) { continue; } $dmv['dmcnt'] = $dmcnt; array_push($dmarr, $dmv); } $zl['dm'] = $dmarr; //查看港澳台西藏 $hknb = $std->where("stdnp LIKE '%香港%' AND f_std_statid=5")->count(); $zl['hknb'] = $hknb; $mcnb = $std->where("stdnp LIKE '%澳门%' AND f_std_statid=5")->count(); $zl['mcnb'] = $mcnb; $twnb = $std->where("stdnp LIKE '%台湾%' AND f_std_statid=5")->count(); $zl['twnb'] = $twnb; $tbnb = $std->where("stdnp LIKE '%西藏%' AND f_std_statid=5")->count(); $zl['tbnb'] = $tbnb; $otnb = $std->where("stdnp NOT LIKE '%香港%' AND stdnp NOT LIKE '%澳门%' AND stdnp NOT LIKE '%台湾%' AND stdnp NOT LIKE '%西藏%' AND f_std_statid=5")->count(); $zl['otnb'] = $otnb; //查看班级 $clsarr = array(); foreach ($clsls as $clsv) { $clscnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_stdxqcls_clsid=' . $clsv['clsid'] . ' AND f_std_statid=5')->count(); if ($clscnt == 0) { continue; } $clsv['clscnt'] = $clscnt; array_push($clsarr, $clsv); } $zl['cls'] = $clsarr; //查看专业 $mjarr = array(); foreach ($mjls as $mjv) { $mjcnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_stdxqmj_mjid=' . $mjv['mjid'] . ' AND f_std_statid=5')->count(); if ($mjcnt == 0) { continue; } $mjv['clscnt'] = $mjcnt; array_push($mjarr, $mjv); } $zl['mj'] = $mjarr; $grdv['zl'] = $zl; array_push($grdlsfn, $grdv); } $this->assign('grdls', $grdlsfn); $this->assign('title', '学生数据分析'); $this->assign('theme', '学生数据分析详细'); $this->display('stddtfx'); } } } } }
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='Zsstd'")->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']); $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; $sttid = 1; if ($x == 'vw') { $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; if ($athofn['aths'] == 1) { //aths==1说明是教务的人或者是管理员 $mo['mdf'] = 1; } else { $mo['mdf'] = 0; } $this->assign('mo', $mo); //搞推荐人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); } else { $this->assign('ifrcmd', '否'); } //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $stdid = $_GET['stdid']; if ($stdid == 0) { $mo['stdid'] = 0; $mo['stdsol'] = '无'; $mo['stdpt'] = C('PUBLIC') . '/IMG/default.jpg'; //第几学年 第几学期的班级 第几学年 第几学期的专业 ... //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓 //默认年级是当前年级 $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $mo['f_std_grdid'] = $grdid; $mo['grdnm'] = $grdo['grdnm']; //默认站点,有主的找有主的,没主的找本部 $mo['f_std_sttid'] = 1; //默认学期 为XX年级XX站点的起始学期 $mo['f_stdxqcls_xqid'] = $xqid; $mo['f_stdxqmj_xqid'] = $xqid; $this->assign('title', '添加'); $this->assign('theme', '添加:'); $this->assign('btnvl', '添加'); //q特殊 $xq = M('xq'); $xqls = $xq->where('xqid=' . $xqid)->select(); //我TMD就为了一个置顶的xq来了 $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=1'; //之前已经确定过到底是看哪个年级 $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); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-1-%'"; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); } else { $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //q特殊 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdo['grdid'], 1, 'DESC'); $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=1'; //之前已经确定过到底是看哪个年级 $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); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-1-%' AND f_mj_bxxsid=" . $mo['f_mj_bxxsid']; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); } // //搞学生照片 // if(file_exists('./Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg')){ // $mo['stdpt']=__ROOT__.'/Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg'; // }else{ // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // } $this->assign('mo', $mo); //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); $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特殊 $stat = M('stat'); $statls = $stat->where("statactvt=1 AND statmk='zs'")->select(); $this->assign('statls', $statls); //搞介绍人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); $this->assign('rcmdcls', ''); } else { $this->assign('ifrcmd', '否'); $this->assign('rcmdcls', 'readonly'); } $this->display('update'); } else { if ($x == 'ylqtz') { //根据学期获得学年 $xq = M('xq'); $xqo = $xq->where('xqid=' . $xqid)->find(); if (preg_match('/第1学期/', $xqo['xqnm'])) { $tmp = explode('-', $xqo[xqnm]); $xnnm = $tmp[0]; } else { $tmp = explode('-', $xqo[xqnm]); $tmp = explode('学年', $tmp[1]); $xnnm = $tmp[0]; } $xn = M('xn'); $xno = $xn->where("xnnm='" . $xnnm . "'")->find(); $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('f_cw_stdid=' . $stdid . ' AND f_cw_xnid=' . $xno['xnid'])->find(); $cwid = $cwo['cwid']; $xqid = $cwo['cwzcxqid']; $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('mo', $mo); //添加缴费信息1、学费教材考务费2、住宿费 $mj = M($grdo['grdnm'] . '_mj'); $mjo = $mj->where('mjid=' . $mo['f_stdxqmj_mjid'])->find(); $xf = M($grdo['grdnm'] . '_xf'); $xfo = $xf->where('f_xf_sttid=' . $mo['f_std_sttid'] . ' AND f_xf_bxxsid=' . $mjo['f_mj_bxxsid'] . ' AND f_xf_ccid=' . $mjo['f_mj_ccid'] . ' AND f_xf_klid=' . $mjo['f_mj_klid'])->find(); $zsf = M($grdo['grdnm'] . '_zsf'); $zsfo = $zsf->where('f_zsf_dmid=' . $mo['f_stdxqdm_dmid'])->find(); $this->assign('xfo', $xfo); $this->assign('zsfo', $zsfo); $this->assign('title', '预录取通知书电子版'); $this->assign('theme', '预录取通知书电子版'); $this->display('ylqtz'); } else { if ($x == 'stdda') { //学生档案 $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('mo', $mo); $this->assign('title', '学生档案流程单'); $this->assign('theme', '档案流程单'); $this->display('stdda'); } else { if ($x == 'mdf') { $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //q特殊 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdo['grdid'], 1, 'DESC'); $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=1'; //之前已经确定过到底是看哪个年级 $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); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-1-%' AND f_mj_bxxsid=" . $mo['f_mj_bxxsid']; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); // //搞学生照片 // if(file_exists('./Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg')){ // $mo['stdpt']=__ROOT__.'/Uploads/std/'.$grdo['grdnm'].'/'.$mo['f_std_sttid'].'/'.$mo['stdno'].'.jpg'; // }else{ // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // } $this->assign('mo', $mo); //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); $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特殊 $stat = M('stat'); $statls = $stat->where("statactvt=1 AND statmk='zs'")->select(); $this->assign('statls', $statls); //搞介绍人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); $this->assign('rcmdcls', ''); } else { $this->assign('ifrcmd', '否'); $this->assign('rcmdcls', 'readonly'); } $this->display('update'); } else { if ($x = 'stddtfx') { $xqiddq = $xqid; $bxxs = M('bxxs'); $bxxsls = $bxxs->select(); $dm = M('dm'); $dmls = $dm->select(); //先分开算再合起来 $grd = M('grd'); $grdls = $grd->where('grdid=' . $grdid)->order('grdnm DESC')->select(); $grdlsfn = array(); foreach ($grdls as $grdv) { $zl = array(); //资料 $cls = M($grdv['grdnm'] . '_cls'); $clsls = $cls->where('clsactvt=1 AND f_cls_sttid=' . $sttid)->order('clsnm ASC')->select(); $mj = M($grdv['grdnm'] . '_mj'); $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->where("mjsttu LIKE '%-" . $sttid . "-%' AND mjbbzs=1")->order('bxxsid ASC,mjnm ASC')->select(); $std = M($grdv['grdnm'] . '_std'); if ($std->count() == 0) { continue; } $zongsm = $std->count(); $zl['zongsm'] = $zongsm; //总大小 $bulaism = $std->where('f_std_statid=9')->count(); $zl['bulaism'] = $bulaism; $kenenglaism = $std->where('f_std_statid<>9')->count(); $zl['kenenglaism'] = $kenenglaism; $zongnb = $std->where('f_std_statid<>9')->count(); $zl['zongnb'] = $zongnb; // $bynb = $std->where('f_std_statid<>9 AND f_std_sexid=1')->count(); $zl['bynb'] = $bynb; $glnb = $std->where('f_std_statid<>9 AND f_std_sexid=2')->count(); $zl['glnb'] = $glnb; //查看办学形式 $bxxsarr = array(); foreach ($bxxsls as $bxxsv) { $bxxscnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_mj_bxxsid=' . $bxxsv['bxxsid'] . ' AND f_std_statid<>9')->count(); if ($bxxscnt == 0) { continue; } $bxxsv['bxxscnt'] = $bxxscnt; array_push($bxxsarr, $bxxsv); } $zl['bxxs'] = $bxxsarr; //查看住宿 $dmarr = array(); foreach ($dmls as $dmv) { $dmcnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqdm ON stdid=f_stdxqdm_stdid')->where("f_stdxqdm_xqid=" . $xqiddq . ' AND f_stdxqdm_dmid=' . $dmv['dmid'] . ' AND f_std_statid<>9')->count(); if ($dmcnt == 0) { continue; } $dmv['dmcnt'] = $dmcnt; array_push($dmarr, $dmv); } $zl['dm'] = $dmarr; //查看港澳台西藏 $hknb = $std->where("stdnp LIKE '%香港%' AND f_std_statid<>9")->count(); $zl['hknb'] = $hknb; $mcnb = $std->where("stdnp LIKE '%澳门%' AND f_std_statid<>9")->count(); $zl['mcnb'] = $mcnb; $twnb = $std->where("stdnp LIKE '%台湾%' AND f_std_statid<>9")->count(); $zl['twnb'] = $twnb; $tbnb = $std->where("stdnp LIKE '%西藏%' AND f_std_statid<>9")->count(); $zl['tbnb'] = $tbnb; $otnb = $std->where("stdnp NOT LIKE '%香港%' AND stdnp NOT LIKE '%澳门%' AND stdnp NOT LIKE '%台湾%' AND stdnp NOT LIKE '%西藏%' AND f_std_statid<>9")->count(); $zl['otnb'] = $otnb; //PS:这里发现了个彩蛋,mysql在利用某个字段搜索的时候都是有个默认前提的,就是在这个字段有值的 条目中进行筛选 // //查看班级 // $clsarr=array(); // foreach ($clsls as $clsv){ // $clscnt=$std->join('inner join tb_'.$grdv['grdnm'].'_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_'.$grdv['grdnm'].'_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_'.$grdv['grdnm'].'_cls ON f_stdxqcls_clsid=clsid')->where("f_stdxqcls_xqid=".$xqiddq." AND f_stdxqmj_xqid=".$xqiddq.' AND f_stdxqcls_clsid='.$clsv['clsid'].' AND f_std_statid=5')->count(); // if($clscnt==0){ // continue; // } // $clsv['clscnt']=$clscnt; // array_push($clsarr, $clsv); // } // $zl['cls']=$clsarr; //查看专业 $mjarr = array(); foreach ($mjls as $mjv) { $mjcnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_stdxqmj_mjid=' . $mjv['mjid'] . ' AND f_std_statid<>9')->count(); if ($mjcnt == 0) { continue; } $mjv['mjcnt'] = $mjcnt; array_push($mjarr, $mjv); } $zl['mj'] = $mjarr; //查看班级 $clsarr = array(); foreach ($clsls as $clsv) { $clscnt = $std->join('inner join tb_' . $grdv['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $grdv['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid')->join('tb_' . $grdv['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where("f_stdxqcls_xqid=" . $xqiddq . " AND f_stdxqmj_xqid=" . $xqiddq . ' AND f_stdxqcls_clsid=' . $clsv['clsid'] . ' AND f_std_statid<>9')->count(); if ($clscnt == 0) { continue; } $clsv['clscnt'] = $clscnt; array_push($clsarr, $clsv); } $zl['cls'] = $clsarr; $grdv['zl'] = $zl; array_push($grdlsfn, $grdv); } $this->assign('grdls', $grdlsfn); $begin = '2015-05-01'; $end = date("Y-m-d", time()); import('@.TM.TMAction'); $tm = new TMAction(); $datels = $tm->timelist($begin, $end); $dtls = array(); $rsls = array(); //人数 foreach ($datels as $k => $dtv) { $dateo = date("m-d", $dtv); $tmp = array(); //清空一下,一面造成累计 $tmp['rq'] = $dateo; array_push($dtls, $tmp); $cnt = $std->where("stdaddtm LIKE '%" . $dateo . "%'")->count(); $tmp = array(); //清空一下,一面造成累计 $tmp['rs'] = $cnt; array_push($rsls, $tmp); } $this->assign('dtls', $dtls); $this->assign('rsls', $rsls); $this->assign('title', '招生学生数据分析'); $this->assign('theme', '招生学生数据分析详细'); $this->display('stddtfx'); } } } } } } }
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='Cjzx'")->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']); if ($x == 'vw') { $grdid = $_GET['grdid']; $cjzxid = $_GET['cjzxid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cjzx = M($grdo['grdnm'] . '_cjzx'); $cjzxo = $cjzx->where('cjzxid=' . $cjzxid)->find(); $mo = $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')->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_stdxqcls_xqid=" . $cjzxo['f_cjzx_xqid'] . " AND f_stdxqmj_xqid=" . $cjzxo['f_cjzx_xqid'] . " AND f_std_statid=5 AND cjzxid=" . $cjzxid)->find(); if ($mo['pkzkkm'] == 1) { $mo['pkzkkm'] = '【自考科目】'; } else { if ($mo['pkzkkm'] == 0) { $mo['pkzkkm'] = ''; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_cjzx_sttid'], $mo['f_cjzx_xqid']); $mo['xqnm'] = $xqnm; if ($mo['cjzxxk'] == 1) { $mo['cjzxxk'] = '是'; } else { $mo['cjzxxk'] = '否'; } if ($mo['cjzxqk'] == 1) { $mo['cjzxqk'] = '是'; } else { $mo['cjzxqk'] = '否'; } if ($mo['cjzxhk'] == 1) { $mo['cjzxhk'] = '是'; } else { $mo['cjzxhk'] = '否'; } $this->assign('mo', $mo); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $grdid = $_GET['grdid']; $cjzxid = $_GET['cjzxid']; // $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 ($cjzxid == 0) { // $mo['cjzxid']=0; // //默认年级是当前年级 // $grd=M('grd'); // $grdo=$grd->order('grdnm DESC')->find(); // $grdid=$grdo['grdid']; // $mo['f_cjzx_grdid']=$grdid; // //默认站点,有主的找有主的,没主的找本部 // if($athofnstt['aths']!=1){ // $mo['f_cjzx_sttid']=$usro['f_usr_sttid']; // }else{ // $mo['f_cjzx_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_cjzx_sttid'])->find(); // if($xqid<$sttintxqo['f_sttintxq_xqid']){$xqid=$sttintxqo['f_sttintxq_xqid'];}//①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期 // $mo['f_cjzx_xqid']=$xqid; // $this->assign('title','添加'); // $this->assign('theme','添加:'); // $this->assign('btnvl','添加'); } else { $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cjzx = M($grdo['grdnm'] . '_cjzx'); $cjzxo = $cjzx->where('cjzxid=' . $cjzxid)->find(); $mo = $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')->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_stdxqcls_xqid=" . $cjzxo['f_cjzx_xqid'] . " AND f_stdxqmj_xqid=" . $cjzxo['f_cjzx_xqid'] . " AND f_std_statid=5 AND cjzxid=" . $cjzxid)->find(); if ($mo['pkzkkm'] == 1) { $mo['pkzkkm'] = '【自考科目】'; } else { if ($mo['pkzkkm'] == 0) { $mo['pkzkkm'] = ''; } } $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_cjzx_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_cjzx_sttid'])->select(); // $this->assign('tcrls',$tcrls); $this->display('update'); } } }
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='Jjqk'")->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 == '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'); } } }
function gtxpg() { header("Content-Type:text/html; charset=utf-8"); //先给hd设置好些东西,他自身是无法提取的 import('@.SS.SSAction'); $ss = new SSAction(); $ss->setss(); $x = $_GET['x']; // //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处 // $mdII=M('md'); // $mdo=$mdII->where("mdmk='Cjzx'")->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']); if ($x == 'vw') { $grdid = $_GET['grdid']; $cjzxid = $_GET['cjzxid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cjzx = M($grdo['grdnm'] . '_cjzx'); $mo = $cjzx->join('tb_stt ON f_cjzx_sttid=sttid')->join('tb_grd ON f_cjzx_grdid=grdid')->join('tb_xq ON f_cjzx_xqid=xqid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_cjzx_kcid=kcid')->join('tb_tcr ON f_cjzx_tcrid=tcrid')->where("cjzxid=" . $cjzxid)->find(); //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_cjzx_sttid'], $mo['f_cjzx_xqid']); $mo['xqnm'] = $xqnm; $this->assign('mo', $mo); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $grdid = $_GET['grdid']; $cjzxid = $_GET['cjzxid']; $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 ($cjzxid == 0) { $mo['cjzxid'] = 0; //默认年级是当前年级 $grd = M('grd'); $grdo = $grd->order('grdnm DESC')->find(); $grdid = $grdo['grdid']; $mo['f_cjzx_grdid'] = $grdid; //默认站点,有主的找有主的,没主的找本部 if ($athofnstt['aths'] != 1) { $mo['f_cjzx_sttid'] = $usro['f_usr_sttid']; } else { $mo['f_cjzx_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_cjzx_sttid'])->find(); if ($xqid < $sttintxqo['f_sttintxq_xqid']) { $xqid = $sttintxqo['f_sttintxq_xqid']; } //①如果激活的学期在初始学期后范围内的那么就选激活的学期②如果...在范围外的话呢就选择第初始学期为默认学期 $mo['f_cjzx_xqid'] = $xqid; $this->assign('title', '添加'); $this->assign('theme', '添加:'); $this->assign('btnvl', '添加'); } else { $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cjzx = M($grdo['grdnm'] . '_cjzx'); $mo = $cjzx->join('tb_stt ON f_cjzx_sttid=sttid')->join('tb_grd ON f_cjzx_grdid=grdid')->join('tb_xq ON f_cjzx_xqid=xqid')->join('tb_' . $grdo['grdnm'] . '_kc ON f_cjzx_kcid=kcid')->join('tb_tcr ON f_cjzx_tcrid=tcrid')->where("cjzxid=" . $cjzxid)->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_cjzx_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_cjzx_sttid'])->select(); $this->assign('tcrls', $tcrls); $this->display('update'); } else { if ($x = 'skxx') { //授课信息 //获得这个人id $tcrid = session('tcridss'); $tcr = M('tcr'); $tcro = $tcr->where('tcrid=' . $tcrid)->find(); //sttid tcrid $xq = M('xq'); $xqo = $xq->where('xqdq=1')->find(); //xqid $grd = M('grd'); $grdls = $grd->order('grdnm DESC')->select(); $grdlsfn = array(); foreach ($grdls as $v) { //grdid $pk = M($v['grdnm'] . '_pk'); $pkls = $pk->join('tb_' . $v['grdnm'] . '_kc ON f_pk_kcid=kcid')->where('f_pk_grdid=' . $v['grdid'] . ' AND f_pk_sttid=' . $tcro['f_tcr_sttid'] . ' AND f_pk_xqid=' . $xqo['xqid'] . ' AND f_pk_tcrid=' . $tcro['tcrid'])->select(); if (!$pkls) { continue; } $pklsfn = array(); foreach ($pkls as $u) { $cjzx = M($v['grdnm'] . '_cjzx'); $cjzx->join('tb_' . $v['grdnm'] . '_std ON f_cjzx_stdid=stdid')->join('inner join tb_' . $v['grdnm'] . '_stdxqcls ON stdid=f_stdxqcls_stdid')->join('inner join tb_' . $v['grdnm'] . '_stdxqmj ON stdid=f_stdxqmj_stdid'); $cjzx->join('tb_' . $v['grdnm'] . '_pk ON f_cjzx_pkid=pkid')->join('tb_stt ON f_cjzx_sttid=sttid')->join('tb_grd ON f_cjzx_grdid=grdid')->join('tb_' . $v['grdnm'] . '_kc ON f_pk_kcid=kcid')->join('tb_tcr ON f_pk_tcrid=tcrid')->join('tb_xq ON f_cjzx_xqid=xqid')->join('tb_' . $v['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_' . $v['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'); $cjzxls = $cjzx->Distinct(true)->field('clsid,clsnm,cjzxsftj')->where('f_stdxqcls_xqid=' . $xqo['xqid'] . ' AND f_stdxqmj_xqid=' . $xqo['xqid'] . ' AND f_cjzx_pkid=' . $u['pkid'] . ' AND f_std_statid=5')->select(); $u['clsls'] = $cjzxls; array_push($pklsfn, $u); } $v['pkls'] = $pklsfn; array_push($grdlsfn, $v); } $this->assign('grdls', $grdlsfn); $this->assign('title', '授课信息'); $this->assign('theme', '授课信息:'); $this->assign('btnvl', ''); $this->display('skxx'); } } } }
function gtxpg() { //先给hd设置好些东西,他自身是无法提取的 import('@.SS.SSAction'); $ss = new SSAction(); $ss->setss(); $x = $_GET['x']; if ($x == 'vw') { $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; //根据学期获得学年 $xq = M('xq'); $xqo = $xq->where('xqid=' . $xqid)->find(); if (preg_match('/第1学期/', $xqo['xqnm'])) { $tmp = explode('-', $xqo[xqnm]); $xnnm = $tmp[0]; } else { $tmp = explode('-', $xqo[xqnm]); $tmp = explode('学年', $tmp[1]); $xnnm = $tmp[0]; } $xn = M('xn'); $xno = $xn->where("xnnm='" . $xnnm . "'")->find(); $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('f_cw_stdid=' . $stdid . ' AND f_cw_xnid=' . $xno['xnid'])->find(); $cwid = $cwo['cwid']; $xqid = $cwo['cwzcxqid']; $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('mo', $mo); $this->assign('title', '查看'); $this->assign('theme', '查看缴费信息'); $this->display('view'); } else { if ($x == 'updt') { $cwid = $_GET['cwid']; $grdid = $_GET['grdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('cwid=' . $cwid)->find(); $xqid = $cwo['cwzcxqid']; $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 ($cwid == 0) { // $mo['stdid']=0; // $mo['stdsol']='无'; // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // //第几学年 第几学期的班级 第几学年 第几学期的专业 ... // //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓 // //默认年级是当前年级 // $grd=M('grd'); // $grdo=$grd->order('grdnm DESC')->find(); // $grdid=$grdo['grdid']; // $mo['f_std_grdid']=$grdid; // $mo['grdnm']=$grdo['grdnm']; // //默认站点,有主的找有主的,没主的找本部 // if($athofnstt['aths']!=1){ // $mo['f_std_sttid']=$usro['f_usr_sttid']; // }else{ // $mo['f_std_sttid']=1; // } // //默认学期 为XX年级XX站点的起始学期 // $sttintxq=M($grdo['grdnm'].'_sttintxq'); // $sttintxqo=$sttintxq->where('f_sttintxq_grdid='.$grdo['grdid'].' AND f_sttintxq_sttid='.$mo['f_std_sttid'])->find(); // $xqid=$sttintxqo['f_sttintxq_xqid']; // $mo['f_stdxqcls_xqid']=$xqid; // $mo['f_stdxqmj_xqid']=$xqid; // $this->assign('title','添加'); // $this->assign('theme','添加:'); // $this->assign('btnvl','添加'); // //q特殊 // $xq=M('xq'); // $xqls=$xq->where('xqid='.$xqid)->select();//我TMD就为了一个置顶的xq来了 // $this->assign('xqls',$xqls); // $where='1=1'; // if($athofnstt['aths']!=1){ // $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(); // $this->assign('clsls',$clsls); // $where='1=1'; // if($athofnstt['aths']!=1){ // $where=$where." AND mjsttu LIKE '%-".$usro['f_usr_sttid']."-%'"; // } // //之前已经确定过到底是看哪个年级 // $where=$where.' AND f_mj_grdid='.$grdid; // $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(); // $mjlsnw=array(); // foreach($mjls as $v){ // //给专业多点修饰 // if(preg_match('/技能/',$v['bxxsnm'])){ // $v['bxxsnmst']='技能'; // }else if(preg_match('/自考/',$v['bxxsnm'])){ // $v['bxxsnmst']='自考'; // }else{ // $v['bxxsnmst']='普通'; // } // array_push($mjlsnw, $v); // } // $this->assign('mjls',$mjlsnw); } else { $grd = M('grd'); $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //所有的注册信息,哪个学期哪个班哪个专业 //应该具备哪些注册信息 //学期 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC'); //年级确定开始,学制确定过程 $stdxqcls = M($grdo['grdnm'] . '_stdxqcls'); $stdxqmj = M($grdo['grdnm'] . '_stdxqmj'); for ($i = 0; $i < count($xqls); $i++) { $xqid = $xqls[$i]['xqid']; if ($stdxqcls->where('f_stdxqcls_stdid=' . $mo['f_cw_stdid'] . ' AND f_stdxqcls_xqid=' . $xqid)->find() && $stdxqmj->where('f_stdxqmj_stdid=' . $mo['f_cw_stdid'] . ' AND f_stdxqmj_xqid=' . $xqid)->find()) { $xqls[$i]['zcf'] = 'active'; //注册否? $xqls[$i]['zczt'] = '已注册'; } else { $xqls[$i]['zcf'] = 'disabled'; $xqls[$i]['zczt'] = '未注册'; } $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $mo['f_cw_stdid'] . ' AND f_stdxqcls_xqid=' . $xqid)->find(); $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $mo['f_cw_stdid'] . ' AND f_stdxqmj_xqid=' . $xqid)->find(); $xqls[$i]['clsnm'] = $stdxqclso['clsnm']; $xqls[$i]['mjnm'] = $stdxqmjo['mjnm']; } $this->assign('zcls', $xqls); //注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $mo['f_cw_stdid'])->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); } $this->assign('mo', $mo); $this->display('update'); } else { if ($x == 'center') { $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; //根据学期获得学年 $xq = M('xq'); $xqo = $xq->where('xqid=' . $xqid)->find(); if (preg_match('/第1学期/', $xqo['xqnm'])) { $tmp = explode('-', $xqo[xqnm]); $xnnm = $tmp[0]; } else { $tmp = explode('-', $xqo[xqnm]); $tmp = explode('学年', $tmp[1]); $xnnm = $tmp[0]; } $xn = M('xn'); $xno = $xn->where("xnnm='" . $xnnm . "'")->find(); $stdid = session('stdidss'); $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('f_cw_stdid=' . $stdid . ' AND f_cw_xnid=' . $xno['xnid'])->find(); $cwid = $cwo['cwid']; $xqid = $cwo['cwzcxqid']; $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('mo', $mo); $this->assign('title', '个人财务中心'); $this->assign('theme', '个人财务中心'); $this->display('center'); } } } }
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'); } } } } } } }
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='Zscw'")->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']); $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; if ($x == 'vw') { $cwid = $_GET['cwid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('cwid=' . $cwid)->find(); $xqid = $cwo['cwzcxqid']; $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('mo', $mo); //搞推荐人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); } else { $this->assign('ifrcmd', '否'); } //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $cwid = $_GET['cwid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('cwid=' . $cwid)->find(); $xqid = $cwo['cwzcxqid']; if ($cwid == 0) { // $mo['stdid']=0; // $mo['stdsol']='无'; // $mo['stdpt']=C('PUBLIC').'/IMG/default.jpg'; // //第几学年 第几学期的班级 第几学年 第几学期的专业 ... // //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓 // //默认年级是当前年级 // $grd=M('grd'); // $grdo=$grd->order('grdnm DESC')->find(); // $grdid=$grdo['grdid']; // $mo['f_std_grdid']=$grdid; // $mo['grdnm']=$grdo['grdnm']; // //默认站点,有主的找有主的,没主的找本部 // if($athofnstt['aths']!=1){ // $mo['f_std_sttid']=$usro['f_usr_sttid']; // }else{ // $mo['f_std_sttid']=1; // } // //默认学期 为XX年级XX站点的起始学期 // $sttintxq=M($grdo['grdnm'].'_sttintxq'); // $sttintxqo=$sttintxq->where('f_sttintxq_grdid='.$grdo['grdid'].' AND f_sttintxq_sttid='.$mo['f_std_sttid'])->find(); // $xqid=$sttintxqo['f_sttintxq_xqid']; // $mo['f_stdxqcls_xqid']=$xqid; // $mo['f_stdxqmj_xqid']=$xqid; // $this->assign('title','添加'); // $this->assign('theme','添加:'); // $this->assign('btnvl','添加'); // //q特殊 // $xq=M('xq'); // $xqls=$xq->where('xqid='.$xqid)->select();//我TMD就为了一个置顶的xq来了 // $this->assign('xqls',$xqls); // $where='1=1'; // if($athofnstt['aths']!=1){ // $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(); // $this->assign('clsls',$clsls); // $where='1=1'; // if($athofnstt['aths']!=1){ // $where=$where." AND mjsttu LIKE '%-".$usro['f_usr_sttid']."-%'"; // } // //之前已经确定过到底是看哪个年级 // $where=$where.' AND f_mj_grdid='.$grdid; // $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(); // $mjlsnw=array(); // foreach($mjls as $v){ // //给专业多点修饰 // if(preg_match('/技能/',$v['bxxsnm'])){ // $v['bxxsnmst']='技能'; // }else if(preg_match('/自考/',$v['bxxsnm'])){ // $v['bxxsnmst']='自考'; // }else{ // $v['bxxsnmst']='普通'; // } // array_push($mjlsnw, $v); // } // $this->assign('mjls',$mjlsnw); } else { $grd = M('grd'); $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $mo['f_cw_stdid'])->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); } $this->assign('mo', $mo); $this->display('update'); } else { if ($x = 'cwdtfx') { $xqiddq = $xqid; $bxxs = M('bxxs'); $bxxsls = $bxxs->select(); $dm = M('dm'); $dmls = $dm->select(); //先分开算再合起来 $grd = M('grd'); $grdls = $grd->where('grdid=' . $grdid)->order('grdnm DESC')->select(); $grdlsfn = array(); foreach ($grdls as $grdv) { $zl = array(); //资料 $cw = M($grdv['grdnm'] . '_cw'); if ($cw->join('tb_' . $grdv['grdnm'] . '_std ON f_cw_stdid=stdid')->where('f_std_statid<>9')->count() == 0) { continue; } $zongnb = $cw->join('tb_' . $grdv['grdnm'] . '_std ON f_cw_stdid=stdid')->where('f_std_statid<>9')->count(); $zl['zongnb'] = $zongnb; // $wjfnb = $cw->join('tb_' . $grdv['grdnm'] . '_std ON f_cw_stdid=stdid')->where('f_std_statid<>9 AND cwsjxfsm+cwsjjckwfsm+cwsjzsfsm=0')->count(); $zl['wjfnb'] = $wjfnb; //未交费 $bfjnb = $cw->join('tb_' . $grdv['grdnm'] . '_std ON f_cw_stdid=stdid')->where('f_std_statid<>9 AND cwyjxfsm+cwyjjckwfsm+cwyjzsfsm>cwsjxfsm+cwsjjckwfsm+cwsjzsfsm AND cwsjxfsm+cwsjjckwfsm+cwsjzsfsm>0')->count(); $zl['bfjnb'] = $bfjnb; //部分缴 $yjqnb = $cw->join('tb_' . $grdv['grdnm'] . '_std ON f_cw_stdid=stdid')->where('f_std_statid<>9 AND cwyjxfsm+cwyjjckwfsm+cwyjzsfsm=cwsjxfsm+cwsjjckwfsm+cwsjzsfsm')->count(); $zl['yjqnb'] = $yjqnb; //已缴清 $grdv['zl'] = $zl; array_push($grdlsfn, $grdv); } $this->assign('grdls', $grdlsfn); $this->assign('title', '招生财务数据分析'); $this->assign('theme', '招生财务数据分析详细'); $this->display('cwdtfx'); } } } }
function gtxpg() { //先给hd设置好些东西,他自身是无法提取的 import('@.SS.SSAction'); $ss = new SSAction(); $ss->setss(); $x = $_GET['x']; if ($x == 'vw') { if ($_GET['bmcg']) { $this->assign('bmcg', 'y'); } $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; $stdid = $_GET['stdid']; $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $this->assign('mo', $mo); //搞推荐人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); } else { $this->assign('ifrcmd', '否'); } // //所有的注册信息,哪个学期哪个班哪个专业 // //应该具备哪些注册信息 // //学期 // import('@.XQ.XQAction'); // $xqw = new XQAction();//外来的学期 // $xqls=$xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC');//年级确定开始,学制确定过程 // $stdxqcls=M($grdo['grdnm'].'_stdxqcls'); // $stdxqmj=M($grdo['grdnm'].'_stdxqmj'); // for($i=0;$i<count($xqls);$i++){ // $xqid=$xqls[$i]['xqid']; // if($stdxqcls->where('f_stdxqcls_stdid='.$stdid.' AND f_stdxqcls_xqid='.$xqid)->find()&&$stdxqmj->where('f_stdxqmj_stdid='.$stdid.' AND f_stdxqmj_xqid='.$xqid)->find()){ // $xqls[$i]['zcf']='active';//注册否? // $xqls[$i]['zczt']='已注册'; // }else{ // $xqls[$i]['zcf']='disabled'; // $xqls[$i]['zczt']='未注册'; // } // $stdxqclso=$stdxqcls->join('tb_'.$grdo['grdnm'].'_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid='.$stdid.' AND f_stdxqcls_xqid='.$xqid)->find(); // $stdxqmjo=$stdxqmj->join('tb_'.$grdo['grdnm'].'_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid='.$stdid.' AND f_stdxqmj_xqid='.$xqid)->find(); // $xqls[$i]['clsnm']=$stdxqclso['clsnm']; // $xqls[$i]['mjnm']=$stdxqmjo['mjnm']; // } // $this->assign('zcls',$xqls);//注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); $this->assign('title', '查看'); $this->assign('theme', '查看详细'); $this->display('view'); } else { if ($x == 'updt') { $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; $stdid = $_GET['stdid']; if ($stdid == 0) { $mo['stdid'] = 0; $mo['stdsol'] = '无'; $mo['stdpt'] = C('PUBLIC') . '/IMG/default.jpg'; //第几学年 第几学期的班级 第几学年 第几学期的专业 ... //因为grd无法定下来,所以stdxqcls stdxqmj_xqid 定下来也没有意义,干脆就不定了,等搜索时候自由分晓 //默认年级是当前年级 $grd = M('grd'); $grdo = $grd->where('grdid=' . $zsszo['f_zssz_grdid'])->find(); $mo['grdnm'] = $grdo['grdnm']; $this->assign('title', '报名'); $this->assign('theme', '报名(填写基本信息&选择专业)'); $this->assign('btnvl', '报名'); $where = '1=1'; $where = $where . ' AND f_cls_sttid=1'; //之前已经确定过到底是看哪个年级 $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(); $this->assign('clsls', $clsls); $where = '1=1 AND mjbbzs=1'; $where = $where . " AND mjsttu LIKE '%-1-%'"; $tmp = explode('-', $zsszo['zsszbxxsu']); $wr = ' AND (1=2'; for ($i = 1; $i < count($tmp) - 1; $i++) { $wr = $wr . ' OR f_mj_bxxsid=' . $tmp[$i]; } $wr = $wr . ')'; $where = $where . $wr; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $mj = M($grdo['grdnm'] . '_mj'); $mjls = $mj->select(); $mjls = $mj->join('tb_bxxs ON f_mj_bxxsid=bxxsid')->join('tb_kl ON f_mj_klid=klid')->where($where)->order('f_mj_bxxsid ASC,mjdm ASC')->select(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); } else { $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=' . $xqid . " AND stdid=" . $stdid)->find(); $this->assign('title', '修改'); $this->assign('theme', '修改:'); $this->assign('btnvl', '修改'); //q特殊 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdo['grdid'], $mo['f_std_sttid'], 'DESC'); $this->assign('xqls', $xqls); $where = '1=1'; $where = $where . ' AND f_cls_sttid=' . $mo['f_std_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(); $this->assign('clsls', $clsls); $where = '1=1'; $where = $where . " AND mjsttu LIKE '%-" . $mo['f_std_sttid'] . "-%' AND f_mj_bxxsid=" . $mo['f_mj_bxxsid']; //之前已经确定过到底是看哪个年级 $where = $where . ' AND f_mj_grdid=' . $grdid; $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(); $mjlsnw = array(); foreach ($mjls as $v) { //给专业多点修饰 if (preg_match('/技能/', $v['bxxsnm'])) { $v['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $v['bxxsnm'])) { $v['bxxsnmst'] = '自考'; } else { $v['bxxsnmst'] = '普通'; } } array_push($mjlsnw, $v); } $this->assign('mjls', $mjlsnw); //所有的注册信息,哪个学期哪个班哪个专业 //应该具备哪些注册信息 //学期 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqls = $xqw->getxqls($grdid, $mo['f_std_sttid'], 'ASC'); //年级确定开始,学制确定过程 $stdxqcls = M($grdo['grdnm'] . '_stdxqcls'); $stdxqmj = M($grdo['grdnm'] . '_stdxqmj'); for ($i = 0; $i < count($xqls); $i++) { $xqid = $xqls[$i]['xqid']; if ($stdxqcls->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find() && $stdxqmj->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find()) { $xqls[$i]['zcf'] = 'active'; //注册否? $xqls[$i]['zczt'] = '已注册'; } else { $xqls[$i]['zcf'] = 'disabled'; $xqls[$i]['zczt'] = '未注册'; } $stdxqclso = $stdxqcls->join('tb_' . $grdo['grdnm'] . '_cls ON f_stdxqcls_clsid=clsid')->where('f_stdxqcls_stdid=' . $stdid . ' AND f_stdxqcls_xqid=' . $xqid)->find(); $stdxqmjo = $stdxqmj->join('tb_' . $grdo['grdnm'] . '_mj ON f_stdxqmj_mjid=mjid')->where('f_stdxqmj_stdid=' . $stdid . ' AND f_stdxqmj_xqid=' . $xqid)->find(); $xqls[$i]['clsnm'] = $stdxqclso['clsnm']; $xqls[$i]['mjnm'] = $stdxqmjo['mjnm']; } $this->assign('zcls', $xqls); //注册列表 //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); } $this->assign('mo', $mo); $tmp = explode('-', $zsszo['zsszbxxsu']); $where = '1=1'; $wr = ' AND (1=2'; for ($i = 1; $i < count($tmp) - 1; $i++) { $wr = $wr . ' OR bxxsid=' . $tmp[$i]; } $wr = $wr . ')'; $where = $where . $wr; //q特殊 $bxxs = M('bxxs'); $bxxsls = $bxxs->where($where)->select(); if (count($bxxsls) == 1) { $this->assign('bxxssg', 'y'); } else { $this->assign('bxxssg', 'n'); } //bxxs single $this->assign('bxxsls', $bxxsls); //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); $dm = M('dm'); $dmls = $dm->select(); $this->assign('dmls', $dmls); //q特殊 $stat = M('stat'); $statls = $stat->select(); $this->assign('statls', $statls); //搞介绍人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); $this->assign('rcmdcls', ''); } else { $this->assign('ifrcmd', '否'); $this->assign('rcmdcls', 'readonly'); } $this->display('update'); } else { if ($x == 'ylqtz') { $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; //根据学期获得学年 $xq = M('xq'); $xqo = $xq->where('xqid=' . $xqid)->find(); if (preg_match('/第1学期/', $xqo['xqnm'])) { $tmp = explode('-', $xqo[xqnm]); $xnnm = $tmp[0]; } else { $tmp = explode('-', $xqo[xqnm]); $tmp = explode('学年', $tmp[1]); $xnnm = $tmp[0]; } $xn = M('xn'); $xno = $xn->where("xnnm='" . $xnnm . "'")->find(); $stdid = session('stdidss'); $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $cwo = M($grdo['grdnm'] . '_cw')->where('f_cw_stdid=' . $stdid . ' AND f_cw_xnid=' . $xno['xnid'])->find(); $cwid = $cwo['cwid']; $xqid = $cwo['cwzcxqid']; $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'); $mo = $cw->join('tb_xn ON f_cw_xnid=xnid')->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND cwid=" . $cwid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $mo['cwyjze'] = $mo['cwyjxfsm'] + $mo['cwyjjckwfsm'] + $mo['cwyjzsfsm']; $mo['cwsjze'] = $mo['cwsjxfsm'] + $mo['cwsjjckwfsm'] + $mo['cwsjzsfsm']; $this->assign('mo', $mo); //添加缴费信息1、学费教材考务费2、住宿费 $mj = M($grdo['grdnm'] . '_mj'); $mjo = $mj->where('mjid=' . $mo['f_stdxqmj_mjid'])->find(); $xf = M($grdo['grdnm'] . '_xf'); $xfo = $xf->where('f_xf_sttid=' . $mo['f_std_sttid'] . ' AND f_xf_bxxsid=' . $mjo['f_mj_bxxsid'] . ' AND f_xf_ccid=' . $mjo['f_mj_ccid'] . ' AND f_xf_klid=' . $mjo['f_mj_klid'])->find(); $zsf = M($grdo['grdnm'] . '_zsf'); $zsfo = $zsf->where('f_zsf_dmid=' . $mo['f_stdxqdm_dmid'])->find(); $this->assign('xfo', $xfo); $this->assign('zsfo', $zsfo); $this->assign('title', '预录取通知书电子版'); $this->assign('theme', '预录取通知书电子版'); $this->display('ylqtz'); } else { if ($x == 'center') { if ($_GET['bmcg']) { $this->assign('bmcg', 'y'); } $zssz = M('zssz'); $zsszo = $zssz->find(); $grdid = $zsszo['f_zssz_grdid']; $xqid = $zsszo['f_zssz_xqid']; $stdid = session('stdidss'); $grd = M('grd'); $grdo = $grd->where('grdid=' . $grdid)->find(); $std = M($grdo['grdnm'] . '_std')->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'); $mo = $std->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_dm ON f_stdxqdm_dmid=dmid')->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_stdxqdm_xqid=" . $xqid . " AND stdid=" . $stdid)->find(); //给专业多点修饰 if (preg_match('/技能/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '技能'; } else { if (preg_match('/自考/', $mo['bxxsnm'])) { $mo['bxxsnmst'] = '自考'; } else { $mo['bxxsnmst'] = '普通'; } } //需要看下如果是其他函授站的可以能要第一学期,第二学期,第三学期之类的很BT的东西 //适应一些站点用一二三 import('@.XQ.XQAction'); $xqw = new XQAction(); //外来的学期 $xqnm = $xqw->getxqnm($grdid, $mo['f_std_sttid'], $xqid); $mo['xqnm'] = $xqnm; $this->assign('mo', $mo); //搞推荐人 if ($mo['stdrcmdnm'] || $mo['stdrcmdcp']) { $this->assign('ifrcmd', '是'); } else { $this->assign('ifrcmd', '否'); } //特殊情况 $tsqk = M($grdo['grdnm'] . '_tsqk'); $tsqkls = $tsqk->where('f_tsqk_stdid=' . $stdid)->order('tsqktm DESC')->select(); $this->assign('tsqkls', $tsqkls); $this->assign('title', '个人中心'); $this->assign('theme', '个人中心'); $this->display('center'); } } } } }
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'); }