當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Orders類代碼示例

本文整理匯總了PHP中Orders的典型用法代碼示例。如果您正苦於以下問題:PHP Orders類的具體用法?PHP Orders怎麽用?PHP Orders使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Orders類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionGet_list_basket

 public function actionGet_list_basket()
 {
     $order_id = $_POST['order_id'];
     $order = new Orders();
     $data['basket'] = $order->_get_list_order($order_id);
     $this->renderPartial('//backend/order/basket', $data);
 }
開發者ID:kimniyom,項目名稱:shopping_cart,代碼行數:7,代碼來源:OrdersController.php

示例2: testGetAnnualMonthlyReport

 public function testGetAnnualMonthlyReport()
 {
     /*insert last month*/
     foreach (range(0, 5) as $key => $value) {
         /*insert 5 orders row*/
         $newOrder = new Orders();
         $newOrder->paid = 5000.0;
         $newOrder->order_date = (string) Carbon::parse('monday last month');
         $newOrder->save(false);
     }
     foreach (range(0, 5) as $key => $value) {
         /*insert 5 orders row*/
         $newOrder = new Orders();
         $newOrder->paid = 5000.0;
         $newOrder->order_date = (string) Carbon::parse('monday this month');
         $newOrder->save(false);
     }
     /*insert this month*/
     $reportArr = $this->annualReport->getAnnualMonthlyReport();
     /*check if Month is complete*/
     $this->assertNotNull($reportArr['January'], 'Check if January is in the report');
     $this->assertNotNull($reportArr['February'], 'Check if February is in the report');
     $this->assertNotNull($reportArr['March'], 'Check if March is in the report');
     $this->assertNotNull($reportArr['April'], 'Check if April is in the report');
     $this->assertNotNull($reportArr['May'], 'Check if May is in the report');
     $this->assertNotNull($reportArr['June'], 'Check if June is in the report');
     $this->assertNotNull($reportArr['July'], 'Check if July is in the report');
     $this->assertNotNull($reportArr['August'], 'Check if August is in the report');
     $this->assertNotNull($reportArr['September'], 'Check if September is in the report');
     $this->assertNotNull($reportArr['October'], 'Check if October is in the report');
     $this->assertNotNull($reportArr['November'], 'Check if November is in the report');
     $this->assertNotNull($reportArr['December'], 'Check if December is in the report');
     $this->assertEquals($reportArr['October'], 30000, 'Make sure total is 30000');
     $this->assertEquals($reportArr['November'], 30000, 'Make sure total is 30000');
 }
開發者ID:kevindaus,項目名稱:Order-Billing-Inventory-System-Marcials-Furniture,代碼行數:35,代碼來源:AnnualReportTest.php

示例3: viewResultDetail

 public function viewResultDetail()
 {
     $objOrder = new Orders();
     $objOrder->setTest(request_var("info"));
     $objOrder->setOrderId(request_var("ordId"));
     $objOrder->setTable(TEMP_TABLE_RESULTS . $objOrder->getOrderId());
     echo $objOrder->viewResultDetail();
 }
開發者ID:atoledov,項目名稱:siglab,代碼行數:8,代碼來源:controlOrder.php

