for i2 STUDIOS Visit http://www.i2studios.com for additional details This script is free and can be used freely. For details about license, refer to http://www.i2studios.com/php/policy.php Creates 1..n no of clickable headers that alternates ascending and descending queries of a SQL database driven table in a dynamic webpage. Syntax: createTableHeader(Page to direct the request to, Text to display at webpage, Text to use when searching database) Call the function createTableHeader 1..n times depending on the number of headers you need. Clicking the same header more than one time switches between ascending and descending query. Four different images can be used to make the header more intuitive: asc-on, asc-off, desc-on, desc-off. A set of them can be downloaded at http://www.i2studios.com/download/tablebuttons.zip The text changes color to reflect which header is in use. Go to http://www.i2studios.com/download/demo-create_tableheader.php for additional source. */ if (!isset($sortby)) $sortby='Title'; if (!isset($order)) $order='asc'; function createTableHeader($page,$header, $sort){ global $order, $sortby, $start; $this_order=$order; echo""; //börja alltid en ny sortering stigande if ($sortby!=$sort) { $this_order='asc'; $new_order='asc'; $mode='off'; $color="#777777"; } else { $color="#000000"; $mode='on'; if ($order=='asc') { $new_order='desc'; $alt='Desc'; } else { $new_order='asc'; $alt='Asc'; } } if ($sort!="") echo"\"$alt\" $header"; else echo" "; echo""; } ?>