The login info in the
database page is in the footer (at least in the standard themes; it may be different in specifically tailored themes in which case you can inspect the page source to find the DOM structure).
The user name should be retrievable by something like
var whoami=document.getElementById("footer").getElementsByTagName("a")[1].innerHTML;
If you want the user Moodle-id you need to retreive the href of the a tag and extract that id from it
/moodle/user/view.php?id=
747&course=20666
Now with this info you can set the location.href to something like
http://moodle.yours.u/moodle/mod/data/view.php?d=13&perpage=100&search=John Doe&sort=0&order=ASC&advanced=0&filter=1&u_fn=&u_ln=
and that should reload the page and display only John Doe's records.