示例4: actionIndex

 /**
  * 訂單列表
  */
 public function actionIndex()
 {
     $pageIndex = isset($_GET['page']) ? $_GET['page'] : 1;
     $view = isset($_GET['view']) ? $_GET['view'] : 0;
     $conditionArr = array();
     //待發貨 pay_status:1;ship_status:0
     if ($view == 0) {
         $conditionArr = array('pay_status' => 1, 'ship_status' => 0);
     }
     //已發貨 ship_status:1
     if ($view == 1) {
         $conditionArr = array('ship_status' => 1);
     }
     //待支付 pay_status:0
     if ($view == 2) {
         $conditionArr = array('pay_status' => 0);
     }
     //已支付到擔保方 pay_status:2
     if ($view == 3) {
         $conditionArr = array('pay_status' => 2);
     }
     //已支付 pay_status:1
     if ($view == 4) {
         $conditionArr = array('pay_status' => 1);
     }
     //貨到付款
     if ($view == 5) {
         $conditionArr = array('pay_status' => 10);
     }
     //活動 status:active
     if ($view == 6) {
         $conditionArr = array('status' => 'active', 'pay_status' => 0);
     }
     //已作廢 status:dead
     if ($view == 7) {
         $conditionArr = array('status' => 'dead');
     }
     //已完成 status:finish
     if ($view == 8) {
         $conditionArr = array('status' => 'finish');
     }
     //全部
     if ($view == 9) {
         $conditionArr = array();
     }
     $Order = new Orders();
     $result = $Order->orderList($conditionArr, $pageIndex, $this->pagesize);
     $order_list = array();
     foreach ($result['items'] as $k => $v) {
         $order_list[$k] = $v;
         $order_list[$k]['pay_status_name'] = Params::PayStatus($v['pay_status']);
         $order_list[$k]['ship_status_name'] = Params::ShipStatus($v['ship_status']);
         $order_list[$k]['member_name'] = Params::PamMember($v['member_id']);
     }
     //分頁
     $pages = new CPagination($result['count']);
     $this->render('index', array('dataProvider' => $order_list, 'view' => $view, 'pages' => $pages, 'pageIndex' => $pageIndex - 1));
 }
開發者ID:ShuiMuQinHua,項目名稱:yiishop,代碼行數:61,代碼來源:DefaultController.php

示例5: actionReship

 /**
  * 退貨
  */
 public function actionReship()
 {
     $order_id = $this->post('order_id');
     $Order = new Orders();
     $order_info = $Order->Item($order_id);
     $dlycorp_list = Dlycorp::model()->findAll("disabled = 'false'");
     $Delivery = new Delivery();
     $addr_info = $Delivery->AreaToAddr($order_info['ship_area']);
     echo $this->renderPartial('reship', array('order_id' => $order_id, 'order_info' => $order_info, 'dlycorp_list' => $dlycorp_list, 'addr_info' => $addr_info), true);
 }
開發者ID:ShuiMuQinHua,項目名稱:yiishop,代碼行數:13,代碼來源:DeliveryController.php

示例6: getOrderProducts

 public function getOrderProducts($request)
 {
     $check = $this->checkDetails($request);
     if ($check) {
         $order = new Orders();
         $array = $order->getOrderProducts($request["restaurantID"], $request["orderID"]);
         return $array;
     } else {
         return $check;
     }
 }
開發者ID:veron123,項目名稱:BaseW,代碼行數:11,代碼來源:customercontroller.php

示例7: create

 public static function create()
 {
     $model = new Orders();
     $dateCreated = new DateTime('now');
     $model->created = $dateCreated->format('Y-m-d H:i:s');
     $model->status = Orders::STATUS_CREATED;
     if ($model->save()) {
         return $model->id;
     } else {
         return false;
     }
 }
開發者ID:norv95,項目名稱:kmptest,代碼行數:12,代碼來源:Orders.php

