本文整理汇总了PHP中Campaign::fillFromDbPk方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::fillFromDbPk方法的具体用法?PHP Campaign::fillFromDbPk怎么用?PHP Campaign::fillFromDbPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::fillFromDbPk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getmethodsbycampaigngatewayAction
function getmethodsbycampaigngatewayAction()
{
$this->checkLogin();
AF::setJsonHeaders('json');
$gateway_id = AF::get($_POST, 'gateway_id', false);
if (!$gateway_id) {
Message::echoJsonError(__('incorrect_gateway_id'));
}
$campaign_id = AF::get($_POST, 'campaign_id', false);
$model = new Campaign();
if (!$model->fillFromDbPk($campaign_id)) {
Message::echoJsonError(__('incorrect_campaign_id'));
}
$result = ProfileGateways::getMethodsByProfileGateway($model->profile_id, $gateway_id);
if (count($result)) {
Message::echoJsonSuccess(array('message' => array('data' => $result)));
} else {
Message::echoJsonError('No Valid Payment Methods For the Selected Campaign and Gateway');
}
exit;
}
示例2: emailAction
function emailAction()
{
$model = new CampaignEmail();
if (isset($_POST['ajax'])) {
if (isset($_POST['model']) && $_POST['model'] == 'prospects') {
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
$model->fillFromArray($_POST);
/*
$model->user_id_created = $this->user->user_id;
$model->user_id_updated = $this->user->user_id;
$model->updated = 'NOW():sql';
$model->created = 'NOW():sql';
$model->model_uset_id = $this->user->user_id;
*/
if ($model->save()) {
Message::echoJsonSuccess();
} else {
Message::echoJsonError(__('prospects_email_not_created') . ' ' . $model->errors2string);
}
die;
}
if (isset($_POST['model']) && $_POST['model'] == 'campaigns') {
$campaignModel = new Campaign();
$campaignModel->setIsNewRecord(false);
$campaignID = AF::get($_POST, 'campaign_id');
$campaignModel->fillFromDbPk($campaignID);
$campaignModel->smtp_id = AF::get($_POST, 'smtp_id');
$campaignModel->user_id_updated = $this->user->user_id;
$campaignModel->updated = 'NOW():sql';
if ($campaignModel->save(false)) {
Message::echoJsonSuccess(__('campaign_updated'));
} else {
Message::echoJsonError(__('campaign_no_updated'));
}
die;
}
}
$clearArray = array();
$this->filter($clearArray);
$pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
$models = AFActiveDataProvider::models('CampaignEmail', $this->params, $pagination);
$dataProvider = $models->getAll();
$filterFields = $models->getoutFilterFields($clearArray);
// set ajax table
if (AF::isAjaxRequestModels()) {
$this->view->includeFile('_email_table', array('application', 'views', 'prospects'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields));
die;
}
$templates = Template::model()->cache()->findAllInArray();
$smtps = Smtp::model()->cache()->findAllInArray();
$campaignID = AF::get($this->params, 'campaign_id');
$campaignModel = new Campaign();
$campaignModel->fillFromDbPk($campaignID);
Assets::js('jquery.form');
$this->addToPageTitle(__('prospect_email'));
$this->render('email', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'campaignModel' => $campaignModel, 'templates' => $templates, 'smtps' => $smtps, 'filterFields' => $filterFields));
}
示例3: isset
<?php
$tProspectEmailID = isset($_GET['prospect_email_id']) ? $_GET['prospect_email_id'] : false;
$code = isset($_GET['code']) ? $_GET['code'] : false;
if (!$tProspectEmailID && !$code) {
die;
}
@(include_once '../settings/autoload.php');
//$msql = SafeMySQL::getInstance();
$prospectEmailID = base_convert($tProspectEmailID, 36, 10);
$prospectEmailModel = new ProspectEmail();
$prospectEmailModel->fillFromDbPk($prospectEmailID);
$campaignModel = new Campaign();
$campaignModel->fillFromDbPk($prospectEmailModel->campaign_id);
if (!$prospectEmailModel->checkCode($code)) {
header('Location: http://' . $campaignModel->url);
die;
}
if ($prospectEmailModel->isFlag('click')) {
header('Location: http://' . $campaignModel->url . '?ei=' . $tProspectEmailID . '&ec=' . $code);
die;
}
$prospectEmailModel->addFlags('open');
$prospectEmailModel->addFlags('click');
$prospectEmailModel->save();
header('Location: http://' . $campaignModel->url . '?ei=' . $tProspectEmailID . '&ec=' . $code);
die;