[eluser]Adnan1984[/eluser]
Hello to All, Here is my program code:
In Model:
Code:
public function manage_user_model(){
$query = $this->db->get('agent');
return $query->result();
}
public function delete_user($userid){
$query = $this->db->get_where('image' , array('agent_id' => $userid));
$data['image']=$query->row_array();
$this->db->where('agent_id',$this->uri->segment(3));
$this->db->delete('agent');
if($this->db->affected_rows() >= 1){
$path1=realpath(APPPATH.'../uploads/thumbs/'.$data['image']['reference_num'].''.$data['image']['ext']);
$path2=realpath(APPPATH.'../uploads/'.$data['image']['reference_num'].''.$data['image']['ext']);
if(unlink($path1) AND unlink($path2)){
return TRUE;
}else{
return FALSE;
}
}
}
In Controller:
Code:
public function manage_user($userid){
$this->load->library('table');
$this->load->model('admin_model');
$this->admin_model->delete_user($userid);
$data = array();
$query = $this->admin_model->manage_user_model();
if($query){
$data['record'] = $query ;
}
$data['username'] = $this->session->userdata('username');
$this->load->view('manage_user_view',$data);
}
If i opened like "http://localhost/ci_eee/index.php/site/manage_user" and i got error message and it says:
Quote:A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for Site::manage_user()
Filename: controllers/site.php
Line Number: 113
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: userid
Filename: controllers/site.php
Line Number: 120
If i changed like "http://localhost/ci_eee/index.php/site/manage_user/12" then no error.
Can you solve me this problem?
Thanks