form validation help PLEASE

#29
[eluser]dadamssg[/eluser]
yeah this is getting really confusing because i have a working site using no framework thats pretty involved. And now im trying to recreate it using codeigniter. What i'm really trying to do is create a login form to display if they're not logged in and if they are a link to their profile, inbox, and notifications. I want to display this at the top of every page so i thought i would do it like this..

*this isnt a working example just my theory

for my mains controller

Code:
<?php

class Mains extends Controller {

    function Mains()
    {
        parent::Controller();
        $this->load->helper('url');
        $this->load->helper('date');
        $this->load->helper('text');
        $this->load->helper('form');
        $this->load->library('session');
        $this->load->library('form_validation');
    }

    function index()
    {
        $data['title'] = "Home";
        $data['heading'] = "All Events";
        $this->load->model('Frontmodel');
        $data['query'] = $this->Frontmodel->get_all_events();
        
        $this->load->view('header_view', $data);



                if(logged in)
                {///load the login form in the header
        $this->load->view('login_view', $data);
        }
                else
                {//load the logged in portion with the profile/inbox/notification links
                 $this->load->view('logged_view', $data);
                }

                //then load the main content
        $this->load->view('main_view', $data);
    }
    
    function performance()
    {
        $data['title'] = "Performance";
        $data['heading'] = "Performance Events";
        $this->load->model('Frontmodel');
        $data['query'] = $this->Frontmodel->get_category_events('performance');
        
        $this->load->view('header_view', $data);

if(logged in)
                {///load the login form in the header
        $this->load->view('login_view', $data);
        }
                else
                {//load the logged in portion with the profile/inbox/notification links
                 $this->load->view('logged_view', $data);
                }

                //then load the main content

        $this->load->view('main_view', $data);    
    }
    
    function sports()
    {
        $data['title'] = "Sports";
        $data['heading'] = "Sports Events";
        $this->load->model('Frontmodel');
        $data['query'] = $this->Frontmodel->get_category_events('sports');
        
        $this->load->view('header_view', $data);

if(logged in)
                {///load the login form in the header
        $this->load->view('login_view', $data);
        }
                else
                {//load the logged in portion with the profile/inbox/notification links
                 $this->load->view('logged_view', $data);
                }

                //then load the main content

        $this->load->view('main_view', $data);    
    }
    function organization()
    {
        $data['title'] = "Organizational";
        $data['heading'] = "Organization Events";
        $this->load->model('Frontmodel');
        $data['query'] = $this->Frontmodel->get_category_events('organization');
        
        $this->load->view('header_view', $data);

if(logged in)
                {///load the login form in the header
        $this->load->view('login_view', $data);
        }
                else
                {//load the logged in portion with the profile/inbox/notification links
                 $this->load->view('logged_view', $data);
                }

                //then load the main content

        $this->load->view('main_view', $data);    
    }
    function random()
    {
        $data['title'] = "Random";
        $data['heading'] = "Random Events";
        $this->load->model('Frontmodel');
        $data['query'] = $this->Frontmodel->get_category_events('random');
        
        $this->load->view('header_view', $data);

if(logged in)
                {///load the login form in the header
        $this->load->view('login_view', $data);
        }
                else
                {//load the logged in portion with the profile/inbox/notification links
                 $this->load->view('logged_view', $data);
                }

                //then load the main content

        $this->load->view('main_view', $data);    
    }
}

?>


Messages In This Thread
form validation help PLEASE - by El Forum - 01-09-2010, 12:34 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:20 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:21 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:24 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:28 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:31 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:31 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:33 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:35 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:42 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:43 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:45 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:54 AM
form validation help PLEASE - by El Forum - 01-09-2010, 01:55 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:01 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:03 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:05 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:08 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:09 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:09 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:10 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:13 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:16 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:20 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:20 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:24 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:27 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:32 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:41 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:45 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:45 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:48 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:51 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:56 AM
form validation help PLEASE - by El Forum - 01-09-2010, 03:13 AM
form validation help PLEASE - by El Forum - 01-09-2010, 10:51 AM
form validation help PLEASE - by El Forum - 01-09-2010, 02:42 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:45 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:52 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:54 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:54 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:56 PM
form validation help PLEASE - by El Forum - 01-09-2010, 02:59 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.