コード例 #1
0
function WOFABGenerate($PROJECT_NO, $conn)
{
    $kdAwal = "FAB.WO." . $PROJECT_NO . ".";
    $MaxKd = SingleQryFld("SELECT MAX(FAB_NO) FROM MST_FABR WHERE FAB_NO like '{$kdAwal}%'", $conn);
    // echo "MAK ID = $MaxKd <br>";
    $NextId = intval(str_replace($kdAwal, "", $MaxKd)) + 1;
    // echo "$NextId<br>";
    return $kdAwal . str_pad($NextId, 4, "0", STR_PAD_LEFT);
}
コード例 #2
0
function PO_NO_generate($type_po, $datePO, $grandtot, $conn)
{
    $newDatePO = new dateTime($datePO);
    $kdAwal = $newDatePO->format('md-');
    $kdAwal_thn = $newDatePO->format('y');
    $grandtot = floatval($grandtot);
    // }
    if ($type_po == 'NONVAT') {
        $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 50 AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 50 AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        if ($grandtot > 3000000) {
            $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
            $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        }
    } else {
        $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 50 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 50 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
    }
    $emptyPO = SingleQryFld($emptyPOSQL, $conn);
    if ($emptyPO != "") {
        return $emptyPO;
    } else {
        //     echo "$cekPOIdSql<br>";
        $cekPOIdParse = oci_parse($conn, $cekPOIdSql);
        //oci_bind_by_name($cekPOIdParse, ":PONOMAX", $poNo);
        oci_execute($cekPOIdParse);
        $cekPOId = oci_fetch_array($cekPOIdParse)[0];
        // echo "$cekPOId - $type_po";
        if ($cekPOId == "" and $type_po == "VAT") {
            $num = 1;
            $num = str_pad($num, 2, "0", STR_PAD_LEFT);
        } elseif ($cekPOId == "" and $type_po == "NONVAT") {
            if ($grandtot > 3000000) {
                $num = 71;
            } else {
                $num = 51;
            }
        } else {
            $num = substr($cekPOId, 5);
            $num = substr($num, 0, -7);
            $num++;
            $num = str_pad($num, 2, "0", STR_PAD_LEFT);
        }
        //echo "$num";
        return $kdAwal . $num . '/WEN/' . $kdAwal_thn;
    }
}
コード例 #3
0
while ($row = oci_fetch_array($dateParse)) {
    echo "<th style='border: 1px ridge black;' class='text-center'>{$row['TANGGAL']}</th>";
    array_push($arrayTangal, $row['TANGGAL']);
}
?>
                <th style="border: 1px ridge black;" class='text-center'>TOTAL</th>
            </tr>
        </thead>
        <tbody> 
            <?php 
$sql = "SELECT DISTINCT INV_ID, INV_DESC " . "FROM MASTER_INV@WELTESMART_WENLOGINV_LINK " . "WHERE INV_WM_SELECT = '1' " . "ORDER BY INV_DESC ASC";
$parse = oci_parse($conn, $sql);
oci_execute($parse);
while ($row1 = oci_fetch_array($parse)) {
    $total = 0;
    echo "<tr>";
    echo "<td style='border: 1px ridge black;'>{$row1['INV_DESC']}</td>";
    for ($index = 0; $index < count($arrayTangal); $index++) {
        $querySQl = "SELECT nvl(SUM( MART_WR_INV_QTY),0) " . "FROM MART_CHECKOUT_INFO " . "WHERE MART_WR_JOB = '{$job}' " . "AND TO_CHAR(MART_WR_DATE, 'DD-MM-YYYY') = '{$arrayTangal[$index]}' " . "AND MART_WR_INV_ID = '{$row1['INV_ID']}'";
        $query = intval(SingleQryFld("{$querySQl}", $conn));
        echo "<td style='border: 1px ridge black;'>{$query}</td>";
        $total += intval($query);
    }
    echo "<td style='border: 1px ridge black;'>{$total}</td>";
    echo "</tr>";
}
?>
        </tbody>
    </table>
</div>
コード例 #4
0
                    <th class="text-center">Profile</th>
                    <th class="text-center">Unit<br>WT/Surf</th>
                    <th class="text-center">Tgl Akhir<br>Kirim</th>
                </tr>
            </thead>         

            <tbody>
                <?php 
