[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>
</body>
res_page_two.php (view file)
Code:
<html
<head>
<title>CSS Liquid Layout: Two Column Left Navigation [# 2]</title>
<?= link_tag($cssfile2) ?>
</head>
<body>
<div id="header">
<?php include("header.php"); ?>
</div>
<div id="main">
<?php include("reslistview.php"); ?>
</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">
<?php include("sidemenu.php"); ?>
</div>
<div class="nav-three">
<p>Sponsored By Code Igniter</p>
</div>
</div>
<div id="footer">
<?php include("footer.php"); ?>
<p></p>
</div>
</body>
</html>
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