electrical problems on 2006 malibu wouldn't start. on 2006 Chevrolet Malibu Maxx

about a week and a half ago my 2006 malibu maxx ss with the 3.9 litre motor would not start, replaced battery still no fire or clicks engageing starter next day it started with no additional work but would turn off when driving down the road. Now the trans will not work in drive but in Manuel will move in first but slip and if starting in 2 will move a lot easier then you can shift in d and will work fine was moving. can these problems be all related. maybe by a bad ground or something

Asked by for the 2006 Chevrolet Malibu Maxx