Advertisement
Guest User

Table

a guest
Jul 28th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. <?php
  2. include ("_functions.php");
  3. conecta();
  4. ?>
  5. <!DOCTYPE html>
  6. <html lang="pt-br">
  7. <head>
  8.  
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <title>ITENS COTACOES</title>
  12. <!-- <link rel="stylesheet" type="text/css" href="estilo.css" /> -->
  13. <!-- <script type="text/javascript" src="script.js"></script> -->
  14. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  15. <link rel="stylesheet" href="css/estilos.css">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <link href='https://fonts.googleapis.com/css?family=Quicksand:400,700' rel='stylesheet' type='text/css'>
  18. </head>
  19. <body>
  20. <form method="post" name="attcotacao" >
  21. <table width="100%" border="1" cellspacing="0" cellpadding="3" id="playlistTable">
  22. <tr>
  23. <tr>
  24. <td align="center" bgcolor="#CCCCCC"><strong>DISTRIBUIDOR</strong></td>
  25. <td align="center" bgcolor="#CCCCCC"><strong>COD. BARRA</strong></td>
  26. <td align="center" bgcolor="#CCCCCC"><strong>PRODUTO</strong></td>
  27. <td align="center" bgcolor="#CCCCCC"><strong>LABORATORIO</strong></td>
  28. <td align="center" bgcolor="#CCCCCC"><strong>QNTD.</strong></td>
  29. <td align="center" bgcolor="#CCCCCC"><strong>PRECO ATUAL</strong></td>
  30. <td align="center" bgcolor="#CCCCCC"><strong>PRECO COTACAO</strong></td>
  31.  
  32. </tr>
  33. <?php
  34. //Recebe Dados do Form
  35. $tecnicos = ibase_query('SELECT * FROM ITENS_COTACOES');
  36.  
  37.  
  38. while ($linha = ibase_fetch_assoc($tecnicos)) {
  39.  
  40.  
  41. //Imprime Resultado na Tela
  42. echo '<tr>';
  43. echo '<td align="center">'.$linha['DISTRIBUIDOR'].'</td>';
  44. echo '<td align="center">'.$linha['CODIGO_BARRAS'].'</td>';
  45. echo '<td align="center">'.$linha['PRODUTO'].'</td>';
  46. echo '<td align="center">'.$linha['LABORATORIO'].'</td>';
  47. echo '<td align="center">'.$linha['QUANTIDADE'].'</td>';
  48. echo '<td align="center">'.$linha['PRECO'].'</td>';
  49. echo '<td align="center"><input type="text" name="status[]" id="status"></td>';
  50.  
  51.  
  52. }
  53. ?>
  54. <input type='hidden' name='codigo[]' value="<?php echo $dados[$key]['CODIGO_BARRAS']?>" id=''/>
  55. <input type="submit" name="atualizar" id="atualizar" value="Atualizar Preços">
  56. <?php
  57.  
  58. if (isset($_POST['atualizar'])){
  59. $_PO
  60. $x = 0;
  61. while($x < count($_POST['CODIGO_BARRAS'])) {
  62. $preco[$x] = $_POST['preco'][$x];
  63.  
  64. //E para fazer o insert ou update no banco, insira o código aqui. Ou seja,
  65. //para cadas registro na table ele executará a ação para o banco.
  66.  
  67.  
  68. $query = ibase_query("UPDATE ITENS_COTACOES SET PRECO = $preco_novo WHERE id_produto = 13840");
  69.  
  70. echo "<script>window.alert('Atualizado com Sucesso!')</script>";
  71.  
  72. $x++;
  73. }
  74. }
  75. ?>
  76.  
  77. </form>
  78. <a class="logoff" href="logout.php">Sair do Sistema</a>
  79. </table>
  80.  
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement