kopia lustrzana https://github.com/magicbug/Cloudlog
Merge pull request #1488 from phl0/logbookNames
Add logbook and station profile name to Logbook pagepull/1510/head
commit
f257ec1843
|
|
@ -26,6 +26,7 @@ class Logbook extends CI_Controller {
|
|||
// user is not logged in
|
||||
redirect('user/login');
|
||||
}
|
||||
$this->load->model('stations');
|
||||
|
||||
// If environment is set to development then show the debug toolbar
|
||||
if(ENVIRONMENT == 'development') {
|
||||
|
|
|
|||
|
|
@ -81,6 +81,23 @@ class Logbooks_model extends CI_Model {
|
|||
return $this->db->get('station_logbooks');
|
||||
}
|
||||
|
||||
function find_name($id) {
|
||||
// Clean ID
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
$this->db->where('user_id', $this->session->userdata('user_id'));
|
||||
$this->db->where('logbook_id', $clean_id);
|
||||
$query = $this->db->get('station_logbooks');
|
||||
if ($query->num_rows() > 0){
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
return $row->logbook_name;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return "n/a";
|
||||
}
|
||||
}
|
||||
|
||||
// Creates relationship between a logbook and a station location
|
||||
function create_logbook_location_link($logbook_id, $location_id) {
|
||||
|
|
@ -253,4 +270,4 @@ class Logbooks_model extends CI_Model {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -202,6 +202,21 @@ class Stations extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
public function find_name() {
|
||||
$this->db->where('user_id', $this->session->userdata('user_id'));
|
||||
$this->db->where('station_active', 1);
|
||||
$query = $this->db->get('station_profile');
|
||||
|
||||
if($query->num_rows() >= 1) {
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
return $row->station_profile_name;
|
||||
}
|
||||
} else {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
public function reassign($id) {
|
||||
// Clean ID
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
|
@ -314,4 +329,4 @@ class Stations extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<div class="container logbook">
|
||||
|
||||
<h2><?php echo $this->lang->line('gen_hamradio_logbook'); ?></h2>
|
||||
<h6><?php echo $this->lang->line('gen_hamradio_logbook').": ".$this->logbooks_model->find_name($this->session->userdata('active_station_logbook')); ?> <?php echo $this->lang->line('general_word_location').": ".$this->stations->find_name(); ?></h6>
|
||||
|
||||
<?php if($this->session->flashdata('notice')) { ?>
|
||||
<div class="alert alert-info" role="alert">
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue