• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Quote类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: run

 public function run()
 {
     $form = new AddQuoteForm();
     if (!empty($_POST['AddQuoteForm']) && is_array($_POST['AddQuoteForm'])) {
         $form->attributes = $_POST['AddQuoteForm'];
         if ($form->validate()) {
             $quote = new Quote();
             $quote->textEn = $form->textEn;
             $quote->textRu = $form->textRu;
             $quote->authorId = 0;
             $quote->notes = $form->author . ' : ' . $form->notes;
             if ($quote->save()) {
                 /*
                  * Send emaiil with notification to admin.
                  */
                 $email = Yii::app()->email;
                 $email->type = 'text/plain';
                 $email->to = Yii::app()->params['adminEmail'];
                 $email->subject = 'New quote request.';
                 $email->message = $this->controller->renderPartial('_emailAdd', array('quote' => $quote), true);
                 $email->send();
                 $this->controller->redirect(array('addThanks'));
             }
         }
     }
     $this->controller->render('add', array('form' => $form));
 }
开发者ID:vchimishuk,项目名称:itquotes,代码行数:27,代码来源:AddAction.php


示例2: quotazione

 function quotazione()
 {
     $conn = $this->get_connection();
     $quote = new Quote();
     $quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($_GET['isin'])}' ", 'order_by' => '`data` DESC, `ora` DESC ', 'limit' => 1));
     $quotazione = $quotes[0]->quotazione;
     die('({quotazione:' . $quotazione . '})');
 }
开发者ID:emeraldion,项目名称:creso,代码行数:8,代码来源:json_controller.php


示例3: getUnvote

 public function getUnvote(Quote $quote)
 {
     $vuser = $quote->voted()->whereUserId(Auth::user()->id)->first();
     if ($vuser) {
         $quote->voted()->detach(Auth::user());
         $quote->updateVoteConfidence();
         return Redirect::route('quote', array($quote->id))->withErrors('You have removed your vote!');
     }
 }
开发者ID:shiftosnext,项目名称:Quotinator,代码行数:9,代码来源:QuoteController.php


示例4: add

 public function add()
 {
     $quote = new Quote();
     $quote->user_id = $this->session->userdata('id');
     $quote->text = $this->input->post('body');
     $quote->author = $this->input->post('author');
     $quote->save();
     header('Location: /quotes');
 }
开发者ID:frosoco,项目名称:frosoco-local,代码行数:9,代码来源:quotes.php


示例5: for_range_and_order

 public static function for_range_and_order($isin, $date_from, $date_to, $order_by, $sort_dir)
 {
     $conn = Db::get_connection();
     $quote = new Quote();
     $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($isin)}' " . "AND `data` > '{$conn->escape($date_from)}' " . "AND `data` < '{$conn->escape($date_to)}' " . "ORDER BY `{$conn->escape($order_by)}` {$conn->escape(strtoupper($sort_dir))} " . 'LIMIT 1');
     // print_r($quotes);
     Db::close_connection($conn);
     return $quotes[0];
 }
开发者ID:emeraldion,项目名称:creso,代码行数:9,代码来源:quote_helper.php


示例6: createOne

 public static function createOne($array)
 {
     $quote = new Quote();
     foreach ($array as $key => $value) {
         $quote[$key] = $value;
     }
     $quote->calc();
     //automatic save
     //$quote->save();
     return $quote;
 }
开发者ID:jaspertomas,项目名称:tmcprogram_tacloban,代码行数:11,代码来源:QuoteTable.class.php


示例7: index

 public function index()
 {
     App::import('Model', 'QuoteManager.Quote');
     $quoteModel = new Quote();
     $quoteDataList = $quoteModel->find('all', array('fields' => array('quote_number', 'status'), 'conditions' => array('Quote.vid' => null, 'Quote.created_by' => $this->loginUser['id'])));
     App::import('Model', 'WorkOrderManager.WorkOrder');
     $workOrderModel = new WorkOrder();
     $workOrderDataList = $workOrderModel->find('all', array('fields' => array('work_order_number', 'status'), 'conditions' => array('WorkOrder.created_by' => $this->loginUser['id'])));
     App::import('Model', 'PurchaseOrderManager.PurchaseOrder');
     $purchaseOrderModel = new PurchaseOrder();
     $purchaseOrderDataList = $purchaseOrderModel->find('all', array('fields' => array('purchase_order_num', 'received'), 'conditions' => array('PurchaseOrder.created_by' => $this->loginUser['id'])));
     $this->set(compact('quoteDataList', 'workOrderDataList', 'purchaseOrderDataList'));
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:13,代码来源:DashboardsController.php


示例8: get

 public function get()
 {
     $x = Quote::all();
     $data['res'] = $x;
     $data['res_type'] = 'quote';
     return View::make('admin.result.master.quote', $data);
 }
开发者ID:RainbowSeven,项目名称:la-chene,代码行数:7,代码来源:QuoteController.php


示例9: getMain

 public function getMain()
 {
     $moderatequotes = Quote::orderBy('id', 'desc')->whereStatus(0);
     $quotes = Auth::user()->quotes()->orderBy('id', 'desc')->paginate(Config::get('settings.per_page'));
     $this->layout->title = 'Dashboard';
     $this->layout->nest('content', 'user.dashboard.main', ['quotes' => $quotes, 'moderatequotes' => $moderatequotes]);
 }
开发者ID:shiftosnext,项目名称:Quotinator,代码行数:7,代码来源:UserDashboardController.php


示例10: run

 public function run()
 {
     $session = Yii::app()->session;
     $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php');
     $cookies = Yii::app()->request->cookies;
     // If referrer is not our controller delete search parameters from session.
     if (strpos(Yii::app()->request->urlReferrer, '/quote/list') === false) {
         unset($session['search']);
     }
     if (!empty($_POST['search']) && is_array($_POST['search'])) {
         $search = $_POST['search'];
         $session['search'] = $search;
     } else {
         if (!empty($session['search'])) {
             $search = $session['search'];
         } else {
             $search = array('text' => '', 'authorId' => 0, 'approved' => 'all');
         }
     }
     $criteria = new CDbCriteria();
     $criteria->condition = '(textRu LIKE :text OR textEn LIKE :text) ' . ($search['authorId'] ? 'AND authorId = :authorId ' : '') . ($search['approved'] == 'approved' ? 'AND approvedTime ' : '') . ($search['approved'] == 'unApproved' ? 'AND (approvedTime IS NULL OR approvedTime = 0) ' : '');
     $criteria->params = array(':text' => "%{$search['text']}%") + ($search['authorId'] ? array(':authorId' => $search['authorId']) : array());
     $criteria->order = 'Quote.id DESC';
     $pages = new CPagination(Quote::model()->count($criteria));
     $config->applyTo($pages);
     $pages->applyLimit($criteria);
     $quotes = Quote::model()->with('tags', 'author')->findAll($criteria);
     $showSearchForm = !empty($cookies['showSearchForm']) && $cookies['showSearchForm']->value ? true : false;
     $criteria = new CDbCriteria();
     $criteria->order = 'name';
     $authors = Author::model()->findAll($criteria);
     $this->controller->render('list', array('quotes' => $quotes, 'pages' => $pages, 'authors' => $authors, 'search' => $search, 'showSearchForm' => $showSearchForm));
 }
开发者ID:vchimishuk,项目名称:itquotes,代码行数:33,代码来源:ListAction.php


示例11: run

 public function run()
 {
     $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php');
     $form = new SearchForm();
     // If referrer is not our action delete search parameters from session.
     if (strpos(Yii::app()->request->urlReferrer, '/site/search') === false) {
         Yii::app()->session->remove('siteSearch');
     } else {
         if (!empty(Yii::app()->session['SearchForm'])) {
             $siteSearch = Yii::app()->session['SearchForm'];
             $form->text = $siteSearch['text'];
             $form->authorId = $siteSearch['authorId'];
         }
     }
     if (!empty($_POST['SearchForm']) && is_array($_POST['SearchForm'])) {
         $form->attributes = $_POST['SearchForm'];
         Yii::app()->session['SearchForm'] = array('text' => $form->text, 'authorId' => $form->authorId);
     }
     $criteria = new CDbCriteria();
     $criteria->order = 'approvedTime DESC';
     $criteria->condition = 'approvedTime AND (textRu LIKE :text OR textEn LIKE :text) ' . ($form->authorId ? 'AND (authorId LIKE :authorId)' : '');
     $criteria->params = array(':text' => "%{$form->text}%") + ($form->authorId ? array(':authorId' => $form->authorId) : array());
     $pages = new CPagination(Quote::model()->count($criteria));
     $config->applyTo($pages);
     $pages->applyLimit($criteria);
     $quotes = Quote::model()->with('tags')->findAll($criteria);
     $criteria = new CDbCriteria();
     $criteria->order = 'name';
     $authors = Author::model()->findAll($criteria);
     $this->controller->render('search', array('quotes' => $quotes, 'pages' => $pages, 'form' => $form, 'authors' => $authors));
 }
开发者ID:vchimishuk,项目名称:itquotes,代码行数:31,代码来源:SearchAction.php


示例12: removeQuote

 private function removeQuote()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST['quoteId'])) {
         Quote::removeQuote($_POST['quoteId']);
     }
     header("Location: " . URL);
 }
