Former Pakistani president appears before court in graft cases