function index() { if (isset($_POST['nice_id'])) { $Order = new mOrder(); $Order->__post(); $Customer = new mCustomer(); $Customer->__post(); if ($Order->load($Customer)) { $Order->__toMemory(); //$_SESSION['orderid'] = $Order->id(); redirect('/trackorder/view/'); } else { data('error', 'We couldn\'t find those order details'); } } $this->display('search'); }
function details() { if (count($this->order->items()) == 0) { redirect(getUrl('basket')); } $Customer = new mCustomer(); $Customer->__fromMemory(); if (isset($_POST['street_1'])) { //Are we valid - auto bind from post $Customer->__post(); if ($Customer->validate()) { $this->order->__post(); $this->order->__toMemory(); $Customer->__toMemory(); $_SESSION['postdata'] = $_POST; redirect('/checkout/charge'); } } data('Customer', $Customer); data('Order', $this->order); $this->display('details'); }