} else { $sql = "update " . $ecs->table("grade_rank") . " set student_code='" . $_REQUEST["student_code"] . "',\r\n\t\t\tprj_id='" . $exam_prj . "',\r\n\t\t\tgrade_rank='" . $_REQUEST["grade_rank"] . "',\r\n\t\t\tup_down='" . $_REQUEST["up_down"] . "'\r\n\t\t\twhere grank_id=" . $id; $db->query($sql); admin_log(addslashes($_REQUEST["student_code"]), 'update', $sql); make_json_result("修改成功!"); } } elseif ($_REQUEST['act'] == 'ajax_delete') { $id = !empty($_REQUEST['grank_id']) ? trim($_REQUEST['grank_id']) : ""; $sql = "delete from " . $ecs->table("grade_rank") . " where grank_id in (" . $id . ")"; $db->query($sql); admin_log($_REQUEST["grank_id"], 'delete', 'grade_rank'); make_json_result("删除成功!"); } elseif ($_REQUEST['act'] == 'export') { $prj_id = empty($_REQUEST['prj_id']) ? '' : trim($_REQUEST['prj_id']); //学生学号 $list = get_grade_ranks($class_code, $prj_id, $_SESSION["student_code"], " s.prj_id"); $content = "考试名称,学号,姓名,年级排名,年级进退\r\n"; foreach ($list as $k => $v) { $content .= $v["prj_name"] . "," . $v["student_code"] . "," . $v["student_name"] . "," . $v["grade_rank"] . "," . $v["up_down"] . "\r\n"; } $charset = empty($_REQUEST['charset']) ? 'UTF8' : trim($_REQUEST['charset']); $file = ecs_iconv(EC_CHARSET, $charset, $content); header("Content-Disposition: attachment; filename=grade_rank.csv"); header("Content-Type: application/unknown"); die($file); } /** * 返回班级管理员列表数据 * * @access public * @param
$db->query($sql); admin_log(addslashes($_REQUEST["student_code"]), 'update', $sql); make_json_result("修改成功!"); } } elseif ($_REQUEST['act'] == 'ajax_delete') { $id = !empty($_REQUEST['grank_id']) ? trim($_REQUEST['grank_id']) : ""; $sql = "delete from " . $ecs->table("grade_rank") . " where grank_id in (" . $id . ")"; $db->query($sql); admin_log($_REQUEST["grank_id"], 'delete', 'grade_rank'); make_json_result("删除成功!"); } elseif ($_REQUEST['act'] == 'export') { $student_code = empty($_REQUEST['student_code']) ? '' : trim($_REQUEST['student_code']); //学生学号 $prj_id = empty($_REQUEST['prj_id']) ? '' : trim($_REQUEST['prj_id']); //学生学号 $list = get_grade_ranks($class_code, $prj_id, $student_code, " s.student_code"); $content = "考试名称,学号,姓名,年级排名,年级进退\r\n"; foreach ($list as $k => $v) { $content .= $v["prj_name"] . "," . $v["student_code"] . "," . $v["student_name"] . "," . $v["grade_rank"] . "," . $v["up_down"] . "\r\n"; } $charset = empty($_REQUEST['charset']) ? 'UTF8' : trim($_REQUEST['charset']); $file = ecs_iconv(EC_CHARSET, $charset, $content); header("Content-Disposition: attachment; filename=grade_rank.csv"); header("Content-Type: application/unknown"); die($file); } /** * 返回班级管理员列表数据 * * @access public * @param