The frameworks I'm using are Zurb Foundation 5 and Codeigniter.
How to display in a modal foundation 5 database information per ID? Actually I have already performed the procedure, but I can not display the record by ID.
Displaying records with the Reveal Modal 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 gives me an error when I go to the manage screen (locahost / system / protocol / manage):
Fatal error: Call a member function row () on a non-object.
I think this error is because I'm calling a modal that has a parameter, in this case the id of the user. How can I resolve this problem?