Welcome Guest, Not a member yet? Register   Sign In
Ajax Record Deletion?
#2

[eluser]Corey Freeman[/eluser]
Okay so this actually isn't working at all...my browser is just reloading super fast. Here's my controller too:

Code:
<?
class Dashboard extends Controller
{
    function Dashboard()
    {
        parent::Controller();
        $this->load->library('Jquery_pagination');
        $this->load->model('goals_model');
    }
    function index($type = NULL) {
        //Load the Header
        $data['title'] = 'Your Nimblu Goals Dashboard';
        $this->load->view('templates/dash_header', $data);
        //Load up 'dem dere goals!
        ///////////////////////////////////////////////////////////
            $total = $this->goals_model->count_user_goals();
            $config['base_url'] = site_url('dashboard/index/2/');
            $config['total_rows'] = $total;
            $config['per_page'] = 5;
            $config['div'] = 'body';
            $config['uri_segment'] = '4';
            $config['full_tag_open'] = '<div id="pagination">';
            $config['full_tag_close'] = '</div>';
            //Previous
            $config['prev_link'] = 'Previous';
            $config['prev_tag_open'] = '<span class="prev">';
            $config['prev_tag_close'] = '</span>';
            //Next
            $config['next_link'] = 'Next';
            $config['next_tag_open'] = '<span class="next">';
            $config['next_tag_close'] = '</span>';
            $this->jquery_pagination->initialize($config);
            $data['goals'] = $this->goals_model->get_user_goals(5, $this->uri->segment(4));
        ///////////////////////////////////////////////////////////
        //Is Ajax Being Used?
        if ($type == "ajax") {$this->load->view('dashboard/goals', $data);}
        //Load a Normal View
        else {$this->load->view('dashboard/default', $data);}
        //Load the Footer
        $this->load->view('templates/footer');
    }  
    function add_goal()
    {
    if($_POST && $_POST['goal'] != NULL) {
        $message['goal_text'] = $this->input->xss_clean($_POST['goal']);
        $message['owner_id'] = $this->input->post('owner_id');
        $message['complete_status'] = $this->input->post('complete');
        $this->goals_model->add($message);
    } else
        redirect('dashboard');
    }
    function delete_goal() {
        $this->goals_model->delete_user_goal();
    }
}


Messages In This Thread
Ajax Record Deletion? - by El Forum - 09-18-2010, 11:39 AM
Ajax Record Deletion? - by El Forum - 09-18-2010, 11:54 AM
Ajax Record Deletion? - by El Forum - 04-22-2011, 12:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB