1
The frameworks I’m using are the Zurb Foundation 5 and the Codeigniter.
How to display on a modal Foundation 5 database information per ID? I’ve actually performed the procedure, only I can’t display the record per ID.
Displaying records with the Modal Reveal link:
<?php
$query = $this->protocolo->get_all_protocolo()->result();
foreach ($query as $linha):
echo '<tr>';
printf('<td class="text-center">%s</td>', $linha->id);
printf('<td class="text-center">%s</td>', $linha->nome);
printf('<td class="text-center">%s</td>', $linha->numerodocumento);
printf('<td class="text-center">%s</td>', anchor("protocolo/gerenciar/$linha->id", 'Observação', 'data-reveal-id="firstModal"'));
printf('<td class="text-center">%s</td>', anchor('#', 'Detalhes', 'class="addimg"'));
printf('<td class="text-center">%s</td>', 'Status');
echo '</tr>';
endforeach;
?>
Form:
<?php
$iduser = $this->uri->segment(3);
$querys = $this->protocolo->get_byid($iduser)->row();
echo '<div id="firstModal" class="reveal-modal small" data-reveal>';
echo '<div class="row">';
echo '<div class="small-8 columns">';
echo form_open('#');
echo form_fieldset('Observação');
echo form_label('Protocolo');
echo form_input(array('name' => 'protocolo', 'class' => 'five', 'disabled' => 'disabled'), set_value('protocolo', $querys->id));
echo form_label('Observação');
echo form_textarea(array('name' => 'texto', 'class' => 'five'));
echo '<div class="row">';
echo '<div class="small-2 columns">';
echo form_submit(array('name' => 'cadastrar', 'class' => 'button radius small font'), 'Salvar dados');
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<a class="close-reveal-modal">×';
echo '</div>';
break;
This way it presents me an error when I go to the manage screen(locahost/system/protocol/manage):
Fatal error: Call to a Member Function Row() on a non-object.
I believe this error is because I am calling a modal that has a parameter, in this case the user id. How can I solve this problem?
Andrew in my experience what’s happening is that the
get_byid($iduser)
is returningfalse
ornull
. See what the result of this function isvar_dump($this->protocolo->get_byid($iduser))
and see the result.– Jorge B.