public function init() { OrderController::$status = array('' => '全部') + Doo::conf()->wxStatus; Doo::loadClassAt('City', 'default'); OrderController::$dataTableUrl = adminAppUrl('operation/order/dataTable'); OrderController::$addUrl = adminAppUrl('operation/order/add'); OrderController::$modUrl = adminAppUrl('operation/order/mod?id='); OrderController::$delUrl = adminAppUrl('operation/order/del?id='); OrderController::$city = '<select class="m-wrap" name="city" id="city-element"><option value="0">' . L('顶级城市') . '</option>' . City::cateToOption($this->getUrlVar('city'), false) . '</select>'; }
public function __construct() { parent::__construct(); }
private function handleOrderOperations($request) { include_once __DIR__ . '/../dataController/OrderController.php'; $orderController = new OrderController(); if (isset($request[1])) { $this->setResponseCodesAndData($orderController->getById($request[1]), 1); } else { $this->setResponseCodesAndData($orderController->getAll(), 1); } }
<?php /** * Created by PhpStorm. * User: Home * Date: 09.11.2015 * Time: 16:47 */ include_once $_SERVER['DOCUMENT_ROOT'] . '/Controllers/OrderController.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/Model/OrderModel.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/View/OrderView.php'; $model = new OrderModel(); //It is important that the controller and the view share the model $controller = new OrderController($model); $view = new OrderView($model); $controller->actionCompleteOrder(); $view->DoctypeView('order'); $view->headerView(); $view->thanksMessage();
public function buildAddToCartValidator($options, $variations, $prefix = '') { $validator = $this->getValidator("addToCart", $this->getRequest()); $prefixes = (array) $prefix; // option validation foreach ($prefixes as $prefix) { foreach ($options as $option) { if ($option['isRequired']) { $optField = $prefix . 'option_' . $option['ID']; OrderController::addOptionValidation($validator, $option, $optField); } } if (isset($variations['variations'])) { foreach ($variations['variations'] as $variation) { $validator->addCheck($prefix . 'variation_' . $variation['ID'], new IsNotEmptyCheck($this->translate('_err_option_0'))); } } $validator->addCheck($prefix . 'count', new IsNumericCheck('')); $validator->addFilter($prefix . 'count', new NumericFilter()); } return $validator; }
private function saveOrder($jsonArray = null) { if (is_array($jsonArray) && isset($jsonArray['usr']) && isset($jsonArray['cart'])) { $order = new OrderModel(); $usr = $jsonArray['usr']; $cart = $jsonArray['cart']; // echo '<pre>';print_R($cart);die; // add checks here before saving order $order->setBfname($usr['fname']); $order->setBlname($usr['lname']); $order->setBemail($usr['email']); $order->setBaddressl1($usr['addr1']); $order->setBaddressl2($usr['addr2']); $order->setBaddressl3($usr['addr3']); $order->setBcity($usr['city']); $order->setBcountry($usr['country']); $order->setBstate($usr['state']); $order->setBzipcode($usr['zipcode']); $order->setInserttime(date("Y-m-d H:i:s")); $order->setSfname($usr['sfname']); $order->setSlname($usr['slname']); $order->setSemail($usr['semail']); $order->setSaddressl1($usr['saddr1']); $order->setSaddressl2($usr['saddr2']); $order->setSaddressl3($usr['saddr3']); $order->setScity($usr['scity']); $order->setScountry($usr['scountry']); $order->setSstate($usr['sstate']); $order->setStatus("pending"); $order->setSubtotal($cart['subTotal']); $order->setSzipcode($usr['szipcode']); $order->setDiscount($cart['discount']); $order->setTotal($cart['total']); $order->setQty($cart['qty']); $order->setOrder_type(strtoupper($usr['ordertype'])); $order->setUserid(Session::getInstance()->getSess("userid")); $order->insert(); if ($order->isSuccess() == 1) { $oid = $order->getOrderid(); foreach ($cart['items'] as $k => $itm) { $item = new OrderProdsModel(); $item->setOid($oid); $item->setTid($itm['template']); $item->setPid($itm['product']); $item->setPrice($itm['price']); $item->setQty($itm['qty']); $item->setTotal($itm['total']); $item->insert(); $this->moveTemplate($itm['template']); // converts file urls from temp dir to final destination dir } if ($cart['disId'] != 0) { $du = new DiscountUserModel(); $du->setDiscountId($cart['disId']); $du->setUserId(Session::getInstance()->getSess("userid")); $du->insert(); if ($cart['discountFor'] == 1) { $dis = new DiscountModel(); $dis->setDiscountid($cart['disId']); $dis->setStatus(1); $dis->update_status(); } } if ($usr['ordertype'] == 'cod') { $this->cod_order($oid, $usr, $cart['total']); } $oc = new OrderController(); ob_start(); $oc->printinvoice($oid); $html = ob_get_clean(); if ($usr['ordertype'] != 'payment') { Session::getInstance()->setMessage("Order accepted.", "green"); Session::getInstance()->removeSess('cart'); } mail($usr['email'], "Order Confirmation", $html, "Content-type: text/html; charset=iso-8859-1 \r\nFrom: noreply@snooky.com\r\n"); echo $oid; } else { Session::getInstance()->setMessage("Problem in accepting order, please try again.", "red"); echo "failed"; } } }
// Controller /////////////////////// include_once 'controller/config.controller.php'; include_once 'controller/product.controller.php'; include_once 'controller/image.controller.php'; include_once 'controller/user.controller.php'; include_once 'controller/api.controller.php'; include_once 'controller/order.controller.php'; include_once 'controller/bank.controller.php'; // Object of Controller $config = new ConfigController(); $detect = new Mobile_Detect(); $product = new ProductController(); $image = new ImageController(); $user = new UserController(); $api = new APIController(); $order = new OrderController(); $bank = new BankController(); // Set Config data $config->GetConfig(); // Metatag setup $metadata = array('title' => $config->meta_title, 'description' => $config->meta_description, 'image' => '/image/logo.jpg', 'type' => 'website', 'site_name' => $config->meta_sitename, 'fb_app_id' => '218590748331719', 'fb_admins' => '1818320188', 'author' => $config->meta_author, 'generator' => 'iGenGoods 1.0', 'keywords' => $config->meta_keyword, 'domain' => 'http://' . $_SERVER['SERVER_NAME']); // Photo Upload config /////////////////////// // Photo desctination folder ///////////////// $destination_folder = array('thumbnail' => 'image/upload/thumbnail/', 'mini' => 'image/upload/mini/', 'square' => 'image/upload/square/', 'normal' => 'image/upload/normal/', 'large' => 'image/upload/large/'); // Photo upload resize /////////////////////// $size = array('thumbnail' => 150, 'mini' => 400, 'square' => 800, 'normal' => 700, 'large' => 1600); // Photo Quality $quality = array('thumbnail' => 100, 'mini' => 90, 'square' => 80, 'normal' => 70, 'large' => 65); // Facebook App Setting define("APP_ID", $config->facebook_app_id); define("APP_SECRET", $config->facebook_app_secret);
public function saveVariations() { $item = ActiveRecordModel::getInstanceByID('OrderedItem', $this->request->get('id'), OrderedItem::LOAD_DATA, OrderedItem::LOAD_REFERENCES); $variations = $item->getProduct()->getVariationData($this->application); $c = new OrderController($this->application); if (!$c->buildVariationsValidator($item, $variations)->isValid()) { return new RawResponse(); } $product = $c->getVariationFromRequest($variations); $item->product->set($product); $item->save(); $item->shipment->get()->save(); return $this->getItemResponse($item); }
<?php /** * Created by PhpStorm. * User: Home * Date: 09.11.2015 * Time: 16:15 */ include_once $_SERVER['DOCUMENT_ROOT'] . '/Controllers/OrderController.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/Model/OrderModel.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/View/OrderView.php'; $model = new OrderModel(); //It is important that the controller and the view share the model $controller = new OrderController($model); $view = new OrderView($model); $controller->actionGetHeaderCart(); $controller->getDefaultBilling(); $view->DoctypeView('order'); $view->headerView(); $view->getPlaceOrder();
include_once 'model/bank.model.php'; // Controller /////////////////////// include_once 'controller/config.controller.php'; include_once 'controller/product.controller.php'; include_once 'controller/image.controller.php'; include_once 'controller/user.controller.php'; include_once 'controller/api.controller.php'; include_once 'controller/order.controller.php'; include_once 'controller/bank.controller.php'; // Object of Controller $config = new ConfigController(); $detect = new Mobile_Detect(); $product = new ProductController(); $image = new ImageController(); $api = new APIController(); $order = new OrderController(); $bank = new BankController(); $user = new UserController(); // Set Config data $config->GetConfig(); // Metatag setup $metadata = array('title' => $config->meta_title, 'description' => $config->meta_description, 'image' => '/image/logo.jpg', 'type' => 'website', 'site_name' => $config->meta_sitename, 'fb_app_id' => '218590748331719', 'fb_admins' => '1818320188', 'author' => $config->meta_author, 'generator' => 'iGenGoods 1.0', 'keywords' => $config->meta_keyword, 'domain' => 'http://' . $_SERVER['SERVER_NAME']); // Photo Upload config /////////////////////// // Photo desctination folder ///////////////// $destination_folder = array('thumbnail' => '../image/upload/thumbnail/', 'mini' => '../image/upload/mini/', 'square' => '../image/upload/square/', 'normal' => '../image/upload/normal/', 'large' => '../image/upload/large/'); // Photo upload resize /////////////////////// $size = array('thumbnail' => 200, 'mini' => 500, 'square' => 900, 'normal' => 900, 'large' => 1200); // Photo Quality $quality = array('thumbnail' => 70, 'mini' => 80, 'square' => 90, 'normal' => 100, 'large' => 80); // Facebook App Setting define("APP_ID", $config->facebook_app_id);
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * @category PayIntelligent * @package ratepay * @copyright (C) 2012 PayIntelligent GmbH <http://www.payintelligent.de/> * @license GPLv2 */ /** * RatePAY order script calls the right controller action for RatePAY order operations */ require_once 'includes/application_top.php'; require_once '../includes/classes/ratepay/helpers/Data.php'; require_once '../includes/classes/ratepay/helpers/Globals.php'; require_once '../includes/classes/ratepay/controllers/OrderController.php'; if (Globals::hasPostEntry('order_number')) { if (Globals::hasPostEntry('ship')) { OrderController::deliverAction(); } elseif (Globals::hasPostEntry('cancel')) { OrderController::cancelAction(); } elseif (Globals::hasPostEntry('refund')) { OrderController::refundAction(); } elseif (Globals::hasPostEntry('credit')) { OrderController::creditAction(); } else { die('Operation not found!'); } } else { die('Missing post param "order_number"!'); }
<div id="cart"> <p><a title="logout" name="op" href="../index.php?op=logout">Logout</a></p> </div> </div> <br> </div> <!-- END Header --> <!--Main--> <div class="wrapper1"> <br> <h1>These orders are created:</h1> <!--Neuer OrderController wird instanziiert und Funktion (listOrders) wird aufgerufen--> <?php include_once "../controller/OrderController.php"; $order_controller = new OrderController(); $order_controller->listOrders(); ?> <form action="../index.php" method="post"> <input type="submit" class="submit" name="op" value="Back"> </form> </div> </div> <div id="footer-push"></div> <!-- END Wrapper --> <!-- Footer --> <p class="optimize"> Optimized for Firefox! </p> <div id="footer">
/** * reqister new user * * @return json * */ public function payment($input) { $newOrder = parent::payment(json_decode($input, true)); return $this->buildAnswer($newOrder[0], $newOrder[1]); }
<?php require_once 'Autoloader.php'; // create a new controller for the order page $controller = new OrderController(); // let the controller handle the request $controller->handleRequest(); // render the page and print it echo $controller->displayPage();