Jump to content
Fórum Script Brasil
  • 0

Table php



Como eu poderia colocar um botão no para setar um valor na tabela do php?

meu codigo php abaixo, eu gostaria que ele colocasse o valor onclick $nome na parte do analista da tabela via modal.

$nome = isset($_GET["nome"])? $_GET["nome"]:null;
$matricula = isset($_GET["matricula"])? $_GET["matricula"]:null;
$solicitacao = isset($_GET["solicitacao"])? $_GET["solicitacao"]:null;
$prioridade = isset($_GET["prioridade"])? $_GET["prioridade"]:null;
$orgao = isset($_GET["orgao"])? $_GET["orgao"]:null;

$conexao = mysqli_connect('localhost', 'root', '', 'analistas');

$query = "SELECT `solicitacao`,`prioridade`,`orgao`, `nome` from `analistas` WHERE `analistas`";
if (mysqli_query($conexao, $query))
    { ?>

$conexao = mysqli_connect('localhost', 'root', '', 'analistas');
echo 'Failed to connecto to database'.mysqli_connect_error();}

$query= mysqli_query($conexao, "SELECT DISTINCT `solicitacao`, `prioridade`, `orgao` FROM ordem");
                            <?php while($rows = mysqli_fetch_array($query)): ?>
                                <td><?php echo $rows['solicitacao']; ?></td>

                                <td><?php echo $rows['prioridade']; ?></td>
                                <td><?php echo $rows['orgao']; ?></td>
                            <?php endwhile; ?>

 <!-- Modal -->
                    <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">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel"><strong>Solicitação</strong></h4>
                                <div class="modal-body">
                                    <div class="insertHere">

                                <div class="modal-footer">
                                    <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                                    <button class="btn btn-success" data-dismiss="modal" value="Add Item" onClick="addRow('OrderTable')">Confirmar</button>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...