<?php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
define('EOL', PHP_SAPI == 'cli' ? PHP_EOL : '<br \\>');
include "../inc/blob.php";
include "../do/class.do.php";
require_once "../inc/PHPExcel.php";
// DEFINE ALL CLASSES
$data = new do_do();
$objExcel = PHPExcel_IOFactory::load("../template-report/each-do.xls");
$objWriter = new PHPExcel_Writer_Excel5($objExcel);
$objOrderedSign = new PHPExcel_Worksheet_Drawing();
$objApprovedSign = new PHPExcel_Worksheet_Drawing();
$id = $_GET['id'];
$layout = $_GET['layout'];
$objExcel->setActiveSheetIndex(0);
// DEFINE STYLES MAY NEED IN EXCEL DOCUMENT
$styleBorder = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN)));
$styleCenter = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER));
// RETRIEVE DATA AND BIND IN VARIABLES
$q = "SELECT `do`.*, `pelanggan`.`noreg`, `pelanggan`.`nama`,`pelanggan`.`alamat`,`karyawan`.`nama` as `nama_karyawan`, `level`.`jabatan`, `area`.`area` AS nama_area FROM `do` \n\t\t\tINNER JOIN `pelanggan` ON `pelanggan`.`id` = `do`.`id_pelanggan`\n\t\t\tINNER JOIN `karyawan` ON `karyawan`.`id` = `do`.`id_karyawan`\n\t\t\tINNER JOIN `level` ON `karyawan`.`level` = `level`.`id` \n\t\t\tINNER JOIN `area` ON `area`.`id` = `do`.`area`\n\t\t\tWHERE `do`.`id` = '{$id}' ";
if ($query = $data->runQuery($q)) {
    while ($rs = $query->fetch_array()) {
        $noDO = $rs['no'];
        $tglDO = $rs['tgl_do'];
        $noreg = $rs['noreg'];
        $nama = $rs['nama'];
        $alamat = $rs['alamat'];
예제 #2
0
     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>";
             }
         }
     }
     break;
 case "isi-daftar-layar":
     include 'layar/class.layar.php';
     $layar = new layar();
     if ($daftar = $layar->getLayar()) {
         while ($rs = $daftar->fetch_array()) {
             echo "<option value='" . $rs['no'] . "' data-harga='" . $rs['harga/m'] . "'>" . $rs['bahan'] . "</option>";
         }
     }
예제 #3
0
<?php

