I have a computer engineering degree from CMU with 20 years experience programming. From 2000-2006 I worked in the mobile industry and our main product was what you are doing at it's core. It did a lot of other stuff of course, but the main thing was sending/receiving over a socket and storing/reading/formatting data from a DB.
And all of these tasks -- reading/writing from socket, storing/reading from DB, and formatting text are basic programming things. So it's really easy. I said 6 days because I'm doing some other things, but it's really about 6 hours of work. If it's really urgent I could probably move it up.
Just curious, do you care what language to use? You mention C and PHP and I'm good at both of those. But Java has some core classes that are kind of meant for this so I'd rather use that. I know lots of languages and I could get it done anyway, but I'd rather use Java if that's ok.