diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index c764ce09..196780da 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -728,5 +728,4 @@ class Logbook extends CI_Controller { return $this->db->get(); } - } diff --git a/application/controllers/Logbooks.php b/application/controllers/Logbooks.php new file mode 100644 index 00000000..eee2abba --- /dev/null +++ b/application/controllers/Logbooks.php @@ -0,0 +1,31 @@ +load->helper(array('form', 'url')); + + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + function index() { + $this->load->model('logbooks_model'); + + $data['my_logbooks'] = $this->logbooks_model->show_all(); + + // Render Page + $data['page_title'] = "Station Logbooks"; + $this->load->view('interface_assets/header', $data); + $this->load->view('logbooks/index'); + $this->load->view('interface_assets/footer'); + } + + +} \ No newline at end of file diff --git a/application/models/Logbooks_model.php b/application/models/Logbooks_model.php new file mode 100644 index 00000000..b1b7e37c --- /dev/null +++ b/application/models/Logbooks_model.php @@ -0,0 +1,17 @@ +db->where('user_id', $this->session->userdata('user_id')); + return $this->db->get('station_logbooks'); + } +} +?> \ No newline at end of file diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 088d02da..20071666 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -185,6 +185,8 @@