示例8: doneAction

 public function doneAction()
 {
     session_start();
     $orderid = $this->getRequest()->getParam('orderid');
     $totalprice = $this->getRequest()->getParam('totalprice');
     $orders = new Orders();
     $db = $orders->getAdapter();
     $sql = "select b.name,b.price,oi.nums from orders o, orderitem oi, book b where oi.orderid = o.id and oi.bookid = b.id and o.userid =" . $_SESSION['userid'] . " and o.id=" . $orderid;
     $res = $db->query($sql)->fetchAll();
     //EMAIL內容
     $str = "<h1>歡迎您" . $_SESSION['loginuser'] . "來到 http://shoppingcar.com</h1>";
     $str .= "您購買的東西有如下<br/>";
     $str .= "<table border='1px' width='400px'>";
     for ($i = 0; $i < count($res); $i++) {
         $str .= "<tr><td>{$i}</td><td>{$res[$i]['name']}</td>\r\n\t\t\t<td>{$res[$i]['price']}</td>\r\n\t\t\t<td>{$res[$i]['nums']}</td></tr>";
     }
     $str .= "</table>";
     $str .= "<br/><br/>總價格:" . $totalprice;
     $str .= "<br/>有什麽事情請聯係我們的E-MAIL yuxujian@shoppingcar.com.";
     $filename = dirname(__FILE__) . '../../../public/email/contents.html';
     file_put_contents($filename, $str);
     error_reporting(E_STRICT);
     date_default_timezone_set('America/Toronto');
     $body = file_get_contents(dirname(__FILE__) . '../../../public/email/contents.html');
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->SMTPSecure = "ssl";
     // sets the prefix to the servier
     $mail->Host = "smtp.gmail.com";
     // sets GMAIL as the SMTP server
     $mail->Port = 465;
     // set the SMTP port for the GMAIL server
     $mail->Username = "yuxujian@gmail.com";
     // GMAIL username
     $mail->Password = "002232100";
     // GMAIL password
     $mail->CharSet = "UTF-8";
     $address = "english8080@gmail.com";
     $mail->AddAddress($address, "Dear Customer");
     $mail->SetFrom('yuxujian@shoppingcar.com', 'Customer Service');
     $mail->Subject = "您的訂單 shoppingcar.com";
     $mail->AltBody = "We have receive your order, you can check your order from our web site shoppingcar.com";
     // optional, comment out and test
     $mail->IsHTML(true);
     $mail->MsgHTML($body);
     if (!$mail->Send()) {
         echo "Mailer Error: " . $mail->ErrorInfo;
     } else {
         echo "Message sent!";
     }
 }
開發者ID:yuxujian,項目名稱:YuNote,代碼行數:53,代碼來源:FinishController.php

示例9: actionEdit

 public function actionEdit($id)
 {
     $model = new Orders();
     $order_id = Yii::app()->request->getPost('order_id');
     $price = Yii::app()->request->getPost('price');
     $description = Yii::app()->request->getPost('description');
     $available = Yii::app()->request->getPost('available');
     $data = array('description' => $description, 'order_id' => $order_id, 'price' => $price, 'description' => $description, 'available' => $available);
     if (Yii::app()->request->isPostRequest) {
         $model->edit($data, $id);
     }
     $editOrders = $model->selectFromId($id);
     $this->render('edit', array('editOrders' => $editOrders));
 }
開發者ID:aramharutyunyan1234,項目名稱:YiiFramework,代碼行數:14,代碼來源:OrdersController.php

示例10: map

 public static function map(Orders $order, array $properties)
 {
     if (array_key_exists('id', $properties)) {
         $order->setId($properties['id']);
     }
     if (array_key_exists('user_id', $properties)) {
         $order->setUserId($properties['user_id']);
     }
     if (array_key_exists('business_id', $properties)) {
         $order->setBusinessId($properties['business_id']);
     }
     if (array_key_exists('date', $properties)) {
         $formattedDate = $properties['date'];
         $orderDate = self::createDateTime($formattedDate);
         if ($orderDate) {
             $order->setDate($orderDate);
         }
         if (array_key_exists('status', $properties)) {
             $order->setStatus($properties['status']);
         }
         if (array_key_exists('assigned_to', $properties)) {
             $order->setAssignedTo($properties['assigned_to']);
         }
         if (array_key_exists('order_details', $properties)) {
             $order->setOrderDetails($properties['order_details']);
         }
     }
 }
開發者ID:beshad,項目名稱:dropoff_30_nov_,代碼行數:28,代碼來源:OrderMapper.php

示例11: cakemake

