What should I do if someone submit a review of a manuscript in journal system sooner than I know and I already prepared a detailed review? I am a Ph.D. student. My supervisor frequently tells me if you want to do a review for journals, login into my account and perform the review. He never reviews any paper. He is very lazy and I have to do all of the submission of my articles into journal system myself using his account. 

A while ago, I wanted to check a journal and I saw a pending invitation for review from a famous researcher, which I love his works very much, as associate editor of that journal. I accepted review and downloaded manuscript. I read the manuscript and wrote a detailed review of it, six pages long!. I recommended a major revision. It takes a lot of my time to read the references and perform the review. In my review, I suggested a set of improvements to the authors which I think will help them improve their work. 

Today, I wanted to submit the review using my supervisor account. I suddenly noticed that my supervisor submitted a review. I am very upset as it took much of my time to perform this task. I read his review, a very short note to reject the manuscript, less than half a page long. Other anonymous reviewers recommended a minor revision.  

What should I do? Is there any way to make the best use of my review? not to waste my time. 

Disclaimer: 
Please don't be so judgmental. Assume someone in such a situation. 
He didn't know it is unethical not even a bit until asked this question. He even guesses his supervisor himself not knows this. Since there was never any evil intention by any of them. 

Here we want to ask questions and consult/educate ourselves from members; not judging people. He just worked hard to help some other researchers and nothing else. Not a first-year Ph.D. student.
I understand that this proxy review may be a cultural norm where you are. Nevertheless, it is considered malpractice in many places, and admitting to doing this can land you in trouble. Keep that in mind, because a publisher like Elsevier is massively cross-cultural, so they may take umbrage to something like this if it is reported.

Now, coming to what you get out of it. Your learning has happened anyway; I'm sure you expanded your understanding by reading all the references etc. At no point were you getting any credit for it - certainly not from journal,  probably not from supervisor (I understand this particular review was not done with his knowledge). So there's no reason to be upset. I would suggest conserving your energies. If anything, you could show your supervisor your review, just so he knows how hard you worked. But if he is as lazy and uninterested as the question makes him sound,  he may dismiss it.

Bottom line is, don't be upset. You volunteered to do the review by proxy and didn't inform supervisor what you were doing - so it's hard to find fault with anyone else. Learn from this incident and move on.