$arr['status'] = FALSE; $arr['msg'] = "Lengkapi terlebih dahulu.."; } echo json_encode($arr); break; case "daftar-do": if (isset($_POST['tglAwal']) && isset($_POST['tglAkhir'])) { $collect = array(); $tglAwal = $_POST['tglAwal']; $tglAkhir = $_POST['tglAkhir']; if ($_SESSION['media-status'] == e_code("2") || $_SESSION['media-status'] == e_code("9") || $_SESSION['media-level'] == "2") { $area = "%"; } else { $area = $_SESSION['media-area']; } if ($query = $data->daftar_do($area, $_SESSION['media-id'], $tglAwal, $tglAkhir, "%")) { while ($rs = $query->fetch_array()) { $detail = array(); array_push($detail, $rs["no"]); array_push($detail, $rs["tgl_do"]); array_push($detail, $rs["nama"]); array_push($detail, $rs["nama_area"]); switch ($rs["status"]) { case "1": $status = "Diajukan"; break; case "2": $status = "Acc"; break; case "3": $status = "Ditolak";
$data = new po_po(); switch ($_POST['apa']) { case "isi-daftar-supplier": include 'supplier/class.supplier.php'; $supplier = new supplier(); if ($daftar = $supplier->daftar_supplier()) { while ($rs = $daftar->fetch_array()) { echo "<option value='" . $rs['id'] . "'>" . stripslashes($rs['nama']) . ", " . $rs['alamat'] . "</option>"; } } break; case "isi-daftar-do": if (isset($_POST['tglAwal']) && isset($_POST['tglAkhir'])) { include 'do/class.do.php'; $do = new do_do(); if ($daftar = $do->daftar_do("%", "%", $_POST['tglAwal'], $_POST['tglAkhir'], "2")) { while ($rs = $daftar->fetch_array()) { echo "<option value='" . $rs['id'] . "'>" . $rs['no'] . ", " . $rs['tgl_do'] . ", " . stripslashes($rs['nama']) . ", " . $rs['nama_area'] . "</option>"; } } } break; case "isi-daftar-item-do": if (isset($_POST['idDO'])) { include 'do/class.do.php'; $do = new do_do(); if ($daftar = $do->detail_do($_POST['idDO'])) { while ($rs = $daftar->fetch_array()) { echo "<option value='" . $rs[0] . "' data-tema='" . $rs[9] . "' data-pre='" . $rs[14] . "' data-panjang='" . $rs[12] . "' data-lebar='" . $rs[13] . "' data-jml='" . $rs[5] . "'>" . $rs[5] . " " . $rs[9] . ", " . $rs[14] . " " . $rs[12] . " x " . $rs[13] . "</option>"; } }
$area = $_GET['area']; $namaArea = $_GET['namaarea']; $objExcel->setActiveSheetIndex(0); $styleBorder = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN))); $styleCenter = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER)); $q = "SELECT nama, ttd FROM karyawan WHERE id = '{$idLogin}'"; if ($query = $data->runQuery($q)) { while ($rs = $query->fetch_array()) { $printedBy = $rs['nama']; $ttdPrintedBy = $rs['ttd'] != null ? $rs['ttd'] : "-"; } } $objExcel->getActiveSheet()->SetCellValue('C3', $tglAwal . " s/d " . $tglAkhir); $objExcel->getActiveSheet()->SetCellValue('C4', $namaArea); $startRow = 7; if ($query = $data->daftar_do($area, "%", $tglAwal, $tglAkhir, "%")) { while ($rs = $query->fetch_array()) { switch ($rs['status']) { case "1": $status = "Diajukan"; break; case "2": $status = "Acc"; break; case "3": $status = "Ditolak"; break; } $q = "SELECT `do`.*, `karyawan`.`nama` AS `nama_karyawan`, `level`.`jabatan` FROM `do` \n\t\t\t\t\tINNER JOIN `karyawan` ON `karyawan`.`id` = `do`.`acc`\n\t\t\t\t\tINNER JOIN `level` ON `karyawan`.`level` = `level`.`id` \n\t\t\t\t\tWHERE `do`.`id` = '{$rs['0']}'"; if ($qAcc = $data->runQuery($q)) { while ($rsAcc = $qAcc->fetch_array()) {