Welcome Guest, Not a member yet? Register   Sign In
Navigation links wont open page! interesting....
#1

[eluser]crispinatari[/eluser]
controller

Code:
class Side_menu extends Controller {

  function Side_menu()
  {
      parent::Controller();
      //$this->load->scaffolding('emps');
      $this->load->model('empsmodel');
      $this->load->model('depmodel');
      $this->load->model('coursemodel');
      $this->load->model('resmodel');
      $this->load->model('repmodel');
      $this->load->helper('html');
      $this->load->helper('url');
      $this->load->helper('form');
      
      
  }
    
  function index()
    {
        //default method, gets data from model
        //and lists all employees using default view
      $data['cssfile'] = base_url().'css/styles.css';
        
    $data['title'] = "Side Menu";
        //$data['heading'] = "";
        
          /// LOADING PARTIALS //
        //$data ['header']    = $this->load->view('views/header', $data, TRUE);
        //$data ['menu']      = $this->load->view('views/menu', $data, TRUE);
        //$data ['footer']    = $this->load->view('views/footer', $data, TRUE);  
      $this->load->view('sidemenu', $data);
  }

    
    function res_page_two()    //emplink()
    {
    
    
          //form for adding an entry';
        $data['heading'] = "Results List";
        $data['cssfile'] = base_url().'css/styles.css';
                $data['cssfile2'] = base_url().'css/main.css';
    
        
            $data['header'] = $this->load->view('header', $data, true);
        $data['sidemenu'] = $this->load->view('sidemenu', $data, true);
        $data['res']=$this->resmodel->get_all_emps();
        $data['reslistview'] = $this->load->view('reslistview', $data, true);
        $data['footer'] = $this->load->view('footer', $data, true);
          
        
        $this->load->view('res_page_two', $data);
    }

view: left navigation

Code:
<head>
<?= link_tag($cssfile) ?>
  </head>  
<body>
<div id="navigation-block">  
  <ul id="sliding-navigation">  
    <li class="sliding-element"><a href="#"><a href = "http://cit3.ldl.swin.edu.au/~grek/CI1/index.php/Side_menu/emps_page_two"><h2> Employees</h2></a></li></ul></a>
    <li class="sliding-element"><a href="#"><a href = "http://cit3.ldl.swin.edu.au/~grek/CI1/index.php/Side_menu/dep_page_two"><h2> Departments</h2></a></li></a>  
    <li class="sliding-element"><a href="#"><a href ="http://cit3.ldl.swin.edu.au/~grek/CI1/index.php/Side_menu/course_page_two"><h2> Courses</h2></a></li></a>  
[b]    <li class="sliding-element"><a href="#"><a href = "http://cit3.ldl.swin.edu.au/~grek/CI1/index.php/Side_menu/res_page_two"><h2> Results</h2></a></li>  </a>[/b]
    <li class="sliding-element"><a href="#"><a href = "http://cit3.ldl.swin.edu.au/~grek/CI1/index.php/Side_menu/reps_page_two"><h2> Reports</h2></a></li></a>  
  </ul>  
</div>
&lt;/body&gt;

res_page_two.php (view file)
Code:
&lt;html
  &lt;head>
  &lt;title&gt;CSS Liquid Layout: Two Column Left Navigation [# 2]&lt;/title&gt;
   &lt;?= link_tag($cssfile2) ?&gt;
  &lt;/head&gt;

  &lt;body&gt;
  <div id="header">
  &lt;?php include("header.php"); ?&gt;    
  </div>

  <div id="main">
  &lt;?php include("reslistview.php"); ?&gt;    
  </div>

  <div id="nav-one">
  <p>Welcome! to the Skills Audit Home page! View lists of employees enrolled in a course and the course they are currently studying.</p>

  <div class="nav-two">
   &lt;?php include("sidemenu.php"); ?&gt;    
  </div>

  <div class="nav-three">
  <p>Sponsored By Code Igniter</p>
  </div>
  </div>

  <div id="footer">
    &lt;?php include("footer.php"); ?&gt;    

  <p></p>
  </div>
  &lt;/body&gt;
  &lt;/html&gt;


it should work but it throws a 404 page not found error! it works on my localhost but not on a server, but its all set up perfectly
#2

[eluser]kgill[/eluser]
Your links in the nav menu, you use Side_menu, make that all lowercase. Second, just a pointer use site_ur() instead of hard coding those links in the menu to make working on things easier to work with between your localhost and the live site.




Theme © iAndrew 2016 - Forum software by © MyBB