[Visitor] Allows setting a public URL for viewing a basic dashboard

pull/1443/head
Peter Goodhall 2022-03-24 14:26:03 +00:00
rodzic 31ed071839
commit f7427f59de
5 zmienionych plików z 542 dodań i 9 usunięć

Wyświetl plik

@ -11,6 +11,9 @@ class Visitor extends CI_Controller {
if($method == "config") {
$this->$method();
}
elseif($method == "map") {
$this->map($method);
}
else {
$this->index($method);
}
@ -22,26 +25,156 @@ class Visitor extends CI_Controller {
public function index($public_slug = NULL)
{
// If environment is set to development then show the debug toolbar
if(ENVIRONMENT == 'development') {
$this->output->enable_profiler(TRUE);
}
$this->load->model('user_model');
// Check if users logged in
if($this->user_model->validate_session() != 0) {
// If environment is set to development then show the debug toolbar
if(ENVIRONMENT == 'development') {
$this->output->enable_profiler(TRUE);
}
}
// Check slug passed and is valid
if ($this->security->xss_clean($public_slug, TRUE) === FALSE)
{
// file failed the XSS test#
// Public Slug failed the XSS test
log_message('error', '[Visitor] XSS Attack detected on public_slug '. $public_slug);
show_404('Unknown Public Page.');
} else {
// Checked slug passed and clean
log_message('info', '[Visitor] public_slug '. $public_slug .' loaded');
echo $public_slug = $this->security->xss_clean($public_slug);
// Check if the slug is contained in the station_logbooks table
$this->load->model('logbooks_model');
if($this->logbooks_model->public_slug_exists($public_slug)) {
// Load the public view
if($logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($public_slug) != false)
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
} else {
log_message('error', $public_slug.' has no associated station locations');
show_404('Unknown Public Page.');
}
$this->load->model('logbook_model');
// Public visitor so no QRA to setup
$data['qra'] = "none";
$this->load->model('cat');
$data['radio_status'] = $this->cat->recent_status();
// Store info
$data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array);
$data['total_qsos'] = $this->logbook_model->total_qsos($logbooks_locations_array);
$data['month_qsos'] = $this->logbook_model->month_qsos($logbooks_locations_array);
$data['year_qsos'] = $this->logbook_model->year_qsos($logbooks_locations_array);
// Load Countries Breakdown data into array
$CountriesBreakdown = $this->logbook_model->total_countries_confirmed($logbooks_locations_array);
$data['total_countries'] = $CountriesBreakdown['Countries_Worked'];
$data['total_countries_confirmed_paper'] = $CountriesBreakdown['Countries_Worked_QSL'];
$data['total_countries_confirmed_eqsl'] = $CountriesBreakdown['Countries_Worked_EQSL'];
$data['total_countries_confirmed_lotw'] = $CountriesBreakdown['Countries_Worked_LOTW'];
$QSLStatsBreakdownArray =$this->logbook_model->get_QSLStats($logbooks_locations_array);
$data['total_qsl_sent'] = $QSLStatsBreakdownArray['QSL_Sent'];
$data['total_qsl_recv'] = $QSLStatsBreakdownArray['QSL_Received'];
$data['total_qsl_requested'] = $QSLStatsBreakdownArray['QSL_Requested'];
$data['total_eqsl_sent'] = $QSLStatsBreakdownArray['eQSL_Sent'];
$data['total_eqsl_recv'] = $QSLStatsBreakdownArray['eQSL_Received'];
$data['total_lotw_sent'] = $QSLStatsBreakdownArray['LoTW_Sent'];
$data['total_lotw_recv'] = $QSLStatsBreakdownArray['LoTW_Received'];
$data['last_five_qsos'] = $this->logbook_model->get_last_qsos('18', $logbooks_locations_array);
$data['page_title'] = "Dashboard";
$data['slug'] = $public_slug;
$this->load->model('dxcc');
$dxcc = $this->dxcc->list_current();
$current = $this->logbook_model->total_countries_current($logbooks_locations_array);
$data['total_countries_needed'] = count($dxcc->result()) - $current;
$this->load->view('visitor/layout/header', $data);
$this->load->view('visitor/index');
$this->load->view('visitor/layout/footer');
} else {
// Show 404
log_message('error', '[Visitor] XSS Attack detected on public_slug '. $public_slug);
show_404('Unknown Public Page.');
}
}
}
public function map() {
$this->load->model('logbook_model');
$this->load->library('qra');
$slug = $this->security->xss_clean($this->uri->segment(3));
$this->load->model('logbooks_model');
if($logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($slug) != false)
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
} else {
log_message('error', $slug.' has no associated station locations');
show_404('Unknown Public Page.');
}
$qsos = $this->logbook_model->get_last_qsos('18', $logbooks_locations_array);
header('Content-Type: application/json; charset=utf-8');
echo "{\"markers\": [";
$count = 1;
foreach ($qsos->result() as $row) {
//print_r($row);
if($row->COL_GRIDSQUARE != null) {
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
if($count != 1) {
echo ",";
}
if($row->COL_SAT_NAME != null) {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
} else {
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
}
$count++;
} else {
$query = $this->db->query('
SELECT *
FROM dxcc_entities
WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) )
ORDER BY LENGTH( prefix ) DESC
LIMIT 1
');
foreach ($query->result() as $dxcc) {
if($count != 1) {
echo ",";
}
echo "{\"lat\":\"".$dxcc->lat."\",\"lng\":\"".$dxcc->long."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}";
$count++;
}
}
}
echo "]";
echo "}";
}
}

