PageRenderTime 59ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/models/sendOrder.php

https://bitbucket.org/designbyheart/original
PHP | 55 lines | 13 code | 8 blank | 34 comment | 2 complexity | af9da2a3c0e61aa62348c0871f9ee5ed MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. /**
  3. * Created by JetBrains PhpStorm.
  4. * User: predragjevtic
  5. * Date: 9/15/12
  6. * Time: 8:43 AM
  7. * To change this template use File | Settings | File Templates.
  8. */
  9. if (isset($_POST['cancelOrder'])) {
  10. $log = new Log();
  11. $log->note = "Narudžbina je otkazana";
  12. $log->userID = $_SESSION['clientID'];
  13. $log->eventTime = time();
  14. $log->selectedProducts = "";
  15. $log->save();
  16. $session->message("Porudžbina je otkazana");
  17. redirect_to(SITE_ROOT."my-account");
  18. } else {
  19. $address = Address::find_by_customer($_SESSION['clientID']);
  20. /*
  21. $order = new Order();
  22. $order->customerID = $_SESSION['clientID'];
  23. $order->orderDate = time();
  24. $address = Address::find_by_customer($_SESSION['clientID']);
  25. $order->status = 7;
  26. //notCompleteOrder 7
  27. //pending =1
  28. //confirmed =2
  29. //payed = 3
  30. //sentProducts = 4
  31. //closed = 5
  32. $order->totalPrice = $_POST['totalPrice'];
  33. $order->ipAddress = $_SERVER['REMOTE_ADDR'];
  34. $order->products = str_replace('\n', '', str_replace('\r', '', $_POST['products']));
  35. $order->customerID = $_SESSION['clientID'];
  36. $order->save();
  37. if (isset($order->id)) {
  38. $_SESSION['orderID'] = $order->id;
  39. }
  40. */
  41. }