Code comments because its a nightmare without them

pull/594/head
Peter Goodhall 2020-08-13 17:28:22 +01:00
rodzic 1296656dd6
commit c780de0b7d
2 zmienionych plików z 21 dodań i 2 usunięć

Wyświetl plik

@ -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');

Wyświetl plik

@ -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');