function cakemake()
{
    $cake = new Cakes();
    $wedding = new Orders('hogs', 'chocolate', $cake);
    isset($_GET['frosting_color']) ? $cake->frosting_color = $_GET['frosting_color'] : ($cake->frosting_color = 'none');
    isset($_GET['cake_flavor']) ? $cake->cake_flavor = $_GET['cake_flavor'] : ($cake->cake_flavor = 'none');
    if (isset($_GET['decor_message'])) {
        $cake->decor_message = $_GET['decor_message'];
        $wedding->cost();
    } else {
        $cake->decor_message = '';
    }
    $pass = ['cake' => $cake, 'wedding' => $wedding];
    return $pass;
}
開發者ID:annajmorton,項目名稱:codeup.dev,代碼行數:15,代碼來源:bakeryFunctions.php

示例12: paymentAction

 public function paymentAction()
 {
     if ($this->request->isPost()) {
         $orderarray = $this->request->getPost('orderarray');
         $orderarray = json_decode($orderarray, TRUE);
         $sum = 0;
         foreach ($orderarray as $veg) {
             $sum += $veg[m_price] * $veg[quant];
         }
         //echo $sum;
         $auth = $this->session->get('auth');
         $id = $auth[uid];
         $orders = new Orders();
         $orders->u_id = $id;
         $orders->o_price = $sum;
         $orders->o_date = date("Y-m-d");
         $orders->o_payment = "Failed";
         $orders->o_delivery = 0;
         if ($orders->save() == false) {
             foreach ($orders->getMessages() as $message) {
                 echo $message;
             }
         } else {
             foreach ($orderarray as $veg) {
                 $orderdetails = new Orderdetails();
                 $orderdetails->o_id = $orders->o_id;
                 $orderdetails->m_id = $veg[m_id];
                 $orderdetails->od_quantity = $veg[quant];
                 $orderdetails->od_prepared = 0;
                 if ($orderdetails->save() == false) {
                     foreach ($orderdetails->getMessages() as $message) {
                         echo $message;
                     }
                 } else {
                     $user = Userdetails::findFirst(array("(u_id = :id:)", 'bind' => array('id' => $id)));
                     if ($user != false) {
                         $datename = $user->u_fname;
                         $dataemail = $user->u_email;
                         $dataphone = $user->u_phno;
                         $dataamount = $sum;
                         $url = "https://www.instamojo.com/slickaccount/test-for-integration-monthly-payment/?intent=buy&data_name=" . $dataname . "&data_email=" . $dataemail . "&data_phone=" . $dataphone . "&data_amount=" . $dataamount . "&data_readonly=data_phone&data_readonly=data_name&data_readonly=data_email";
                         header('Location: ' . $url);
                     }
                 }
             }
         }
     }
 }
開發者ID:redefiningcuriosity,項目名稱:rms,代碼行數:48,代碼來源:PlaceorderController.php

示例13: actionStep2

 public function actionStep2($id, $day)
 {
     $models_orders = new Orders();
     if (isset($_POST['Orders'])) {
         $models_orders->name = $_POST['Orders']['name'];
         $models_orders->tel = $_POST['Orders']['tel'];
         $models_orders->selected_time_id = $_POST['selected_time_id'];
         $models_orders->quest_id = $_GET['id'];
         $models_orders->date_day = $_GET['day'];
         $models_orders->setScenario('insert');
         if ($models_orders->save()) {
             $this->redirect('/site/success');
         }
     }
     $this->render('step2', array('model' => $this->loadModel($id), 'day' => $date_day, 'models_orders' => $models_orders));
 }
開發者ID:R-thomas,項目名稱:quest,代碼行數:16,代碼來源:SiteController.php

