SQL 90% working,

main page table now sortable