Default Nexus 7 charges only when battery is flat!

I am having problem charging my n7 while it is on or off. It only start charging when it auto shut off because battery is flat. My PC is unable to detect the usb connection too. Anyone could advise me what is the cause and the rectification?

I bought the n7 from amazon and asus doesnt offer international warranty to my country, furthermore it is rooted and i cant lock back the bootloader as my pc cant detect the device.