问题描述
我认为这是一个权限问题,因为从管理页面下载 PDF 工作得很好。但是当我为用户复制代码时,我得到了一个 404 错误页面。
public function presult($id,$term)
{
if (!$this->rbac->hasPrivilege('student','can_view')) {
access_denied();
}
$data['title'] = 'Student Details';
$student = $this->student_model->get($id);
$data['student'] = $student;
$gradeList = $this->grade_model->get();
$class_id = $student["class_id"];
$studentSession = $this->student_model->getStudentSession($id);
$student_session_id = $studentSession["student_session_id"];
$student_session = $studentSession["session"];
$data['sch_setting'] = $this->sch_setting_detail;
$current_student_session = $this->student_model->get_studentsession($student['student_session_id']);
$data["session"] = $current_student_session["session"];
$data['principalmt_comment'] = $this->Mtcomment_model->GetPrincipalmtComment($id,$student_session_id);
$data['teacher_comment'] = $this->Comment_model->GetTeacherComment($id,$student_session_id);
$data['principal_comment'] = $this->Comment_model->GetPrincipalComment($id,$student_session_id);
$student_class_section = $this->student_model->currentClassSectionById($id,$student_session_id);
if($term == "first")
{
$data['subjectftscores'] = $this->getFirstTermResult($id,$class_id);
$view = $this->load->view('user/savepdf/first_term',$data,TRUE);
$title = $student['firstname'] . " " . $student['lastname']."First Term Result";
$filename = $student['firstname'] . "_" . $student['lastname']."_firstterm.pdf";
$this->show_pdf($view,$title,$filename);
}
}
查看
<a class="btn btn-primary" href="<?=site_url("savepdf/presult/".$student["id"]."/first")?>" download>Save as PDF</a>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)