} else { $Name = $_POST['Name']; } if (empty($_POST['Name_Amharic'])) { $errors[] = "Amharic name should be filled"; } else { $Name_Amharic = $_POST['Name_Amharic']; } if (empty($_POST['Region_ID'])) { $errors[] = "Region ID should be filled"; } else { $Region_ID = $_POST['Region_ID']; } if (empty($errors)) { $region = new Region($Name, $Name_Amharic); if ($encoder_con->Region_Exists_For_Edit($region, $Region_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $Region_ID); } $added = $encoder_con->Edit_Region($region, $Region_ID); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($region); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Region_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Region_ID); } }