// $userC = $_COOKIE['id']; // $status = $_REQUEST['pro_status']; // $id_pro = $_REQUEST['pro']; // INIT - Server side validations $error = false; $proId = intval($app->getRequest()->post('pro_id')); if (empty($proId)) { $error = true; } $data = array(); $data["pro_status"] = $app->getRequest()->post('pro_status'); if (empty($data["pro_status"]) || $data["pro_status"] != Project::PROJECT_STATUS_DRAFT && $data["pro_status"] != Project::PROJECT_STATUS_ACTIVE) { $error = true; } $data["pro_type"] = intval($app->getRequest()->post('pro_type')); $category = Category::loadCategoryById($data["pro_type"]); if (empty($data["pro_type"]) || $category == false) { $error = true; } $data["pro_tit"] = $app->getRequest()->post('pro_title'); if (empty($data["pro_tit"]) || strlen($data["pro_tit"]) < 4 || strlen($data["pro_tit"]) > 50) { $error = true; } $data["pro_descripcion"] = nl2br($app->getRequest()->post('pro_descripcion')); if (empty($data["pro_descripcion"]) || strlen($data["pro_descripcion"]) < 150 || strlen($data["pro_descripcion"]) > 500) { $error = true; } $data["pro_cant"] = intval($app->getRequest()->post('pro_quant')); if (!empty($data["pro_cant"]) && !is_numeric($data["pro_cant"])) { $error = true; }