Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id_kelas=$_POST['kelas'];
- $id_ajaran=$_POST['ajaran'];
- $no=0;
- $a=0;
- $b=0;
- $c=0;
- $v=0;
- $y=0;
- $z=0;
- $f=0;
- $g=0;
- $h=0;
- $p=0;
- $e=0;
- ?>
- <?php
- $sql =" select * from tb_detailkelas
- where id_kelas='$id_kelas' and id_ajaran='$id_ajaran'";
- $hasil = mysql_query($sql) ;//or die ("Kesalahan pada perintah SQL!");
- echo mysql_error();
- while ($data=mysql_fetch_array($hasil)){
- ?>
- <tr>
- <td><?php $no; ?> </td>
- <td><?php $data['nis']?></td>
- </tr>
- <?php
- $test=$data['nis'];
- $ARSISWA=array();
- $no++;
- $sql1 =" select * from tb_rapot
- where nis='$test' and id_ajaran='$id_ajaran' order by nilai_rapot desc";
- $hasil1 = mysql_query($sql1) ;
- echo mysql_error();
- while ($data1=mysql_fetch_array($hasil1)){
- ?>
- <tr>
- <td><?php $no; ?> </td>
- <td><?php $data1['nis']?></td>
- <td><?php $data1['nilai_rapot']?></td>
- </tr>
- <?php
- $ARSISWA[$data1['nis']]= $data1['nilai_rapot'];
- }
- ?></table>
- <table>
- <?php
- arsort($ARSISWA);
- $i=0;
- foreach($ARSISWA as $nm=>$val)
- {
- $i++;
- ?><tr><td><?=$i;?></td><td><?=$nm;?></td>
- <td><?=$val;;?></td></tr><?php
- if($i>=3) break;
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement