コード例 #1
0
    if (trim($scd) != '' && trim($snm) == '') {
        $whr .= " AND spo.vProductCode LIKE '%{$scd}%' ";
    } else {
        if (trim($scd) != '' && trim($snm) != '') {
            $whr .= " AND (spo.vProductName LIKE '%{$snm}%' OR spo.vProductCode LIKE '%{$scd}%') ";
        }
    }
}
if (trim($iBuyer2Id) != '' && $iBuyer2Id > 0) {
    $whr .= " AND spo.iProductId NOT IN (Select iProductId from " . PRJ_DB_PREFIX . "_buyer2_sproduct_association where iBuyer2Id={$iBuyer2Id} AND NOT (eStatus='Delete' AND eNeedToVerify='No'))";
}
if (trim($sid) != '' && $sid > 0) {
    $whr .= " OR spo.iProductId={$sid} ";
}
// echo $whr; exit;
$sprdt = $sprdtObj->getDetails("*", " AND spo.eAvailability='association' {$whr} ", " spo.vProductName ASC ");
// prints($sprdt); exit;
if (is_array($sprdt) && count($sprdt) > 0) {
    $ln = count($sprdt);
    $html .= "<select id='{$fid}' name='{$fnm}' class='{$cls}' {$ea} style='{$styl}' title='" . $smarty->get_template_vars('LBL_SELECT') . ' ' . $smarty->get_template_vars('LBL_SPRODUCT') . "'>";
    for ($l = 0; $l < $ln; $l++) {
        $sel = "";
        if ($sid > 0 && $bprdt[$l]['iProductId'] == $sid) {
            $sel = "selected='selected'";
        }
        $html .= "<option value='" . $sprdt[$l]['iProductId'] . "'>" . $sprdt[$l]['vProductName'] . " (" . $sprdt[$l]['vProductCode'] . ")" . "</option>";
    }
    $html .= "</select>";
} else {
    $html .= "<select id='{$fid}' name='{$fnm}' class='{$cls}' {$ea} style='{$styl}' title='" . $smarty->get_template_vars('LBL_SELECT') . ' ' . $smarty->get_template_vars('LBL_SPRODUCT') . "'>";
    $html .= "<option value=''>---" . $smarty->get_template_vars('LBL_SELECT') . ' ' . $smarty->get_template_vars('LBL_SPRODUCT') . "---</option>";
コード例 #2
0
ファイル: b2sprodtsasoc.php プロジェクト: nstungxd/F2CA5
        $arr[0] = $post_data['Data'];
        if (isset($arr[0]['iBuyer2Id']) && $arr[0]['iBuyer2Id'] > 0) {
            if (!isset($orgObj)) {
                include_once SITE_CLASS_APPLICATION . "organization/class.Organization.php";
                $orgObj = new Organization();
            }
            $buyer2 = $orgObj->getDetails('vCompanyName, vCompCode', " AND iOrganizationID='" . $arr[0]['iBuyer2Id'] . "'");
            $arr[0]['vBuyer2'] = $buyer2[0]['vCompanyName'];
            $arr[0]['vB2Code'] = $buyer2[0]['vCompCode'];
        }
        if (isset($arr[0]['iProductId']) && $arr[0]['iProductId'] > 0) {
            if (!isset($spoObj)) {
                include_once SITE_CLASS_APPLICATION . "productorganization/class.SProductOrganization.php";
                $spoObj = new SProductOrganization();
            }
            $product = $spoObj->getDetails('vProductName, vProductCode', " AND iProductId='" . $arr[0]['iProductId'] . "'");
            $arr[0]['vProduct'] = $product[0]['vProductName'];
            $arr[0]['vProductCode'] = $product[0]['vProductCode'];
        }
        $arr[0]['iSupplierId'] = 0;
    }
    // pr($arr); exit;
}
// For OAs
// pr($_SESSION); exit;
if (isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ORGTYPE']) && $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ORGTYPE'] != 'Buyer2' && $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USRTYPE'] != 'SM') {
    if ($iAssociationId > 0) {
        header("Location: " . SITE_URL_DUM . "b2sprodtsasocview/{$iAssociationId}");
    } else {
        header("Location: " . SITE_URL_DUM . "b2sprodtsasoclist");
    }
コード例 #3
0
ファイル: sprodtls.php プロジェクト: nstungxd/F2CA5
<?php

$iProductId = GetVar('id');
$dtls = array();
if (trim($iProductId) != '' && $iProductId > 0) {
    if (!isset($sProductOrgObj)) {
        include_once SITE_CLASS_APPLICATION . 'productorganization/class.SProductOrganization.php';
        $sProductOrgObj = new SProductOrganization();
    }
    $flds = "spo.iProductId, spo.vProductName, spo.vProductCode, 'sproduct' as eProductType, spo.eAvailability, (select vBankName from " . PRJ_DB_PREFIX . "_bank_master bm where bm.iBankId=spo.iBankId) as vBankName, spo.vBankAccount";
    $dtls = $sProductOrgObj->getDetails($flds, " AND iProductId='{$iProductId}' ");
}
if (!(is_array($dtls) && count($dtls) > 0)) {
    $dtls = 'nrf';
}
$smarty->assign("dtls", $dtls);
コード例 #4
0
ファイル: aj_getproducts.php プロジェクト: nstungxd/F2CA5
}
$dtls = array();
if ($curORGID > 0 && $orgas != '' && ($iInvoiceID > 0 || $iPurchaseOrderID > 0)) {
    if ($orgas == 'Buyer') {
        if (!isset($bProductOrgObj)) {
            include_once SITE_CLASS_APPLICATION . 'productorganization/class.BProductOrganization.php';
            $bProductOrgObj = new BProductOrganization();
        }
        $dtls = $bProductOrgObj->getDetails("iProductId, vProductName, vProductCode, 'bproduct' as eProductType", " AND eAvailability='{$availability}' {$whr}");
    } else {
        if ($orgas == 'Supplier') {
            if (!isset($sProductOrgObj)) {
                include_once SITE_CLASS_APPLICATION . 'productorganization/class.SProductOrganization.php';
                $sProductOrgObj = new SProductOrganization();
            }
            $dtls = $sProductOrgObj->getDetails("iProductId, vProductName, vProductCode, 'sproduct' as eProductType", " AND eAvailability='{$availability}' {$whr}");
        } else {
            if ($orgas == 'Both') {
                $sql = "(Select iProductId, vProductName, vProductCode, 'b' as eProductType from " . PRJ_DB_PREFIX . "_bproduct_organization where eAvailability='{$availability} {$whr}')\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\t(Select iProductId, vProductName, vProductCode, 's' as eProductType from " . PRJ_DB_PREFIX . "_sproduct_organization where eAvailability='{$availability} {$whr}')\r\n\t\t\t\t\tORDER BY vProductName ASC";
                $dtls = $dbobj->MySQLSelect($sql);
            }
        }
    }
}
?>
<select id="<?php 
echo $elid;
?>
" class="save required" name="<?php 
echo $elnm;
?>
コード例 #5
0
ファイル: aj_showprdtls.php プロジェクト: nstungxd/F2CA5
    if ($typ == 'b') {
        if (!isset($bProductOrgObj)) {
            include_once SITE_CLASS_APPLICATION . 'productorganization/class.BProductOrganization.php';
            $bProductOrgObj = new BProductOrganization();
        }
        $flds = "bpo.iProductId, bpo.vProductName, bpo.vProductCode, 'sproduct' as eProductType, bpo.eAvailability, (select vBankName from " . PRJ_DB_PREFIX . "_bank_master bm where bm.iBankId=bpo.iBankId) as vBankName, bpo.vBankAccount";
        $dtls = $bProductOrgObj->getDetails($flds, " AND iProductId='{$ipids}' ");
    } else {
        if ($typ == 's') {
            if (!isset($sProductOrgObj)) {
                include_once SITE_CLASS_APPLICATION . 'productorganization/class.SProductOrganization.php';
                $sProductOrgObj = new SProductOrganization();
            }
            $flds = "spo.iProductId, spo.vProductName, spo.vProductCode, 'sproduct' as eProductType, spo.eAvailability, (select vBankName from " . PRJ_DB_PREFIX . "_bank_master bm where bm.iBankId=spo.iBankId) as vBankName, spo.vBankAccount";
            // echo "Select ". $flds ." from "." where AND iProductId='$ipids'"; exit;
            $dtls = $sProductOrgObj->getDetails($flds, " AND spo.iProductId='{$ipids}' ");
        }
    }
}
if (is_array($dtls) && count($dtls) > 0 && isset($dtls[0]['iProductId']) && $dtls[0]['iProductId'] > 0) {
    ?>
<table cellpadding="0" cellspacing="0" style="background:#f7f7f7; font-size:12px;">
<tr>
	<td colspan="2" align="left" valign="top"><b><u><?php 
    echo $smarty->get_template_vars('LBL_PRODUCT') . ' ' . $smarty->get_template_vars('LBL_DETAILS');
    ?>
</u>:-</b></td>
</tr>
<tr>
	<td width="190px" valign="top"><?php 
    echo $smarty->get_template_vars('LBL_PRODUCT');