Rupee ends nearly flat aided by RBI intervention; logs weekly decline