本文整理汇总了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);
}
示例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();
}
示例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));
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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!";
}
}
示例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));
}
示例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']);
}
}
}
示例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;
}
示例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);
}
}
}
}
}
}
示例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));
}
示例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)");
}
示例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;
}
}