Evolution of solitary waves and undular bores in shallow-water flows over a gradual slope with bottom friction