include_once 'class_konversi.php'; $seem = new Konversi(); $res = $mysqli->query("SELECT * FROM jadwal"); while ($row = $res->fetch_object()) { ?> <tr> <td><?php echo $no; ?> </td> <td><?php echo $row->id_jadwal; ?> </td> <td><?php echo $seem->cetak_bulan($row->bln); ?> </td> <td><?php echo $row->thn; ?> </td> <td><?php echo $seem->nama_admin($row->id_admin); ?> </td> <td> <?php echo "<a href='cetak_jadwal.php?idjdw={$row->id_jadwal}' target='_blank'><button type='button' class='btn btn-primary'>Cetak</button></a> "; // $adm = $mysqli->query("SELECT id FROM admin WHERE username='******'"); // $res2 = $adm->fetch_assoc();
// echo "batas salah"; $bts_shift = 1; break; } } include_once 'class_konversi.php'; $ambln = new Konversi(); $cekjad = $mysqli->query("SELECT bln, thn FROM jadwal WHERE bln='{$bln}' AND thn='{$thn}'"); $res2 = $cekjad->num_rows; if ($res2 == 1) { ?> <script> swal({ title: "Oops, terjadi kesalahan!", text: "Jadwal <?php echo $ambln->cetak_bulan($bln) . ' ' . $thn; ?> sudah ada. Harap hapus terlebih dahulu untuk membuat yang baru.", type: "error" }, function(){ window.location.replace("main.php?page=1"); }); </script> <?php } elseif ($bts_shift > 0) { echo "<script>\n swal({\n title: 'Oops, terjadi kesalahan!',\n text: 'Batas shift minimal tidak boleh lebih besar dari batas shift maksimal',\n type: 'error'\n }, function(){\n window.location.replace('main.php?page=1');\n });\n </script>"; // $bts_shift = 0; } else { $thnbln = $thn . "-" . $bln; include_once "class_algen.php"; $saya = new Algen($bln, $thn, $minshift, $maxshift, $pola);
<td></td> <td></td> <td colspan="28"><h2>JADWAL DINASAN PETUGAS PAM STASIUN SUDIMARA</h2></td> </tr> </table> <table border="1" class="tab-ok"> <tr> <th rowspan="2">No.</th> <th rowspan="2">NAMA</th> <th rowspan="2">JABATAN </th> <th rowspan="2">NIK</th> <?php include_once 'class_konversi.php'; $getd = new Konversi(); echo "<th colspan='" . count($jadwal[0]) . "'>BULAN " . $getd->cetak_bulan(substr($kd_jdw, 1, 2)) . " " . substr($kd_jdw, 3, 4) . "</th>"; echo "<th rowspan='2'>HADIR</th></tr><tr>"; $tahun = substr($kd_jdw, 3, 4); $bulan = substr($kd_jdw, 1, 2); for ($j = 0; $j < count($jadwal[0]); $j++) { $hari = $tahun . "-" . $bulan . "-" . ($j + 1); $date1 = strtotime($hari); $date2 = date("l", $date1); if ($date2 == "Sunday") { echo "<th style='color: red;'>" . ($j + 1) . "</th>"; } else { echo "<th>" . ($j + 1) . "</th>"; } } ?>