<?php // CONFIGURATION session_start(); if (isset($_POST["func"]) && $_POST["func"] == "pp_eval_decision") { $status = $_POST["status"]; $ppID = $_POST["ppID"]; $department = "" . $_SESSION["department"] . ""; $basestatus = array(9004, 9002, 9003, 1107, 402, 9008, 9050, 9009); // CHECKING TEMPLATE $pp_evaluation_decision = array("a" => 1111, "r" => 1112, "c" => 1110, "CHECK" => $basestatus); // APPROVED, REJECT, CORRESPOND, CHECKING TEMPLATE q3p_autoapproved($pp_evaluation_decision, $status, $department, $ppID); } function q3p_autoapproved($checkingarray, $newstatus, $department, $ppID) { include "../config/conn.php"; $column["PRODUCT"] = "pp_rs_kod_product"; $column["API"] = "pp_rs_kod_api"; $column["LAB"] = "pp_rs_kod_lab"; $msg = ""; $columnupdate = $column[$department]; $sql = "UPDATE p_product SET {$columnupdate} = '{$newstatus}' WHERE pp_kod = {$ppID}"; $conn->query($sql); if ($conn->query($sql)) { $msg = "SUCCESS"; } else { $msg = "UPDATE_STATUS_ERROR"; } $sqlcheck = "SELECT\n pp_rkatp_kod,\n pp_rs_kod_product,\n pp_rs_kod_api,\n pp_rs_kod_lab,\n rkatp_api_applicable,\n rkatp_lab_applicable,\n rkatp_sample_applicable\n FROM p_product, ref_kat_produk where pp_kod = {$ppID} AND pp_rkatp_kod = rkatp_kod"; $result = $conn->query($sqlcheck);
function approveEvaluate($pp_kod, $ru_kod, $result) { if ($result == "REJECT") { $result = 9050; } else { $result = 9008; } // $query = "SELECT la_kod FROM lab_assign // WHERE la_pp_kod='$pp_kod' AND (la_rs_kod IN(403,443) OR la_rs_kod IS NULL)"; // if(countRow($query) > 0) { // // } // else { echo q3p_autoapproved($result, $_SESSION['department'], $pp_kod); //} }