$query = "SELECT * FROM MASTER_DRAWING WHERE PROJECT_NAME = :projectName AND SUBCONT_STATUS = 'NOTASSIGNED' AND DWG_STATUS = 'ACTIVE' ORDER BY HEAD_MARK ASC";
//echo $query;
$result = oci_parse($conn, $query);
oci_bind_by_name($result, ":projectName", $projectName);
oci_execute($result);
$j = 0;
while ($row = oci_fetch_array($result)) {
    $qtyAssgment = SingleQryFld("SELECT SUM(UNIT_QTY) AS ASSIGN_QTY FROM FABRICATION WHERE PROJECT_NAME = '{$projectName}' AND HEAD_MARK = '" . $row['HEAD_MARK'] . "'", $conn);
    // echo "SELECT SUM(UNIT_PCK_QTY) FROM DTL_PACKING WHERE HEAD_MARK='".$row['HEAD_MARK']."'<br>";
    $Qty = intval($row['TOTAL_QTY'] - $qtyAssgment);
    ?>
                    <tr>
                        <td style="text-align: center;" class="text-center">
                            <?php 
    if ($row['PPIC_CHECK'] == '0') {
        ?>
                                <label class="label label-danger">Not Approve</label>
                            <?php 
    } else {
        ?>
                                <a href="#lblHM" class="btn btn-success btn-sm" onclick="AddROW('<?php 
        echo $j;
        ?>
 $v = str_replace(" ", "", $row['HEAD_MARK']);
 $perHruf = "";
 $str_HM = "";
 $int_HM = "";
 for ($i = 0; $i < strlen($v); $i++) {
     $perHruf = substr($v, $i, 1);
     if (is_numeric($perHruf)) {
         $int_HM .= $perHruf;
     } else {
         $str_HM .= $perHruf;
     }
 }
 $fnal_HM = $str_HM . sprintf("%'#4s", $int_HM);
 $fnal_HM = str_replace("#", "&nbsp;", $fnal_HM);
 $OPNAME_FAB = SingleQryFld("SELECT nvl(SUM(TOTAL_QTY),0) FROM DTL_OPNAME WHERE HEAD_MARK = '{$row['HEAD_MARK']}'", $conn);
 $OPNAME_PNT = SingleQryFld("SELECT nvl(SUM(OPNAME_QTY),0) FROM DTL_OPNAME_PNT WHERE HEAD_MARK = '{$row['HEAD_MARK']}'", $conn);
 echo '<tr>';
 echo '<td>' . $row['HEAD_MARK'] . '</td>';
 echo '<td>' . $row['COMP_TYPE'] . '</td>';
 echo '<td>' . $row['PROFILE'] . '</td>';
 echo '<td>' . $row['TOTAL_QTY'] . '</td>';
 echo '<td>' . $row['WEIGHT'] . '</td>';
 echo '<td>' . $row['GR_WEIGHT'] . '</td>';
 echo '<td>' . round($row['SURFACE'] * $row['TOTAL_QTY'], 2) . '</td>';
 echo '<td>' . round($row['WEIGHT'] * $row['TOTAL_QTY'], 2) . '</td>';
 echo '<td>' . round($row['GR_WEIGHT'] * $row['TOTAL_QTY'], 2) . '</td>';
 echo '<td>' . $row['LENGTH'] . '</td>';
 echo '<td>' . $ASG_qty . '</td>';
 echo '<td>' . $SUBCON_info . '</td>';
 echo '<td>' . $SPV_info . '</td>';
 echo '<td>' . $QC_INSP_info . '</td>';
コード例 #6
0
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$this_thurday = strtotime('thursday this week');
$last_thursday = strtotime("last Thursday", $this_thurday);
$last_thursday = date("d-m-Y", $last_thursday);
$job = $_POST['job'];
$subjob = $_POST['subjob'];
$subcont = rtrim($_POST['subcont']);
$tanggal = rtrim($_POST['tanggal']);
$query = "SELECT MAX(DISTINCT(OPN_PERIOD))+1 FROM MST_OPNAME WHERE PROJECT_NO = '{$job}' AND SUBCONT_ID = '{$subcont}' AND to_date(TO_CHAR(OPN_ACT_DATE, 'DD-MM-YYYY'), 'dd-mm-yyyy') <= to_date('{$last_thursday}', 'dd-mm-yyyy')";
//echo "$query";
$newPeriode = SingleQryFld("{$query}", $conn);
if ($newPeriode == "") {
    $newPeriode = 1;
}
$subjobInit = SingleQryFld("SELECT PROJECT_CODE FROM VW_PROJ_INFO WHERE PROJECT_NAME_OLD = '{$subjob}'", $conn);
$subcontInit = SingleQryFld("SELECT SUBCONT_CODE FROM SUBCONTRACTOR WHERE SUBCONT_ID = '{$subcont}'", $conn);
$OPNAME_IDX = "{$job}-{$subjobInit}-{$subcontInit}-{$newPeriode}-{$tanggal}";
$OPNAME_ID = str_replace(" ", "", $OPNAME_IDX);
$finalOpnameSql = "SELECT VSOR.* FROM VW_SHOW_OPNAME_PRC VSOR WHERE VSOR.PROJECT_NAME = :PROJNAME " . "AND VSOR.SUBCONT_ID = :SUBCONT AND VSOR.QCPASS <> 0 AND VSOR.QCPASS <> VSOR.QTY_OPN ORDER BY VSOR.HEAD_MARK";
//echo "$finalOpnameSql";
$finalOpnameParse = oci_parse($conn, $finalOpnameSql);
oci_bind_by_name($finalOpnameParse, ":PROJNAME", $subjob);
oci_bind_by_name($finalOpnameParse, ":SUBCONT", $subcont);
oci_execute($finalOpnameParse);
?>
<div class="col-sm-12">
    <table id="opnameSource" class="table table-striped table-bordered" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th class="text-center" style="vertical-align: middle;">HEADMARK</th>
                <th class="text-center" style="vertical-align: middle;">PROFILE</th>
コード例 #7
0
function jumlahREMS($HM, $ID, $PROC_SUB_TYPE, $conn)
{
    $sql_jml = "SELECT COUNT(*) FROM MD_PROC_DELAY_REMS WHERE REGEXP_REPLACE (HEAD_MARK, '[[:space:]]+', '') = '" . str_replace(' ', '', $HM) . "' AND ID='{$ID}' " . " AND PROC_SUB_TYPE='{$PROC_SUB_TYPE}' AND ENTRY_DATE = TO_DATE('" . date("m/d/Y") . "','MM/DD/YYYY')";
    $jml_now_rems = SingleQryFld($sql_jml, $conn);
    return $jml_now_rems;
}
oci_set_client_identifier($conn, $_SESSION['username']);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$projName = $_GET['projName'];
$subcont = $_GET['subcont'];
$date1 = $_GET['date1'];
$time1 = strval($_GET['time1']) . ":00";
$dt1 = new dateTime($date1);
$PROJ_NO = SingleQryFld("SELECT PROJECT_NO FROM PROJECT WHERE PROJECT_NAME='{$projName}'", $conn);
$PROJ_DESC = SingleQryFld("SELECT PROJECT_DESC FROM PROJECT WHERE PROJECT_NAME='{$projName}'", $conn);
$CLIENT_NAME = SingleQryFld("SELECT CLIENT_NAME FROM MST_CLIENT WHERE CLIENT_ID in (SELECT CLIENT_ID FROM PROJECT WHERE PROJECT_NAME='{$projName}')", $conn);
$SPV_SQL = "SELECT DISTINCT(SPV_FAB) FROM MASTER_DRAWING_ASSIGNED WHERE PROJECT_NAME='{$projName}' AND SUBCONT_ID='{$subcont}' AND ASSIGNMENT_DATE >= TO_DATE('{$date1} {$time1}', 'MM/DD/YYYY hh24:mi:ss') AND ASSIGNMENT_DATE <= TO_DATE ('{$date1} 23:59:59', 'MM/DD/YYYY hh24:mi:ss')";
// echo "$SPV_SQL<hr>";
$SPV = SingleQryFld($SPV_SQL, $conn);
$QC_INSP_SQL = "SELECT DISTINCT(QC_INSP) FROM MASTER_DRAWING_ASSIGNED WHERE PROJECT_NAME='{$projName}' AND SUBCONT_ID='{$subcont}' AND ASSIGNMENT_DATE >= TO_DATE('{$date1} {$time1}', 'MM/DD/YYYY hh24:mi:ss') AND ASSIGNMENT_DATE <= TO_DATE ('{$date1} 23:59:59', 'MM/DD/YYYY hh24:mi:ss')";
// echo "$QC_INSP_SQL<hr>";
$QC_INSP = SingleQryFld($QC_INSP_SQL, $conn);
// echo "$projName -- $subcont -- $date1 -- $PROJ_NO -- $PROJ_DESC -- $CLIENT_NAME -- $SPV";
// exit();
?>

<!DOCTYPE html>
<html>
    <head>
        <title>DAILY ASSIGNMENT REPORT</title>
        <!-- bootstrap 3.0.2 -->
        <link href="../../AdminLTE/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
        <link href="../../AdminLTE/css/own.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            /* table {
               width: 97%;
             }*/
コード例 #9
0
$sqlPck = oci_parse($conn, $sql_pack);
oci_execute($sqlPck);
while ($rowPck = oci_fetch_array($sqlPck)) {
    $COLI_NUMBER = $rowPck['COLI_NUMBER'];
    $PACKING_LENGTH = $rowPck['PACK_LEN'];
    $PACKING_WIDTH = $rowPck['PACK_WID'];
    $PACKING_HEIGHT = $rowPck['PACK_HT'];
    $PACKING_VOLUME = round($PACKING_LENGTH * $PACKING_WIDTH * $PACKING_HEIGHT / 1000000000, 2);
    $PACKING_WEIGHT = SingleQryFld("SELECT SUM(UNIT_PCK_WT) FROM VW_PCK_INFO WHERE COLI_NUMBER='{$COLI_NUMBER}'", $conn);
    $SHIPMENT_NO = "&nbsp";
    if (!empty($rowPck['SHIPMENT_NO'])) {
        // $SHIPMENT_NO		= $rowPck['SHIPMENT_NO'];
    }
    $DONumber = SingleQryFld("SELECT DO_NO FROM DTL_DELIV WHERE COLI_NUMBER = '{$COLI_NUMBER}'", $conn);
    $VehicleNo = SingleQryFld("SELECT VHC_NO FROM MST_DELIV WHERE DO_NO = '{$DONumber}'", $conn);
    $DO_DATE = SingleQryFld("SELECT DO_DATE FROM MST_DELIV WHERE DO_NO = '{$DONumber}'", $conn);
    ?>
            <tr class="isi">
            <td><?php 
    echo $i;
    ?>
</td>
            <td><?php 
    echo $COLI_NUMBER;
    ?>
</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
コード例 #10
0
 if ($row['PROCEN_WEIGHT'] == "100") {
     echo "-";
 } else {
     $prosentaseSebelumnya = "SELECT SUM(PROCEN_WEIGHT) FROM VW_INFO_OPNAME_SI WHERE HEAD_MARK = '{$row['HEAD_MARK']}' AND SUBCONT_ID = '{$row['SUBCONT_ID']}'";
     $xx = SingleQryFld($prosentaseSebelumnya, $conn);
     echo "{$xx}%";
 }
 ?>
                         </td>
                         <td class="text-center" style="vertical-align:middle;">
                             <?php 
 if ($row['PROCEN_WEIGHT'] == "100") {
     echo "-";
 } else {
     $hargaSebelumnya = "SELECT SUM(PROCEN_WEIGHT*TOTAL_QTY*WEIGHT/100*OPN_PRICE) FROM VW_INFO_OPNAME_SI WHERE HEAD_MARK = '{$row['HEAD_MARK']}' AND SUBCONT_ID = '{$row['SUBCONT_ID']}'";
     $yy = SingleQryFld($hargaSebelumnya, $conn);
     echo number_format($yy, 2);
 }
 ?>
                         </td>
                         <td class="text-center" style="vertical-align:middle;">
                             <?php 
 echo $row['QTY_OPNAME'];
 ?>
                         </td>
                         <td class="text-right" style="vertical-align:middle;">
                             <?php 
 echo number_format($row['PRICE'], 2);
 ?>
                         </td>
                         <td class="text-center" style="vertical-align:middle;">
コード例 #11
0
     while ($row3 = oci_fetch_array($pembawaParse)) {
         array_push($pembawa, $row3);
     }
     $response = array("job" => $job, "spv" => $spv, "pembawa" => $pembawa);
     echo json_encode($response);
     break;
 case "getsubjob":
     $job = $_POST['job'];
     $subjob = array();
     $sql = "SELECT DISTINCT PROJECT_NAME_NEW FROM VW_PROJ_INFO@WELTESMART_WELTES_LINK WHERE PROJECT_NO = '{$job}' ORDER BY PROJECT_NAME_NEW  ASC";
     $parse = oci_parse($conn, $sql);
     oci_execute($parse);
     while ($row = oci_fetch_array($parse)) {
         array_push($subjob, $row);
     }
     $query = SingleQryFld("SELECT MAX(MART_WR_ID) FROM MART_MST_CHKOUT WHERE MART_WR_JOB = '{$job}'", $conn);
     $nomer = 0;
     if ($query != "null") {
         $nomer = str_replace("WM-WH-{$job}-", "", $query);
         $nomer = intval($nomer) + 1;
     } else {
         $nomer = intval($nomer) + 1;
     }
     $id_checkout = "WM-WH-{$job}-" . str_pad($nomer, 5, 0, STR_PAD_LEFT);
     $response = array("subjob" => $subjob, "wh_id" => $id_checkout);
     echo json_encode($response);
     break;
 case "show_history":
     $start = $_POST['start'];
     $end = $_POST['end'];
     $job = $_POST['job'];
コード例 #12
0
$styleTableContent = array('font' => array('shrinkToFit' => true, 'size' => 16, 'name' => 'Times New Roman'), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER));
$styleBorder = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN)));
// SET DOCUMENT TITLE
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('B1:J1')->setCellValue('B1', "LAPORAN OPNAME {$type}");
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('B2:J2')->setCellValue('B2', 'PT. WELTES ENERGI NUSANTARA');
// SET DOCUMENT MAIN PROPERTIES
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('B4:C4')->setCellValue('B4', 'PERIODE');
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('B5:C5')->setCellValue('B5', 'JOB');
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('B6:C6')->setCellValue('B6', 'SUBJOB');
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('G4:H4')->setCellValue('G4', 'TANGGAL OPNAME');
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('G5:H5')->setCellValue('G5', 'OPNAME TYPE');
//$objPHPExcel->setActiveSheetIndex(0)
//        ->mergeCells('B8:C8')
//        ->setCellValue('B8', 'SUBCONTRACTOR');
$queryDate = "SELECT to_char(MAX(OPNAME_DATE), 'DD MONTH YYYY') OPNAME_DATE " . "FROM VW_REPORT_OPNAME_PNT " . "WHERE OPNAME_PERIOD = '{$periode}' " . "AND OPNAME_TYPE = '{$type}' " . "AND PROJECT_NO = '{$job}' " . "AND PROJECT_NAME_NEW = '{$subjob}'";
$tangal_opname = SingleQryFld($queryDate, $conn);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D4', ": " . "{$periode}");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D5', ": " . "{$job}");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D6', ": " . "{$subjob}");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('I4', ": " . $tangal_opname);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('I5', ": " . "{$type}");
//$objPHPExcel->setActiveSheetIndex(0)
//        ->setCellValue('D8', ": " . "GUNADI");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B10', 'NO')->setCellValue('C10', 'HEADMARK')->setCellValue('D10', 'COMP TYPE')->setCellValue('E10', 'PROFILE')->setCellValue('F10', 'QC PASS QTY')->setCellValue('G10', 'SURFACE AREA')->setCellValue('H10', 'QTY OPNAME')->setCellValue('I10', 'PRICE')->setCellValue('J10', 'TOTAL PRICE');
$baris = 11;
$no = 0;
$qty = 0;
$price = 0;
$total_price = 0;
$surface = 0;
$opnameDtlSql = "SELECT * FROM VW_REPORT_OPNAME_PNT " . "WHERE OPNAME_PERIOD = '{$periode}' " . "AND OPNAME_TYPE = '{$type}' " . "AND PROJECT_NO = '{$job}' " . "AND PROJECT_NAME_NEW = '{$subjob}' " . "ORDER BY PROJECT_NO, PROJECT_NAME_NEW, COMP_TYPE, HEAD_MARK";
コード例 #13
0
<?php

require_once '../../../../dbinfo.inc.php';
require_once '../../../../FunctionAct.php';
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
$HM_ID = intval($_POST['HM_ID']);
$HEAD_MARK = strval($_POST['HEAD_MARK']);
$ProjNme = strval($_POST['ProjNme']);
$no = intval($_POST['no']);
$firstQTY = intval($_POST['firstQTY']);
if ($_POST["type"] == "PAINT_QC_PASS") {
    # code...
    $sql = "SELECT {$_POST['type']} FROM PAINTING_QC WHERE PROJECT_NAME = '{$ProjNme}' AND HEAD_MARK='{$HEAD_MARK}' AND ID='{$HM_ID}' ";
} else {
    # code...
    $sql = "SELECT {$_POST['type']} FROM PAINTING WHERE PROJECT_NAME = '{$ProjNme}' AND HEAD_MARK='{$HEAD_MARK}' AND ID='{$HM_ID}' ";
}
// echo "$sql";
$jumlhFrst = SingleQryFld("{$sql}", $conn);
if ($jumlhFrst != $firstQTY) {
    # code...
    echo "<script>showDoubleInput('{$no}','{$HEAD_MARK}')</script>";
}
コード例 #14
0
// GENERATE THE APPLICATION PAGE
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
// 1. SET THE CLIENT IDENTIFIER AFTER EVERY CALL
// 2. USING UNIQUE VALUE FOR BACK END USER
oci_set_client_identifier($conn, $_SESSION['username']);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
?>

<?php 
switch ($_POST['action']) {
    case "cek_duplikat":
        $array = array();
        $head_mark = strval($_POST['head_mark']);
        $project_name = strval($_POST['project_name']);
        $sql = "SELECT COUNT(*) FROM MASTER_DRAWING WHERE REPLACE(TRIM(HEAD_MARK), ' ', '') = '{$head_mark}' AND DWG_STATUS = 'ACTIVE'";
        $jumlah = SingleQryFld($sql, $conn);
        if ($jumlah == "0") {
            $response = array("status" => "tidak ada", "data_balik" => $array);
            echo json_encode($response);
        } else {
            $query = "SELECT * FROM MASTER_DRAWING WHERE REPLACE(TRIM(HEAD_MARK), ' ', '') = '{$head_mark}'";
            $parse = oci_parse($conn, $query);
            oci_execute($parse);
            while ($row = oci_fetch_array($parse)) {
                array_push($array, $row);
            }
            $response = array("status" => "ada", "data_balik" => $array);
            echo json_encode($response);
        }
        break;
    case "insert_data":
コード例 #15
0
$sql = "SELECT PCK.* FROM MST_PACKING PCK WHERE PCK.COLI_NUMBER = '{$coliNumber}' ";
// echo "$sql";
$sqlPck = oci_parse($conn, $sql);
oci_execute($sqlPck);
$rowPck = oci_fetch_array($sqlPck, OCI_BOTH);
$PACKING_LENGTH = $rowPck['PACK_LEN'];
$PACKING_WIDTH = $rowPck['PACK_WID'];
$PACKING_HEIGHT = $rowPck['PACK_HT'];
$PROJECT_NAME = $rowPck['PROJECT_NAME'];
$ZON_LOC = $rowPck['ZON_LOC'];
$PACK_TYP = $rowPck['PACK_TYP'];
$BOX_WT = $rowPck['BOX_WT'];
$PACKING_VOLUME = round($PACKING_LENGTH * $PACKING_WIDTH * $PACKING_HEIGHT / 1000000000, 2);
$PACKING_WEIGHT = SingleQryFld("SELECT SUM(UNIT_PCK_WT) FROM VW_PCK_INFO WHERE COLI_NUMBER='{$coliNumber}'", $conn);
$PROJNO = SingleQryFld("SELECT PROJECT_NO FROM VW_PROJ_INFO WHERE PROJECT_NAME_OLD = '{$PROJECT_NAME}'", $conn);
$PROJNM_NEW = SingleQryFld("SELECT PROJECT_NAME_NEW FROM VW_PROJ_INFO WHERE PROJECT_NAME_OLD = '{$PROJECT_NAME}'", $conn);
?>
        <div class="container">
            <table align="center" class="center">
                <thead>
                    <tr>
                        <th colspan="5">
                            <img src="img_packing/weltesLogo.jpg">
                        </th>
                        <th colspan="3" rowspan="4">
                            <img class="table-bordered" src="<?php 
echo $PNG_WEB_DIR . basename($filename);
?>
" width="200" height="200">
                            <!-- <div class="col-xs-11 table-bordered" style="text-align:center;"> -->
                            <?php 
コード例 #16
0
    }
    if ($total == 0) {
        $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:12px;;\r\n                color:red;'>" . number_format($total, 2) . " Kg</th>";
    } else {
        $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:12px;\r\n                color:blue;'>" . number_format($total, 2) . " Kg</th>";
    }
    $content .= "</tr>";
}
$arrayTangal = array();
$content .= '<tr><th style="border:1px solid black;">SUMMARY</th>';
$dateSql = "SELECT TO_CHAR(TO_DATE ('{$start_date}', 'mm/dd/yyyy') + ROWNUM - 1,'DD-MM-YYYY') as tanggal " . "FROM all_objects WHERE ROWNUM <= TO_DATE ('{$end_date}', 'mm/dd/yyyy') - TO_DATE ('{$start_date}', 'mm/dd/yyyy') + 1";
$dateParse = oci_parse($conn, $dateSql);
oci_execute($dateParse);
$total = 0;
while ($row = oci_fetch_array($dateParse)) {
    $query = SingleQryFld("SELECT NVL(SUM (WEIGHT * ASSG_QTY),0) TOTAL FROM COMP_VW_INFO WHERE TO_CHAR (ASSG_DATE, 'DD-MM-YYYY') = '{$row['TANGGAL']}' AND TYPE_SUBCONT = 'OUTSOURCE'", $conn);
    if ($query == 0) {
        $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:12px;\r\n                color:red;'>" . number_format($query, 2) . " KG" . "</th>";
    } else {
        $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:12px;\r\n                color:blue;'>" . number_format($query, 2) . " KG" . "</th>";
    }
    $total += $query;
}
if ($total == 0) {
    $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:10px;\r\n                color:red;'>" . number_format($total, 2) . " KG" . "</th>";
} else {
    $content .= "<th style='border-width: 1px;\r\n                padding: 12px;\r\n                border-style: solid;\r\n                border-color: #666666;\r\n                background-color: #dedede;\r\n                font-size:10px;\r\n                color:blue;'>" . number_format($total, 2) . " KG" . "</th>";
}
$footer = '</tr></table>';
$qwe = $header . $content . $footer;
echo "{$qwe}";
                        <th style="vertical-align: middle; text-align:center">PNT QC</th>
                        <th style="vertical-align: middle; text-align:center">PACK QTY</th>
                        <th style="vertical-align: middle; text-align:center">DLV QTY</th>
                        <th style="vertical-align: middle; text-align:center">PACK INFO</th>
                        <th style="vertical-align: middle; text-align:center">DO NO</th>
                        <th style="vertical-align: middle; text-align:center">STATUS DELIVERY</th>
                        <th style="vertical-align: middle; text-align:center">ERECT QTY</th>
                        <th style="vertical-align: middle; text-align:center">STATUS ERECTION</th>
                        <th class="text-center">NOTE</th>
                        <!--<th class="text-center">OPNAME PAINTING</th>-->
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
//MENCARI BERAT UNTUK SUBJOB
$berat = SingleQryFld("SELECT SUM(TOTAL_QTY*WEIGHT) FROM VW_DRAWING_INFO WHERE PROJECT_NAME = '{$projectName}'", $conn);
//MAIN QUERY
$generalInfoSql = "WITH XX " . "AS(SELECT " . "PROJECT_NAME, " . "HEAD_MARK, " . "MAX (FINISHING_PAINT_DATE) FINISHING_PAINT_DATE " . "FROM COMP_VW_INFO " . "WHERE PROJECT_NAME = '{$projectName}' " . "AND TYPE_BLD = 'STRUCTURE' " . "GROUP BY PROJECT_NAME, HEAD_MARK) " . "SELECT VDI.*, XX.FINISHING_PAINT_DATE " . "FROM VW_DRAWING_INFO VDI " . "LEFT OUTER JOIN XX " . "ON XX.HEAD_MARK = VDI.HEAD_MARK " . "AND XX.PROJECT_NAME = VDI.PROJECT_NAME " . "WHERE VDI.PROJECT_NAME = '{$projectName}' {$dlv_sql} {$erc_sql} " . "AND VDI.TYPE_BLD = 'STRUCTURE' " . "AND VDI.ASSIGNED_QTY<>VDI.FAB_FINISHING " . "ORDER BY VDI.COMP_TYPE,TO_NUMBER (REGEXP_REPLACE (VDI.HEAD_MARK, '[^[:digit:]]', NULL))";
//                        echo $generalInfoSql;
$generalInfoParse = oci_parse($conn, $generalInfoSql);
oci_execute($generalInfoParse);
while ($row = oci_fetch_array($generalInfoParse)) {
    ?>
                            <tr>
                            <td style="vertical-align: middle; text-align:center">
                                <?php 
    echo $row['HEAD_MARK'];
    ?>
                            </td>
                            <td style="vertical-align: middle; text-align:center">
                                <?php 
コード例 #18
0
    exit;
}
// GENERATE THE APPLICATION PAGE
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
// 1. SET THE CLIENT IDENTIFIER AFTER EVERY CALL
// 2. USING UNIQUE VALUE FOR BACK END USER
oci_set_client_identifier($conn, $_SESSION['username']);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$HM = $_GET['HM'];
$ID = $_GET['ID'];
$SURF = $_GET['SURF'];
$FAB_PASS = $_GET['FAB_PASS'];
$PAINT_PASS = SingleQryFld("SELECT PAINT_QC_PASS FROM VW_PNT_INFO WHERE HEAD_MARK = '{$HM}' AND ID='{$ID}'", $conn);
$SUBCONT = $_GET['SUBCONT'];
$AvlOpn_bls = SingleQryFld("SELECT SUM(OPN_QTY) FROM PAINTING_OPN WHERE HEAD_MARK = '{$HM}' AND ID='{$ID}' AND OPN_TYPE='BLAST'", $conn);
$AvlOpn_pnt = SingleQryFld("SELECT SUM(OPN_QTY) FROM PAINTING_OPN WHERE HEAD_MARK = '{$HM}' AND ID='{$ID}' AND OPN_TYPE='PAINT'", $conn);
?>
<style type="text/css">
    .table thead tr th{
        text-align: center;
        vertical-align:middle;
    }
    #OPN_tbl_wrapper {
      /*background-color: #91D2E6;*/
      /*width: 96%;*/
      height: 350px;
      overflow-y: scroll; 
    }
    .opndiv table thead {
      background-color: #D7D2CE;
    }
