Exemplo n.º 1
0
$jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master so on so.iOrganizationID=b2sav.iSupplierId\r\n            LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2sav.iBuyer2Id ";
$vb2spdtls = $b2savObj->getJoinTableInfo($jtbl, $flds, " AND b2sav.iAssociationId={$iAssociationId} ", ' b2sav.iVerifiedID DESC ', '', ' LIMIT 0,1');
// pr($vb2spdtls); exit;
$vrq = $b2savObj->isVerifyReq($vb2spdtls);
$vsts = '';
if ($vrq == 'vreq') {
    $vsts = $b2savObj->chkRecVrf($vb2spdtls);
    if ($vsts == 'nr' || $vsts == 'om') {
        header('Location: ' . SITE_URL_DUM . 'b2supplierasoclist');
        exit;
    }
} else {
    if ($vrq == 'nr') {
        $flds = " b2bpa.*, org.vCompanyName as vBuyer2, org.vCompCode, bo.vCompanyName as vSupplier, bo.vCompCode ";
        $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master bo on bo.iOrganizationID=b2bpa.iSupplierId\r\n               LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2bpa.iBuyer2Id ";
        $vb2spdtls = $b2saObj->getJoinTableInfo($jtbl, $flds, " AND iAssociationId={$iAssociationId} ");
        $vrq = $b2savObj->isVerifyReq($vb2spdtls);
        if ($vrq == 'vreq') {
            $vsts = $b2savObj->chkRecVrf($vb2spdtls);
            if ($vsts == 'nr' || $vsts == 'om') {
                header('Location: ' . SITE_URL_DUM . 'b2buyserasoclist');
                exit;
            }
        } else {
            if ($vrq == 'nr') {
                header('Location: ' . SITE_URL_DUM . 'b2supplierasoclist');
                exit;
            }
        }
    }
}
Exemplo n.º 2
0
$cursort = $_POST['cursort'];
$cursorttype = $_POST['cursorttype'];
if ($cursort != '') {
    if ($cursorttype == '1') {
        $cursort_type = 'ASC';
    } else {
        $cursort_type = 'DESC';
    }
    $orderBy = " {$cursort} {$cursort_type}";
} else {
    $orderBy = " b2sa.dADate DESC ";
}
## ENDS HERE ###
$where .= " AND NOT (b2sa.eStatus='Delete' AND b2sa.eNeedToVerify!='Yes') ";
$limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " ";
$jtbl = "";
$fields = "b2sa.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sa.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t(Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sa.iSupplierId) as vSupplier";
$asocs = $assObj->getJoinTableInfo($jtbl, $fields, $where, $orderBy, $groupBy, $limit, 'yes');
// prints($asocs); exit;
$count = $asocs['tot'];
unset($asocs['tot']);
if (!isset($pgajxobj)) {
    require_once SITE_CLASS_GEN . "class.paging-ajax.php";
}
$pgajxobj = new Paging($count, $page, "listb2supplierassocs", $REC_LIMIT_FRONT);
$paging = $pgajxobj->getListPG($page);
$pgmsg = $pgajxobj->setMessage("Records");
$smarty->assign('count', $count);
$smarty->assign('asocs', $asocs);
$smarty->assign('paging', $paging);
$smarty->assign('pgmsg', $pgmsg);
Exemplo n.º 3
0
    $msg = $smarty->get_template_vars('MSG_DEL_SUCC');
} elseif ($msg == 'derr') {
    $msg = $smarty->get_template_vars('MSG_DEL_ERR');
} elseif ($msg == 'rss') {
    $msg = $smarty->get_template_vars('MSG_STATUS_SUCC');
} elseif ($msg == 'rserr') {
    $msg = $smarty->get_template_vars('MSG_STATUS_ERR');
} else {
    $msg = '';
}
$arr = array();
if (trim($iAssociationId) != '' && $iAssociationId > 0) {
    $mod = 'edit';
    $flds = " b2sa.*, org.vCompanyName as vBuyer2, so.vCompanyName as vSupplier";
    $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master so on so.iOrganizationID=b2sa.iSupplierId\r\n               LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2sa.iBuyer2Id ";
    $arr = $b2saObj->getJoinTableInfo($jtbl, $flds, " AND b2sa.iAssociationId={$iAssociationId} ");
    // pr($arr); exit;
    if (!(is_array($arr) && count($arr) > 0)) {
        header('Location: ' . SITE_URL_DUM . 'b2supplierasoclist');
        exit;
    } else {
        if (!(isset($arr[0]['eStatus']) && (($arr[0]['eStatus'] == 'Active' || $arr[0]['eStatus'] == 'Inactive') && $arr[0]['eNeedToVerify'] != 'Yes'))) {
            header('Location: ' . SITE_URL_DUM . 'b2supplierasocview/' . $iAssociationId);
            exit;
        }
    }
    if (count($arr) < 1 || $arr[0]['eStatus'] == 'Delete' && $arr[0]['eNeedToVerify'] != 'Yes') {
        header('Location: ' . SITE_URL_DUM . 'b2supplierasoclist/rnme');
        exit;
    }
} else {