Advertisement
Guest User

fachrel

a guest
Jun 29th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. <?php
  2. include "config/koneksi.php";
  3. include "config/fungsi_indotgl.php";
  4. include "config/class_paging.php";
  5. include "config/kode_auto.php";
  6. include "config/fungsi_combobox.php";
  7. include "config/fungsi_nip.php";
  8. date_default_timezone_set('Asia/Jakarta');
  9.  
  10. if ($_SESSION['leveluser']=='3'){
  11. if($_GET['module']=="absensi"){
  12. include "modul/absensi/absensi.php";
  13. }
  14. else if($_GET['module']=="pegawai"){
  15. include "modul/pegawai/pegawai.php";
  16. }
  17. }
  18.  
  19. if ($_SESSION['leveluser']=='1'){
  20. if($_GET['module']=="home"){
  21. $tgl = date('Y-m-d');
  22. $per=explode('-',$tgl);
  23. $hri=$per[2];
  24. $bln=$per[1];
  25. $thn=$per[0];
  26. $tampil=mysql_query("select * from absensi where Year(tanggal_absen)=$thn and Month(tanggal_absen)=$bln and Day(tanggal_absen)=$hri");
  27. echo "<div class='home'>
  28. <div class='center'><h2 class='head'>Pegawai Yang Masuk Hari Ini</h2></div>
  29. <center><h1>".tgl_indo($tgl)."</h1></center>
  30. <table class='tabel'>
  31. <thead>
  32. <tr>
  33. <td>Nama</td>
  34. <td>Jam Masuk</td>
  35. <td>Jam Keluar</td>
  36. <td>Status</td>
  37. <td>Keterangan</td>
  38. </tr>
  39. </thead>";
  40.  
  41. while($dt=mysql_fetch_array($tampil)){
  42. $ni = $dt[nip];
  43. $nama = mysql_query("select * from pegawai where nip=$ni");
  44. $nma = mysql_fetch_array($nama);
  45. ?>
  46.  
  47. <tr>
  48. <td><?php echo $nma[nama]; ?></td>
  49. <td><?php echo $dt[jam_masuk]; ?></td>
  50. <td><?php echo $dt[jam_keluar]; ?></td>
  51. <td><?php echo $dt[status_masuk]; ?></td>
  52. <td><?php echo $dt[ket]; ?></td>
  53. </tr>
  54.  
  55. <?php }
  56.  
  57. echo "</table>
  58. </div><br><br><br><br><br><br><br><br><br><br><br>";
  59. }
  60. ///==================================================================================
  61. else if($_GET['module']=="bagian"){
  62. include "modul/bagian/bagian.php";
  63. }
  64. ///==================================================================================
  65. else if($_GET['module']=="jabatan"){
  66. include "modul/jabatan/jabatan.php";
  67. }
  68. ///==================================================================================
  69. else if($_GET['module']=="pegawai"){
  70. include "modul/pegawai/pegawai.php";
  71. }
  72. ///==================================================================================
  73. else if($_GET['module']=="lap_absensi"){
  74. echo "<div>
  75. <h2 class='head'>LAPORAN ABSENSI PER-PERIODE</h2>
  76. <form action='laporan_absensi.php' method='POST' target='_blank'>";
  77. combonamabln(1, 12, bulan, 1);
  78. $now = date("Y");
  79. combothn(2015, $now, tahun, 1);
  80. echo"<input type=submit name=submit value=Tampilkan></form>
  81. </div>";
  82. }
  83. ///==================================================================================
  84. else if($_GET['module']=="kehadiran"){
  85.  
  86. $tamp=mysql_query("select * from pegawai order by nama asc");
  87.  
  88. echo "<div>
  89. <h2 class='head'>LAPORAN ABSENSI PER-PERIODE</h2>
  90. <form method='POST' target='_blank'>
  91. <select name=nama>";
  92.  
  93. while($dt=mysql_fetch_array($tamp)){
  94. echo "<option value=$dt[nip] >$dt[nama]</option>";
  95. }
  96.  
  97. echo "</select>
  98. <select name=bln>
  99. <option value=01 >Januari</option>
  100. <option value=02 >Februari</option>
  101. <option value=03 >Maret</option>
  102. <option value=04 >April</option>
  103. <option value=05 >Mei</option>
  104. <option value=06 >Juni</option>
  105. <option value=07 >Juli</option>
  106. <option value=08 >Agustus</option>
  107. <option value=09 >September</option>
  108. <option value=10 >Oktober</option>
  109. <option value=11 >November</option>
  110. <option value=11 >Desember</option>
  111. </select>
  112.  
  113. <select name=thn>";
  114.  
  115. $now = date("Y");
  116. $thn = 2015;
  117. for($l=$thn; $l<=$now; $l++)
  118. {
  119. echo"<option value=$l >$l</option>";
  120. }
  121.  
  122. echo "</select>
  123.  
  124. <input type=submit name=submit value=Tampilkan></form>
  125. </div>";
  126.  
  127. $nip = $_POST['nama'];
  128. $bln = $_POST['bln'];
  129. $thn = $_POST['thn'];
  130.  
  131. if(isset($_POST["submit"]))
  132. header('location: laporan_kehadiran.php?nip='.$nip.'&bln='.$bln.'&thn='.$thn.'');
  133. }
  134. ///==================================================================================
  135. else
  136. {
  137. header('location:media.php?module=home');
  138. }
  139. }
  140.  
  141. if ($_SESSION['leveluser']=='2'){
  142. if($_GET['module']=="lap_absensi"){
  143. include "menu_laporan.php";
  144. }
  145.  
  146. }
  147.  
  148. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement