Example #1
0
    $stsdtls = $statusmasterObj->getDetails('*', " AND eFor='PO' AND vStatus_en='Rejected' ");
    $rjtsts = $stsdtls[0]['iStatusID'];
    if ($podtls[0]['iStatusID'] == $rjtsts) {
        $lang = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG'];
        $msg = $stsdtls[0]['vStatusMsg_' . $lang];
    } else {
        if ($podtls[0]['eSaved'] == 'Yes') {
            $msg = $smarty->get_template_vars('LBL_SAVED');
        } else {
            if ($poad != 'yes') {
                header("Location: " . SITE_URL_DUM . "purchaseorderview/{$iPurchaseOrderID}");
                exit;
            }
        }
    }
    $poprefdt = $poprefObj->getDetails('*', " AND iPurchaseOrderID={$iPurchaseOrderID} ");
    // printS($poprefdt); exit;
    if (is_array($poprefdt) && count($poprefdt) > 0) {
        //
    } else {
        $poprefdt = $orgprefObj->getDetails('*', " AND iOrganizationID=" . $podtls[0]['iBuyerOrganizationID'] . " ");
    }
    // printS($poprefdt); exit;
}
if ($iPurchaseOrderID == '') {
    $podtls[0] = $_SESSION['Data'];
    unset($_SESSION['Data']);
}
if ($view != 'edit') {
    $upermits = $orgUserPermObj->getUserPermits($sess_id);
    $stsdtls = $statusmasterObj->getDetails('*', " AND eFor='PO' AND vStatus_en='Create' ");
Example #2
0
if (!isset($poAttachmentObj)) {
    include_once SITE_CLASS_APPLICATION . "user/class.PurchaseOrderAttachment.php";
    $poAttachmentObj = new PurchaseOrderAttachment();
}
if (!isset($poprefObj)) {
    include_once SITE_CLASS_APPLICATION . "user/class.PoOtherInformation.php";
    $poprefObj = new PoOtherInformation();
}
$eSaved = $_POST['eSaved'];
$Data = $_POST['Data'];
$eFrom = $Data['eFrom'];
unset($Data['eFrom']);
unset($_POST['eFrom']);
$iPurchaseOrderID = $_POST['iPurchaseOrderID'];
$Data['iPurchaseOrderID'] = $iPurchaseOrderID;
$poextdtls = $poprefObj->getDetails("*", " AND iPurchaseOrderID={$iPurchaseOrderID} ");
// prints($poextdtls); exit;
if (is_array($poextdtls) && count($poextdtls) > 0) {
    $rs = $poprefObj->updateData($Data, "iPurchaseOrderID={$iPurchaseOrderID}");
    $msg = "rus";
} else {
    $rs = $poprefObj->insert($Data);
    $msg = "ras";
}
$_SESSION['poadd'] = 'yes';
if ($rs > 0) {
    if ($eSaved == 'Yes') {
        $dtl['eSaved'] = $eSaved;
        $wh_cn = "iPurchaseOrderID={$iPurchaseOrderID}";
        $rs = $pohObj->updateData($dtl, $wh_cn);
        if ($eFrom == "Next") {