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


PHP Quote::create方法代码示例

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


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

示例1: 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

示例2: store

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function store()
 {
     // validate input
     if (!Input::has('quote')) {
         return Response::make('Bad Request', 400);
     }
     // write records
     $quote = Quote::create(['quote' => Input::get('quote'), 'author' => Input::has('author') ? Input::get('author') : 'John Doe', 'image' => Input::has('image') ? Input::get('image') : asset('res/stub.jpg')]);
     // done
     return Response::json($quote);
 }
开发者ID:elvisjames,项目名称:oneline,代码行数:16,代码来源:QuoteController.php

示例3: store

 /**
  * Store a newly created quote in storage.
  *
  * @return Response
  */
 public function store()
 {
     if (!Sentry::getUser()) {
         return Redirect::route('sessions.create');
     }
     $validator = Validator::make($data = Input::all(), Quote::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['event_date'] = strtotime($data['event_date']);
     Quote::create($data);
     return Redirect::route('finances.index');
 }
开发者ID:dynamicsystems,项目名称:TechTracker,代码行数:18,代码来源:QuotesController.php

示例4: order_custom

 public function order_custom($params = [])
 {
     $parts = Part::get_parts();
     $order = Record::allow($params, array_keys($parts));
     $key = Quote::get_unique_key([]);
     $model['`key`'] = $key;
     $fields = ['company', 'address', 'country', 'billing_name', 'billing_email', 'billing_phone', 'technical_name', 'technical_email', 'discount', 'discount_desc'];
     $model += Record::allow($params, $fields);
     $quote = Quote::create($model);
     $total = 0;
     foreach ($order as $name => $value) {
         if ($value) {
             $model = ['quote_id' => $quote['id'], 'part' => $name, 'override' => null, 'quantity' => $value];
             QuoteItem::create($model);
         }
     }
     return Render::json(['key' => $key]);
 }
开发者ID:wileybenet,项目名称:mobile-docs,代码行数:18,代码来源:product_ctrl.php

示例5: foreach

        $mailer->headers($headers);
        $mailer->send();
        foreach ($_POST['contact'] as $key => $value) {
            if (is_array($value)) {
                $value = implode(';', $value);
            }
            $data[$key] = addslashes($value);
        }
        $data['created_at'] = date('Y-m-d H:i:s');
        $data['updated_at'] = date('Y-m-d H:i:s');
        $postQuery = 'INSERT INTO `contact` (`';
        $postQuery .= implode('`, `', array_keys($data));
        $postQuery .= '`) VALUES (\'';
        $postQuery .= implode('\', \'', array_values($data));
        $postQuery .= '\');';
        $success = mysql_query($postQuery);
        Flash::add('success', 'Thanks for your submission. We\'ll contact you shortly.');
        $URL = '/contact.php';
        break;
    case 'quote':
        $quote = new Quote();
        $quote->create($_POST['quote']);
        Flash::add('success', 'Thanks for your submission. We\'ll contact you shortly.');
        $URL = '../quote.php';
        break;
    default:
        exit;
        break;
}
header("Location: {$URL}");
include './closedb.php';
开发者ID:nepageeks,项目名称:champion,代码行数:31,代码来源:functions.php

示例6: getQuote

 protected function getQuote($owner_id = 1)
 {
     return Quote::create(['owner_id' => $owner_id]);
 }
开发者ID:kenarkose,项目名称:chronicle,代码行数:4,代码来源:RecordsActivityTest.php


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