Sorry, I did not bother to make it pretty-print, but the source of the generated page has the div structure you asked for. The code is abstract and has dummy rows array, so you can test it by simply pasting it in an empty phpPHP file and trigger it outside Drupal. Anyway you should get the idea.
Update
You used the PHP code from view-view.tpl.php. This is a template file with a broader picture on a view's output structure. In this file you don't have any control over the traversal (the foreach loop). It just says print $rows
and that's it, meaning "print out the loop, whatever it looks like." What you need is to specify how the loop is generated - that is: open your view, open the Theming information and pick one of the tpl in the Style group (where tpl's contain the word unformatted). There you'll be able to mess with the loop. Remove my code from the former file and move it to that file. Rescan templates.