The line
<a href=\"javascript:eventWindow('../user.php?i=".$id."');\">
will only output the id of the last record in the loop seeing as the link is being created outside of your while loop.
what you need to do is reference the selected id via javascript instead.
give your select an id...
<select id=\"users\" name=\"users\">";
then change your href by removing the id querystring val:
<a href=\"javascript:eventWindow('../user.php');\">
then within your javascript function, insert the following:
<script type="text/javascript">
function eventWindow(url)
{
var sel = document.getElementById('user');
url+= '?i='+sel.options[sel.selectedIndex].value;
event_popupWin = window.open(url, 'event', 'resizable=yes,scrollbars=yes,toolbar=no,width=450,height=500');
event_popupWin.opener = self;
}
</script>
should work i think
oh and also, replace...
<a href=\"javascript:eventWindow('../user.php');\">
<input type=\"submit\" name=\"viewuser\" value=\"View\" />
</a>";
with:
<input type=\"button\" name=\"viewuser\" value=\"View\"
onclick=\"eventWindow('../user.php');\" />
you don't need an input type of submit as you're not using a form and it's kinda strange to wrap one in an href (as far as i'm aware at least)