Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.15 KB | None | 0 0
  1. <?php
  2. require_once 'core/init.php';
  3. require_once 'view/header.php';
  4.  
  5. $error='';
  6.  
  7. // cek apakah yang mengakses halaman ini sudah login
  8. if( !isset($_SESSION['username']) ){
  9. echo "<script>alert('Silakan Login terlebih dahulu untuk mengakses halaman ini');window.location='index.php'</script>";
  10. // header('Location: index.php');
  11. }
  12. ?>
  13.  
  14. <?php
  15. if(cek_status($_SESSION['username'] ) == 'admin' OR
  16. cek_status($_SESSION['username'] ) == 'packing' OR
  17. cek_status($_SESSION['username'] ) == 'kenzin' OR
  18. cek_status($_SESSION['username'] ) == 'kenzin2' OR
  19. cek_status($_SESSION['username'] ) == 'kenzin3' OR
  20. cek_status($_SESSION['username'] ) == 'ppic') {
  21. ?>
  22. <br>
  23. <div class="row">
  24.  
  25.  
  26. <center><h2>PROSES ALUR PART</h2></center>
  27. <div style="height:55px;">
  28. <?php
  29. if (isset($_SESSION['pesan']) && $_SESSION['pesan'] <> '') {
  30. echo '<div id="pesan" class="alert alert-success" style="display:none;">'.$_SESSION['pesan'].'</div>';
  31. }
  32. $_SESSION['pesan'] = '';
  33. ?>
  34. </div>
  35. <br>
  36.  
  37. <!-- <div class="container"> -->
  38. <div class="col-sm-2">
  39. <!-- <form method="post" action="description-part.php"> -->
  40. <font color="blue"><b>Pilih Style</font><br></b>
  41. <div class="input-group">
  42. <div class="input-group-addon">
  43. <i class="glyphicon glyphicon-tags"></i>
  44. </div>
  45. <select id="style" class="ganti form-control" name="style" required>
  46. <option value="">Pilih Style</option>
  47. <?php
  48. $style = tampilkan_style();
  49. while($pilih = mysqli_fetch_assoc($style)){
  50. echo '<option value='.$pilih['style'].'>'.$pilih['style'].'</option>';
  51.  
  52. }
  53. ?>
  54. </select>
  55. </div>
  56. </div>
  57.  
  58. <div class="col-sm-2">
  59. <font color="blue"><b>Urutan Proses</font><br></b>
  60. <div class="input-group">
  61. <div class="input-group-addon">
  62. <i class="glyphicon glyphicon-tags"></i>
  63. </div>
  64. <input type="number" class="form-control" name="urutan_proses" id="urutan_proses" required>
  65. </div>
  66. </div>
  67.  
  68. <div class="col-sm-7">
  69. <font color="blue"><b>Masukkan Description Proses PART BARU</font><br></b>
  70. <div class="input-group">
  71. <div class="input-group-addon">
  72. <i class="glyphicon glyphicon-tags"></i>
  73. </div>
  74. <select id="description" class="ganti form-control" name="description" required>
  75. <option value="">Pilih Proses Part</option>
  76. <?php
  77. $part = tampilkan_descriptionPart();
  78. while($pilih = mysqli_fetch_assoc($part)){
  79. echo '<option value='.$pilih['id_description_part'].'>'.$pilih['description_part'].'</option>';
  80.  
  81. }
  82. ?>
  83. </select>
  84. </div>
  85. </div>
  86.  
  87. <div class="col-sm-1">
  88. <button class="btn btn-success" id="simpan" type="button">SIMPAN</button>
  89. <!-- <button type="submit" class="btn btn-primary" name="tambah" value="SIMPAN" id="simpan" style="margin-top: 20px" > -->
  90. </div>
  91. <!-- </form> -->
  92. <br>
  93. <br><br>
  94. <br>
  95.  
  96. <div id="tampil_tabel"></div>
  97.  
  98.  
  99. <script type="text/javascript">
  100. $(".ganti").change(function(){
  101. var style = $("#style").val();
  102. console.log(style);
  103. $.ajax({
  104. method: "POST",
  105. url : "tampil_alur_part.php",
  106. data: { style : style,
  107. type : 'tampil'
  108. },
  109. success: function(data){
  110. $('#tampil_tabel').html(data);
  111. }
  112. });
  113. });
  114. </script>
  115.  
  116. <script type="text/javascript">
  117. $('#simpan').on('click',function(){
  118. var style = $("#style").val();
  119. var urutan_proses = $('#urutan_proses').val();
  120. var description = $('#description').val();
  121. console.log(style);
  122. console.log(urutan_proses);
  123. console.log(description);
  124. $.ajax({
  125. method: "POST",
  126. url: "tampil_alur_part.php",
  127. data: { style2 : style,
  128. urutan_proses : urutan_proses,
  129. description : description,
  130. type : 'tambah'
  131. },
  132. success: function(data){
  133.  
  134. // $('#tampil_tabel').load(tampil_alur_part.php);
  135. $('#tampil_tabel').html(data);
  136. // console.log(data.trim());
  137. // if(data.trim() == "success"){
  138. // $('#tampil_tabel').load('tampil_alur_part.php');
  139. // }else if(data.trim() == "errorDb"){
  140. // alert("Gagal Ada masalah dengan kode barcode");
  141. // }else if(data.trim() == "errorQtyOrder"){
  142. // alert("Gagal Qty Sudah Memenuhi Order Atau Tidak Ada Orderan untuk Label ini");
  143. // }
  144. }
  145. });
  146. document.getElementById("urutan_proses").value = "";
  147. document.getElementById("description").value = "";
  148. });
  149.  
  150. // $(document).ready(function(){
  151. // $('#tampil_tabel').load("tampil_kenzin2.php");
  152. // });
  153. </script>
  154.  
  155.  
  156.  
  157.  
  158. <?php } else {
  159. echo 'Anda tidak memiliki akses kehalaman ini'; } ?>
  160. <!-- // $('#kode_barcode').on('change',function(){
  161. // $('#tampil_tabel').load(tampil.php);
  162. // }); -->
  163. </script>
  164. <script src="style/jquery.min.js"></script>
  165. <script>
  166. $(document).ready(function(){setTimeout(function(){$("#pesan").fadeIn('slow');}, 500);});
  167. setTimeout(function(){$("#pesan").fadeOut('slow');}, 3600);
  168. </script>
  169. </body>
  170. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement