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