0
I receive from the website contact form the data and list them on a system backend.
Currently all of them are displayed online (nome
, assunto
, e-mail
, telefone
, id
, ação[excluir]
), I would like it to appear only the email and name and the rest by clicking on the line or email it opens in a Bootstrap modal.
I was able to get him to show up for every line, only he only pulls the data from the first message from bd
Follows an excerpt from the code:
<?php
$this->load->view('menu');
?>
<div class="container">
<h1>Dúvidas? Sugestões? Alguem entrou em contato conosco!</h1>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>E-mail</th>
<th>NOME</th>
<th>ASSUNTO</th>
<th>MENSAGEM</th>
<th>TELEFONE</th>
<th>DATA</th>
<th>AÇÃO</th>
</tr>
</thead>
<tbody>
<?php if($usuarios){foreach ($usuarios as $usuario) { ?>
<tr>
<th scope="row"><?php echo $usuario["id"]; ?></th>
<th><a href="#myModal" data-toggle="modal" data-target="#myModal"><?php echo $usuario["email"]; ?></a></th>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<p> <?php echo $usuario["nome"]; ?></p>
<p><?php echo $usuario["assunto"]; ?></p>
<p><?php echo $usuario["mensagem"]; ?></p>
<p><?php echo $usuario["tel"]; ?></p>
<p><?php echo $usuario["data"]; ?></p>
<p><a class="btn btn-danger" href="<?php echo base_url('mensagem/deletar/'. $usuario["id"]); ?>" onclick="return confirm('Deseja deletar esta mensagem?');"> <i class="glyphicon glyphicon-trash"></i>
</a></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</tr>
<?php } // end foreach
} else {
?>
<tr>
<td colspan="3" class="text-center">Não há mensagens pendentes.</td>
</tr>
<?php
} // end if
?>
</tbody>
</table>
<p>Estas mensagens são relacionadas ao formulário de <a href="http://www.softlove.com.br/index.php/formulario/contato"> contato </a> do site.</p>
</div>
<?php
$this->load->view('script');
?>
<script type="text/javascript">
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').focus()
})
</script>
That’s a
VIEW
?– ShutUpMagda
Yes is a view @Shutupmagda
– Rafael Rotiroti