include './do/class.do.php';
$data = new do_do();
$bulan = date("m");
$tahun = date("Y");
switch ($bulan) {
    case "01":
        $namaBulan = "Januari";
        break;
    case "02":
        $namaBulan = "Februari";
        break;
    case "03":
        $namaBulan = "Maret";
        break;
    case "04":
        $namaBulan = "April";
        break;
    case "05":
        $namaBulan = "Mei";
        break;
    case "06":
        $namaBulan = "Juni";
        break;
    case "07":
        $namaBulan = "Juli";
        break;
    case "08":
        $namaBulan = "Agustus";
        break;
예제 #4
0
<?php

if (isset($_POST['apa']) && $_POST['apa'] != "") {
    // include '../inc/tes.php';
    // include 'class.do.php';
    include 'do/class.do.php';
    $data = new do_do();
    switch ($_POST['apa']) {
        case 'help':
            if (isset($_POST['deskripsi']) && isset($_POST['tema']) && isset($_POST['ukuran']) && isset($_POST['jumlah']) && isset($_POST['ket'])) {
                if ($help = $data->runQuery("INSERT INTO `do_help`(`deskripsi`,`id_tema_layar`,`id_ukuran`, `jumlah`,`ket`) VALUES ('" . $_POST['deskripsi'] . "', '" . $_POST['tema'] . "', '" . $_POST['ukuran'] . "', '" . $_POST['jumlah'] . "', '" . $_POST['ket'] . "' ) ")) {
                    $id = $data->lastInsertID();
                    if ($cek = $data->runQuery("SELECT `do_help`.* , `tema_layar`.`tema`,`ukuran`.`pre`,`ukuran`.`panjang`,`ukuran`.`lebar` FROm `do_help` INNER JOIN `tema_layar` ON `tema_layar`.`id`=`do_help`.`id_tema_layar` INNER JOIN `ukuran` ON `ukuran`.`id` = `do_help`.`id_ukuran` WHERE `id` = '" . $id . "'")) {
                        if ($cek->num_rows > 0) {
                            $rs = $cek->fetch_array();
                            echo "<tr>\n\t\t\t\t\t\t\t\t<td>" . $rs['deskripsi'] . "</td>\n\t\t\t\t\t\t\t\t<td>" . $rs['tema'] . "</td>\n\t\t\t\t\t\t\t\t<td>" . $rs['pre'] . " " . $rs['panjang'] . " x " . $rs['lebar'] . "</td>\n\t\t\t\t\t\t\t\t<td>" . $rs['jumlah'] . "</td>\n\t\t\t\t\t\t\t\t<td>" . $rs['ket'] . "</td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>";
                        } else {
                            echo "<script>alert('Gagal menyimpan detail..');</script>";
                        }
                    } else {
                        echo "<script>alert('Gagal menyimpan detail..');</script>";
                    }
                } else {
                    echo "<script>alert('Gagal menyimpan detail..');</script>";
                }
            }
            break;
        case "simpan":
            $arr = array();
            if (isset($_POST['data-detail']) && $_POST['data-detail'] != "" && isset($_POST['idPelanggan']) && $_POST['idPelanggan'] != "" && isset($_POST['tglDO']) && $_POST['tglDO'] != "") {
                $idPelanggan = $_POST['idPelanggan'];
예제 #5
0
<?php

include './do/class.do.php';
$data = new do_do();
$data->runQuery("TRUNCATE TABLE `do_help`");
?>

<div class="container">
	<div class="row">
		<div class="col-md-3"></div>
		<div class="col-md-6">
			<center>
				<h4>Input D.O.</h4>
			</center>
		</div>
		<div class="col-md-3">
			
		</div>
	</div>
	<hr>
	<form action="#" method="POST" id="form-do" name="form-do" >
	<div class="row">
		<div class="col-xs-12">
			
			<div class="form-group">
				<label class="col-sm-9"></label>
				<div class="col-sm-3">
					Search : 
					<select class="form-control" id="cmb-area">
					<?php 
if ($_SESSION['media-status'] == e_code("2") || $_SESSION['media-status'] == e_code("9")) {
<?php

session_start();
include "../inc/blob.php";
include "../do/class.do.php";
require_once "../inc/PHPExcel.php";
$data = new do_do();
$idLogin = $_SESSION['media-id'];
$objExcel = PHPExcel_IOFactory::load("../template-report/all-do.xls");
$objWriter = new PHPExcel_Writer_Excel5($objExcel);
$objPrintedSign = new PHPExcel_Worksheet_Drawing();
$tglAwal = $_GET['tglAwal'];
$tglAkhir = $_GET['tglAkhir'];
$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']) {
예제 #7
0
<?php

include './do/class.do.php';
$data = new do_do();
?>

<div class="container">
	<div class="row">
		<div class="col-md-12">
			<center>
				<h4>ACC D.O.</h4>
			</center>
		</div>
	</div>
	<hr>
	<div class="row">
		<div class="col-md-12">
			<label for="cariTanggal" class="col-sm-2 control-label">Periode DO</label>
			<div class="col-sm-10">
				<div class="col-sm-3"><input type="text" name="tglAwal" id="tglAwal" class="form-control " placeholder="Tanggal Awal"></div>
				<div class="col-sm-3"><input type="text" name="tglAkhir" id="tglAkhir" class="form-control " placeholder="Tanggal Akhir"></div>
				<div class="col-sm-3">
					<select id="cmbArea" class="form-control">
						<?php 
if ($_SESSION['media-status'] == e_code("2") || $_SESSION['media-status'] == e_code("9")) {
    if ($result = $data->runQuery("SELECT `id`, `area` FROM `area` WHERE `hapus` = '0'")) {
        while ($rs = $result->fetch_array()) {
            echo "<option value='" . $rs['id'] . "'>" . $rs['area'] . "</option>";
        }
    }
} else {
예제 #8
0
                     case "3":
                         $status = "Ditolak";
                         break;
                 }
                 array_push($detail, $status);
                 array_push($detail, "<button class='btn btn-sm btn-orange btn-show-detail' id='btn-show-detail' data-id='" . $rs["id"] . "'><i class='fa fa-eye'></i></button>\n\t\t\t\t\t\t\t<button class='btn btn-sm btn-orange btn-cetak-do' id='btn-cetak-do' data-id='" . $rs["id"] . "'><i class='fa fa-print'></i></button>");
                 array_push($collect, $detail);
                 unset($detail);
             }
         }
         echo json_encode(array("data" => $collect));
     }
     break;
 case "cetak-do-daftar-detail-do":
     include 'do/class.do.php';
     $data = new do_do();
     if (isset($_POST['idDO'])) {
         $idDO = $_POST['idDO'];
         $detail = array();
         if ($query = $data->detail_do($idDO)) {
             while ($rs = $query->fetch_array()) {
                 $detail[] = array("deskripsi" => $rs["deskripsi"], "tema" => $rs["tema"], "ukuran" => $rs["pre"] . " " . $rs["panjang"] . " x " . $rs["lebar"], "jml" => $rs["jml"], "ket" => $rs["ket"]);
             }
         }
         echo json_encode($detail);
     }
     break;
 case "cetak-po-daftar-po":
     include 'po/class.po.php';
     $data = new po_po();
     if (isset($_POST['tglAwal']) && isset($_POST['tglAkhir']) && isset($_POST['supplier'])) {