public function order() { if (!isset($_SESSION['userId'])) { header('Location: /php_project/application/public/'); exit; } $order_id = $this->input->get(0); $orderDb = new \Models\Order(); $order = $orderDb->get('order_id = ' . $order_id)[0]; if (!is_numeric($order_id) || !$order) { header('Location: /php_project/application/public/'); exit; } $orderDb->update('order', array('order_id' => $order_id, 'status' => 'closed')); header('Location: /php_project/application/public/user/product/cart'); }