<?php
echo "<table><tr><th><a href='index.php?order=name'>Студент</a></th><th><a href='index.php?order=groupindex'>Номер группы</a></th><th><a href='index.php?order=points'>Баллы</a></th></tr>" ;
$sort = 'points' ;
if ( isset ( $_GET [ 'order' ] ) ) { $sort = $_GET [ 'order' ] ;
}
$STH = $DBH -> query ( "SELECT name, sname, groupindex, points FROM students ORDER BY $sort " ) ;
PD9waHAKCgplY2hvICI8dGFibGU+PHRyPjx0aD48YSBocmVmPSdpbmRleC5waHA/b3JkZXI9bmFtZSc+0KHRgtGD0LTQtdC90YI8L2E+PC90aD48dGg+PGEgaHJlZj0naW5kZXgucGhwP29yZGVyPWdyb3VwaW5kZXgnPtCd0L7QvNC10YAg0LPRgNGD0L/Qv9GLPC9hPjwvdGg+PHRoPjxhIGhyZWY9J2luZGV4LnBocD9vcmRlcj1wb2ludHMnPtCR0LDQu9C70Ys8L2E+PC90aD48L3RyPiI7Cgokc29ydCA9ICdwb2ludHMnOwppZiAoaXNzZXQoJF9HRVRbJ29yZGVyJ10pKSB7CiAgICAkc29ydCA9ICRfR0VUWydvcmRlciddOwp9CgokU1RIID0gJERCSC0+cXVlcnkoIlNFTEVDVCBuYW1lLCBzbmFtZSwgZ3JvdXBpbmRleCwgcG9pbnRzIEZST00gc3R1ZGVudHMgT1JERVIgQlkgJHNvcnQiKTsK