Add logbook and station profile name to Logbook page

这个提交包含在:
phl0 2022-05-02 12:38:55 +02:00
父节点 01a0f75f84
当前提交 798d6315fd
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 4 个文件被更改,包括 36 次插入2 次删除

查看文件

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

查看文件

@ -82,6 +82,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) {
@ -254,4 +271,4 @@ class Logbooks_model extends CI_Model {
return false;
}
}
?>
?>

查看文件

@ -203,6 +203,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);
@ -315,4 +330,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">