本文整理汇总了PHP中Fn::ajax_call方法的典型用法代码示例。如果您正苦于以下问题:PHP Fn::ajax_call方法的具体用法?PHP Fn::ajax_call怎么用?PHP Fn::ajax_call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fn
的用法示例。
在下文中一共展示了Fn::ajax_call方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* 控制界面首页
*/
public function index($exam_pid = 0)
{
Fn::ajax_call($this, 'regenerateExamRecord', 'regenerateExamResults', 'endPlaceExam', 'regenerateSummaryReportData', 'regenerateReport', 'removeCronTaskReport');
$exam_pid = intval($exam_pid);
$param['exam_pid'] = 0;
$param['exam_isfree'] = 0;
$examlist = ExamModel::get_exam_list_all($param);
$exam = array();
if ($exam_pid > 0) {
$exam = ExamModel::get_exam($exam_pid);
}
if (!$exam) {
$exam = current($examlist);
}
$db = Fn::db();
/////////////////////////考试记录是否生成/////////////
$sql = "SELECT uid_data FROM rd_cron_task_place_student_paper ctps\n LEFT JOIN rd_exam_place ep ON ep.place_id = ctps.place_id\n WHERE ep.exam_pid ={$exam['exam_id']} AND ctps.status=2";
$uid_arr = $db->fetchCol($sql);
$paper_count = 0;
foreach ($uid_arr as $item) {
$paper_count += count(json_decode($item));
}
$sql = "SELECT COUNT(*) FROM rd_exam_place_student eps\n LEFT JOIN rd_exam_place ep ON ep.place_id = eps.place_id\n WHERE ep.exam_pid = {$exam['exam_id']}";
$student_count = $db->fetchOne($sql);
if ($paper_count == $student_count) {
$data['paper_status'] = true;
//考试记录是否完全生成
} else {
$data['paper_status'] = false;
}
/////////////////////////////////////////
$sql = "SELECT status FROM rd_cron_task_exam_result \n WHERE exam_pid = {$exam['exam_id']}";
$data['cter_status'] = $db->fetchOne($sql);
//////////////////////////////////////////
$sql = "SELECT DISTINCT(status) FROM rd_cron_task_report ctr \n LEFT JOIN rd_evaluate_rule er ON er.id = ctr.rule_id \n WHERE exam_pid = {$exam['exam_id']}";
$data['ctr_status'] = $db->fetchCol($sql);
////////////////////////////////////////
$data['exam'] = $exam;
$data['demo_exam'] = $this->demo_exam_list();
$data['examlist'] = $examlist;
$data['place'] = ExamPlaceModel::get_exam_place($exam_pid, 'MAX(end_time) as end_time');
$data['crontaskexamresult'] = ReportCommandModel::cronTaskExamResultInfo($exam['exam_id']);
$data['evaluerulelist'] = ReportCommandModel::cronTaskReportLists($exam['exam_id']);
$this->load->view('report_command/index', $data);
}
示例2: index
public function index()
{
Fn::ajax_call($this, 'removeExamRelate', 'setExamRelateFlag');
$data = array();
$cond_param = array('er_exampid' => 0);
$size = 15;
$page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1;
$offset = ($page - 1) * $size;
$list = array();
$total = ZmossModel::examRelatelistCount($cond_param);
if ($total) {
$list = ZmossModel::examRelatelist($cond_param, $page, $size);
$er_exampid = array();
foreach ($list as $k => $val) {
$er_exampid[] = $val['er_examid'];
unset($list[$k]);
$list[$val['er_examid']] = $val;
}
$cond_param['er_exampid'] = implode(',', $er_exampid);
$list2 = ZmossModel::examRelatelist($cond_param);
$zmoss_examid = array();
foreach ($list2 as $item) {
$list[$item['er_exampid']]['child'][] = $item;
$zmoss_examid[] = $list[$item['er_exampid']]['er_zmoss_examid'];
}
$zmoss_examid = array_unique($zmoss_examid);
$data['examrelatelist'] = ZmossModel::examlist('*', array('exam_id' => implode(',', $zmoss_examid)));
}
$data['list'] = $list;
$data['admin_list'] = CpUserModel::get_cpuser_list();
// 分页
$purl = site_url('admin/zmoss/index/');
$data['pagination'] = multipage($total, $size, $page, $purl);
$data['er_flag'] = array('未同步', '进行中', '同步失败', '同步成功');
$data['is_setexamrelate_priv'] = $this->check_power_new('zmoss_setexamrelate', false);
$data['is_setexamrelatequestion_priv'] = $this->check_power_new('zmoss_setexamrelatequestion', false);
$data['is_sync_result_priv'] = $this->check_power_new('zmoss_sync', false);
$data['is_remove_priv'] = $this->check_power_new('zmoss_remove', false);
$data['is_showresult_priv'] = $this->check_power_new('exam_index', false);
// 模版
$this->load->view('zmoss/index', $data);
}
示例3: settcinfo
/**
* 编辑校区表单页面
* @param int $tc_id 要编辑的校区ID
*/
public function settcinfo($tc_id)
{
Fn::ajax_call($this, 'setTC');
$tc_id = intval($tc_id);
$data = array();
if ($tc_id) {
$data['tc_info'] = TrainingInstitutionModel::trainingCampusInfo($tc_id);
}
if (empty($data['tc_info'])) {
message('查询无记录', '/admin/traininginstitution/tilist');
}
$data['province_list'] = RegionModel::get_regions(1);
$data['city_list'] = RegionModel::get_regions($data['tc_info']['tc_provid'], FALSE, 2);
$data['area_list'] = RegionModel::get_regions($data['tc_info']['tc_cityid'], FALSE, 3);
$this->load->view('traininginstitution/settcinfo', $data);
}
示例4: edit
/**
* @description 编辑学生信息表单页面
* @author
* @final
* @param int $uid 学生id
*/
public function edit($uid)
{
if (!$this->check_power('student_manage')) {
return;
}
Fn::ajax_call($this, 'baseFetchTIList', 'baseFetchCORSList', 'baseFetchCTeacherList');
/*
* 基本信息
*/
$uid = intval($uid);
$student = StudentModel::get_student($uid);
$school_id = array();
$volunteer = array();
if (empty($student)) {
message('信息不存在');
return;
}
$school = SchoolModel::schoolInfo($student['school_id'], 'school_id, school_name');
$student['school_name'] = $school['school_name'];
$student['birthday'] = date('Y-m-d', $student['birthday']);
if ($uid) {
$db = Fn::db();
$sbinfo = $db->fetchRow("SELECT * FROM t_student_base WHERE sb_uid = {$uid}");
if ($sbinfo) {
$student = array_merge($student, $sbinfo);
}
$sql = <<<EOT
SELECT sbs_stunumtype FROM t_student_base_stunumtype WHERE sbs_uid = {$uid}
EOT;
$student['sbs_stunumtype'] = $db->fetchCol($sql);
$sql = <<<EOT
SELECT sbclassid_classid FROM t_student_base_classid WHERE sbclassid_uid = {$uid}
EOT;
$student['sbclassid_classid'] = $db->fetchCol($sql);
$sql = <<<EOT
SELECT a.*,
b.ti_id, b.ti_name, b.ti_typeid, b.ti_flag, b.ti_provid, b.ti_cityid, b.ti_areaid,
c.cors_id, c.cors_cmid, c.cors_name, c.cors_flag, c.cors_tiid, c.cors_stunumtype
FROM t_student_base_course a
LEFT JOIN v_training_institution b ON a.sbc_tiid = b.ti_id
LEFT JOIN v_course c ON a.sbc_corsid = c.cors_id
WHERE a.sbc_uid = {$uid} AND a.sbc_idx = 0
EOT;
$sbcinfo = $db->fetchRow($sql);
if (is_array($sbcinfo)) {
$student = array_merge($student, $sbcinfo);
$student['no_tiid'] = 0;
} else {
$student['no_tiid'] = 1;
}
}
$data['student'] = $student;
$data['act'] = 'edit';
/*
* 学校列表
* 根据当前学生的年级获取拥有该年级的所有学校
*/
$grade_period = get_grade_period($student['grade_id']);
$query = $this->db->select('school_id,school_name')->like('grade_period', $grade_period)->get('school');
$data['school_list'] = $query->result_array();
$data['school_list'] || ($data['school_list'] = array());
/*
* 成绩排名
*/
$sql = <<<EOT
SELECT * FROM rd_student_ranking WHERE uid = ? ORDER BY grade_id ASC
EOT;
$data['score_ranks'] = Fn::db()->fetchAll($sql, $uid);
/*
* 竞赛成绩
*/
$sql = <<<EOT
SELECT * FROM rd_student_awards WHERE uid = ?
EOT;
$rows = Fn::db()->fetchAll($sql, $uid);
$awards_list = array();
foreach ($rows as $row) {
$awards_list[$row['typeid']][] = $row;
}
$data['awards_list'] = $awards_list;
/*
* 社会实践
*/
$sql = <<<EOT
SELECT * FROM rd_student_practice WHERE uid = ?
EOT;
$data['practice'] = Fn::db()->fetchRow($sql, $uid);
/*
* 学生意愿
*/
$sql = <<<EOT
SELECT * FROM rd_student_wish WHERE uid = ?
EOT;
$data['student_wish'] = Fn::db()->fetchRow($sql, $uid);
//.........这里部分代码省略.........
示例5: ctflist
/**
* 培训课程教师来源列表
*/
public function ctflist()
{
Fn::ajax_call($this, 'removeCTF', 'setCTF');
$data = array();
$data['ctf_list'] = CourseModel::courseTeachfromList();
$this->load->view('course/ctflist', $data);
}
示例6: editteacher
/**
* 新增/编辑授课教师页面
* @param int $scht_schid 学校ID
* @param int $ct_id 授课教师ID,若为0表新增,否则表编辑
*/
public function editteacher($scht_schid = 0, $ct_id = 0)
{
if (!$scht_schid) {
message('参数错误');
}
$data = array();
$data['scht_schid'] = $scht_schid;
Fn::ajax_call($this, 'setSchoolTeacher');
$ct_id = intval($ct_id);
if ($ct_id) {
$data['ct_info'] = CTeacherModel::CTeacherInfo($ct_id);
if (empty($data['ct_info'])) {
message('查询无记录', 'admin/school/teacherlist/' . $scht_schid);
}
} else {
$data['ct_info'] = array('ct_id' => 0, 'ct_flag' => time());
}
$data['subject_map'] = C('subject');
$data['grade_map'] = C('grades');
$v = CTeacherModel::CTeacherGradeIDPairs($ct_id);
if (isset($v[$ct_id])) {
$v = $v[$ct_id];
} else {
$v = array();
}
$data['cteacher_gradeid'] = $v;
$v = CTeacherModel::CTeacherSubjectIDPairs($ct_id);
if (isset($v[$ct_id])) {
$v = $v[$ct_id];
} else {
$v = array();
}
$data['cteacher_subjectid'] = $v;
// 模版
$this->load->view('school/editteacher', $data);
}
示例7: examresult
/**
* 考试成绩查询
*/
public function examresult()
{
Fn::ajax_call($this, 'logout', 'login');
$uid = $this->_uinfo['uid'];
$data = array();
$data['page_title'] = '考试成绩';
$data['uinfo'] = $this->_uinfo;
if (!$uid) {
redirect('student/exam/index');
} else {
$data['student'] = StudentModel::get_student($this->_uinfo['uid']);
// 检查学生信息是否完善
// $check_message = $this->check_perfect_student();
if ($check_message) {
$data['check_message'] = $check_message;
} else {
$sql = <<<EOT
SELECT DISTINCT(e.exam_id), e.exam_name
FROM rd_exam e
JOIN rd_exam_result_publish erp ON e.exam_id = erp.exam_pid
JOIN rd_exam_place ep ON e.exam_id = ep.exam_pid
JOIN rd_exam_place_student eps ON ep.place_id = eps.place_id
WHERE eps.uid = {$uid}
EOT;
$exam_list = Fn::db()->fetchAssoc($sql);
if (!empty($exam_list)) {
$exam_pid_str = implode(',', array_keys($exam_list));
$sql = <<<EOT
SELECT exam_pid, id, subject_id FROM rd_evaluate_rule
WHERE exam_pid IN ({$exam_pid_str})
ORDER BY subject_id
EOT;
$rule_list = Fn::db()->fetchAll($sql);
foreach ($rule_list as $v) {
$source_path = $v['id'] . "/{$uid}.zip";
$filepath = realpath(dirname(APPPATH)) . "/cache/zip/report/" . $source_path;
if (!file_exists($filepath)) {
//continue;
}
if (!isset($exam_list[$v['exam_pid']]['list'])) {
$exam_list[$v['exam_pid']]['list'] = array();
}
$v['subject_name'] = $this->_subject_name($uid, $v['exam_pid'], $v['subject_id']);
$exam_list[$v['exam_pid']]['list'][] = $v;
}
asort($exam_list);
}
$data['exam_result_list'] = array_values($exam_list);
$data['subject'] = C('subject');
$data['subject'][0] = '总结';
if (C('sfe_data_gz')) {
$sql = <<<EOT
SELECT sfe_uid, sfe_exampid, sfe_placeid, sfe_starttime, sfe_endtime,
sfe_report_status, sfe_subjectid,
b.exam_name, c.place_name
FROM t_student_free_exam a
LEFT JOIN rd_exam b ON a.sfe_exampid = b.exam_id
LEFT JOIN rd_exam_place c ON a.sfe_placeid = c.place_id
WHERE sfe_uid = {$uid}
ORDER BY sfe_exampid DESC, sfe_placeid ASC
EOT;
$rows = Fn::db()->fetchAll($sql);
$exam_free_list = array();
$exam_free_map = array();
foreach ($rows as $row) {
$exam_pid = $row['sfe_exampid'];
$exam_free_list[] = $exam_pid;
if (!isset($exam_free_map[$exam_pid])) {
$exam_free_map[$exam_pid] = array();
}
$row['subject'] = explode(',', trim($row['sfe_subjectid']));
$exam_free_map[$exam_pid][] = $row;
}
$data['exam_free_list'] = array_unique($exam_free_list);
$data['exam_free_map'] = $exam_free_map;
} else {
$sql = <<<EOT
SELECT sfe_uid, sfe_exampid, sfe_placeid, sfe_starttime, sfe_endtime,
sfe_report_status, sfe_data,
b.exam_name, c.place_name
FROM t_student_free_exam a
LEFT JOIN rd_exam b ON a.sfe_exampid = b.exam_id
LEFT JOIN rd_exam_place c ON a.sfe_placeid = c.place_id
WHERE sfe_uid = {$uid}
ORDER BY sfe_exampid DESC, sfe_placeid ASC
EOT;
$rows = Fn::db()->fetchAll($sql);
$exam_free_list = array();
$exam_free_map = array();
foreach ($rows as $row) {
$exam_pid = $row['sfe_exampid'];
$exam_free_list[] = $exam_pid;
if (!isset($exam_free_map[$exam_pid])) {
$exam_free_map[$exam_pid] = array();
}
$v = json_decode($row['sfe_data'], true);
$row['subject'] = array_keys($v);
//.........这里部分代码省略.........
示例8: setctinfo
/**
* 新增/编辑授课教师页面
* @param int $ct_id 授课教师ID,若为0表新增,否则表编辑
*/
public function setctinfo($ct_id)
{
Fn::ajax_call($this, 'setCT');
$ct_id = intval($ct_id);
$data = array();
if ($ct_id) {
$data['ct_info'] = CTeacherModel::CTeacherInfo($ct_id);
if (empty($data['ct_info'])) {
message('查询无记录', 'admin/cteacher/ctlist');
}
} else {
$data['ct_info'] = array('ct_id' => 0, 'ct_flag' => time());
}
$data['subject_map'] = C('subject');
$data['grade_map'] = C('grades');
//$data['subject_map'][0] = '[全部学科]';
//$data['grade_map'][0] = '[全部年级]';
$v = CTeacherModel::CTeacherGradeIDPairs($ct_id);
if (isset($v[$ct_id])) {
$v = $v[$ct_id];
} else {
$v = array();
}
$data['cteacher_gradeid'] = $v;
$v = CTeacherModel::CTeacherSubjectIDPairs($ct_id);
if (isset($v[$ct_id])) {
$v = $v[$ct_id];
} else {
$v = array();
}
$data['cteacher_subjectid'] = $v;
if ($ct_id) {
$sql = <<<EOT
SELECT a.cc_id, a.tc_name, b.ti_name, b.cors_name
FROM v_course_campus a
LEFT JOIN v_course b on a.cc_corsid = b.cors_id
WHERE a.cc_id IN (
SELECT cct_ccid FROM t_course_campus_teacher WHERE cct_ctid = {$ct_id})
EOT;
$data['cteacher_cclist'] = Fn::db()->fetchAll($sql);
}
$this->load->view('cteacher/setctinfo', $data);
}
示例9: resetpwd
public function resetpwd()
{
Fn::ajax_call($this, 'login', 'logout');
$hash = $this->input->get('code');
$uid = email_hash('decode', $hash, 1800);
$uid && ($student = StudentModel::get_student($uid));
if (!$student) {
message('重置链接已失效,请重新提交申请', 'student/index/forget');
}
if ($this->input->post('act') == 'submit') {
$password = $this->input->post('password');
$newpwd_confirm = $this->input->post('password_confirm');
if (is_string($passwd_msg = is_password($password))) {
message($passwd_msg);
}
if ($password != $newpwd_confirm) {
message('您两次输入密码不一致,返回请确认!');
}
$this->db->update('student', array('password' => my_md5($password)), array('uid' => $uid));
$now_time = time() - 1800;
$sql = "UPDATE {pre}user_resetpassword SET expiretime='{$now_time}' WHERE uid='{$uid}' and hash = '{$hash}'";
$row = $this->db->query($sql);
message('您的新密码已设置成功.', 'student/index/login', 'success');
} else {
$data = array();
$data['uinfo'] = StudentModel::studentLoginUInfo();
$data['hash'] = $hash;
// 模版
$this->load->view('index/resetpwd', $data);
}
}
示例10: editpwd
/**
* 修改密码
*/
public function editpwd()
{
Fn::ajax_call($this, 'login', 'logout');
if (!$this->_uinfo['uid']) {
redirect('student/index/login');
}
$data = array();
$data['uinfo'] = $this->_uinfo;
$uid = $this->_uinfo['uid'];
if ($oldpwd = $this->input->post('oldpwd')) {
$newpwd = $this->input->post('newpwd');
$newpwd_confirm = $this->input->post('newpwd_confirm');
if (is_string($passwd_msg = is_password($newpwd))) {
message($passwd_msg);
}
if ($newpwd != $newpwd_confirm) {
message('新密码两次输入不一致!');
}
$query = $this->db->select('password')->get_where('student', array('uid' => $uid));
$user = $query->row_array();
if ($user['password'] !== my_md5($oldpwd)) {
message('原密码错误!');
}
$this->db->update('student', array('password' => my_md5($newpwd)), array('uid' => $uid));
message('密码修改成功!', 'student/profile/preview', 'success');
} else {
$this->load->view('profile/editpwd', $data);
}
}