To get you started, Bootstrap pagination works on a ul of class = pagination with the page links as list items.
Towards the start of your php code add the pagination class to the ul (not the div)
<ul class="pagination">
Then wherever you echo a page link, wrap it with li tags, e.g.
echo " <li><a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> </li>";
EDIT
You also want to tweak the HTML for the current page by changing
echo " [<b>$x</b>] ";
to
echo " <li>$x</li> ";
Edit
If you want to center your pagination bar, Bootstrap 3 has a the text-center class which you can use. See http://jsfiddle.net/panchroma/8RHzw/
Change the first line of your php to
<div class="text-center">
With Bootstrap 2, use
<div style="text-align:center;">
Hope this helps!