本文整理汇总了PHP中Registration::setIPRange方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::setIPRange方法的具体用法?PHP Registration::setIPRange怎么用?PHP Registration::setIPRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::setIPRange方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Registration
/**
* Internal function to return a Registration object from a row.
* @param $row array
* @return Registration
*/
function &_returnRegistrationFromRow(&$row)
{
$registration = new Registration();
$registration->setId($row['registration_id']);
$registration->setSchedConfId($row['sched_conf_id']);
$registration->setUserId($row['user_id']);
$registration->setTypeId($row['type_id']);
$registration->setDateRegistered($this->dateFromDB($row['date_registered']));
$registration->setDatePaid($this->dateFromDB($row['date_paid']));
$registration->setMembership($row['membership']);
$registration->setDomain($row['domain']);
$registration->setIPRange($row['ip_range']);
$registration->setSpecialRequests($row['special_requests']);
$registration->setSurvey($row['survey']);
$registration->setApplicationForm($row['application_form']);
HookRegistry::call('RegistrationDAO::_returnRegistrationFromRow', array(&$registration, &$row));
return $registration;
}
示例2: execute
/**
* Save registration.
*/
function execute()
{
$registrationDao =& DAORegistry::getDAO('RegistrationDAO');
$schedConf =& Request::getSchedConf();
if (isset($this->registrationId)) {
$registration =& $registrationDao->getRegistration($this->registrationId);
}
if (!isset($registration)) {
$registration = new Registration();
$registration->setDateRegistered(time());
}
$registration->setSchedConfId($schedConf->getId());
$registration->setUserId($this->getData('userId'));
$registration->setTypeId($this->getData('typeId'));
$registration->setApplicationForm($this->getData('applicationForm'));
$registration->setSurvey($this->getData('survey'));
$registration->setMembership($this->getData('membership') ? $this->getData('membership') : null);
$registration->setDomain($this->getData('domain') ? $this->getData('domain') : null);
$registration->setIPRange($this->getData('ipRange') ? $this->getData('ipRange') : null);
$registration->setSpecialRequests($this->getData('specialRequests') ? $this->getData('specialRequests') : null);
// Send an email to the registrant informing them that their payment was received
if ($this->getData('notifyPaymentEmail')) {
$userDao =& DAORegistry::getDAO('UserDAO');
$schedConfName = $schedConf->getSchedConfTitle();
$schedConfId = $schedConf->getId();
$user =& $userDao->getUser($this->getData('userId'));
list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
$paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationContactSignature' => $registrationContactSignature);
import('mail.MailTemplate');
$mail = new MailTemplate('MANUAL_PAYMENT_RECEIVED');
$mail->setFrom($registrationEmail, $registrationName);
$mail->assignParams($paramArray);
$mail->addRecipient($user->getEmail(), $user->getFullName());
$mail->send();
}
$registration->setDatePaid($this->getData('datePaid'));
// Update or insert registration
if ($registration->getId() != null) {
$registrationDao->updateRegistration($registration);
} else {
$registrationDao->insertRegistration($registration);
}
$registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');
$registrationOptions =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId());
$registrationOptionIds = (array) $this->getData('registrationOptionIds');
$registrationOptionDao->deleteRegistrationOptionAssocByRegistrationId($this->registrationId);
while ($registrationOption =& $registrationOptions->next()) {
$optionId = (int) $registrationOption->getOptionId();
if (in_array($optionId, $registrationOptionIds)) {
$registrationOptionDao->insertRegistrationOptionAssoc($this->registrationId, $registrationOption->getOptionId());
}
unset($registrationOption);
}
if ($this->getData('notifyEmail')) {
// Send user registration notification email
$userDao =& DAORegistry::getDAO('UserDAO');
$registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
$schedConfName = $schedConf->getSchedConfTitle();
$schedConfId = $schedConf->getId();
$user =& $userDao->getUser($this->getData('userId'));
$registrationType =& $registrationTypeDao->getRegistrationType($this->getData('typeId'));
list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
$paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationType' => $registrationType->getSummaryString(), 'username' => $user->getEmail(), 'registrationContactSignature' => $registrationContactSignature);
import('mail.MailTemplate');
$mail = new MailTemplate('REGISTRATION_NOTIFY', null, null, null, null, false);
$mail->setFrom($registrationEmail, $registrationName);
$mail->assignParams($paramArray);
$mail->addRecipient($user->getEmail(), $user->getFullName());
$mail->send();
}
}
示例3: execute
/**
* Save registration.
*/
function execute()
{
$registrationDao = DAORegistry::getDAO('RegistrationDAO');
$schedConf =& Request::getSchedConf();
if (isset($this->registrationId)) {
$registration =& $registrationDao->getRegistration($this->registrationId);
}
if (!isset($registration)) {
$registration = new Registration();
$registration->setDateRegistered(time());
}
$registration->setSchedConfId($schedConf->getId());
$registration->setUserId($this->getData('userId'));
$registration->setTypeId($this->getData('typeId'));
$registration->setMembership($this->getData('membership') ? $this->getData('membership') : null);
$registration->setDomain($this->getData('domain') ? $this->getData('domain') : null);
$registration->setIPRange($this->getData('ipRange') ? $this->getData('ipRange') : null);
$registration->setSpecialRequests($this->getData('specialRequests') ? $this->getData('specialRequests') : null);
// Send an email to the registrant informing them that their payment was received
if ($this->getData('notifyPaymentEmail')) {
$userDao = DAORegistry::getDAO('UserDAO');
$schedConfName = $schedConf->getLocalizedName();
$schedConfId = $schedConf->getId();
$user =& $userDao->getById($this->getData('userId'));
list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
$paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationContactSignature' => $registrationContactSignature);
import('classes.mail.MailTemplate');
$mail = new MailTemplate('MANUAL_PAYMENT_RECEIVED');
$mail->setFrom($registrationEmail, $registrationName);
$mail->assignParams($paramArray);
$mail->addRecipient($user->getEmail(), $user->getFullName());
$mail->send();
}
$registration->setDatePaid($this->getData('datePaid'));
// Update or insert registration
if ($registration->getId() != null) {
$registrationDao->updateRegistration($registration);
} else {
$registrationDao->insertRegistration($registration);
}
$registrationOptionDao = DAORegistry::getDAO('RegistrationOptionDAO');
$registrationOptions =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId());
$registrationOptionIds = (array) $this->getData('registrationOptionIds');
$registrationOptionDao->deleteRegistrationOptionAssocByRegistrationId($this->registrationId);
$registrationTypeDao = DAORegistry::getDAO('RegistrationTypeDAO');
$registrationType =& $registrationTypeDao->getRegistrationType($registration->getTypeId());
// Present the itemized costs in the notification email
$totalCost = $registrationType->getCost();
$registrationOptionCosts = $registrationTypeDao->getRegistrationOptionCosts($registration->getTypeId());
$registrationOptionText = '';
// Record registration options (and tally up itemized costs for the email)
while ($registrationOption =& $registrationOptions->next()) {
$optionId = (int) $registrationOption->getOptionId();
$optionCost = isset($registrationOptionCosts[$optionId]) ? $registrationOptionCosts[$optionId] : 0;
if (in_array($optionId, $registrationOptionIds)) {
$registrationOptionDao->insertRegistrationOptionAssoc($this->registrationId, $registrationOption->getOptionId());
$registrationOptionText .= $registrationOption->getRegistrationOptionName() . ' - ' . sprintf('%.2f', $optionCost) . ' ' . $registrationType->getCurrencyCodeAlpha() . "\n";
$totalCost += $optionCost;
}
unset($registrationOption);
}
if ($this->getData('notifyEmail')) {
// Send user registration notification email
$userDao = DAORegistry::getDAO('UserDAO');
$registrationTypeDao = DAORegistry::getDAO('RegistrationTypeDAO');
$schedConfName = $schedConf->getLocalizedName();
$schedConfId = $schedConf->getId();
$user =& $userDao->getById($this->getData('userId'));
$registrationType =& $registrationTypeDao->getRegistrationType($this->getData('typeId'));
list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
$paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationType' => $registrationType->getSummaryString(), 'registrationOptions' => $registrationOptionText, 'totalCost' => $totalCost, 'username' => $user->getUsername(), 'registrationContactSignature' => $registrationContactSignature);
import('classes.mail.MailTemplate');
$mail = new MailTemplate('REGISTRATION_NOTIFY', null, null, null, null, false);
$mail->setFrom($registrationEmail, $registrationName);
$mail->assignParams($paramArray);
$mail->addRecipient($user->getEmail(), $user->getFullName());
$mail->send();
}
}