president is nominated and elected by the party and not by the people. to assume the president will serve the people and the country is fool hardy.
Those who nominated were elected by the people ...
So, it was an indirected election
(The difference between the Prime Minister and the president is that president can be anybody, PM should be an elected member of parliament.)