當前位置: 首頁>>代碼示例>>PHP>>正文


PHP astercrm::insertNewCustomerLead方法代碼示例

本文整理匯總了PHP中astercrm::insertNewCustomerLead方法的典型用法代碼示例。如果您正苦於以下問題:PHP astercrm::insertNewCustomerLead方法的具體用法?PHP astercrm::insertNewCustomerLead怎麽用?PHP astercrm::insertNewCustomerLead使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在astercrm的用法示例。


在下文中一共展示了astercrm::insertNewCustomerLead方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save


//.........這裏部分代碼省略.........
            }
        } else {
            $respOk = $f['customerid'];
        }
        $customerID = $respOk;
    }
    if (empty($f['contact'])) {
        $contactID = 0;
    } else {
        if ($f['contactid'] == '') {
            if ($config['system']['allow_same_data'] == false) {
                //檢查是否有完全匹配的contact記錄
                $contact = Customer::checkValues("contact", "contact", $f['contact'], "string", "customerid", $customerID, "int");
            } else {
                $contact = '';
            }
            //有完全匹配的話就取這個contactid
            if ($contact != '') {
                $respOk = $contact;
                $objResponse->addAlert($locate->Translate("found_contact_replaced"));
            } else {
                $respOk = Customer::insertNewContact($f, $customerID);
                // insert a new contact record
                if (!$respOk) {
                    $objResponse->addAlert($locate->Translate("contact_add_error"));
                    return $objResponse;
                }
                $objResponse->addAlert($locate->Translate("a_new_contact_added"));
            }
        } else {
            $respOk = $f['contactid'];
            $res =& Customer::getContactByID($respOk);
            if ($res) {
                $contactCustomerID = $res['customerid'];
                if ($contactCustomerID == 0 && $customerID == 0) {
                } else {
                    $res =& Customer::updateField('contact', 'customerid', $customerID, $f['contactid']);
                    if ($res) {
                        $objResponse->addAlert($locate->Translate("a_contact_binding"));
                    }
                }
            }
        }
        $contactID = $respOk;
    }
    if ($f['surveyoption'] != '' || $f['surveynote'] != '') {
        $respOk = Customer::insertNewSurveyResult($f['surveyid'], $f['surveyoption'], $f['surveynote'], $customerID, $contactID);
        $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("survey_added"));
    }
    $saveNote = '';
    if (!empty($f['note']) || !empty($f['note_code'])) {
        $saveNote = true;
        $respOk = Customer::insertNewNote($f, $customerID, $contactID);
        // add a new Note
        if ($respOk) {
            $html = createGrid(0, ROWSXPAGE);
            $objResponse->addAssign("grid", "innerHTML", $html);
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("a_new_note_added"));
        } else {
            $objResponse->addAlert($locate->Translate("note_add_error"));
            return $objResponse;
        }
    } else {
        $saveNote = false;
    }
    // 查看是否有scheduler call
    if ($f['addedSchedulerDialId'] != '') {
        $res = astercrm::updateAddedSchedulerDial($customerID, $f['addedSchedulerDialId']);
        $objResponse->addAssign("formdAddSechedualaraDiv", "style.visibility", "hidden");
        $objResponse->addAssign("formdAddSechedualaraDiv", "innerHTML", '');
    }
    /*if(empty($f['sDialNum'])) {
    
    	} else{
    		$f['customerid'] = $customerID;
    		$res = astercrm::insertNewSchedulerDial($f);
    		if ($res){
    			$objResponse->addAlert($locate->Translate("Scheduler Call added"));
    		}
    	}*/
    if ($f['customer_leads_check'] == 'on') {
        if ($customerID != '' && $customerID != 0) {
            astercrm::insertNewCustomerLead($customerID, $config['system']['customer_leads'], $saveNote);
        }
    }
    $objResponse->addAssign("formDiv", "style.visibility", "hidden");
    $objResponse->addAssign("formCustomerInfo", "style.visibility", "hidden");
    $objResponse->addAssign("formContactInfo", "style.visibility", "hidden");
    $objResponse->addAssign("formNoteInfo", "style.visibility", "hidden");
    $objResponse->addClear("formDiv", "innerHTML");
    $objResponse->addClear("formCustomerInfo", "innerHTML");
    $objResponse->addClear("formContactInfo", "innerHTML");
    $objResponse->addClear("formNoteInfo", "innerHTML");
    $objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
    if ($chtml != '') {
        $objResponse->addAssign("formCustomerInfo", "style.visibility", "visible");
        $objResponse->addAssign("formCustomerInfo", "innerHTML", $chtml);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:101,代碼來源:astercrm.server.common.php

示例2: customerLeadsAction

function customerLeadsAction($leadType, $f, $searchFormValue)
{
    $objResponse = new xajaxResponse();
    if (is_array($f['ckb'])) {
        foreach ($f['ckb'] as $vaule) {
            $res_contact = astercrm::insertNewCustomerLead($vaule, $leadType, true);
        }
    }
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $numRows = $searchFormValue['numRows'];
    $limit = $searchFormValue['limit'];
    $html = createGrid($numRows, $limit, $searchField, $searchContent, '', 'grid');
    $objResponse->addAssign('grid', "innerHTML", $html);
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:18,代碼來源:customer.server.php


注:本文中的astercrm::insertNewCustomerLead方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。