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


PHP Campaign::update方法代码示例

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


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

示例1: edit

 public function edit($id)
 {
     //$this->output->enable_profiler(true);
     $id = (int) $id;
     $this->load->model('Campaign');
     $this->form_validation->set_rules('name', 'Name', 'required');
     $this->layout->add_basic_assets()->menu();
     if ($this->form_validation->run() === false) {
         $campaign = Campaign::find($id);
         $data = array('action' => $this->router->method, 'id' => $id, 'name' => $campaign->get_name());
         $create_edit = $this->layout->views('controllers/Campaign/actions/create_edit', $data, array(), true);
         $this->layout->action_view(array('create_edit' => $create_edit));
     } else {
         $data = array('name' => $this->input->post('name'));
         $result = Campaign::update($id, $data);
         if ($result === true) {
             $this->layout->view('others/form_success');
         } elseif ($result instanceof Standard_error) {
             $this->layout->views('others/form_failure', array('message' => $result->message));
             $data = array('action' => $this->router->method, 'id' => $id, 'name' => $this->input->post('name'));
             $create_edit = $this->layout->views('controllers/Campaign/actions/create_edit', $data, array(), true);
             $this->layout->action_view(array('create_edit' => $create_edit));
         }
     }
 }
开发者ID:vmoulin77,项目名称:DVB,代码行数:25,代码来源:Campaign_controller.php

示例2: array

<?php

