Welcome Guest, Not a member yet? Register   Sign In
Inserting into table twice..:(
#16

[eluser]Roy MJ[/eluser]
Here is the whole controller :

Code:
class Members extends Controller {
    var $data    =    array();    
    function Members(){
        parent::Controller();    
        $this->load->model('Members_model');
        $this->load->model('Profile_model');
        $this->site_settings->get_site_settings();
        $this->load->helper(array('form'));
        $this->load->library(array('form_validation','pagination'));
        $this->get_common();
    }
    
    function index($pgoffset=''){
        $config['per_page'] = $this->config->item('records_per_page');
        $config['total_rows'] = $this->Members_model->get_total();
        $config['base_url'] = base_url().'index.php/members/index/';
        $config['uri_segment'] = 3;
        $row    =      $this->Profile_model->get_selected($this->session->userdata('user_id'));
        $this->data['username'] = $row->username;
        $data['count_no'] = ($this->uri->segment(3)=='')? 0 : $this->uri->segment(3);
        $data['members']=  $this->Members_model->get_all($config['per_page'], $pgoffset);
        $data['friends']=  $this->Members_model->get_friends();
        $data['pgoffset'] = $pgoffset;
        
        $this->pagination->initialize($config);
        $this->load->view('members/list', $data);
    }
    function search($pgoffset='')
    {
        $tags = $this->input->post('tags');
        $config['per_page'] = $this->config->item('records_per_page');
        $config['total_rows'] = $this->Members_model->get_friends_total($tags);
        $config['base_url'] = base_url().'index.php/members/search/'.$tags.'/';
        $config['uri_segment'] = 4;

        $this->data['count_no'] = ($this->uri->segment(4)=='')? 0 : $this->uri->segment(4);
        $this->data['frnds']=  $this->Members_model->get_friends_all($tags,$config['per_page'], $pgoffset);
        
        $this->data['pgoffset'] = $pgoffset;
        $this->pagination->initialize($config);
        $this->load->view('members/listfriends', $this->data);
        }
        
    function memberadd($id, $pgoffset='')
    {
        $this->Members_model->add_member($id,$member=$this->session->userdata('user_id'));
        /*$row    =      $this->Profile_model->get_selected($this->session->userdata('user_id'));
        $this->data['username'] = $row->username;
        
        $config['per_page'] = $this->config->item('records_per_page');
        $config['total_rows'] = $this->Members_model->get_total_friends();
        $config['base_url'] = base_url().'index.php/members/index/';
        $config['uri_segment'] = 3;
        $row    =      $this->Profile_model->get_selected($this->session->userdata('user_id'));
        $this->data['username'] = $row->username;
        $data['count_no'] = ($this->uri->segment(3)=='')? 0 : $this->uri->segment(3);
        $data['members']=  $this->Members_model->get_all_friends($config['per_page'], $pgoffset);*/
        /*$data['pgoffset'] = $pgoffset;*/
        $this->load->view('members/listfriends', $this->data);
    }
        
    function get_common(){
        $this->site_settings->get_site_settings();
    }
    }


Messages In This Thread
Inserting into table twice..:( - by El Forum - 03-27-2011, 11:02 PM
Inserting into table twice..:( - by El Forum - 03-27-2011, 11:58 PM
Inserting into table twice..:( - by El Forum - 03-28-2011, 12:01 AM
Inserting into table twice..:( - by El Forum - 03-28-2011, 01:06 AM
Inserting into table twice..:( - by El Forum - 03-28-2011, 01:15 AM
Inserting into table twice..:( - by El Forum - 03-28-2011, 03:51 PM
Inserting into table twice..:( - by El Forum - 03-29-2011, 05:57 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 12:30 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 02:00 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 02:39 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 07:36 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 07:38 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 07:45 AM
Inserting into table twice..:( - by El Forum - 03-30-2011, 02:58 PM
Inserting into table twice..:( - by El Forum - 03-30-2011, 05:43 PM
Inserting into table twice..:( - by El Forum - 03-30-2011, 09:49 PM
Inserting into table twice..:( - by El Forum - 03-30-2011, 11:10 PM
Inserting into table twice..:( - by El Forum - 03-31-2011, 01:07 AM
Inserting into table twice..:( - by El Forum - 03-31-2011, 04:12 AM
Inserting into table twice..:( - by El Forum - 03-31-2011, 05:57 AM
Inserting into table twice..:( - by El Forum - 03-31-2011, 06:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB