Hello,
I am a PHP developer and I would like to help you on this.
Referral system is all about links, clicking a particular link with referral code gives the referring user some credits. Now, you have mentioned how should it work but there are many things to discuss.
Starting from how links should work, and how the users are credited etc. And where it will be used, in a already developed system or for a new system.
So, feel free to discuss, I have given you a approximate amount and time.
##UPDATE - I think you have posted this project earlier. --##
Thanks
Meeshal k