示例14: indexAction

 public function indexAction()
 {
     $dateSelected = "";
     $sqlWithDate = "";
     if ($this->request->getPost()) {
         $dateSelected = $this->request->getPost('date');
         $sqlWithDate = " AND date_created = '{$dateSelected}'";
         $today = Carbon::now()->toDateString();
     }
     $hours = ['09' => ['hours' => '09', 'desc' => '09:00 - 10:00'], '10' => ['hours' => '10', 'desc' => '10:00 - 11:00'], '11' => ['hours' => '11', 'desc' => '11:00 - 12:00'], '12' => ['hours' => '12', 'desc' => '12:00 - 13:00'], '13' => ['hours' => '13', 'desc' => '13:00 - 14:00'], '14' => ['hours' => '14', 'desc' => '14:00 - 15:00'], '15' => ['hours' => '15', 'desc' => '15:00 - 16:00'], '16' => ['hours' => '16', 'desc' => '16:00 - 17:00'], '17' => ['hours' => '17', 'desc' => '17:00 - 18:00'], '18' => ['hours' => '18', 'desc' => '18:00 - 19:00'], '19' => ['hours' => '19', 'desc' => '19:00 - 20:00'], '20' => ['hours' => '20', 'desc' => '20:00 - 21:00'], '21' => ['hours' => '21', 'desc' => '21:00 - 22:00']];
     $stadium = [];
     $userID = "";
     for ($i = 1; $i <= 8; $i++) {
         foreach ($hours as $key => $value) {
             $order = Orders::findFirst("stadium = '{$i}' AND start_hour = '{$key}' {$sqlWithDate}");
             $link = "<a href=\"/process/add/{$i}/{$key}/{$this->session->get('user_id')}\" class=\"btn-xs btn-success\">Book Now</a>";
             $name = $link;
             if (isset($order->user_id)) {
                 $name = "<a class=\"btn-xs btn-default\">{$order->Userss->name}</a>";
                 if ($order->user_id == $this->session->get('user_id')) {
                     $name = "<a class=\"btn-xs btn-warning\">Yours</a>";
                 }
                 $userID = isset($order->user_id) ? $order->user_id : "";
             }
             if ($dateSelected < $today) {
                 $name = "<a class=\"btn-xs btn-danger\">Expired Book</a>";
             }
             $stadium[$key][$i] = ['desc' => $value['desc'], 'userId' => $userID, 'name' => $name];
         }
     }
     $this->view->setVar('data', $stadium);
     $this->view->setVar('dateSelected', $dateSelected . " (yy-mm-dd)");
 }
開發者ID:limferdi,項目名稱:soccerStadiumReservation,代碼行數:33,代碼來源:DashboardController.php

示例15: actionLogin

 public function actionLogin()
 {
     switch ($_GET['model']) {
         case 'viivakoodi':
             if (isset($_POST['username']) and isset($_POST['password'])) {
                 $criteria = new CDbCriteria();
                 $criteria->order = " id DESC ";
                 $criteria->condition = " \n\t\t\tusername='" . $_POST['username'] . "' \n\t\t\tAND password='" . md5($_POST['password']) . "' \n\t\t";
                 $user = User::model()->find($criteria);
                 if (!isset($user->id)) {
                     $this->_sendResponse(200, "userError");
                     exit;
                 }
                 $criteria = new CDbCriteria();
                 $criteria->order = " id DESC ";
                 $criteria->condition = " \n\t\t\tuser_id='" . $user->id . "'\n\t\t\tAND CURDATE() BETWEEN start AND stop \n\t\t\tAND status=1 \n\t\t";
                 $order = Orders::model()->find($criteria);
                 if (!isset($order->id)) {
                     $this->_sendResponse(200, 'Käyttöaika umpeutunut. Osta aikaa käyttääksesi ohjelmaa.');
                     exit;
                 }
                 if (isset($user->id) and isset($order->id)) {
                     $this->_sendResponse(200, $user->id);
                 }
             } else {
                 $this->_sendResponse(200, "Jotain on väärin");
             }
             break;
     }
 }
開發者ID:laptopsr,項目名稱:miinus,代碼行數:30,代碼來源:ApiController.php


注:本文中的Orders類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。