<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Export Excel Laporan Absensi
 * File   : export_excel.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

$tgl1 = $_GET['tgl1'];
$tgl2 = $_GET['tgl2'];

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Laporan_Absensi_".$tgl1."_sd_".$tgl2.".xls");

$query = mysqli_query($conn,"
SELECT
a.*,
s.nis,
s.nama_siswa,
k.nama_kelas

FROM absensi a

LEFT JOIN siswa s
ON a.id_siswa=s.id_siswa

LEFT JOIN kelas k
ON s.id_kelas=k.id_kelas

WHERE a.tanggal BETWEEN '$tgl1' AND '$tgl2'

ORDER BY
a.tanggal ASC,
s.nama_siswa
?>

<h2 align="center">

LAPORAN ABSENSI SISWA

</h2>

<p>

Periode :

<?= date('d-m-Y',strtotime($tgl1)); ?>

s/d

<?= date('d-m-Y',strtotime($tgl2)); ?>

</p>

<table border="1">

<thead>

<tr style="background:#D9EAD3;">

<th>No</th>

<th>Tanggal</th>

<th>NIS</th>

<th>Nama Siswa</th>

<th>Kelas</th>

<th>Jam Masuk</th>

<th>Jam Pulang</th>

<th>Status</th>

</tr>

</thead>

<tbody>

<?php

$no=1;

while($row=mysqli_fetch_assoc($query)){

?>

<tr>

<td align="center">

<?= $no++; ?>

</td>

<td>

<?= date('d-m-Y',strtotime($row['tanggal'])); ?>

</td>

<td>

<?= $row['nis']; ?>

</td>

<td>

<?= $row['nama_siswa']; ?>

</td>

<td>

<?= $row['nama_kelas']; ?>

</td>

<td align="center">

<?= $row['jam_masuk']; ?>

</td>

<td align="center">

<?= empty($row['jam_pulang']) ? '-' : $row['jam_pulang']; ?>

</td>

<td align="center">

<?= $row['status']; ?>

</td>

</tr>

<?php

}

?>

</tbody>

</table>