<table id="table-data" class="table table-bordered table-striped"> <thead> <tr> <th>No.</th> <th>ID Jadwal</th> <th>Bulan</th> <th>Tahun</th> <th>Dibuat Oleh</th> <th>Aksi</th> </tr> </thead> <tbody> <?php $no = 1; 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); ?>
// $res = $query->fetch_object(); $bln = $_POST['selbulan']; $thn = $_POST['seltahun']; $pola = $_POST['selpola']; $minshift = $_POST['min']; $maxshift = $_POST['max']; $bts_shift = 0; for ($p = 0; $p < 10; $p++) { if ($minshift[$p] > $maxshift[$p]) { // 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"); });
<td></td> <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>"; } } ?>