Пример #1
0
    exit;
}
if (!isset($b2baObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_Association.php";
    $b2baObj = new Buyer2_Buyer_Association();
}
if (!isset($b2bavObj)) {
    include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Buyer_Association_ToVerify.php";
    $b2bavObj = new Buyer2_Buyer_Association_ToVerify();
}
if (!isset($emailObj)) {
    include_once SITE_CLASS_APPLICATION . 'class.EmailTemplate.php';
    $emailObj = new EmailTemplate();
}
$flds = "b2ba.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2ba.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t(Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2ba.iBuyerId) as vBuyer";
$assocs = $b2baObj->getDetails($flds, " AND b2ba.eStatus IN ('Active','Inactive') AND b2ba.eNeedToVerify!='Yes' AND b2ba.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) != '') {
    $sql1 = "UPDATE " . PRJ_DB_PREFIX . "_buyer2_buyer_association SET eStatus = IF(eStatus='Inactive','Active','Inactive'), eNeedToVerify='Yes', eModifiedBy='" . $sess_usertype_short . "', iModifiedByID='" . $sess_id . "', dModifiedDate='" . date('Y-m-d H:i:s') . "', eVerifiedBy='', iVerifiedByID='', dVerifiedDate='', eRejectedBy='', iRejectedByID='', dRejectedDate='' WHERE iAssociationId IN ({$vl})";
    $sql2 = "INSERT INTO b2b_buyer2_buyer_association_toverify\r\n            (iAssociationId,iBuyer2Id,iBuyerId,vACode,vAccount1,vAcc1Code,vCurrency1,vAccount2,vAcc2Code,vCurrency2,dADate,vFromIP,iCreatedByID,eCreatedBy,iModifiedByID,eModifiedBy,dModifiedDate,iRejectedByID,eRejectedBy,dRejectedDate,iVerifiedByID,eVerifiedBy,dVerifiedDate,tReasonToReject,eNeedToVerify,eStatus)\r\n            SELECT * FROM b2b_buyer2_buyer_association WHERE iAssociationId IN ({$vl})";
    // $rs = $dbobj->dotransaction($sqls);
    $rs = $dbobj->sql_query($sql1);
    if ($rs) {
Пример #2
0
         $whr_cndt = " AND vType='{$esubtyp}' AND eSection='Member' ";
         $email_cnt = $emailObj->getDetails('*', $whr_cndt);
         $type = "Modified";
         $body = array("#BUYER2#", "#BUYER#", "#ACODE#", "#LINK#", "#MODIFIED_BY#");
         $body_arr = array("#USER#", "#BUYER2#", "#BUYER#", "#ACODE#", "#LINK#", "#MODIFIED_BY#", "#MAIL_FOOTER#", "#SITE_URL#");
     } else {
         $msg = 'uerr';
     }
     $id = $iAssociationId;
 } else {
     if ($mod == 'add') {
         // $mod = 'add';
         if (isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ORGTYPE']) && $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ORGTYPE'] == 'Buyer2') {
             $Data['iBuyer2Id'] = $curORGID;
         }
         $drec = $b2baObj->getDetails('*', " AND iBuyer2Id=" . $Data['iBuyer2Id'] . " AND iBuyerId=" . $Data['iBuyerId'] . "");
         if (is_array($drec) && count($drec) > 0 && isset($drec[0]['iAssociationId']) && $drec[0]['iAssociationId'] > 0) {
             if (isset($_SERVER['HTTP_REFERER']) && trim($_SERVER['HTTP_REFERER']) != '') {
                 header("Location: " . $_SERVER['HTTP_REFERER']);
             } else {
                 header("Location: " . SITE_URL_DUM . "b2buyerasoclist");
             }
             exit;
         }
         $Data['dADate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
         $Data['vFromIP'] = $_SERVER['REMOTE_ADDR'];
         $Data['eCreatedBy'] = $sess_usertype_short;
         $Data['iCreatedByID'] = $sess_id;
         $Data['eStatus'] = 'Need to Verify';
         $Data['vACode'] = $b2baObj->getUniqueCode('');
         $rs = $id = $b2baObj->insert($Data);