Advertisement
H4nk

Untitled

Feb 25th, 2013
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1.  
  2. <?php session_start();
  3. if(isset($_SESSION['username'])){
  4. include "conn.php";
  5. $username=$_SESSION['username'];
  6. ?>
  7. <link href="print/css/core.css" rel="stylesheet" media="screen" type="text/css" />
  8.  
  9.  
  10. <script src="print/js/jquery-1.6.2.min.js"></script>
  11.  
  12. <script src="print/js/jquery.PrintArea.js_4.js"></script>
  13.  
  14. <script src="print/js/core.js"></script>
  15.  
  16.  
  17. <a type="submit" href="#" class="print" rel="contentprint"></a>
  18. <a href="home.php?page=laporan_penilaian_admin" class="balik"></a>
  19. <div id="contentprint">
  20. <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
  21. <tr>
  22. <th width="4%" class="table-header-repeat line-left minwidth-1"><a href="">Nomor</a></th>
  23. <th width="12%" class="table-header-repeat line-left minwidth-1"><a href="">Nama Siswa</a></th>
  24. <th width="10%" class="table-header-repeat line-left minwidth-1"><a href="">NIS</a></th>
  25. <th width="16%" class="table-header-repeat line-left minwidth-1"><a href="">Nama Guru</a></th>
  26. <th width="10%" class="table-header-repeat line-left"><a href="">Kelas</a></th>
  27. <th width="26%" class="table-header-repeat line-left"><a href="">Mata Pelajaran</a></th>
  28. <th width="9%" class="table-header-options line-left"><a href="">Nilai Angka</a></th>
  29. <th width="9%" class="table-header-options line-left"><a href="">Nilai Huruf</a></th>
  30.  
  31. </tr>
  32.  
  33. <?php
  34.  
  35. if(isset($_POST['submit'])){
  36.  
  37. $id_guru=htmlentities($_POST['id_guru']);
  38. $id_siswa=htmlentities($_POST['id_siswa']);
  39. $id_pelajaran=htmlentities($_POST['id_pelajaran']);
  40. $id_kelas=htmlentities($_POST['id_kelas']);
  41.  
  42.  
  43. if($id_guru!=="0"){
  44. $filter_guru="and nilai.id_guru='$id_guru'";
  45. }else{
  46. $filter_guru="";
  47. }
  48.  
  49. if($id_siswa!=="0"){
  50. $filter_siswa="and nilai.id_siswa='$id_siswa'";
  51. }else{
  52. $filter_siswa="";
  53. }
  54.  
  55. if($id_pelajaran!=="0"){
  56. $filter_pelajaran="and nilai.id_pelajaran='$id_pelajaran'";
  57. }else{
  58. $filter_pelajaran="";
  59. }
  60.  
  61. if($id_kelas!=="0"){
  62. $filter_kelas="and nilai.id_kelas='$id_kelas'";
  63. }else{
  64. $filter_kelas="";
  65. }
  66.  
  67. }else{
  68. unset($_POST['submit']);
  69. }
  70.  
  71.  
  72. $view=mysql_query("SELECT nama_siswa, nis, nama_guru, nip, nama_kelas, nama_pelajaran, nilai FROM tbl_nilai nilai, data_siswa siswa, setup_pelajaran pelajaran, setup_kelas kelas, data_guru guru WHERE nilai.id_siswa=siswa.id_siswa and nilai.id_kelas=kelas.id_kelas and nilai.id_pelajaran=pelajaran.id_pelajaran and nilai.id_guru=guru.id_guru $filter_guru $filter_siswa $filter_pelajaran $filter_kelas order by siswa.nama_siswa asc");
  73.  
  74. $i = 1;
  75. while($row=mysql_fetch_array($view)){
  76. ?>
  77. <tr>
  78. <td><?php echo $i;?></td>
  79. <td><?php echo $row['nama_siswa'];?></td>
  80. <td><?php echo $row['nis'];?></td>
  81. <td><?php echo $row['nama_guru'];?></td>
  82. <td><?php echo $row['nama_kelas'];?></td>
  83. <td><?php echo $row['nama_pelajaran'];?></td>
  84. <td><?php echo $row['nilai'];?></td>
  85. <td><?php $nilaihuruf = $row['nilai'];
  86. if ( $nilaihuruf >= 85 )
  87. {
  88. echo "A";
  89. }
  90. elseif ( $nilaihuruf >= 75 )
  91. {
  92. echo "B";
  93. }
  94. elseif ( $nilaihuruf >= 65 )
  95. {
  96. echo "C";
  97. }
  98. elseif ( $nilaihuruf >= 55 )
  99. {
  100. echo "D";
  101. }
  102. else
  103. {
  104. echo "E";
  105. }
  106. ?></td>
  107. </tr>
  108. <?php
  109. $i++;
  110. }
  111. $jumSis = $i-1;
  112. ?>
  113. </table>
  114.  
  115. <?php
  116. }else{
  117. session_destroy();
  118. header('Location:index.php?status=Silahkan Login');
  119. }
  120. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement