public function search($uid = FALSE) {
$data['page_title'] = "Signature Uploader";
if (!$uid) {
$this->load->helper('user');
$dd['employees'] = get_all_employees();
$data['page_content'] = $this->load->view('signature_uploader/search', $dd, TRUE);
} else {
$this->load->database('employee');
$result = $this->db->query("SELECT uid FROM `signatures` WHERE uid = '$this->uid'");
$emp = $result->result_array();
$dd['agent'] = new Employee($uid);
var_dump($result);
if($uid==$emp){
$data['page_content'] = $this->load->view('signature_uploader/upload', $dd, TRUE);
}else
redirect(base_url() . "signature_uploader/search");
}
$this->load->view('signature_uploader/exv_page', $data);
}
嗨,我的代码遇到了麻烦,我是Codeigniter
的新手。一点帮助将是伟大的家伙。我要这样做的是,当用户搜索员工时,它将首先使用signatures
检查该员工是否已经在uid(primary key)
表中。 signatures.uid = employee.uid
。我在正确使用我的result_array()
吗?