开发者ID:DvOtterloo,项目名称:Quotes,代码行数:7,代码来源:App.php


示例13: index

 function index()
 {
     $conn = $this->get_connection();
     $dividend_factory = new Dividend();
     //set_default_dir('up');
     $this->dividends = $dividend_factory->find_by_query('SELECT `creso_dividendi`.`id`, `creso_dividendi`.`stacco`, `creso_dividendi`.`importo`, `creso_dividendi`.`isin`, `creso_titoli`.`title` ' . 'FROM `creso_dividendi` ' . 'LEFT JOIN `creso_titoli` ON `creso_dividendi`.`isin` = `creso_titoli`.`isin` ' . "WHERE 1 " . (!empty($_REQUEST['mercato']) ? "AND `mercato` = '{$conn->escape($_REQUEST['mercato'])}' " : '') . (!empty($_REQUEST['tipo']) ? "AND `tipo` = '{$conn->escape($_REQUEST['tipo'])}' " : '') . (!empty($_REQUEST['from']) ? "AND `stacco` >= '{$conn->escape($_REQUEST['from'])}' " : '') . (!empty($_REQUEST['to']) ? "AND `stacco` <= '{$conn->escape($_REQUEST['to'])}' " : '') . 'ORDER BY ' . sprintf('`%s` %s ', $this->get_sort('stacco'), $this->get_dir()) . "LIMIT {$conn->escape($this->get_start())}, {$conn->escape($this->get_limit())}");
     if (count($this->dividends) > 0) {
         foreach ($this->dividends as $dividend) {
             $dividend->stock = new Stock();
             $dividend->stock->find_by_id($dividend->isin);
             $quote = new Quote();
             $quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($dividend->isin)}' ", 'order_by' => '`data` DESC, `ora` DESC', 'limit' => 1));
             $dividend->quote = $quotes[0];
         }
     }
 }
开发者ID:emeraldion,项目名称:creso,代码行数:16,代码来源:dividendi_controller.php


示例14: index

 function index()
 {
     if ($_POST) {
         unset($_POST['send']);
         $_POST = array_map('htmlspecialchars', $_POST);
         $_POST['status'] = "New";
         $_POST['date'] = date("Y-m-d H:i", time());
         $item = Quote::create($_POST);
         if (!$item) {
             $this->session->set_flashdata('message', 'error:' . $this->lang->line('quotation_create_error'));
         } else {
             $this->load->helper('notification');
             $this->session->set_flashdata('message', 'success:' . $this->lang->line('quotation_create_success'));
             $admins = User::find('all', array('conditions' => array('admin = ? AND status = ?', '1', 'active')));
             foreach ($admins as &$value) {
                 send_notification($value->email, $this->lang->line('application_notification_quotation_subject'), $this->lang->line('application_notification_quotation'));
             }
         }
         redirect('quotation');
     } else {
         $this->theme_view = 'fullpage';
         $this->view_data['form_action'] = 'quotation';
         $this->content_view = 'quotation/_main';
     }
 }
开发者ID:pratikbgit,项目名称:freelancerKit,代码行数:25,代码来源:quotation.php


示例15: detail

 /**
  * view method
  *
  * @param string $id
  * @return void
  */
 public function detail($id = null, $modal = null)
 {
     $this->layoutOpt['left_nav_selected'] = "view_customer";
     $this->Customer->id = $id;
     if (!$this->Customer->exists()) {
         throw new NotFoundException(__('Invalid customer'));
     }
     //$this->set('customer', $this->Customer->read(null, $id));
     $customer = $this->Customer->read(null, $id);
     App::uses("CustomerSalesRepresentetives", "CustomerManager.Model");
     $sales = new CustomerSalesRepresentetives();
     $sales_representatives = $sales->find("all", array("conditions" => array("CustomerSalesRepresentetives.customer_id" => $id)));
     App::uses("Quote", "QuoteManager.Model");
     $quote = new Quote();
     $quotes = $quote->find("all", array("conditions" => array("Quote.vid" => null, 'Quote.customer_id' => $id)));
     $this->set(compact('customer', 'modal', 'sales_representatives', 'quotes'));
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:23,代码来源:CustomersController.php


示例16: __construct

 function __construct()
 {
     parent::__construct();
     $this->view_data['core_settings'] = Setting::first();
     if ($this->input->cookie('language') != "") {
         $language = $this->input->cookie('language');
     } else {
         if (isset($this->view_data['language'])) {
             $language = $this->view_data['language'];
         } else {
             if (!empty($this->view_data['core_settings']->language)) {
                 $language = $this->view_data['core_settings']->language;
             } else {
                 $language = "english";
             }
         }
     }
     $this->lang->load('application', $language);
     $this->lang->load('messages', $language);
     $this->lang->load('event', $language);
     $this->user = $this->session->userdata('user_id') ? User::find_by_id($this->session->userdata('user_id')) : FALSE;
     $this->client = $this->session->userdata('client_id') ? Client::find_by_id($this->session->userdata('client_id')) : FALSE;
     if ($this->client) {
         $this->theme_view = 'application_client';
     }
     $this->view_data['datetime'] = date('Y-m-d H:i', time());
     $this->view_data['sticky'] = Project::all(array('conditions' => 'sticky = 1'));
     $this->view_data['quotations_new'] = Quote::find_by_sql("select count(id) as amount from quotations where status='New'");
     if ($this->user || $this->client) {
         $access = $this->user ? $this->user->access : $this->client->access;
         $access = explode(",", $access);
         if ($this->user) {
             $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'main')));
             $this->view_data['widgets'] = Module::find('all', array('conditions' => array('id in (?) AND type = ?', $access, 'widget')));
         } else {
             $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'client')));
         }
         if ($this->user) {
             $update = User::find($this->user->id);
         } else {
             $update = Client::find($this->client->id);
         }
         $update->last_active = time();
         $update->save();
         if ($this->user) {
             $this->view_data['user_online'] = User::all(array('conditions' => array('last_active+(30 * 60) > ? AND status = ?', time(), "active")));
             $this->view_data['client_online'] = Client::all(array('conditions' => array('last_active+(30 * 60) > ? AND inactive = ?', time(), "0")));
         }
         $email = $this->user ? 'u' . $this->user->id : 'c' . $this->client->id;
         $this->view_data['messages_new'] = Privatemessage::find_by_sql("select count(id) as amount from privatemessages where `status`='New' AND recipient = '" . $email . "'");
         $this->view_data['tickets_new'] = Ticket::find_by_sql("select count(id) as amount from tickets where `status`='New'");
     }
     /*$this->load->database();
     		$sql = "select * FROM templates WHERE type='notes'";
     		$query = $this->db->query($sql); */
     $this->view_data["note_templates"] = "";
     //$query->result();
 }
