phpems导出成绩增加自定义字段
导出成绩url:http://localhost/phpems/index.php?exam-teach-users-outscore&basicid=7
调用的文件:index.php 中 require “lib/init.cls.php”;
然后
include $modulefile;
即
app/exam/teach.php
中的这行:
switch($subaction)
{
case ‘outscore’: //导出成绩
//增加导出成绩字段:
$rs = $this->favor->getAllExamHistoryByArgs($args,array(‘ehuserid’,’ehexam’,’ehusername’,’ehscore’));
$r = array();
foreach($rs as $p)
{
$sql=”select useremail from x2_user where userid=’$p[ehuserid]‘“;
$row = $this->db->fetch($sql);
if($row){
$r[] = array(‘ehusername’ => iconv(“UTF-8”,”GBK”,$p[‘ehusername’]),’useremail’ => iconv(“UTF-8”,”GBK”,$row[‘useremail’]),’ehexam’ => iconv(“UTF-8”,”GBK”,$p[‘ehexam’]),’ehscore’ => $p[‘ehscore’]);
}else{
$r[] = array(‘ehusername’ => iconv(“UTF-8”,”GBK”,$p[‘ehusername’]),’ehexam’ => iconv(“UTF-8”,”GBK”,$p[‘ehexam’]),’ehscore’ => $p[‘ehscore’]);
}
}
还没有评论,来说两句吧...