Hello
I want to display a data ($ variable) in a footer.
As it is below, it works and the $operador
variable is displayed correctly on all the options / screens I click.
<?php $operador = $this->session->userdata('nome'); ?>
<div id="footer" class="span12"> <?php echo date('Y'); ?> | Versão: <?php echo $operador; ?>
But I do not want to display a $variável
of the session.
Then I created a controller / modal / view called SYSTEM .
In this controller I have idSistema, nome, data_registro, date_expiracao, licenca, versao
.
So I want to display the version in the footer.
So I tried the following way:
<div id="footer" class="span12"> <?php echo date('Y'); ?> | Versão: <?php foreach ($results as $r) { echo $r->versao; }?></div>
But this only works if I am in the SYSTEM option, if I click on another option, where it should show the system version, the message that the results variable is not defined is displayed.
How can I set this variable as global ??
Below, part of the function code in the system controller.
$this->data['results'] = $this->sistemas_model->get('sistemas','idSistemas,nome, dt_registro,dt_expiracao,licenca,versao','',$config['per_page'],$this->uri->segment(3));
$this->data['view'] = 'sistemas/sistemas';
$this->load->view('tema/topo',$this->data);