Exemplo n.º 1
0
<?php

if (!isset($b2bpbObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association.php";
    $b2bpbObj = new Buyer2_Buyer_BProduct_Association();
}
if (!isset($b2bpbvObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association_ToVerify.php";
    $b2bpbvObj = new Buyer2_Buyer_BProduct_Association_ToVerify();
}
if (!isset($emailObj)) {
    include_once SITE_CLASS_APPLICATION . 'class.EmailTemplate.php';
    $emailObj = new EmailTemplate();
}
$mod = PostVar('mod');
$admr = PostVar('admr');
$iAssociationId = PostVar('iAssociationId');
$Data = PostVar('Data');
$body_arr = '';
$type = '';
$post_data = $_POST;
if ($mod == 'verify') {
    $dtv = $vasocdt = $b2bpbvObj->getDetails('*', " AND iAssociationId={$iAssociationId} ", ' iVerifiedID DESC ', '', ' LIMIT 0,1');
    $dtv = $dtv[0];
    if (is_array($vasocdt) && count($vasocdt) > 0 && isset($vasocdt[0]['iAssociationId']) && isset($vasocdt[0]['iVerifiedID'])) {
        $dtv['eVerifiedBy'] = $sess_usertype_short;
        $dtv['iVerifiedByID'] = $sess_id;
        $dtv['dVerifiedDate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
        // if(! (($dtv['eStatus']=='Active' || $dtv['eStatus']=='Inactive' || $dtv['eStatus']=='Delete') )) {
        if (!(($dtv['eStatus'] == 'Active' || $dtv['eStatus'] == 'Inactive' || $dtv['eStatus'] == 'Delete') && $dtv['eNeedToVerify'] == 'Yes')) {
            $dtv['eStatus'] = 'Active';
Exemplo n.º 2
0
$code = isset($_POST['code']) ? $_POST['code'] : '';
$product = isset($_POST['product']) ? $_POST['product'] : '';
$buyer = isset($_POST['buyer']) ? $_POST['buyer'] : '';
$stype = isset($_POST['styp']) ? $_POST['styp'] : '';
$page = $_POST['page'];
if (trim($page) == '' || trim($page) < 1) {
    $page = 1;
}
// prints($_POST); exit;
if (!isset($orgObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Organization.php";
    $orgObj = new Organization();
}
if (!isset($assObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association.php";
    $assObj = new Buyer2_Buyer_BProduct_Association();
}
$where = "";
$_POST['srchval'] = isset($_POST['srchval']) ? $_POST['srchval'] : '';
if ($_POST['srchval'] == 'act') {
    $where .= " AND b2bpb.eStatus='Active' ";
} else {
    if ($_POST['srchval'] == 'inact') {
        $where .= " AND b2bpb.eStatus='Inactive' ";
    }
}
if ($mode == 'all') {
    if ($val != '') {
        $where .= " AND ((Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bpb.iBuyer2Id) LIKE '%{$val}%' OR\r\n   \t\t\t\t\t\t(Select vProductName from " . PRJ_DB_PREFIX . "_bproduct_organization where iProductId=b2bpb.iProductId) LIKE '%{$val}%' OR\r\n                     (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2bpb.iBuyerId) LIKE '%{$val}%' OR\r\n                     vACode LIKE '%{$val}%' )";
    }
    // echo $where; exit;
Exemplo n.º 3
0
<?php

$mode = PostVar('mode');
$val = PostVar('val');
if (trim($val) == '' || $val < 1 || trim($mode) == '') {
    exit;
}
if (!isset($b2bpbObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association.php";
    $b2bpbObj = new Buyer2_Buyer_BProduct_Association();
}
if (!isset($b2bpbvObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association_ToVerify.php";
    $b2bpbvObj = new Buyer2_Buyer_BProduct_Association_ToVerify();
}
if (!isset($emailObj)) {
    include_once SITE_CLASS_APPLICATION . 'class.EmailTemplate.php';
    $emailObj = new EmailTemplate();
}
$flds = "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";
$assocs = $b2bpbObj->getDetails($flds, " AND b2bpb.eStatus IN ('Active','Inactive') AND b2bpb.eNeedToVerify!='Yes' AND b2bpb.iAssociationId IN ({$val}) ");
// pr($assocs); exit;
$assocsids = multi21Array($assocs, 'iAssociationId');
$vl = '';
if (is_array($assocsids) && count($assocsids) > 0) {
    $vl = @implode(',', $assocsids);
}
$rs = false;
$type = '';
$esubtyp = '';
if ($mode == 'status' && trim($vl) != '') {
Exemplo n.º 4
0
<?php

if (!isset($b2bpbObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association.php";
    $b2bpbObj = new Buyer2_Buyer_BProduct_Association();
}
$iAssociationId = GetVar('id');
// $msg = GetVar('msg');
$msg = '';
if (isset($_SESSION[PRJ_CONST_PREFIX . '_action_msg']) && trim($_SESSION[PRJ_CONST_PREFIX . '_action_msg']) != '') {
    $msg = $_SESSION[PRJ_CONST_PREFIX . '_action_msg'];
    unset($_SESSION[PRJ_CONST_PREFIX . '_action_msg']);
}
if ($msg == 'ras') {
    $msg = $smarty->get_template_vars('MSG_ADD_SUCC');
} elseif ($msg == 'aerr') {
    $msg = $smarty->get_template_vars('MSG_ADD_ERR');
} elseif ($msg == 'rus') {
    $msg = $smarty->get_template_vars('MSG_UPDATE_SUCC');
} elseif ($msg == 'uerr') {
    $msg = $smarty->get_template_vars('MSG_UPDATE_ERR');
} elseif ($msg == 'rvs') {
    $msg = $smarty->get_template_vars('MSG_VERIFY_SUCC');
} elseif ($msg == 'verr') {
    $msg = $smarty->get_template_vars('MSG_VERIFY_ERR');
} elseif ($msg == 'rds') {
    $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');
Exemplo n.º 5
0
$orgas = "";
$invdtls = $invOrdObj->getDetails('iBuyerOrganizationID,iSupplierOrganizationID', " AND iInvoiceID={$iInvoiceID} ");
if ($invdtls[0]['iBuyerOrganizationID'] == $curORGID) {
    $orgas = "Buyer";
} else {
    if ($invdtls[0]['iSupplierOrganizationID'] == $curORGID) {
        $orgas = "Supplier";
    }
}
$orgas = trim($orgas) != '' ? $orgas : $uorg_type;
$dtls = array();
if ($curORGID > 0 && $orgas != '') {
    if ($orgas == 'Buyer') {
        if (!isset($b2bpbObj)) {
            include_once SITE_CLASS_APPLICATION . 'organization/class.Buyer2_Buyer_BProduct_Association.php';
            $b2bpbObj = new Buyer2_Buyer_BProduct_Association();
        }
        $dtls = $b2bpbObj->getDetails("*", " AND iBuyerId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids} ");
    } else {
        if ($orgas == 'Supplier') {
            if (!isset($b2spsObj)) {
                include_once SITE_CLASS_APPLICATION . 'organization/class.Buyer2_Supplier_SProduct_Association.php';
                $b2spsObj = new Buyer2_Supplier_SProduct_Association();
            }
            $dtls = $b2spsObj->getDetails("*", " AND iSupplierId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids} ");
        } else {
            if ($orgas == 'Both') {
                $sql = "(Select DISTINCT * from " . PRJ_DB_PREFIX . "_buyer2_buyer_bproduct_association where iBuyerId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids})\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\t(Select DISTINCT * from " . PRJ_DB_PREFIX . "_buyer2_supplier_sproduct_association where iSupplierId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids})\r\n\t\t\t\t\tORDER BY vACode ASC";
                // echo $sql; exit;
                $dtls = $dbobj->MySQLSelect($sql);
            }
Exemplo n.º 6
0
<?php

$iAssociationId = GetVar('id');
/*if($sess_usertype == 'orgadmin' && $asoc != $iAssociationId) {
   header("Location: ".SITE_URL_DUM."oadashboard");
   exit;
}*/
if (!isset($b2bpbObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association.php";
    $b2bpbObj = new Buyer2_Buyer_BProduct_Association();
}
if (!isset($b2bpbvObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_BProduct_Association_ToVerify.php";
    $b2bpbvObj = new Buyer2_Buyer_BProduct_Association_ToVerify();
}
$b2bprdtls = $b2bpbObj->select($iAssociationId);
$b2bprdthistory = $b2bpbvObj->getHistory($iAssociationId);
// prints($b2bprdthistory); exit;
$smarty->assign('b2bprdtls', $b2bprdtls);
$smarty->assign('b2bprdthistory', $b2bprdthistory);