本文整理汇总了PHP中Campaign::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::fetchAll方法的具体用法?PHP Campaign::fetchAll怎么用?PHP Campaign::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::fetchAll方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($options = null)
{
parent::__construct($options);
$emailCategoryOptionList = array('Invite non-sparks to join campaign' => $this->getView()->translate('Admin_Non-Sparks_Invitation'), 'Invite sparks to join campaign' => $this->getView()->translate('Admin_Sparks_Invitation'), 'Send mail to sparks' => $this->getView()->translate('Admin_Send_Mail_To_Sparks'));
$emailCategory = new Zend_Form_Element_Select('emailCategory');
$emailCategory->setMultiOptions($emailCategoryOptionList);
$emailList = new Zend_Form_Element_Textarea('emailList');
$emailList->setAttribs(array('rows' => 5, 'cols' => 150, 'onChange' => 'datetable()'))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
$subject = new Zend_Form_Element_Text('subject');
$subject->setAttribs(array('size' => 150))->addFilter('StringTrim');
$message = new Zend_Form_Element_Textarea('message');
$message->setAttribs(array('rows' => 30, 'cols' => 150))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
$optionList = array();
$campaign = new Campaign();
$campaigns = $campaign->fetchAll(null, "id desc", null, null);
foreach ($campaigns as $campaign) {
$optionList[$campaign->id] = $campaign->name;
}
$optionList['0'] = $this->getView()->translate('ADMIN_NOT_AUTO_INVITATION');
$campaignId = new Zend_Form_Element_Select('campaignId');
$campaignId->setMultiOptions($optionList);
$code_source = new Zend_Form_Element_Text('code_source');
$code_source->addFilter('StringTrim');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND'));
$this->addElements(array($emailCategory, $emailList, $subject, $message, $campaignId, $code_source, $submit));
}
示例2: clientindexAction
function clientindexAction()
{
$this->_helper->layout->setLayout("layout_client");
$this->view->title = "Dashboard For Campaigns";
$this->view->activeTab = "List Campaigns";
$campaign = new Campaign();
$order = "expire_date desc";
$this->view->campaigns = $campaign->fetchAll(null, $order, null, null);
}
示例3: admineditAction
function admineditAction()
{
$reportTab = new ReportTab();
$this->view->reportTab = $reportTab->fetchRow("id = " . $this->getRequest()->getParam('id'));
$campaign = new Campaign();
$this->view->campaigns = $campaign->fetchAll();
$tag = new Tag();
$this->view->tags = $tag->fetchAll();
$tagging = new Tagging();
//$taggings = $tagging->fetchAll($tagging->select()->from('taggings', 'tag_id')->where('report_tab_id = ? ', $this->getRequest()->getParam('id')));
$taggings = $tagging->findBy(array('report_tab_id' => $this->getRequest()->getParam('id')));
$tagging_ids = array();
foreach ($taggings as $tagging) {
array_push($tagging_ids, $tagging->tag_id);
}
$this->view->taggings = $tagging_ids;
}
示例4: admincreategroupAction
function admincreategroupAction()
{
$request = $this->getRequest();
//1.get all campaign
$campaign = new Campaign();
$order = "expire_date desc";
$this->view->campaigns = $campaign->fetchAll(null, $order, null, null);
//2.get all profile_survey
$profileSurveyModel = new ProfileSurvey();
$this->view->profilesurveys = $profileSurveyModel->find_by_condition();
//3.execute sql
$profileSurveyGroupModel = new ProfileSurveyGroup();
if ($request->isPost()) {
$formData = $request->getPost();
$sql = $formData['sql'];
if ($sql == null || $sql == '') {
return;
} else {
$sql = 'select consumer.id ' . $sql;
}
$campaignId = $formData['campaign_id'];
$profileSurveyId = $formData['profile_survey_id'];
$comment = $formData['comment'];
$currentTime = date("Y-m-d H:i:s");
//get all consumer id
$db = Zend_Registry::get('db');
$result = $db->query($sql);
$consumers = $result->fetchAll();
//4.save ProfileSurveyGroup
$newProfileSurveyGroupId = $profileSurveyGroupModel->createRecord(count($consumers), $campaignId, $profileSurveyId, $currentTime, $comment);
//5.insert profile survey group consumer
$profileSurveyGroupConsumerModel = new ProfileSurveyGroupConsumer();
foreach ($consumers as $row) {
$profileSurveyGroupConsumerModel->createRecord($newProfileSurveyGroupId, $row['id']);
}
}
//4.get all profile survey group
$this->view->profilesurveygroups = $profileSurveyGroupModel->find_by_condition('id asc');
//Zend_Debug::dump($this->view->profilesurveygroups);
$this->_helper->layout->setLayout("layout_admin");
}
示例5: adminreportcaculateAction
/**
*
* analyze the report statistics replied by admin group
*/
function adminreportcaculateAction()
{
$this->_helper->layout->setLayout("layout_admin");
$curPage = 1;
$rowsPerPage = 99999;
if ($this->_request->getParam('page')) {
$curPage = $this->_request->getParam('page');
}
$campaignModel = new Campaign();
$campaignData = $campaignModel->fetchAll();
$adminModel = new Admin();
$adminData = $adminModel->fetchAll();
$postData = $this->_request->getPost();
if (count($postData)) {
//var_dump($postData);die;
$this->view->campaigns = $postData['campaign'];
$this->view->admins = $postData['admin'];
$this->view->start_date = $postData['start_date'];
$this->view->end_date = $postData['end_date'];
$db = Zend_Registry::get('db');
$select = $db->select();
$select->from('report_batch', '*')->join('admin', 'admin.id = report_batch.admin_id', 'name as admin_name')->join('campaign', 'campaign.id = report_batch.campaign_id', 'name as campaign_name')->order('report_batch.start_datetime desc');
if (!in_array('all', $this->view->admins) && count($this->view->admins)) {
$select->where('admin_id in( ' . implode(',', $this->view->admins) . ')');
}
if (!in_array('all', $this->view->campaigns) && count($this->view->campaigns)) {
$select->where('campaign_id in( ' . implode(',', $this->view->campaigns) . ')');
}
if ($this->view->start_date != '') {
$select->where('start_datetime >= "' . $this->view->start_date . '"');
}
if ($this->view->end_date != '') {
$select->where('end_datetime <= "' . $this->view->end_date . '"');
}
$reportBatchs = $db->fetchAll($select);
//var_dump($reportBatchs);die;
//paging
$this->view->controller = $this->_request->getControllerName();
$this->view->action = $this->_request->getActionName();
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($reportBatchs));
$paginator->setCurrentPageNumber($curPage)->setItemCountPerPage($rowsPerPage);
$this->view->paginator = $paginator;
}
$this->view->campaignData = $campaignData;
$this->view->adminData = $adminData;
}
示例6: admindownloaddataAction
function admindownloaddataAction()
{
$this->_helper->layout->setLayout("layout_admin");
if ($this->_request->isPost()) {
$formData = $this->_request->getPost();
$campaignCriteria = $formData['campaign'];
$reportCriteria = $formData['report'];
$statusCriteria = $formData['status'];
$db = Zend_Registry::get('db');
$sql = "SELECT c.* , b.num,ci.*\r\n\t\t\t\t\tFROM consumer c , campaign_invitation ci\r\n\t\t\t\t\tLEFT JOIN \r\n\t\t\t\t\t(\r\n\t\t\t\t\tSELECT COUNT(report.id) AS num ,report.consumer_id FROM report \r\n\t\t\t\t\tINNER JOIN campaign_invitation ci ON report.consumer_id = ci.consumer_id WHERE report.campaign_id = {$campaignCriteria}\r\n\t\t\t\t\tGROUP BY report.consumer_id ORDER BY num DESC\r\n\t\t\t\t\t)b ON b.consumer_id = ci.consumer_id\r\n\t\t\t\t\tWHERE ci.consumer_id = c.id AND ci.campaign_id = {$campaignCriteria} AND ci.state = '{$statusCriteria}'";
//die($sql);
$campaignUsers = $db->fetchAll($sql);
if ($reportCriteria > 0 && count($campaignUsers)) {
$users = array();
foreach ($campaignUsers as $val) {
if ($val['num'] >= $reportCriteria) {
$users[] = $val;
}
}
} else {
$users = $campaignUsers;
}
$campaignUsers = array();
$file = $campaignCriteria . '_' . date('Y-m-d_H_i_s') . "campaignusers.csv";
if (count($users)) {
$i = 0;
foreach ($users as $val) {
$campaignUsers[] = array($i, $val['name'], $val['email'] . '/' . $val['login_phone'], $val['recipients_name'], $val['province'], $val['city'], $val['address1'], $val['phone'], $val['id'], $val['create_date'], $val['num'], $val['campaign_id']);
$i++;
}
$header = array('No.', 'Name', 'Email/Telephone', 'Recipients_name', 'Province', 'City', 'Address', 'Phone', 'UserID', 'Date', 'Num', 'Campaign');
$handle = fopen(dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file, "w");
fputcsv($handle, $header);
foreach ($campaignUsers as $line) {
fputcsv($handle, $line);
}
fclose($handle);
$this->view->file = file_exists(dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file) ? dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file : false;
$this->view->filename = $file;
} else {
$this->view->nousers = true;
}
}
$campaignModel = new Campaign();
$this->view->campaigns = $campaignModel->fetchAll();
}
示例7: adminreceiveAction
function adminreceiveAction()
{
$this->_helper->layout->setLayout("layout_admin");
// get current page(default page = 1)
if ($this->_request->getParam('page')) {
$this->_curPage = $this->_request->getParam('page');
}
// get all sms desc
$sparkSmsModel = new SparkSms();
$this->view->messages = $sparkSmsModel->findAllSMS();
//Zend_Debug::dump($this->view->messages);
//paging
$this->view->controller = $this->_request->getControllerName();
$this->view->action = $this->_request->getActionName();
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($this->view->messages));
$paginator->setCurrentPageNumber($this->_curPage)->setItemCountPerPage($this->_rowsPerPage);
$this->view->paginator = $paginator;
$this->view->testEnv = Zend_Registry::get('testEnv');
// get active campaign
$campaign = new Campaign();
$time = date("Y-m-d H:i:s");
$where = "create_date<'" . $time . "' and expire_date>'" . $time . "'";
$order = "expire_date desc";
$this->view->campaigns = $campaign->fetchAll($where, $order, null, null);
}
示例8: adminadvancedsearchAction
function adminadvancedsearchAction()
{
$this->_helper->layout->setLayout("layout_admin");
$campaigns = new Campaign();
$this->view->campaigns = $campaigns->fetchAll();
}
示例9: adminemailtemplateAction
function adminemailtemplateAction()
{
$this->_helper->layout->setLayout("layout_admin");
$emailTemplate = new EmailTemplate();
$admintemplateId = $this->_request->getParam('id');
if ($this->_request->isPost()) {
if (!$admintemplateId) {
$row = $emailTemplate->createRow();
$row->campaign = $this->_request->getPost('campaign');
$row->subject = $this->_request->getPost('subject');
if ($this->_request->getPost('message') != '') {
$row->message = $this->_request->getPost('message');
} else {
$row->message = $this->_request->getPost('htmlmessage');
}
$row->crdate = date('Y-m-d h:i:s');
$row->save();
} else {
if ($this->_request->getPost('message') != '') {
$message = $this->_request->getPost('message');
} else {
$message = $this->_request->getPost('htmlmessage');
}
$emailTemplate->update(array('subject' => $this->_request->getPost('subject'), 'message' => $message), 'id = ' . $admintemplateId);
}
$submitted = true;
} else {
$submitted = false;
}
$form = new CampaignEmailTemplateForm();
$campaigns = new Campaign();
$campaignsData = $campaigns->fetchAll(NULL, 'create_date desc');
//print_r($campaignsData);
$campaignOptions = array();
foreach ($campaignsData as $val) {
$campaignOptions[$val->id] = $val->name;
}
$fc = Zend_Controller_Front::getInstance();
$this->view->oFCKeditor = new FCKeditor('htmlmessage');
$this->view->oFCKeditor->BasePath = $fc->getBaseUrl() . "/js/fckeditor/";
$this->view->oFCKeditor->Height = "500px";
if ($admintemplateId) {
$email = $emailTemplate->fetchRow('id =' . $admintemplateId);
$this->view->oFCKeditor->Value = $email->message;
$form->setDefault('subject', $email->subject);
$this->view->admintemplateId = $admintemplateId;
}
//var_dump($email->message);die;
$this->view->form = $form;
$this->view->campaigns = $campaignOptions;
$this->view->submitted = $submitted;
}
示例10: adminphoneinAction
function adminphoneinAction()
{
$campaign = new Campaign();
$order = "expire_date desc";
$this->view->campaigns = $campaign->fetchAll(null, $order, null, null);
}