Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (68414 Members, 793 Products, 5353 Topic, 13045 Comments)

menampilkan jumlah sisa selalu error dan tidak tampil...

Dibuat
Login Terakhir 9 Jam lalu,
Telah Dilihat 1045 Kali
Rafisqy Adhideva Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. Mastah2 yg saya hormati,
  4. maaf sy sedang ada kesulitan membuat tampilan keterangan sisa dari script dibawah ini...mohon bantuannya mastah2...terima kasih sebelumnya
  5.  
  6. <?php
  7. include("sess_check.php");
  8. include("koneksi.php");
  9.  
  10. $id=$sess_pegawaiid;
  11.  
  12.  
  13. $sql_g = "SELECT * FROM employee WHERE npp='$id'";
  14. $ress_g = mysqli_query($conn, $sql_g);
  15. $res = mysqli_fetch_array($ress_g);
  16.  
  17. $sqlb = "SELECT * FROM cuti WHERE npp='$id' AND stt_cuti!='Rejected'";
  18. $ressb = mysqli_query($conn, $sqlb);
  19. $b = mysqli_num_rows($ressb);
  20.  
  21. $sqlc = "SELECT * FROM cuti WHERE npp='$id' AND stt_cuti='Rejected'";
  22. $ressc = mysqli_query($conn, $sqlc);
  23. $c = mysqli_num_rows($ressc);
  24.  
  25. $sqla = "SELECT * FROM cuti WHERE npp='$id' AND hrd_app=1";
  26. $ressa = mysqli_query($conn, $sqla);
  27. $a = mysqli_num_rows($ressa);
  28.  
  29. $sqld = "SELECT jml_cuti FROM cuti WHERE jml_cuti=$jml AND hrd_app=1";
  30. $ressd = mysqli_query($conn, $sqld);
  31. $d = mysqli_num_rows($ressd);
  32.  
  33.  
  34. // deskripsi halaman
  35. $pagedesc = "Beranda";
  36. include("layout_top.php");
  37. include("dist/function/format_rupiah.php");
  38. ?>
  39. <!-- top of file -->
  40. <!-- Page Content -->
  41. <div id="page-wrapper">
  42. <div class="container-fluid">
  43. <div class="row">
  44. <div class="col-lg-12">
  45. <form class="form-horizontal">
  46. <div class="panel panel-default">
  47. <div class="panel-body">
  48. <h2 align="center">Selamat Datang, <?php echo $res['nama_emp'];?>!</h2>
  49. <hr/>
  50. <center><img src="../foto/<?php echo $res['foto_emp']?>" width="120px"></center>
  51. <hr/>
  52. </div>
  53. </div><!-- /.panel -->
  54. </form>
  55. </div><!-- /.col-lg-12 -->
  56. </div><!-- /.row -->
  57.  
  58. <div class="row">
  59. <div class="col-lg-4 col-md-4">
  60. <div class="panel panel-primary">
  61. <div class="panel-heading">
  62. <div class="row">
  63. <div class="col-xs-3">
  64. <i class="fa fa-check-circle fa-3x"></i>
  65. </div>
  66. <div class="col-xs-9 text-right">
  67. <div class="huge"><?php echo $a; ?></div>
  68. <div><h4>Approved</h4></div>
  69. </div>
  70. </div>
  71. </div>
  72. <a href="cuti_app.php">
  73. <div class="panel-footer">
  74. <span class="pull-left">Lihat Rincian</span>
  75. <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
  76. <div class="clearfix"></div>
  77. </div>
  78. </a>
  79. </div>
  80. </div><!-- /.panel-green -->
  81.  
  82. <div class="col-lg-4 col-md-4">
  83. <div class="panel panel-yellow">
  84. <div class="panel-heading">
  85. <div class="row">
  86. <div class="col-xs-3">
  87. <i class="fa fa-plus-circle fa-3x"></i>
  88. </div>
  89. <div class="col-xs-9 text-right">
  90. <div class="huge"><?php echo $b; ?></div>
  91. <div><h4>Menunggu Approval</h4></div>
  92. </div>
  93. </div>
  94. </div>
  95. <a href="cuti_waitapp.php">
  96. <div class="panel-footer">
  97. <span class="pull-left">Lihat Rincian</span>
  98. <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
  99. <div class="clearfix"></div>
  100. </div>
  101. </a>
  102. </div>
  103. </div><!-- /.panel-green -->
  104.  
  105. <div class="col-lg-4 col-md-4">
  106. <div class="panel panel-red">
  107. <div class="panel-heading">
  108. <div class="row">
  109. <div class="col-xs-3">
  110. <i class="fa fa-minus-circle fa-3x"></i>
  111. </div>
  112. <div class="col-xs-9 text-right">
  113. <div class="huge"><?php echo $c; ?></div>
  114. <div><h4>Rejected</h4></div>
  115. </div>
  116. </div>
  117. </div>
  118. <a href="cuti_reject.php">
  119. <div class="panel-footer">
  120. <span class="pull-left">Lihat Rincian</span>
  121. <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
  122. <div class="clearfix"></div>
  123. </div>
  124. </a>
  125. </div>
  126. </div><!-- /.panel-green -->
  127.  
  128. <div class="col-lg-12 col-md-12">
  129. <div class="panel panel-orange">
  130. <div class="panel-heading">
  131. <div class="row">
  132. <div class="col-xs-3">
  133. <i class="fa fa-paperclip fa-3x"></i>
  134. </div>
  135. <div class="col-xs-9 text-right">
  136. <div class="huge"><?php echo $d-$a; ?></div>
  137. <div><h4>Sisa Cuti</h4></div>
  138. </div>
  139. </div>
  140. </div>
  141. <a href="cuti_reject.php">
  142. <div class="panel-footer">
  143. <span class="pull-left">Lihat Rincian</span>
  144. <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
  145. <div class="clearfix"></div>
  146. </div>
  147. </a>
  148. </div>
  149. </div><!-- /.panel-green -->
  150.  
  151. </div><!-- /.row -->
  152.  
  153. </div><!-- /.container-fluid -->
  154. </div><!-- /#page-wrapper -->
  155. <!-- bottom of file -->
  156. <?php
  157. include("layout_bottom.php");
  158. ?>
  159.  

