function cektindak($nis) { // cek masuk sanksi yang manakan ia $poin = cekpoin($nis); $q = mysql_query("select * from sanksi order by minimal desc"); while ($d = mysql_fetch_array($q)) { $id = $d['id']; $sql = "select true from sanksi where '{$poin}'>=minimal and '{$poin}'<=maksimal and id='{$id}'"; $q2 = mysql_query($sql); $d2 = mysql_fetch_array($q2); $cek = $d2['TRUE']; if ($cek == 1) { // input ke tabel tindak $uuid = id(); mysql_query("insert into tindak(id,idsiswa,idsanksi,buat) values('{$uuid}','{$nis}','{$id}',now())"); } } }
<td><?php echo $d['idsiswa']; ?> </td> </tr> <tr> <td>Nama</td> <td><?php echo konvert2('siswa', 'nis', $d['idsiswa'], 'nama'); ?> </td> </tr> <tr> <td>Total Poin</td> <td><?php echo cekpoin($d['idsiswa']); ?> </td> </tr> <tr> <td>Sanksi</td> <td><?php echo konvert('sanksi', $d['idsanksi'], 'nama'); ?> </td> </tr> <input type="hidden" name="idtindak" id="inputIdtindak" class="form-control" value="<?php echo $id; ?> "> <tr>
<td><a href="?hal=detail_pelanggaran&nis=<?php echo $dt['nis']; ?> &ref=<?php echo $_GET['hal']; ?> "><?php echo konvert2('siswa', 'nis', $dt['nis'], 'nama'); ?> </a></td> <td class="text-center"><?php echo cekpelanggaran($dt['nis']); ?> </td> <td class="text-center"><?php echo cekpoin($dt['nis']); ?> </td> </tr> <?php $o++; } ?> </tbody> </table> </div> <script> var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var barChartData = { labels : [<?php foreach ($ds as $d) {