コード例 #19
0
        } else {
            oci_rollback($conn);
        }
        echo "sukses";
    } else {
        $IDEMAIL = "email-" . date("d/m/Y");
        $insertEmailSql = "INSERT INTO EMAIL_NOTIFICATION (ID_EMAIL, RECEIVER, SENT_DATE, STATUS, EMAIL_TYPE) VALUES('{$IDEMAIL}', '{$recepient}', SYSDATE, 'FAILSS', 'W15050')";
        $insertEmailParse = oci_parse($conn, $insertEmailSql);
        $insertEmail = oci_execute($insertEmailParse);
        if ($insertEmail) {
            oci_commit($conn);
        } else {
            oci_rollback($conn);
        }
        echo "fail";
    }
}
//DailyFabrication();
$hour = date("H");
if ($hour > 12 && $hour < 24) {
    $IDEMAIL = "email-" . date("d/m/Y");
    $cekEmailSql1 = "SELECT COUNT(*) JUMLAH FROM EMAIL_NOTIFICATION WHERE ID_EMAIL = '{$IDEMAIL}' AND STATUS = 'SUCCESS' AND EMAIL_TYPE = 'W15050'";
    $result1 = SingleQryFld($cekEmailSql1, $conn);
    if ($result1 == "0") {
        DailyFabrication();
    } else {
        echo "email WIGG sudah terkirim" . "<br/>";
    }
} else {
    echo "bukan jam kirim email boss";
}
コード例 #20
0
 }
 //insert PAINT Qc History
 $updateQcHistSql = "INSERT INTO PAINTING_QC_HIST (PROJECT_NAME, HEAD_MARK, ID, \r\n                BLASTING_QC, PRIMER_QC, INTERMEDIATE_QC, FINISHING_QC,\r\n                PAINT_QC_HIST_SIGN, PAINT_QC_ENTRY_DATE, MEMO)           \r\n                VALUES (:pn, :hm, :id, '{$dataQCPass}', '{$dataQCPass}', '{$dataQCPass}', '{$dataQCPass}', '{$username}', SYSDATE, '{$memo}')";
 $updateQcHistParse = oci_parse($conn, $updateQcHistSql);
 oci_bind_by_name($updateQcHistParse, ":pn", $ProjNme);
 oci_bind_by_name($updateQcHistParse, ":hm", $HEAD_MARK);
 oci_bind_by_name($updateQcHistParse, ":id", $HM_ID);
 $updateQcHistRes = oci_execute($updateQcHistParse);
 if ($updateQcHistRes) {
     oci_commit($conn);
     // echo "<script>alert('HISTORY QC PASS INSERTED');</script>";
 } else {
     oci_rollback($conn);
     // echo "<script>alert('HISTORY QC PASS NOT INSERTED');</script>";
 }
 $jmlHMPckList = SingleQryFld("SELECT count(*) FROM PREPACKING_LIST WHERE HEAD_MARK = '{$HEAD_MARK}' AND PROJECT_NAME='{$ProjNme}'", $conn);
 // echo "JML = $jmlHMPckList<br>";
 //Insert OR Update PACKINGLIST
 if ($jmlHMPckList == 0) {
     # code...
     //INSERT INTO PREPACKING LIST WHEN FINISHED
     $transferToPackingParse = oci_parse($conn, "INSERT INTO PREPACKING_LIST (PROJECT_NAME, HEAD_MARK, UNIT_QTY, ENTRY_DATE, ENTRY_SIGN, PACKING_STATUS) " . "VALUES (:projName, :headMark, :unitQty, SYSDATE, '{$username}', 'NP')");
     oci_bind_by_name($transferToPackingParse, ":projName", $ProjNme);
     oci_bind_by_name($transferToPackingParse, ":headMark", $HEAD_MARK);
     oci_bind_by_name($transferToPackingParse, ":unitQty", $dataQCPass);
     $transferToPackingRes = oci_execute($transferToPackingParse);
     if ($transferToPackingRes) {
         oci_commit($conn);
         // echo "<script>alert('TRF PACKLIST SUCCESS');</script>";
     } else {
         oci_rollback($conn);
コード例 #21
0
require_once '../../../FunctionAct.php';
session_start();
// CHECK IF THE USER IS LOGGED ON ACCORDING
// TO THE APPLICATION AUTHENTICATION
if (!isset($_SESSION['username'])) {
    echo <<<EOD
       <h1>You are UNAUTHORIZED !</h1>
       <p>INVALID usernames/passwords<p>
       <p><a href="/WeltesinformationCenter/index.html">LOGIN PAGE</a><p>
EOD;
    exit;
}
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$OPNAME_STATUS = SingleQryFld("SELECT OPN_STATUS FROM MST_OPNAME_SI WHERE OPNAME_ID = '{$_POST['opname_id']}'", $conn);
$OPNAME_STATUS = SingleQryFld("SELECT OPN_STATUS FROM MST_OPNAME_SI WHERE OPNAME_ID = '{$_POST['opname_id']}'", $conn);
if ($username == "miko" || $username == "edward" || $username == "chrishutagalung") {
    $OPNAME_STATUS = "OPEN";
}
if ($OPNAME_STATUS == "CLOSE") {
    ?>
    <button type="button" class="btn btn-success col-sm-12" id="button-openkey" onclick="OpenKey();">OPEN KEY</button>
    <br><br>
    <?php 
}
?>
<div class="row">
    <table class="table table-striped table-bordered table-condensed" id="table-input">
        <thead>
            <tr>
                <th class="text-center">
//done!
if (isset($_POST['btnSubmit'])) {
    // echo "Dalam Perbaikan";exit();
    $projName = strval($_POST['projName']);
    $coliNo = trim(strval($_POST['coliNumber']));
    $coliLength = intval($_POST['coliLength']);
    $coliWidth = intval($_POST['coliWidth']);
    $coliHeight = intval($_POST['coliHeight']);
    $actualPacking = strval($_POST['packingDate']);
    $actualPackingDate = date('m-d-Y h:i:s', strtotime($actualPacking));
    $packageType = strval($_POST['packageAssign']);
    $PackWT = intval($_POST['PackWT']);
    $zoneArea = strval($_POST['zoneArea']);
    // $PCKPrntSze            = strval($_POST['PCKPrntSze']);
    $coliVol = $coliLength * $coliWidth * $coliHeight;
    $jmlPck = SingleQryFld("SELECT COUNT(*) FROM MST_PACKING WHERE COLI_NUMBER='{$coliNo}' AND PCK_STAT='ACTIVE'", $conn);
    if ($jmlPck > 0) {
        # code...
        echo "COLI NUMBER {$coliNo} Already EXIST!";
        exit;
    }
    // Delete Coli Exist
    $delMstPckPARSE = oci_parse($conn, "DELETE FROM MST_PACKING WHERE COLI_NUMBER='{$coliNo}' AND PCK_STAT = 'INACTIVE'");
    $delMstPckRES = oci_execute($delMstPckPARSE);
    $delDtlPckPARSE = oci_parse($conn, "DELETE FROM DTL_PACKING WHERE COLI_NUMBER='{$coliNo}'");
    $delDtlPckRES = oci_execute($delDtlPckPARSE);
    if ($delDtlPckRES && $delMstPckRES) {
        oci_commit($conn);
    } else {
        oci_rollback($conn);
    }
コード例 #23
0
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
oci_set_client_identifier($conn, $_SESSION['username']);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$head_mark = $_POST['head_mark'];
$opname_qty = $_POST['opname_qty'];
$price = $_POST['price'];
$type = $_POST['type'];
$periode = $_POST['periode'];
$tgl_opname = $_POST['tgl_opname'];
$project_name = $_POST['project_name'];
$project_code = SingleQryFld("SELECT PROJECT_CODE FROM VW_PROJ_INFO WHERE PROJECT_NAME_OLD = '{$project_name}'", $conn);
$project_no = SingleQryFld("SELECT PROJECT_NO FROM VW_PROJ_INFO WHERE PROJECT_NAME_OLD = '{$project_name}'", $conn);
$opname_id = "{$type}-{$project_no}-{$project_code}-{$periode}";
//JIKA MASTER OPNAME MASIH BELUM ADA
$array_dtl = "";
$cekOpnameID = SingleQryFld("SELECT COUNT(*) FROM MST_OPNAME_PNT WHERE OPNAME_ID = '{$opname_id}'", $conn);
if ($cekOpnameID == 0) {
    $insertMstOpnSql = "INSERT INTO MST_OPNAME_PNT (OPNAME_ID, OPNAME_DATE, OPNAME_SYSDATE, OPNAME_SIGN, OPNAME_SUBCONT, OPNAME_TYPE, OPNAME_PERIOD) \r\n    VALUES ('{$opname_id}', to_date('{$tgl_opname}', 'MM/DD/YYYY'), SYSDATE, '{$username}', 'GUNADI', '{$type}', '{$periode}')";
    $insertMstOpnParse = oci_parse($conn, $insertMstOpnSql);
    $insertMstOpn = oci_execute($insertMstOpnParse);
    if ($insertMstOpn) {
        for ($i = 0; $i < sizeof($head_mark); $i++) {
            $insertDtlOpnSql = "BEGIN SP_DTL_OPNAME_PNT_INS('{$opname_id}', '{$head_mark[$i]}', '{$opname_qty[$i]}', '{$price}'); END;";
            $insertDtlOpnParse = oci_parse($conn, $insertDtlOpnSql);
            $insertDtlOpn = oci_execute($insertDtlOpnParse);
            if ($insertDtlOpn) {
                oci_commit($conn);
                $array_dtl .= "SUCCESS";
            } else {
                oci_rollback($conn);
                $array_dtl .= "FAIL";
コード例 #24
0
         } else {
             oci_rollback($conn);
             echo "failed";
         }
     }
     break;
 case 'add_md_remaks':
     $HM = $_POST['HM'];
     $HMID = $_POST['HMID'];
     $REMS = $_POST['REMS'];
     $REMS_DT = $_POST['REMS_DT'];
     $PROC_TYP = $_POST['PROC_TYP'];
     $PROC_SUB_TYP = $_POST['PROC_SUB_TYP'];
     $sql = "SELECT COUNT(*) FROM MD_PROC_DELAY_REMS WHERE HEAD_MARK = '{$HM}' AND ID='{$HMID}' AND ENTRY_DATE = TO_DATE('{$REMS_DT}','MM/DD/YYYY') AND PROC_TYPE = '{$PROC_TYP}' AND PROC_SUB_TYPE = '{$PROC_SUB_TYP}' ";
     // echo "$sql";
     $duplicate = SingleQryFld($sql, $conn);
     if ($duplicate > 0) {
         $sql = "UPDATE MD_PROC_DELAY_REMS SET REMS = '{$REMS}',ENTRY_SIGN = '{$username}' WHERE HEAD_MARK = '{$HM}' AND ID='{$HMID}' AND ENTRY_DATE = TO_DATE('{$REMS_DT}','MM/DD/YYYY') AND PROC_TYPE = '{$PROC_TYP}' AND PROC_SUB_TYPE = '{$PROC_SUB_TYP}'";
         $parse = oci_parse($conn, $sql);
         oci_execute($parse);
         if ($parse) {
             oci_commit($conn);
             echo "success";
         } else {
             oci_rollback($conn);
             echo "failed";
         }
     } else {
         $sql = "INSERT INTO MD_PROC_DELAY_REMS(HEAD_MARK,ID,REMS,ENTRY_DATE,ENTRY_SIGN,PROC_TYPE,PROC_SUB_TYPE) values ('{$HM}','{$HMID}','{$REMS}',TO_DATE('{$REMS_DT}','MM/DD/YYYY'),'{$username}','{$PROC_TYP}','{$PROC_SUB_TYP}')";
         $parse = oci_parse($conn, $sql);
         oci_execute($parse);
コード例 #25
0
// CHECK IF THE USER IS LOGGED ON ACCORDING
// TO THE APPLICATION AUTHENTICATION
if (!isset($_SESSION['username'])) {
    echo <<<EOD
       <h1>You are UNAUTHORIZED !</h1>
       <p>INVALID usernames/passwords<p>
       <p><a href="/WeltesinformationCenter/index.html">LOGIN PAGE</a><p>
EOD;
    exit;
}
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$opname_id = $_POST['opname_id'];
$job = $_POST['job'];
$subjob = $_POST['subjob'];
$OPNAME_STATUS = SingleQryFld("SELECT DISTINCT OPN_STATUS FROM VW_INFO_OPNAME_FAB WHERE OPNAME_ID = '{$opname_id}' AND PROJECT_NO = '{$job}' AND PROJECT_NAME = '{$subjob}'", $conn);
$sql = "WITH OPN\r\n     AS (SELECT HEAD_MARK,\r\n                SUBCONT_ID,\r\n                TOTAL_QTY,\r\n                OPN_PRICE,\r\n                UNIT_WEIGHT\r\n           FROM vw_info_opname_fab\r\n          WHERE OPNAME_ID = '{$opname_id}' AND PROJECT_NO = '{$job}' AND PROJECT_NAME = '{$subjob}'),\r\n     QCPASS\r\n     AS (  SELECT HEAD_MARK,\r\n                  SUBCONT_ID,\r\n                  SUM (QCPASS) QCPASS,\r\n                  SUM (QTY_OPN) QTY_OPN,\r\n                  SUM (REMAINING_QCPASS) REMAINING_QCPASS\r\n             FROM VW_SHOW_OPNAME_PRC\r\n         GROUP BY HEAD_MARK, SUBCONT_ID)\r\nSELECT OPN.HEAD_MARK,\r\n       OPN.SUBCONT_ID,\r\n       OPN.TOTAL_QTY,\r\n       OPN.OPN_PRICE,\r\n       OPN.UNIT_WEIGHT,\r\n       QCPASS.REMAINING_QCPASS\r\n  FROM OPN\r\n       INNER JOIN\r\n       QCPASS\r\n          ON     OPN.HEAD_MARK = QCPASS.HEAD_MARK\r\n             AND OPN.SUBCONT_ID = QCPASS.SUBCONT_ID";
$parse = oci_parse($conn, $sql);
oci_execute($parse);
?>
<marquee behavior="scroll" direction="left">
    <div class="col-sm-12 text-center" style="background-color: aquamarine;" id="div-textopname">
        <b>
            <?php 
if ($OPNAME_STATUS == "OPEN") {
    echo "OPNAME IS OPEN FOR EDIT <br>";
} else {
    echo "OPNAME HAS BEEN CLOSED, PLEASE CONTACT ADMIN TO OPEN IT!! <br>";
}
?>
        </b>
コード例 #26
0
     $id_checkout = "WM-WH-{$job}-" . str_pad($nomer, 5, 0, STR_PAD_LEFT);
     $response = array("subjob" => $subjob, "wh_id" => $id_checkout);
     echo json_encode($response);
     break;
 case "get_inventory":
     $response = array();
     $sql = "SELECT INV_ID, " . "SUM (TRANS_QTY) TRANS_QTY, " . "INV_DESC " . "FROM VW_STOCK_HIST " . "GROUP BY INV_ID, " . "INV_DESC " . "HAVING SUM (TRANS_QTY) > 0 " . "ORDER BY INV_DESC ASC";
     $parse = oci_parse($conn, $sql);
     oci_execute($parse);
     while ($row = oci_fetch_array($parse)) {
         array_push($response, $row);
     }
     echo json_encode($response);
     break;
 case "submit_data":
     $id = SingleQryFld("SELECT MART_SEQ_MST_CHKOUT.NEXTVAL FROM DUAL", $conn);
     $wh_id = $_POST['wh_id'];
     $tanggal = $_POST['tanggal'];
     $job = $_POST['job'];
     $subjob = $_POST['subjob'];
     $pembawa = str_replace("'", "''", $_POST['pembawa']);
     $spv = $_POST['spv'];
     $manager = $_POST['manager'];
     $inv_id = $_POST['inv_id'];
     $qty = $_POST['qty'];
     $unit = $_POST['unit'];
     $remark = $_POST['remark'];
     $rem = $_POST['rem'];
     $sql = "INSERT INTO MART_MST_CHKOUT (MART_WR_ID, MART_WR_DATE, MART_WR_SYSDATE, MART_WR_SIGN, \n            MART_WR_REMARK, MART_WR_JOB, MART_WR_SUBJOB, MART_WR_CARRIER, MART_WR_SPV_SIGN, MART_WR_FM_SIGN ) \n            VALUES ('{$id}', TO_DATE('{$tanggal}', 'MM/DD/YYYY'), SYSDATE, '{$username}', \n                '{$rem}', '{$job}', '{$subjob}', '{$pembawa}', '{$spv}', '{$manager}')";
     $parse = oci_parse($conn, $sql);
     $exe = oci_execute($parse);
コード例 #27
0
if ($DATE == $tgl_trakhir_opname) {
    $sql = "UPDATE MST_OPNAME SET OPN_STATUS = 'CLOSE' WHERE OPN_ACT_DATE <  to_date('{$tgl_trakhir_opname}', 'MM/DD/YYYY')";
    $parse = oci_parse($conn, $sql);
    $exe = oci_execute($parse);
    if ($exe) {
        oci_commit($conn);
        echo "OPNAME SUDAH DI LOCK";
    } else {
        oci_rollback($conn);
        echo "OPNAME GAGAL DI LOCK";
    }
} else {
    echo "BUKAN SAAAT LOCK OPNAME BOSS";
}
/*-------------------------------------------------------------------------------------------------------------------------*/
$tgl_trakhir_opname_si = SingleQryFld("select to_char(max(distinct(opn_act_date)+4), 'mm/dd/yyyy') tgl from MST_OPNAME_SI", $conn);
$DATE = strval(date("m/d/Y"));
if ($DATE == $tgl_trakhir_opname) {
    $sql1 = "UPDATE MST_OPNAME SET OPN_STATUS = 'CLOSE' WHERE OPN_ACT_DATE <  to_date('{$tgl_trakhir_opname_si}', 'MM/DD/YYYY')";
    $parse1 = oci_parse($conn, $sql1);
    $exe1 = oci_execute($parse1);
    if ($exe1) {
        oci_commit($conn);
        echo "OPNAME SUDAH DI LOCK";
    } else {
        oci_rollback($conn);
        echo "OPNAME GAGAL DI LOCK";
    }
} else {
    echo "BUKAN SAAAT LOCK OPNAME BOSS";
}
コード例 #28
0
                  <!-- <tr style="display:none">
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr> -->
                    <?php 
$projectName = strval($_GET['project']);
$query = "SELECT * FROM PREPACKING_LIST WHERE PROJECT_NAME = :projectName " . "AND (PACKING_STATUS = 'NP' OR PACKING_STATUS = 'PP') ORDER BY HEAD_MARK ASC";
$result = oci_parse($conn, $query);
oci_bind_by_name($result, ":projectName", $projectName);
oci_execute($result);
$j = 0;
while ($row = oci_fetch_array($result)) {
    $qtyAssgment = SingleQryFld("SELECT SUM(DTL_PACKING.UNIT_PCK_QTY) FROM DTL_PACKING, MST_PACKING WHERE MST_PACKING.COLI_NUMBER=DTL_PACKING.COLI_NUMBER AND MST_PACKING.PCK_STAT = 'ACTIVE' AND DTL_PACKING.HEAD_MARK='" . $row['HEAD_MARK'] . "'", $conn);
    // echo "SELECT SUM(UNIT_PCK_QTY) FROM DTL_PACKING WHERE HEAD_MARK='".$row['HEAD_MARK']."'<br>";
    $Qty = intval($row['UNIT_QTY'] - $qtyAssgment);
    ?>
                        <tr>
                            <td style="text-align: center;">
                                <a href="#lblHM" class="btn btn-success" id="<?php 
    echo "btnSRC" . $j;
    ?>
" onclick="AddROW('<?php 
    echo $j;
    ?>
')">add</a>
                            </td>
                            <td id="<?php 
    echo "HM" . $j;
コード例 #29
0
<?php

require_once '../../_config/dbinfo.inc.php';
require_once '../../_config/misc.func.php';
require_once '../../_config/hash.pwd.php';
session_start();
$conn = oci_connect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB) or die;
$pass = $_POST['password'];
$username = $_POST['username'];
oci_set_client_identifier($conn, 'admin');
$sql = oci_parse($conn, "SELECT WMU.MART_PASS HASHPASS,\r\n                            WMU.MART_FULL_NAME FULLNAME,\r\n                            WMR.MART_ROLE_DESC COMP_ROLE_COMPLETE\r\n                       FROM MART_USER WMU\r\n                            INNER JOIN MART_ROLE WMR\r\n                               ON WMR.MART_ROLE_ID = WMU.MART_ROLE_ID\r\n                      WHERE WMU.MART_FULL_NAME = :finemail");
oci_bind_by_name($sql, ":finemail", $username);
oci_define_by_name($sql, "COMP_ROLE_COMPLETE", $role);
oci_define_by_name($sql, "HASHPASS", $hashpass);
oci_execute($sql);
$r = oci_fetch_array($sql, OCI_ASSOC);
$passMatchInt = validate_password($pass, $hashpass);
if ($passMatchInt == 1) {
    $_SESSION['userlogin'] = $username;
    $_SESSION['rolelogin'] = $role;
    echo '<script>location.href="../main.php"</script>';
} else {
    echo '<script>alert("LOGIN FAILED !!! \\nPLEASE ENTER APPROPRIATE USER NAME AND PASSWORD")</script>';
    echo '<script>location.href="../../index.php"</script>';
}
$globalName = SingleQryFld("SELECT WMS.SETTING_VALUE_STRING FROM MART_SETTINGS WMS WHERE WMS.SETTING_DESC = 'GLOBAL_NAME'", $conn);
$_SESSION['globalname'] = $globalName;
",
                            DO_no: $('#orderNumber').val().replace(" ", "")
                        },
                function (res) {
                    $("#contenCOLI").html(res);
                }
                );
            });

        </script>
        <?php 
        break;
    case 'show_do_list':
        $projNo = strval($_GET['projNo']);
        $DO_no = $_GET['DO_no'];
        $jmlDO_NO = SingleQryFld("SELECT COUNT(*) FROM MST_DELIV WHERE DO_NO = '{$DO_no}' ", $conn);
        $i = 0;
        ?>
        <table class="compact display" cellpadding="0" cellspacing="0" style="background-color:#F2F2F2;" id="tbl_packing">
            <thead>
                <tr>
                <th><input class="checkbox-inline" type="checkbox" id="chkAll" name="chkAll" style="display:none;" onchange="checkAll('chkAll', 'chkCN[]');"/></th>
                <th>Coli No.</th>
                <th>Pack Type</th>
                <th>Volume ( M<sup>3</sup>)</th>
                <th>Project Type</th>
                </tr>
            </thead>
            <tbody>
                <?php 
        // SHOW COLI EXIST ON DO NO