$cursorttype = $_POST['cursorttype']; if ($cursort != '') { if ($cursorttype == '1') { $cursort_type = 'ASC'; } else { $cursort_type = 'DESC'; } $orderBy = " {$cursort} {$cursort_type}"; } else { $orderBy = " b2sav.dADate DESC "; } ## ENDS HERE ### $where .= " AND NOT (b2sav.eStatus='Delete' AND b2sav.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 = "b2sav.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sav.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sav.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, "listb2supplierassocsv", $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);
<?php if (!isset($b2saObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_Association.php"; $b2saObj = new Buyer2_Supplier_Association(); } if (!isset($b2savObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_Association_ToVerify.php"; $b2savObj = new Buyer2_Supplier_Association_ToVerify(); } $iAssociationId = GetVar('id'); // $msg = GetVar('msg'); $mod = ''; $flds = " b2sav.*, org.vCompanyName as vBuyer2, org.vCompCode, so.vCompanyName as vSupplier, so.vCompCode "; $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);