当前位置: 首页>>代码示例>>PHP>>正文


PHP Customers::getCustomerContactByGuid方法代码示例

本文整理汇总了PHP中Customers::getCustomerContactByGuid方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::getCustomerContactByGuid方法的具体用法?PHP Customers::getCustomerContactByGuid怎么用?PHP Customers::getCustomerContactByGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customers的用法示例。


在下文中一共展示了Customers::getCustomerContactByGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: customers_maintcontent_alm_customers_BeforeShow

function customers_maintcontent_alm_customers_BeforeShow(&$sender)
{
    $customers_maintcontent_alm_customers_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_maintcontent;
    //Compatibility
    //End customers_maintcontent_alm_customers_BeforeShow
    //Custom Code @140-2A29BDB7
    // -------------------------
    // Write your own code here.
    $guid = CCGetFromGet("guid", "");
    $contact_guid = CCGetFromGet("contact_guid", "");
    $tab = CCGetFromGet("tab", "");
    $o = CCGetFromGet("o", "");
    $params = array();
    $params["customer_guid"] = $guid;
    $params["contact_guid"] = $contact_guid;
    if (strlen($guid) > 0) {
        global $Tpl;
        global $FileName;
        $customers = new Customers();
        $contacts = $customers->getCustomerContacts($params);
        $contacts = $contacts["contacts"];
        $querystring = CCGetQueryString("QueryString", array("contact_guid"));
        $db = new clsDBdbConnection();
        foreach ($contacts as $contact) {
            $editurl = $FileName . "?{$querystring}&contact_guid=" . $contact["guid"] . "&tab=addcontact";
            $Tpl->setvar("lbedit", $editurl);
            if ($contact["maincontact"] == "1") {
                $Tpl->setvar("lbmaincontact", "");
            } else {
                $Tpl->setvar("lbmaincontact", "hide");
            }
            $Tpl->setvar("lbcontact", $contact["contact"]);
            $jobposition = $contact["jobposition"];
            $jobposition = CCDLookup("jobposition", "alm_jobpositions", "id = {$jobposition}", $db);
            $Tpl->setvar("lbcontact_jobposition", $jobposition);
            $Tpl->setvar("lbcontact_phone", $contact["phone"]);
            $Tpl->setvar("lbcontact_extension", $contact["extension"]);
            $Tpl->setvar("lbcontact_mobile", $contact["mobile"]);
            $Tpl->setvar("lbcontact_workemail", $contact["workemail"]);
            $Tpl->setvar("lbcontact_personalemail", $contact["personalemail"]);
            $dateupdated = $contact["dateupdated"];
            if (strlen($dateupdated) > 0) {
                $dateupdated_array = CCParseDate($dateupdated, array("yyyy", "-", "mm", "-", "dd", " ", "H", ":", "n", ":", "s"));
                $format = array("mm", "/", "dd", "/", "yyyy", " ", "hh", ":", "nn", " ", "AM/PM");
                $dateupdated = CCFormatDate($dateupdated_array, $format);
                $Tpl->setvar("lbcontact_dateupdated", $dateupdated);
            }
            $Tpl->parse("contact_list", true);
        }
        $db->close();
    }
    //Filling up contact info for updates
    if (strlen($contact_guid) > 0 && $o != "delcontact") {
        $customers = new Customers();
        $contacts = $customers->getCustomerContactByGuid($params);
        $contacts = $contacts["contacts"];
        if (is_array($contacts[0])) {
            $customers_maintcontent->alm_customers->contact->SetValue($contacts[0]["contact"]);
            $customers_maintcontent->alm_customers->contact_jobposition->SetValue($contacts[0]["jobposition"]);
            $customers_maintcontent->alm_customers->contact_phone->SetValue($contacts[0]["phone"]);
            $customers_maintcontent->alm_customers->contact_extension->SetValue($contacts[0]["extension"]);
            $customers_maintcontent->alm_customers->contact_mobile->SetValue($contacts[0]["mobile"]);
            $customers_maintcontent->alm_customers->contact_workemail->SetValue($contacts[0]["workemail"]);
            $customers_maintcontent->alm_customers->contact_personalemail->SetValue($contacts[0]["personalemail"]);
            $customers_maintcontent->alm_customers->contact_maincontact->SetValue($contacts[0]["maincontact"]);
            $contact_dob = $contacts[0]["contact_dob"];
            $contact_dob_array = CCParseDate($contact_dob, array("yyyy", "-", "mm", "-", "dd"));
            if ($contact_dob_array[1] == "0000") {
                $contact_dob_array = null;
            }
            $customers_maintcontent->alm_customers->contact_dob->SetValue($contact_dob_array);
            $contact_preferred_color = explode(",", $contacts[0]["preferred_color"]);
            $customers_maintcontent->alm_customers->contact_preferred_color->Multiple = true;
            $customers_maintcontent->alm_customers->contact_preferred_color->SetValue($contact_preferred_color);
            $contact_hobbies = explode(",", $contacts[0]["hobbies"]);
            $customers_maintcontent->alm_customers->contact_hobbies->Multiple = true;
            $customers_maintcontent->alm_customers->contact_hobbies->SetValue($contact_hobbies);
            $contact_holidays = explode(",", $contacts[0]["notify_holidays"]);
            $customers_maintcontent->alm_customers->contact_notify_holidays->Multiple = true;
            $customers_maintcontent->alm_customers->contact_notify_holidays->SetValue($contact_holidays);
        }
    }
    // -------------------------
    //End Custom Code
    //Close customers_maintcontent_alm_customers_BeforeShow @8-32D525B2
    return $customers_maintcontent_alm_customers_BeforeShow;
}
开发者ID:wangshipeng,项目名称:license_manager,代码行数:90,代码来源:customers_maintcontent_events.php


注:本文中的Customers::getCustomerContactByGuid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。