Esempio n. 1
0
<?php

if (!isset($b2baObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_Association.php";
    $b2baObj = new Buyer2_Buyer_Association();
}
if (!isset($b2bavObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_Association_ToVerify.php";
    $b2bavObj = new Buyer2_Buyer_Association_ToVerify();
}
$iAssociationId = GetVar('id');
// $msg = GetVar('msg');
$mod = '';
$flds = " b2bav.*, org.vCompanyName as vBuyer2, org.vCompCode, bo.vCompanyName as vBuyer, bo.vCompCode ";
$jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master bo on bo.iOrganizationID=b2bav.iBuyerId\r\n            LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2bav.iBuyer2Id ";
$vb2bydtls = $b2bavObj->getJoinTableInfo($jtbl, $flds, " AND b2bav.iAssociationId={$iAssociationId} ", ' b2bav.iVerifiedID DESC ', '', ' LIMIT 0,1');
// pr($vb2bydtls); exit;
$vrq = $b2bavObj->isVerifyReq($vb2bydtls);
$vsts = '';
if ($vrq == 'vreq') {
    $vsts = $b2bavObj->chkRecVrf($vb2bydtls);
    if ($vsts == 'nr' || $vsts == 'om') {
        header('Location: ' . SITE_URL_DUM . 'b2buyerasoclist');
        exit;
    }
} else {
    if ($vrq == 'nr') {
        $flds = " b2bpa.*, org.vCompanyName as vBuyer2, org.vCompCode, bo.vCompanyName as vBuyer, bo.vCompCode ";
        $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master bo on bo.iOrganizationID=b2bpa.iBuyerId\r\n               LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2bpa.iBuyer2Id ";
        $vb2bydtls = $b2baObj->getJoinTableInfo($jtbl, $flds, " AND iAssociationId={$iAssociationId} ");
        $vrq = $b2bavObj->isVerifyReq($vb2bydtls);
Esempio n. 2
0
$cursorttype = $_POST['cursorttype'];
if ($cursort != '') {
    if ($cursorttype == '1') {
        $cursort_type = 'ASC';
    } else {
        $cursort_type = 'DESC';
    }
    $orderBy = " {$cursort} {$cursort_type}";
} else {
    $orderBy = " b2bav.dADate DESC ";
}
## ENDS HERE ###
$where .= " AND NOT (b2bav.eStatus='Delete' AND b2bav.eNeedToVerify!='Yes') AND (eStatus IN ('Modified','Need to Verify') OR eNeedToVerify='Yes') ";
$limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " ";
$jtbl = "";
// echo $where; exit;
$fields = "b2bav.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bav.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bav.iBuyerId) as vBuyer";
$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, "listb2buyerassocsv", $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);