本文整理汇总了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');
}
示例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);
}
}
}