By all means, PHP can develop an application that suits your needs. There are several ways to do this and using a database is a good idea.
By inserting a RMA transaction record into the database, it will provide you a history of transactions, plus you'll be able to select the max RMA value in the database, add (int) one, to use as the RMA value for the next customer. This will guarantee an unqiue RMA value.
The RMA numeric value could get very large since your dealing with Mac products.
🙂
(Sorry, I had to throw that in...)
Another detail such as sending the email with the RMA number to the customer will require that your internet host where you plan to host the application, will allow you to send emails with PHP by using the mail() method.
Or if you have your own web server and mail server, I'm sure your system administrator could set that up.
I'd check on that as well since this is a requirement.
The logic of the application described is not hard and I am not for sure if there is any prebuild applications that meet your requirements at this point, but again... this isn't hard.
Are you building this yourself or are you looking for contracted help?
Thanks,