/**
 * Envoi d'une campagne de SMS
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <hi@hiwelo.co>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
$campagne = array('titre' => $_GET['titre'], 'message' => $_GET['message']);
$campaign = Campaign::create('sms');
$campaign = new Campaign($campaign);
$campaign->update('titre', $campagne['titre']);
$campaign->update('message', $campagne['message']);
$var = $_GET;
$var['criteres'] = trim($var['criteres'], ';');
$campaign->addRecipients(People::listing($var, 0, false));
echo $campaign->get('id');
开发者ID:leqg,项目名称:leqg,代码行数:22,代码来源:sms-campagne.ajax.php

示例3: precampaignfinishedAction

 function precampaignfinishedAction()
 {
     $this->view->activeTab = 'Campaign';
     $this->view->title = $this->view->title = $this->view->translate("Wildfire") . " - " . $this->view->translate("You_are_in");
     //precampaignsurvey的css使用的是layout_survey
     $this->_helper->layout->setLayout("layout_survey");
     $id = (int) $this->_request->getParam('survey');
     $campaignModel = new Campaign();
     $this->view->campaign = $campaignModel->fetchRow("pre_campaign_survey=" . $id . " or " . "pre_campaign_survey_en=" . $id);
     $db = Zend_Registry::get('db');
     if ($this->view->campaign != null) {
         $campaignId = $this->view->campaign->id;
     }
     $consumer = $this->_currentUser;
     //TOCHECK
     //$select_extra_info = $db->select ();
     //$select_extra_info->from ( "consumer",array ('consumer.*', 'consumer_extra_info.gender as gender','consumer_extra_info.education as education','consumer_extra_info.income as income'  ));
     //$select_extra_info->joinLeft ( "consumer_extra_info","consumer.id = consumer_extra_info.consumer_id",null);
     //$select_extra_info->where("consumer.id = ".$this->_currentUser->id );
     //$consumer2 = $db->fetchRow ( $select_extra_info );
     //Zend_Debug::dump($consumer2);die;
     if ($this->view->campaign != null && $campaignId != null && $campaignId > 0) {
         // check if precampaign poll is finished
         //			$select1 = $db->select();
         //			$select1->from('campaign', 'pre_campaign_survey');
         //			$select1->where('campaign.id = ?',$campaignId);
         //			$previewCamSurvey = $db->fetchOne($select1);
         //			$indicate2Connect = new Indicate2_Connect();
         //			$ids = array($previewCamSurvey);
         //			$wsResult = $indicate2Connect->getAnswerSetCount($consumer->email,$ids);
         //
         //			if ($wsResult==0){
         //				$this->_redirect('campaign/precampaign/survey/'.$previewCamSurvey);
         //			}else{
         $campaignInvitationModel = new CampaignInvitation();
         $campaignInvitation = $campaignInvitationModel->fetchRow("campaign_id=" . $campaignId . " and consumer_id=" . $consumer->id);
         if ($campaignInvitation == null) {
             $this->_redirect('http://community.wildfire.asia/public/home');
         }
         $id = $campaignInvitation->id;
         //Zend_Debug::dump($campaignInvitation);
         $campaignInvitation->state = "ACCEPTED";
         $campaignInvitation->save();
         //2011-05-19 ham.bao add the badge
         //			$consumerBadgeModel = new ConsumerBadge();
         //			$notificationModel = new Notification();
         //			$consumerBadgeData  = $consumerBadgeModel->fetchRow('badge='.$this->view->campaign->badge .' and consumer='.$consumer->id);
         //			if(!count($consumerBadgeData)){
         //				$row = $consumerBadgeModel->createRow();
         //				$row->consumer = $consumer->id;
         //				$row->badge    = $this->view->campaign->badge;
         //				$row->create_date = date("Y-m-d H:i:s");
         //				$row->save();
         //				// add notification
         //				$notificationModel->createRecord("CONSUMER_BADGE",$consumer->id);
         //
         //			}
         //2011-05-19 ham.bao add the badge
         $result = $db->fetchOne("SELECT COUNT(*) FROM campaign_participation WHERE campaign_invitation_id=:t1", array('t1' => $id));
         if ($result == 0) {
             //2011-02-22 ham.bao add the logic to calculate the number of participation
             $campaignModel->update(array('participation' => $this->view->campaign->participation + 1), 'id = ' . $this->view->campaign->id);
             if ($this->view->campaign->participation + 1 >= $this->view->campaign->total) {
                 $campaignInvitationModel->update(array('state' => 'EXPIRED'), ' state = "NEW" and campaign_id =' . $this->view->campaign->id);
                 $signauthcodeModel = new SignupAuthCode();
                 $signauthcodeModel->update(array('auto_invitation' => 0), 'auto_invitation =' . $this->view->campaign->id);
             }
             //create participation
             $campaignParticipationModel = new CampaignParticipation();
             $currentTime = date("Y-m-d H:i:s");
             $row = $campaignParticipationModel->createRow();
             $row->campaign_invitation_id = $id;
             $row->accept_date = $currentTime;
             $row->state = 'NEW';
             $row->save();
             //send "welcome to campaign" mail
             //set the content of mail
             $emailSubject = $this->view->translate('Welcome_to_Spark_Campaign_Email_subject_campaign_' . $campaignId);
             $emailBody = $this->view->translate('Welcome_to_Spark_Campaign_Email_body_campaign_' . $campaignId);
             $stringChange = array('?USERNAME?' => $this->_currentUser['name']);
             $emailBody = strtr($emailBody, $stringChange);
             //send...
             $config = Zend_Registry::get('config');
             $smtpSender = new Zend_Mail_Transport_Smtp($config->smtp->welcome->mail->server, array('username' => $config->smtp->welcome->mail->username, 'password' => $config->smtp->welcome->mail->password, 'auth' => $config->smtp->welcome->mail->auth, 'ssl' => $config->smtp->welcome->mail->ssl, 'port' => $config->smtp->welcome->mail->port));
             Zend_Mail::setDefaultTransport($smtpSender);
             $mail = new Zend_Mail('utf-8');
             $langNamespace = new Zend_Session_Namespace('Lang');
             if ($langNamespace->lang == 'en' || $langNamespace->lang == 'EN') {
                 $mail->setSubject($emailSubject);
             } else {
                 $mail->setSubject("=?UTF-8?B?" . base64_encode($emailSubject) . "?=");
             }
             $mail->setBodyText($emailBody);
             $mail->setFrom($config->smtp->welcome->mail->username, $this->view->translate('Wildfire'));
             $mail->addTo($this->_currentUser['email']);
             $mail->send();
         }
     }
     //edit ConsumerContactForm();
     $form = new ConsumerContactForm(array('relative' => $this->view->campaign->relative));
//.........这里部分代码省略.........
开发者ID:omusico,项目名称:wildfire_php,代码行数:101,代码来源:CampaignController.php

示例4: array

            $data->templateWrite($_POST['templateEditor']);
            break;
        case 'launch':
            $data->launch();
            break;
        case 'newTemplate':
            $data->templateEmpty();
            break;
        case 'modificationObjetCampagne':
            $data->object($_POST['objet']);
            break;
        case 'copieTemplate':
            $data->templateCopy($_GET['template']);
            break;
        case 'modificationSMSCampagne':
            $data->update('message', $_POST['message']);
            break;
        case 'updateTracking':
            $data->trackingUpdate();
            break;
        case 'test':
            $data->testing();
            Core::goPage('campagne', array('id' => $_GET['id']), true);
            break;
    }
}
Configuration::write('tpl.actuel', $data->get('type'));
Core::loadHeader();
if ($data->get('type') == 'email') {
    ?>
<h2 id="titre-campagne" <?php 
开发者ID:leqg,项目名称:leqg,代码行数:31,代码来源:campaign-dashboard.tpl.php

示例5: Campaign

**
**    ACH is distributed in the hope that it will be useful,
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**    GNU General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////// */
include "code/includes.php";
$active_campaign = new Campaign();
$active_campaign->populateFromAttribute($_REQUEST["keyword"], "keyword");
foreach ($_REQUEST as $field => $value) {
    $active_campaign->{$field} = addslashes($value);
}
$active_campaign->update();
Campaign::setStatusMessage("Saved!");
?>

<html>
<head>
	<title>Updating...</title>
	<meta http-equiv=Refresh content="0; url=campaign/<?php 
echo $active_campaign->keyword;
?>
">
</head>



<body>
开发者ID:Burton,项目名称:Analysis-of-Competing-Hypotheses,代码行数:31,代码来源:class_action.php


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