public static function completePersonalProductUpdate() { require_once 'Product.model.php'; $data = array(); if (isset($_POST['updateProduct'])) { $title = $_POST['title']; $state = $_POST['state']; $price = $_POST['price']; $text = $_POST['text']; $category = $_POST['category']; $subcategory = $_POST['subcategory']; $id = $_POST['product_id']; try { $result = ProductModel::updatePersonalProduct($title, $text, $price, $category, $subcategory, $state, $id); $data['redirect'] = '?/Product/myProducts'; } catch (Exception $e) { $data['error'] = $e->getMessage(); $data['template'] = 'error.html'; } } else { $data['redirect'] = '?/User/personalProduct'; } return $data; }