Ejemplo n.º 1
0
$cursorttype = $_POST['cursorttype'];
if ($cursort != '') {
    if ($cursorttype == '1') {
        $cursort_type = 'ASC';
    } else {
        $cursort_type = 'DESC';
    }
    $orderBy = " {$cursort} {$cursort_type}";
} else {
    $orderBy = " b2bpb.dADate DESC ";
}
## ENDS HERE ###
$where .= " AND NOT (b2bpb.eStatus='Delete' AND b2bpb.eNeedToVerify!='Yes') ";
$limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " ";
$jtbl = "";
$fields = "b2bpb.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bpb.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t (Select vProductName from " . PRJ_DB_PREFIX . "_bproduct_organization where iProductId=b2bpb.iProductId) as vProduct,\r\n                (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bpb.iBuyerId) as vBuyer";
// (Select CONCAT(vCompanyName,' (',b2bpb.vSupplierCode,')') from b2b_organization_master where iOrganizationID=b2bpb.iSupplierAssocationID) as vSupplierOrg
$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, "listb2bprdtbassocs", $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);
Ejemplo n.º 2
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 = " b2bpb.*, org.vCompanyName as vBuyer2, org.vCompCode as vB2Code, bpo.vProductName as vProduct, bpo.vProductCode, bo.vCompanyName as vBuyer, bo.vCompCode as vBCode ";
    $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_bproduct_organization bpo on bpo.iProductId=b2bpb.iProductId\r\n               LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2bpb.iBuyer2Id\r\n               LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master bo on bo.iOrganizationID=b2bpb.iBuyerId";
    $arr = $b2bpbObj->getJoinTableInfo($jtbl, $flds, " AND iAssociationId={$iAssociationId} ");
    if (!(is_array($arr) && count($arr) > 0)) {
        header('Location: ' . SITE_URL_DUM . 'b2bprodtbasoclist');
        exit;
    } else {
        if (!(isset($arr[0]['eStatus']) && (($arr[0]['eStatus'] == 'Active' || $arr[0]['eStatus'] == 'Inactive') && $arr[0]['eNeedToVerify'] != 'Yes'))) {
            header('Location: ' . SITE_URL_DUM . 'b2bprodtbasocview/' . $iAssociationId);
            exit;
        }
    }
    if ($arr[0]['eStatus'] == 'Delete' && $arr[0]['eNeedToVerify'] != 'Yes') {
        header('Location: ' . SITE_URL_DUM . 'b2bprodtbasoclist/rnme');
        exit;
    }
} else {
    $mod = 'add';