Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <center><h3>Form Input SPP Perkelas</h3></center>
- <form method="POST" action="./dXBkYXRlX2lucHV0X3NwcA.htm" >
- <table class="table table-hover">
- <?php
- //bulan
- $bulangasal = array("juli","agustus","september","oktober","nopember","desember");
- $bulangenap = array("januari","februari","maret","april","mei","juni");
- //select semester
- $semes = mysql_fetch_array(mysql_query("SELECT kode, ket_smstr FROM semester WHERE aktif='aktif'"))or die(mysql_error());
- $kode = $semes['kode'];
- $status = $semes['ket_smstr'];
- //mencaritahu gasal atau genap
- $s = explode($status, " ");
- $g = $s[0];
- ?>
- <thead>
- <tr>
- <th>NIS</th>
- <th>Nama</th>
- <?php
- //buat bulan
- if($g == 'Gasal'){
- for($n=0; $n<6; $n++){
- echo "<th>".ucfirst($bulangasal[$n])."</th>";
- }
- }else{
- for($n=0; $n<6; $n++){
- echo "<th>".ucfirst($bulangenap[$n])."</th>";
- }
- }
- ?>
- </tr>
- </thead>
- <tbody>
- <?php
- $siswa = mysql_query("SELECT nis, nama FROM student WHERE id_kelas='".$_POST['kelas']."'");
- while ($s = mysql_fetch_array($siswa)) {
- echo "<tr>
- <td>".$s['nis']."</td>
- <td>".$s['nama']."</td>";
- for($a=0; $a<6; $a++){
- //query untuk valuenya
- $h = mysql_num_rows(mysql_query("SELECT * FROM keu_$kode WHERE nis='".$s['nis']."'"));
- if($h = '0'){
- $value = '0';
- $cek = 'checked';
- }else{
- $keu = mysql_fetch_array(mysql_query("SELECT * FROM keu_$kode WHERE nis='".$s['nis']."'"))or die(mysql_error());
- //gasal
- if($g == 'Gasal'){
- for($n=0; $n<6; $n++){
- if ($keu[$bulangasal[$n]] == '1') {
- $value = '1';
- $cek = 'checked';
- }else{
- $value = '0';
- $cek = '';
- }
- }
- }else{
- for($n=0; $n<6; $n++){
- if ($keu[$bulangenap[$n]] == '1') {
- $value = '1';
- $cek = 'checked';
- }else{
- $value = '0';
- $cek = '';
- }
- }
- }
- }
- echo "<td>
- <label class='checkbox'>
- <input type='checkbox' name='input[]' value='$value' $cek>
- </label>
- </td>";
- }
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- <center><button class="btn"><i class="icon-info-sign"></i> Input SPP</button></center>
- </form>
- ------------------------------------------------------------------------------------------------------------------------
- <form method="POST" action="./dXBkYXRlX2lucHV0X3NwcA.htm" >
- <table class="table table-hover">
- <thead>
- <tr>
- <th>NIS</th>
- <th>Nama</th>
- <th>Januari</th><th>Februari</th><th>Maret</th><th>April</th><th>Mei</th><th>Juni</th> </tr>
- </thead>
- <tbody>
- <tr>
- <td>1234</td>
- <td>Biancha</td>
Advertisement
Add Comment
Please, Sign In to add comment