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


PHP Subscriber::setRespName方法代码示例

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


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

示例1: pre_process


//.........这里部分代码省略.........
         /* subscr_help_url */
         if (isset($_POST['subscr_help_email']) && $_POST['subscr_help_email'] != "") {
             $subscr_help_email_trim = trim($_POST['subscr_help_email']);
             $this->form_data['subscr_help_email'] = Input::sanitizeEmail($subscr_help_email_trim);
             if ($this->form_data['subscr_help_email'] != $subscr_help_email_trim) {
                 $this->form_data['subscr_help_email'] = "";
                 $this->form_data['subscr_help_email_invalid'] = true;
                 $this->displayInvalidCharError($subscr_help_email_trim, $this->form_data['subscr_help_email'], 'l10n_label_helpdeskemail');
                 $this->validationErrors = true;
             }
         }
         /* subscr_help_email */
         /* don't continue, if data was stripped due to the field
          * sanitation */
         if ($this->validationErrors) {
             return;
         }
         switch (htmlentities($_POST['subscriber'])) {
             case 'edit':
                 $subscriber = null;
                 if ($this->person->getSubscriber()->hasDBID($id)) {
                     $subscriber = $this->person->getSubscriber();
                 } else {
                     /* Other subscruber than user's
                      * subscriber, must create new object
                      * from DB */
                     $subscriber = Subscriber::getSubscriberByID($id, $this->person->getNREN());
                 }
                 if (!is_null($subscriber)) {
                     /* subscriber will clean input */
                     $update = $subscriber->setState($state);
                     $update |= $subscriber->setEmail($this->form_data['subscr_email']);
                     $update |= $subscriber->setPhone($this->form_data['subscr_phone']);
                     $update |= $subscriber->setRespName($this->form_data['subscr_responsible_name']);
                     $update |= $subscriber->setRespEmail($this->form_data['subscr_responsible_email']);
                     $update |= $subscriber->setComment($this->form_data['subscr_comment']);
                     $update |= $subscriber->setHelpURL($this->form_data['subscr_help_url']);
                     $update |= $subscriber->setHelpEmail($this->form_data['subscr_help_email']);
                     if ($update) {
                         if (!$subscriber->save(true)) {
                             Framework::error_output($this->translateTag('l10n_fail_editsubs1', 'nrenadmin'));
                         } else {
                             Framework::success_output($this->translateTag('l10n_suc_editsubs1', 'nrenadmin'));
                         }
                     }
                     /* show info-list for subscriber */
                     $this->tpl->assign('subscr_details', Subscriber::getSubscriberByID($id, $this->person->GetNREN())->getInfo());
                     $this->tpl->assign('subscriber_details', true);
                     $this->tpl->assign('subscriber_detail_id', $id);
                 }
                 break;
             case 'editState':
                 $subscriber = null;
                 if ($this->person->getSubscriber()->hasDBID($id)) {
                     $subscriber = $this->person->getSubscriber();
                 } else {
                     $subscriber = Subscriber::getSubscriberByID($id, $this->person->getNREN());
                 }
                 if (!is_null($subscriber)) {
                     if ($subscriber->setState($state)) {
                         if (!$subscriber->save(true)) {
                             Framework::error_output("Could not update state of subscriber. Is the database-layer broken?");
                             Framework::error_output($this->translateTag("l10n_fail_edit_subscr_state", "nrenadmin"));
                         }
                     }
                 }
开发者ID:henrikau,项目名称:confusa,代码行数:67,代码来源:nren_admin.php

示例2: getSubscriberList

 /**
  * get the list of subscribers for that NREN
  *
  * @param void
  * @return array<Subscriber> the subscribers signed up to this NREN
  * @since Confusa v0.4-rc0
  * @access public
  */
 public function getSubscriberList($orderBy = 'subscriber_id')
 {
     $subscribers = null;
     $query = "SELECT subscriber_id, name, org_state, lang, subscr_email, ";
     $query .= "subscr_phone, subscr_resp_name, subscr_resp_email, ";
     $query .= "subscr_comment, dn_name FROM subscribers WHERE nren_id=?\n\t\tORDER BY trim({$orderBy})";
     $res = MDB2Wrapper::execute($query, array('integer'), array($this->getID()));
     if (count($res) > 0) {
         foreach ($res as $row) {
             $subs = new Subscriber($row['name'], $this->getName(), $row['dn_name'], $row['org_state'], $row['subscriber_id']);
             $subs->setEmail($row['subscr_email']);
             $subs->setPhone($row['subscr_phone']);
             $subs->setRespName($row['subscr_resp_name']);
             $subs->setRespEmail($row['subscr_resp_email']);
             $subs->setComment($row['subscr_comment']);
             $subscribers[] = $subs;
         }
     }
     return $subscribers;
 }
开发者ID:henrikau,项目名称:confusa,代码行数:28,代码来源:NREN.php


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