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


PHP Campaign::getStatus方法代碼示例

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


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

示例1: getUserInterface

 function getUserInterface()
 {
     require_once SITE_ROOT . '/modules/Campaigns/include/Campaign.php';
     if (@$_REQUEST['hash'] == 'register') {
         $register = new CampaignRegister();
         $form = $register->getRegisterForm();
         $this->smarty->assign('form', $form);
         if ($form->validate() && $form->isSubmitted() && isset($_REQUEST['register_submit'])) {
             return $this->smarty->fetch('registersucceed.tpl');
         }
         return $this->smarty->fetch('register.tpl');
     } else {
         if (@$_REQUEST['hash'] == 'Retrieve_Key') {
             $form = CampaignUser::getRetievalForm($err);
             if ($form->isSubmitted() && isset($_POST['submit']) && $form->validate()) {
                 if ($err) {
                     return "<h1>Failed</h1><br /><p>Your e-mail address was invalid.</p>";
                 }
                 return "<h1>Success</h1><br /><p>Hash key recovery has been sent.</p>";
             }
             $this->smarty->assign('form', $form);
             return $this->smarty->fetch('hashretrieve.tpl');
         } else {
             if (!is_null(@$_REQUEST['hash']) && !empty($_REQUEST['hash'])) {
                 $cData = Campaign::checkHash($_REQUEST['hash']);
                 if ($cData) {
                     $campaign = new Campaign($cData);
                     if (strpos($campaign->getStatus(), 'progress') > 0) {
                         $form = $campaign->getVoteForm($_REQUEST['hash']);
                         $this->smarty->assign('campaign', $campaign);
                         $this->smarty->assign('form', $form);
                         if ($form->validate() && $form->isSubmitted() && isset($_POST['vote_submit'])) {
                             foreach ($_POST['vote_choice'] as $selChoice) {
                                 $uChoice = new CampaignChoice($selChoice);
                                 $uChoice->setVote($_REQUEST['hash']);
                             }
                             return $this->smarty->fetch('votesucceed.tpl');
                         } else {
                             $this->parentSmarty->addJS('/modules/Campaigns/js/frontEnd.js');
                             return $this->smarty->fetch('vote.tpl');
                         }
                     }
                 }
                 return $this->smarty->fetch('votefail.tpl');
             }
         }
     }
     $form = Campaign::getHashForm();
     $this->smarty->assign('form', $form);
     return $this->smarty->fetch('voteinsert.tpl');
 }
開發者ID:swat30,項目名稱:safeballot,代碼行數:51,代碼來源:Campaigns.php

示例2: delete

 public function delete()
 {
     $sql = 'delete from campaign_recipients where id="' . e($this->id) . '"';
     Database::singleton()->query($sql);
     $sql = 'select campaign_id from campaign_hash where user_id="' . e($this->id) . '"';
     $campaigns = Database::singleton()->query_fetch_all($sql);
     foreach ($campaigns as $campaign) {
         $campaign = new Campaign($campaign['campaign_id']);
         if (strpos($campaign->getStatus(), "pcoming") > 0) {
             $sql = 'delete from campaign_hash where campaign_id="' . e($campaign->getId()) . '" and user_id="' . e($this->id) . '"';
             Database::singleton()->query($sql);
         }
     }
 }
開發者ID:swat30,項目名稱:safeballot,代碼行數:14,代碼來源:CampaignUser.php


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