本文整理汇总了PHP中Contacts::addContact方法的典型用法代码示例。如果您正苦于以下问题:PHP Contacts::addContact方法的具体用法?PHP Contacts::addContact怎么用?PHP Contacts::addContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contacts
的用法示例。
在下文中一共展示了Contacts::addContact方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showRespondentSetContactStatus
function showRespondentSetContactStatus($primkey, $type = 1)
{
if ($type == 1) {
$respondent = new Respondent($primkey);
} else {
$respondent = new Household($primkey);
}
$contactcode = loadvar("csid");
$contactts = date('Y-m-d H:i:s');
$contacts = new Contacts();
$errorMessage = $contacts->addContact($primkey, $contactcode, $contactts, '', '', '', '', $_SESSION['URID']);
if ($respondent->getUrid() != $_SESSION['URID']) {
//if assigned to other urid than this
//add to communication!
$communication = new Communication();
$communication->addSQLToUser($contacts->getLastQuery(), $respondent->getUrid());
}
$display = new Display();
if (sizeof($errorMessage) == 0) {
return $this->showInterviewerRespondentInfo($primkey, $display->displayInfo(Language::messageContactAdded()), $type);
} else {
return $this->showInterviewerRespondentInfo($primkey, $display->displayError(implode('<br/>', $errorMessage)), $type);
}
}
示例2: showAddContactRes
function showAddContactRes($primkey)
{
$respondent = new Respondent($primkey);
$contactwith = loadvar("contactwith");
$contactperson = loadvar("contactperson");
$contactcode = loadvar("contactcode");
$contactts = loadvar("contactts");
$contactappointment = loadvar("contactappointment");
$contactremark = loadvar("contactremark");
$contacts = new Contacts();
$errorMessage = $contacts->addContact($primkey, $contactcode, $contactts, $contactwith, $contactperson, $contactremark, $contactappointment, $_SESSION['URID']);
$display = new Display();
if (sizeof($errorMessage) == 0) {
return $this->showInfo($primkey, $display->displayInfo(Language::messageContactAdded()));
} else {
return $this->showAddContact($primkey, $display->displayError(implode('<br/>', $errorMessage)));
}
}
示例3: Contacts
$phone = test_input($_POST["phone"]);
$phoneErr = "";
}
}
if (!preg_match("/^[a-zA-Z ]*\$/", $name)) {
$nameErr = "Only letters and white space allowed. ";
}
if (!preg_match("/^[0-9]+\$/", $phone) && !empty($phone)) {
$phoneErr = "Only numbers allowed. ";
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL) && !empty($email)) {
$emailErr = "Invalid email format";
}
if ($nameErr . $emailErr . $phoneErr . $phoneErr == '') {
$contact = new Contacts();
if ($contact->addContact($name, $company, $address, $phone, $email, $notes)) {
$name = $company = $address = $phone = $email = $notes = '';
header('Location: addContact.php?action=addContactOK');
} else {
header('Location: addContact.php?action=addContactFail');
}
}
require "header.php";
?>
<div class="clearfix visible-xs-block"></div>
<?php
switch ($_GET['action']) {
case 'addContactOK':
echo '</p><span><font class="addContactOK">Contact added.</font></span></p>';
示例4: showStartSurvey
function showStartSurvey($primkey, $type = 1, $message = '')
{
if ($type == 1) {
$respondent = new Respondent($primkey);
} else {
$respondent = new Household($primkey);
}
$_SESSION['SURVEYLOGIN'] = LOGIN_DIRECT;
$respondent->setStatus(1);
//set status to 1: started survey
$respondent->saveChanges();
//add contact 100
$contactcode = Language::startInterviewCode();
$contactts = date('Y-m-d H:i:s');
$contacts = new Contacts();
$errorMessage = $contacts->addContact($respondent->getPrimkey(), $contactcode, $contactts, '', '', '', '', $_SESSION['URID']);
//end add contact
$displayInterviewer = new DisplayInterviewer();
return $displayInterviewer->showStartSurvey($respondent, $message);
}