Wyświetl plik

@ -124,12 +124,36 @@ class Logbooks_model extends CI_Model {
}
}
function public_slug_exists($slug) {
$this->db->where('public_slug', $this->security->xss_clean($slug));
$query = $this->db->get('station_logbooks');
if ($query->num_rows() > 0){
return true;
}
else{
return false;
}
}
function public_slug_exists_logbook_id($slug) {
$this->db->where('public_slug', $this->security->xss_clean($slug));
$query = $this->db->get('station_logbooks');
if ($query->num_rows() > 0){
foreach ($query->result() as $row)
{
return $row->logbook_id;
}
}
else{
return false;
}
}
function is_public_slug_available($slug) {
// Clean public_slug
$clean_slug = $this->security->xss_clean($slug);
$this->db->where('public_slug', $clean_slug);
$query = $this->db->get('station_logbooks');

Wyświetl plik

@ -0,0 +1,266 @@
<?php
function echo_table_header_col($ctx, $name) {
switch($name) {
case 'Mode': echo '<th>'.$ctx->lang->line('gen_hamradio_mode').'</th>'; break;
case 'RSTS': echo '<th class="d-none d-sm-table-cell">'.$ctx->lang->line('gen_hamradio_rsts').'</th>'; break;
case 'RSTR': echo '<th class="d-none d-sm-table-cell">'.$ctx->lang->line('gen_hamradio_rstr').'</th>'; break;
case 'Country': echo '<th>'.$ctx->lang->line('general_word_country').'</th>'; break;
case 'IOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_iota').'</th>'; break;
case 'SOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_sota').'</th>'; break;
case 'State': echo '<th>'.$ctx->lang->line('gen_hamradio_state').'</th>'; break;
case 'Grid': echo '<th>'.$ctx->lang->line('gen_hamradio_gridsquare').'</th>'; break;
case 'Band': echo '<th>'.$ctx->lang->line('gen_hamradio_band').'</th>'; break;
case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
}
}
function echo_table_col($row, $name) {
switch($name) {
case 'Mode': echo '<td>'; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . '</td>'; break;
case 'RSTS': echo '<td class="d-none d-sm-table-cell">' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '</span>';} if ($row->COL_STX_STRING) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '</span>';} echo '</td>'; break;
case 'RSTR': echo '<td class="d-none d-sm-table-cell">' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_SRX); echo '</span>';} if ($row->COL_SRX_STRING) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_SRX_STRING . '</span>';} echo '</td>'; break;
case 'Country': echo '<td>' . ucwords(strtolower(($row->COL_COUNTRY))) . '</td>'; break;
case 'IOTA': echo '<td>' . ($row->COL_IOTA) . '</td>'; break;
case 'SOTA': echo '<td>' . ($row->COL_SOTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->station_gridsquare, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}
?>
<div class="container dashboard">
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
<?php if($todays_qsos >= 1) { ?>
<div class="alert alert-success" role="alert">
<?php echo $this->lang->line('dashboard_you_have_had'); ?> <strong><?php echo $todays_qsos; ?></strong> <?php echo $this->lang->line('dashboard_qsos_today'); ?>
</div>
<?php } else { ?>
<div class="alert alert-warning" role="alert">
<span class="badge badge-info"><?php echo $this->lang->line('general_word_important'); ?></span> <i class="fas fa-broadcast-tower"></i> <?php echo $this->lang->line('notice_turn_the_radio_on'); ?>
</div>
<?php } ?>
<?php if($current_active == 0) { ?>
<div class="alert alert-danger" role="alert">
<?php echo $this->lang->line('error_no_active_station_profile'); ?>
</div>
<?php } ?>
<?php } ?>
</div>
<!-- Map -->
<div id="map" style="width: 100%; height: 350px"></div>
<div style="padding-top: 0px; margin-top: 5px;" class="container dashboard">
<!-- Log Data -->
<div class="row logdata">
<div class="col-sm-8">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr class="titles">
<th><?php echo $this->lang->line('general_word_date'); ?></th>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<th><?php echo $this->lang->line('general_word_time'); ?></th>
<?php } ?>
<th><?php echo $this->lang->line('gen_hamradio_call'); ?></th>
<?php
echo_table_header_col($this, $this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1'));
echo_table_header_col($this, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2'));
echo_table_header_col($this, $this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3'));
echo_table_header_col($this, $this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4'));
?>
</tr>
</thead>
<?php
$i = 0;
if(!empty($last_five_qsos) > 0) {
foreach ($last_five_qsos->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<?php
// Get Date format
if($this->session->userdata('user_date_format')) {
// If Logged in and session exists
$custom_date_format = $this->session->userdata('user_date_format');
} else {
// Get Default date format from /config/cloudlog.php
$custom_date_format = $this->config->item('qso_date_format');
}
?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date($custom_date_format, $timestamp); ?></td>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<?php } ?>
<td>
<?php echo str_replace("0","&Oslash;",strtoupper($row->COL_CALL)); ?>
</td>
<?php
echo_table_col($row, $this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1'));
echo_table_col($row, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2'));
echo_table_col($row, $this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3'));
echo_table_col($row, $this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4'));
?>
</tr>
<?php $i++; } } ?>
</table>
</div>
</div>
<div class="col-sm-4">
<div class="table-responsive">
<?php if($radio_status->num_rows()) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-broadcast-tower"></i> Radio Status</td>
</tr>
<?php foreach ($radio_status->result_array() as $row) { ?>
<tr>
<td><?php echo $row['radio']; ?></td>
<td>
<?php if($row['radio'] == "SatPC32") { ?>
<?php echo $row['sat_name']; ?>
<?php } else { ?>
<?php echo $this->frequency->hz_to_mhz($row['frequency']); ?> (<?php echo $row['mode']; ?>)
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-chart-bar"></i> <?php echo $this->lang->line('dashboard_qso_breakdown'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_total'); ?></td>
<td width="50%"><?php echo $total_qsos; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_year'); ?></td>
<td width="50%"><?php echo $year_qsos; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_month'); ?></td>
<td width="50%"><?php echo $month_qsos; ?></td>
</tr>
</table>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-globe-europe"></i> <?php echo $this->lang->line('dashboard_countries_breakdown'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_worked'); ?></td>
<td width="50%"><?php echo $total_countries; ?></td>
</tr>
<tr>
<td width="50%"><a href="#" onclick="return false" data-original-title="QSL Cards / eQSL / LoTW" data-toggle="tooltip"><?php echo $this->lang->line('general_word_confirmed'); ?></a></td>
<td width="50%">
<?php echo $total_countries_confirmed_paper; ?> /
<?php echo $total_countries_confirmed_eqsl; ?> /
<?php echo $total_countries_confirmed_lotw; ?>
</td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_needed'); ?></td>
<td width="50%"><?php echo $total_countries_needed; ?></td>
</tr>
</table>
<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_recv != 0 || $total_qsl_requested != 0)) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-envelope"></i> <?php echo $this->lang->line('general_word_qslcards'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
<td width="50%"><?php echo $total_qsl_sent; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
<td width="50%"><?php echo $total_qsl_recv; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_requested'); ?></td>
<td width="50%"><?php echo $total_qsl_requested; ?></td>
</tr>
</table>
<?php } ?>
<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_recv != 0)) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-address-card"></i> <?php echo $this->lang->line('general_word_eqslcards'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
<td width="50%"><?php echo $total_eqsl_sent; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
<td width="50%"><?php echo $total_eqsl_recv; ?></td>
</tr>
</table>
<?php } ?>
<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_lotw_sent != 0 || $total_lotw_recv != 0)) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-list"></i> <?php echo $this->lang->line('general_word_lotw'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
<td width="50%"><?php echo $total_lotw_sent; ?></td>
</tr>
<tr>
<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
<td width="50%"><?php echo $total_lotw_recv; ?></td>
</tr>
</table>
<?php } ?>
</div>
</div>
</div>
</div>

