<?php if (!isset($b2spaObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_SProduct_Association.php"; $b2spaObj = new Buyer2_SProduct_Association(); } if (!isset($b2spavObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_SProduct_Association_ToVerify.php"; $b2spavObj = new Buyer2_SProduct_Association_ToVerify(); } $iAssociationId = GetVar('id'); // $msg = GetVar('msg'); $mod = ''; $flds = " b2spav.*, org.vCompanyName as vBuyer2, org.vCompCode, spo.vProductName as vProduct, spo.vProductCode "; $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_sproduct_organization spo on spo.iProductId=b2spav.iProductId\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2spav.iBuyer2Id "; $vb2sprdtls = $b2spavObj->getJoinTableInfo($jtbl, $flds, " AND b2spav.iAssociationId={$iAssociationId} ", ' b2spav.iVerifiedID DESC ', '', ' LIMIT 0,1'); $vrq = $b2spavObj->isVerifyReq($vb2sprdtls); $vsts = ''; if ($vrq == 'vreq') { $vsts = $b2spavObj->chkRecVrf($vb2sprdtls); if ($vsts == 'nr' || $vsts == 'om') { header('Location: ' . SITE_URL_DUM . 'b2sprodtasoclist'); exit; } } else { if ($vrq == 'nr') { $flds = " b2spa.*, org.vCompanyName as vBuyer2, org.vCompCode, spo.vProductName as vProduct, spo.vProductCode "; $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_sproduct_organization spo on spo.iProductId=b2spa.iProductId\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2spa.iBuyer2Id "; $vb2sprdtls = $b2spaObj->getJoinTableInfo($jtbl, $flds, " AND iAssociationId={$iAssociationId} "); $vrq = $b2spavObj->isVerifyReq($vb2sprdtls); if ($vrq == 'vreq') {
$cursort = $_POST['cursort']; $cursorttype = $_POST['cursorttype']; if ($cursort != '') { if ($cursorttype == '1') { $cursort_type = 'ASC'; } else { $cursort_type = 'DESC'; } $orderBy = " {$cursort} {$cursort_type}"; } else { $orderBy = " b2spav.dADate DESC "; } ## ENDS HERE ### $where .= " AND NOT (b2spav.eStatus='Delete' AND b2spav.eNeedToVerify!='Yes') AND (eStatus IN ('Modified','Need to Verify') OR eNeedToVerify='Yes') "; $limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " "; $jtbl = ""; $fields = "b2spav.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2spav.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t (Select vProductName from " . PRJ_DB_PREFIX . "_sproduct_organization where iProductId=b2spav.iProductId) as vProduct"; $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, "listb2sprdtassocsv", $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);