Advertisement
NetCut

vali2

Feb 26th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. <?php
  2. if( empty( $_SESSION['id_user'] ) ){
  3. $_SESSION['err'] = '<strong>ERROR!</strong> Anda harus login terlebih dahulu.';
  4. header('Location: ./');
  5. die();
  6. } else {
  7. if( isset( $_REQUEST['vs'] )){
  8. $vs = $_REQUEST['vs'];
  9. switch($vs){
  10. case 'setuju':
  11. include 'valid_proses.php';
  12. break;
  13. case 'hapus':
  14. include 'valid_hapus.php';
  15. break;
  16.  
  17. }
  18. }else {
  19. $nota = $_REQUEST['nota'];
  20. $sql3 = mysqli_query($koneksi, "SELECT * from transaksi where nota='$nota'");
  21. $row2 = mysqli_fetch_array($sql3)
  22. ?>
  23. <form method="post" action="" class="form-inline" role="form">
  24. <div ><br></div>
  25. <div class="form-group">
  26. <?php
  27. ?>
  28.  
  29. <label for="nota" class="col-sm-2 control-label">No. Nota</label>
  30. <div class="col-sm-2"><div class="col-sm-2">
  31. <input type="text" name="nota" id="nota" class="form-control" value="<?php echo $row2['nota']?>" readonly>
  32. </div>
  33. </div>
  34.  
  35. <div class="pull-right">
  36.  
  37. <label for="koordinator" class="col-sm-4 control-label">Koordinator</label>
  38. <div class="col-sm-4">
  39. <h3>
  40. <?php echo $_SESSION['koordinator']; ?>
  41.  
  42. </h3>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="pull-right">
  47.  
  48. <button class="btn btn-primary pull-right" name="submit" id="submit">Selesai</button>
  49. </div>
  50.  
  51. <hr>
  52.  
  53. <div >
  54. <form action="valid_proses.php" method="POST">
  55. <table class="table table-bordered">
  56. <thead>
  57. <tr class="info">
  58. <th width="5%">No</th>
  59. <th width="10%">Kode Barang</th>
  60. <th width="22%">Nama Barang</th>
  61. <th width="10%">Jenis</th>
  62. <th width="10%">satuan</th>
  63. <th width="10%">permintaan</th>
  64. <th width="10%">Disetujui</th>
  65. <th width="20%">Tindakan</th>
  66. </tr>
  67. </thead>
  68.  
  69. <tbody>
  70. <?php
  71. $nota = $_REQUEST['nota'];
  72. $sql = mysqli_query($koneksi, "SELECT * FROM sub where nota='$nota'");
  73. if(mysqli_num_rows($sql) > 0){
  74. $no = 0;
  75.  
  76. while($row = mysqli_fetch_array($sql)){
  77. $no++;
  78. echo '
  79.  
  80. <tr>
  81. <td>'.$no.'</td>
  82. <td>'.$row['id_barang'].'</td>
  83. <td>'.$row['nama_barang'].'</td>
  84. <td>'.$row['jenis_barang'].'</td>
  85. <td>'.$row['satuan'].'</td>
  86. <td>'.$row['permintaan'].'</td>
  87. <td>
  88. <input type="text" class="form-control " value="" name="setuju" id="setuju">
  89.  
  90. </td>
  91. <td>';
  92. echo'
  93.  
  94.  
  95. <script type="text/javascript" language="JavaScript">
  96. function konfirmasi(){
  97. tanya = confirm("Anda yakin akan menghapus data ini ?");
  98. if (tanya == true) return true;
  99. else return false;
  100. }
  101. </script>
  102. <a href="?hlm=transaksi&aksi=valid&vs=setuju&submit=yes&id_sub='.$row['id_sub'].'" onclick="return konfirmasi()" class="btn btn-success btn-s">Setuju</a>
  103. <a href="?hlm=transaksi&aksi=valid&vs=hapus&submit=yes&id_sub='.$row['id_sub'].'" onclick="return konfirmasi()" class="btn btn-danger btn-s">Hapus</a>
  104. </td>';
  105. }
  106. }
  107.  
  108. ?>
  109.  
  110. </tr>
  111.  
  112. </tbody>
  113. </table>
  114. </div>
  115. </form>
  116. </div>
  117.  
  118. </form>
  119.  
  120.  
  121.  
  122.  
  123.  
  124. <?php
  125. }
  126. }
  127. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement