I don't know anything about only your passenger lock working, but I think I've got some info on the key code. According to my manual, you enter the 7 digit code and that allows you to set up a 4 digit PIN that will be your new code. The 7 digit's like the master. If you've got a manual, check it out.
So you were able to locate the 7 digit pin under the dash. Where exactly was it? I've been trying to find it for awhile. If you don't have a manual let me know and I'll get you the instructions on setting up the 4 digit pin.