/framework/models/sendOrder.php
PHP | 55 lines | 13 code | 8 blank | 34 comment | 2 complexity | af9da2a3c0e61aa62348c0871f9ee5ed MD5 | raw file
Possible License(s): GPL-3.0
- <?php
- /**
- * Created by JetBrains PhpStorm.
- * User: predragjevtic
- * Date: 9/15/12
- * Time: 8:43 AM
- * To change this template use File | Settings | File Templates.
- */
- if (isset($_POST['cancelOrder'])) {
- $log = new Log();
- $log->note = "Narudžbina je otkazana";
- $log->userID = $_SESSION['clientID'];
- $log->eventTime = time();
- $log->selectedProducts = "";
- $log->save();
- $session->message("Porudžbina je otkazana");
- redirect_to(SITE_ROOT."my-account");
- } else {
- $address = Address::find_by_customer($_SESSION['clientID']);
- /*
- $order = new Order();
- $order->customerID = $_SESSION['clientID'];
- $order->orderDate = time();
- $address = Address::find_by_customer($_SESSION['clientID']);
- $order->status = 7;
- //notCompleteOrder 7
- //pending =1
- //confirmed =2
- //payed = 3
- //sentProducts = 4
- //closed = 5
- $order->totalPrice = $_POST['totalPrice'];
- $order->ipAddress = $_SERVER['REMOTE_ADDR'];
- $order->products = str_replace('\n', '', str_replace('\r', '', $_POST['products']));
- $order->customerID = $_SESSION['clientID'];
- $order->save();
- if (isset($order->id)) {
- $_SESSION['orderID'] = $order->id;
- }
- */
- }