diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index f2a7ec80..711d8bd9 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -9,15 +9,26 @@ class Lotw extends CI_Controller { $this->load->helper(array('form', 'url')); } - + /* + |-------------------------------------------------------------------------- + | Function: index + |-------------------------------------------------------------------------- + | + | Default function for the controller which loads when doing /lotw + | this shows all the uploaded lotw p12 certificates the user has uploaded + | + */ public function index() { - + // Load required models for page generation $this->load->model('LotwCert'); + // Get Array of the logged in users LOTW certs. $data['lotw_cert_results'] = $this->LotwCert->lotw_certs($this->session->userdata('user_id')); + // Set Page Title $data['page_title'] = "Logbook of the World"; + // Load Views $this->load->view('interface_assets/header', $data); $this->load->view('lotw_views/index'); $this->load->view('interface_assets/footer'); diff --git a/application/models/LotwCert.php b/application/models/LotwCert.php index 447cddae..b26c712e 100644 --- a/application/models/LotwCert.php +++ b/application/models/LotwCert.php @@ -8,6 +8,14 @@ class LotwCert extends CI_Model { parent::__construct(); } + /* + |-------------------------------------------------------------------------- + | Function: lotw_certs + |-------------------------------------------------------------------------- + | + | Returns all lotw_certs for a selected user via the $user_id parameter + | + */ function lotw_certs($user_id) { $this->db->where('user_id', $user_id); $query = $this->db->get('lotw_certs');