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


PHP Reply::fetchRow方法代码示例

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


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

示例1: getreplyAction

 function getreplyAction()
 {
     $this->_helper->layout->disableLayout();
     $result = null;
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         $reportId = $formData['report_id'];
         $replyModel = new Reply();
         $reply = $replyModel->fetchRow('report_id = ' . $reportId);
         if (isset($reply)) {
             $result->content = $reply->content;
         }
         $this->_helper->json($result);
     }
 }
开发者ID:omusico,项目名称:wildfire_php,代码行数:15,代码来源:DashboardController.php

示例2: adminreportbatchreplysendAction

 function adminreportbatchreplysendAction()
 {
     $this->_helper->layout->setLayout("layout_admin");
     ini_set('display_errors', 1);
     $frontController = Zend_Controller_Front::getInstance();
     $frontController->throwExceptions(true);
     if ($this->_request->isPost()) {
         $form = new ReplyReportForm();
         $formData = $this->_request->getPost();
         if ($form->isValid($formData)) {
             //print_r($formData);die;
             $reportSource = $this->_request->getParam('report_source');
             // sms report:
             if ($reportSource == 'sms') {
                 $db = Zend_Registry::get('db');
                 $select = $db->select();
                 $select->from('consumer', '*');
                 $select->where('id = ?', $this->_request->getParam('consumer_id'));
                 $consumer = $db->fetchAll($select);
                 // 1.send reply
                 $msmStr = $form->getValue('message');
                 $len = strlen($msmStr);
                 for ($i = 0, $msmStrLen = 0; $i < $len; $i++, $msmStrLen++) {
                     if (ord($msmStr[$i]) >= 128) {
                         $i = $i + 2;
                     }
                 }
                 if ($msmStrLen > 70) {
                     $this->view->batchId = $formData['batch_id'];
                     $this->view->showMessage = 'Reply fail: The sms should be short then 70 characters.';
                     return;
                 }
                 include_once 'sms.inc.php';
                 $newclient = new SMS();
                 $apitype = 0;
                 $msg = iconv("UTF-8", "GB2312", $form->getValue('message'));
                 $respxml = $newclient->sendSMS($form->getValue('email'), $msg, date("Y-m-d H:i:s"), $apitype);
                 // 2.save reply
                 $replyModel = new Reply();
                 $reply = $replyModel->fetchRow('report_id = ' . $this->_request->getParam('report_id'));
                 //check reply condition!
                 if ($reply != null && $reply->status == 'SENT') {
                     $this->view->showMessage = "Reply fail: the reply has been sent!";
                     return;
                 }
                 if ($reply == null) {
                     $replyModel = new Reply();
                     $reply = $replyModel->createRow();
                 }
                 $currentTime = date("Y-m-d H:i:s");
                 $reply->date = $currentTime;
                 $reply->subject = $form->getValue('subject');
                 $reply->content = $form->getValue('message');
                 $reply->from = $config->smtp->report->mail->username;
                 $reply->campaign_id = $formData['campaign_id'];
                 $reply->report_id = $formData['report_id'];
                 $reply->to = $form->getValue('email');
                 $reply->status = 'SENT';
                 //2011-04-08 ham.bao separate the sessions with admin
                 $reply->admin_id = $this->_currentAdmin->id;
                 //$reply->usetime =$formData['usetime'];
                 $reply->save();
                 // 3.grade
                 $report_id = (int) $this->_request->getParam('report_id');
                 $this->saveReportReward($report_id, $form->getValue('grade'));
                 // 4.update notes for report
                 //$this->saveTags($report_id,$formData ['report_id']);
                 $this->saveTags($report_id, $formData['note']);
                 $this->view->batchId = $formData['batch_id'];
                 $this->updateBatchTotaltime($formData['batch_id'], $addtive);
                 $this->view->showMessage = $this->view->translate('Admin_Reply_the_report_successfully');
                 return;
             }
             // email report:
             //1. config
             $config = Zend_Registry::get('config');
             /* 
             $smtpSender = new Zend_Mail_Transport_Smtp(
             			$config->smtp->report->mail->server,
             			array(
             				'username'=> $config->smtp->report->mail->username,
             				'password'=> $config->smtp->report->mail->password,
             				'auth'=> $config->smtp->report->mail->auth,
             				'ssl' => $config->smtp->report->mail->ssl,
             			               			'port' => $config->smtp->report->mail->port));
             Zend_Mail::setDefaultTransport($smtpSender);
             $mail = new Zend_Mail('utf-8');
             */
             $db = Zend_Registry::get('db');
             $select = $db->select();
             $select->from('consumer', '*');
             $select->where('email = ?', $form->getValue('email'));
             $consumer = $db->fetchAll($select);
             if ($consumer[0] != null) {
                 /*
                 //2.get "Your story" from report
                 $reportId = $formData['report_id'];
                 				    	$reportModel = new Report();
                 				    	$report = $reportModel->find($reportId)->current();
                 				    	$config = Zend_Registry::get('config');
//.........这里部分代码省略.........
开发者ID:omusico,项目名称:wildfire_php,代码行数:101,代码来源:ReportController.php

示例3: ajaxreportAction

 function ajaxreportAction()
 {
     $this->_helper->layout->disableLayout();
     $config = Zend_Registry::get('config');
     $db = Zend_Registry::get('db');
     $select = $db->select();
     //tag for report
     $selectTags = $db->select();
     $selectTags->from('tags', array('name', 'id', 'sort'))->where("module = 'REPORT'")->order('sort');
     $this->view->tags = $db->fetchAll($selectTags);
     //organize tag list
     $tagHash = array();
     foreach ($this->view->tags as $tag) {
         $tagHash[$tag['id']] = $tag['name'];
     }
     // get reports
     $select->from('report', array('id', 'accesscode', 'create_date'))->where('consumer_id = ?', $this->_request->getParam('uid'))->order('create_date desc');
     $oldreportArray = $db->fetchAll($select);
     $replyModel = new Reply();
     $this->view->oldreports = array();
     $i = 1;
     foreach ($oldreportArray as $oldreport) {
         $oldTags = '';
         $this->view->oldreports[$oldreport["accesscode"]]['url'] = $config->indicate2->home . "/report/showAnswer/accessCode/" . $oldreport["accesscode"];
         $reply = $replyModel->fetchRow('report_id = ' . $oldreport['id']);
         if ($reply['admin_id'] != null) {
             $adminModel = new Admin();
             $admin = $adminModel->fetchRow('id = ' . $reply['admin_id']);
             $adminname = $admin['name'];
         } else {
             $adminname = '';
         }
         $this->view->oldreports[$oldreport["accesscode"]]['id'] = $oldreport['id'];
         $this->view->oldreports[$oldreport["accesscode"]]['create_date'] = $oldreport['create_date'];
         $this->view->oldreports[$oldreport["accesscode"]]['adminname'] = $adminname;
         $this->view->oldreports[$oldreport["accesscode"]]['replydate'] = $reply['date'];
         $this->view->oldreports[$oldreport["accesscode"]]['replycontent'] = $reply['content'];
         //tag
         $oldreportTagSelect = $db->select();
         $oldreportTagSelect->from('report_tag', 'tag_id')->where('report_tag.report_id = ?', $oldreport['id']);
         $oldreportTag = $db->fetchAll($oldreportTagSelect);
         foreach ($oldreportTag as $tag) {
             $oldTags .= $this->view->translate('Report_Tag_' . $tagHash[$tag['tag_id']]) . " ";
         }
         $this->view->oldreports[$oldreport["accesscode"]]['tag'] = $oldTags;
     }
 }
开发者ID:omusico,项目名称:wildfire_php,代码行数:47,代码来源:ConsumerController.php


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