Ada 8 Jawaban

PHPMU.COM Support
commented on 20 Apr 2020 10:29:39
  1. Assalamualaikum,.. sertakan printscreen,
  2. dan jelaskan sisa apa yang dimaksud disini,
  3. dan sertakan juga hasil yang mau diinginkan seperti apa.
Rafisqy Adhideva
commented on 20 Apr 2020 13:34:21
  1. Assalamualaikum,..
  2.  
  3.  
  4. berikut terlampir printscreen aplikasinya mastah,
  5. sy ingin menampilkan sisa cuti yg dilingkari merah itu hasil dari jumlah cuti yg diinput admin dikurangi jumlah yg di approved mastah tp kok hasilnya selalu gitu...mohon pencerahan dan bimbingannya mastah...terima kasih sebelumnya...
Terdapat 2 File dilampirkan :
1. print011.jpg (152 KB)
2. print021.jpg (106 KB)
Hardiansyah
commented on 20 Apr 2020 14:18:21
  1. Assalamualaikum,..
  2. $sqld = "SELECT jml_cuti FROM cuti WHERE jml_cuti=$jml AND hrd_app=1"; dirubah menjadi
  3. $sqld = "SELECT jml_cuti FROM cuti WHERE npp='$id'";
Rafisqy Adhideva
commented on 20 Apr 2020 14:42:30
  1. Assalamualaikum,..
  2.  
  3. Masih gini itu hasilnya mastah...mohon bimbingannya...
Terdapat 1 File dilampirkan :
1. print03.jpg (140 KB)
Hardiansyah
commented on 20 Apr 2020 14:50:16
  1. Assalamualaikum,..
  2. $sqld = "SELECT jml_cuti FROM cuti WHERE npp='$id'";
  3. $ressd = mysqli_query($conn, $sqld);
  4. while ($de = mysqli_fetch_array($ressd)) { $d = $de['jml_cuti']; }
Rafisqy Adhideva
commented on 20 Apr 2020 15:17:56
  1. Assalamualaikum,..
  2.  
  3. Masih seperti ini mastah @hardiansyah...sy sertakan printscreen dan mentahannya...mohon pencerahannya mastah
Terdapat 4 File dilampirkan :
1. print04.jpg (138 KB)
2. db_cuti(1).zip (1 KB)
3. karyawan_edit.zip (1 KB)
4. index2.zip (1 KB)
Hardiansyah
commented on 20 Apr 2020 15:53:37
Salah satu jawaban terbaik,..
  1. $sqld = "SELECT jml_cuti FROM cuti WHERE npp='$id'";
  2. diganti
  3. $sqld = "SELECT jml_cuti FROM employee WHERE npp='$id'";
Rafisqy Adhideva
commented on 20 Apr 2020 16:36:32
  1. Assalamualaikum,..
  2.  
  3. Terima kasih mastah @hardiansyah...it's work...
Terdapat 1 File dilampirkan :
1. SalutingEmoji.jpg (20 KB)
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online