Wyświetl plik

@ -0,0 +1,55 @@
<!-- General JS Files used across Cloudlog -->
<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/popper.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.fancybox.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.qrb.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.geodesic.js"></script>
<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/darkmodehelpers.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrapdialog/js/bootstrap-dialog.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/easyprint.js"></script>
<script src="https://unpkg.com/htmx.org@1.6.1"></script>
<script type="text/javascript">
/*
*
* Define global javascript variables
*
*/
var base_url = "<?php echo base_url(); ?>"; // Base URL
var site_url = "<?php echo site_url(); ?>"; // Site URL
var icon_dot_url = "<?php echo base_url();?>assets/images/dot.png";
</script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js"></script>
<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
<?php if($qra == "set") { ?>
var q_lat = <?php echo $qra_lat; ?>;
var q_lng = <?php echo $qra_lng; ?>;
<?php } else { ?>
var q_lat = 40.313043;
var q_lng = -32.695312;
<?php } ?>
var qso_loc = '<?php echo site_url('visitor/map/'.$slug);?>';
var q_zoom = 3;
$(document).ready(function(){
<?php if ($this->config->item('map_gridsquares') != FALSE) { ?>
var grid = "Yes";
<?php } else { ?>
var grid = "No";
<?php } ?>
console.log("lets go");
initmap(grid);
});
</script>
</body>
</html>

Wyświetl plik

@ -0,0 +1,55 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<?php if($this->optionslib->get_theme()) { ?>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/general.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/selectize.bootstrap4.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap-dialog.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/overrides.css">
<?php } ?>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery.fancybox.min.css" />
<!-- Maps -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/js/leaflet/leaflet.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/loading.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/ldbtn.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/buttons.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/datatables.min.css"/>
<?php if (file_exists(APPPATH.'../assets/css/custom.css')) { echo '<link rel="stylesheet" href="'.base_url().'assets/css/custom.css">'; } ?>
<link rel="icon" href="<?php echo base_url(); ?>favicon.ico">
<title><?php if(isset($page_title)) { echo $page_title; } ?> - Cloudlog</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light main-nav">
<div class="container">
<a class="navbar-brand" href="<?php echo site_url(); ?>">Cloudlog</a> <?php if(ENVIRONMENT == "development") { ?><span class="badge badge-danger">Developer Mode</span><?php } ?>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="btn btn-outline-primary" href="<?php echo site_url('login');?>">Login</a>
</li>
</ul>
</div>
</div>
</nav>