开发者ID:pratikbgit,项目名称:freelancerKit,代码行数:58,代码来源:MY_Controller.php


示例17: home

 public function home()
 {
     $quotes = Quote::all()->toArray();
     //var_dump($quotes);
     $quote = $quotes[rand(0, count($quotes) - 1)];
     $mostviewed = Katalog::orderBy('view', 'desc')->take(9)->get();
     $lastrelease = Katalog::orderBy('created_at', 'desc')->take(9)->get();
     return View::make('home', compact('quote', 'mostviewed', 'lastrelease'));
 }
开发者ID:beruxganteng,项目名称:repository-djpbn,代码行数:9,代码来源:HomeController.php


示例18: index

 /**
  * Display a listing of finances
  *
  * @return Response
  */
 public function index()
 {
     if (!Sentry::getUser()) {
         return Redirect::route('sessions.create');
     }
     $timecards = Timecard::all();
     $quotes = Quote::all();
     $invoices = Invoice::all();
     return View::make('finances.index', compact('timecards', 'quotes', 'invoices'));
 }
开发者ID:dynamicsystems,项目名称:TechTracker,代码行数:15,代码来源:FinancesController.php


示例19: run

 public function run()
 {
     $criteria = new CDbCriteria();
     $criteria->condition = 'approvedTime';
     $quote = Quote::model()->findByPk($_GET['id'], $criteria);
     if ($quote === null) {
         throw new CHttpException(404, 'Quote not found');
     }
     $this->controller->render('quote', array('quote' => $quote));
 }
开发者ID:vchimishuk,项目名称:itquotes,代码行数:10,代码来源:QuoteAction.php


示例20: index

 function index()
 {
     $conn = $this->get_connection();
     $item_factory = new WatchlistItem();
     $this->items = $item_factory->find_all(array('where_clause' => "`utente` = '{$conn->escape($_COOKIE['username'])}' ", 'order_by' => sprintf('`%s` %s', $this->get_sort('isin'), $this->get_dir()), 'limit' => $this->get_limit()));
     if (count($this->items) > 0) {
         foreach ($this->items as $item) {
             $item->stock = new Stock();
             $item->stock->find_by_id($item->isin);
             $quote = new Quote();
             $quotes = $quote->find_all(array('where_clause' => "`isin` = '{$conn->escape($item->isin)}' ", 'order_by' => '`data` DESC, `ora` DESC', 'limit' => 1));
             $item->quote = $quotes[0];
             $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($item->isin)}' " . "AND `data` >= '{$conn->escape(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)))}' " . 'ORDER BY `quotazione` DESC ' . 'LIMIT 1');
             $item->max_quote = $quotes[0];
             $quotes = $quote->find_by_query('SELECT `id`, `quotazione` ' . 'FROM `creso_quotazioni` ' . "WHERE `isin` = '{$conn->escape($item->isin)}' " . "AND `data` >= '{$conn->escape(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)))}' " . 'ORDER BY `quotazione` ASC ' . 'LIMIT 1');
             $item->min_quote = $quotes[0];
         }
     }
 }
开发者ID:emeraldion,项目名称:creso,代码行数:19,代码来源:watchlist_controller.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP R类代码示例发布时间:2022-05-23
下一篇:
PHP Quota类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap