if ($_SESSION['sortby'] == "book_id")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=DESC'>ID ∧</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "book_name")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=DESC'>Book Name ∧</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "author")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=DESC'>Author ∧</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "publishing_house")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=DESC'>Publishing house ∧</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "year_of_publication")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=DESC'>Year of publication ∧</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "binding")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASSC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=DESC'>Binding ∧</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
if ($_SESSION['sortby'] == "availability")
{
if ($_SESSION['dir'] == "ASC")
{
echo "<table bgcolor=#EEEEEE border=1 align=center width='920'><tr> <th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASSC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=DESC'>Availability ∧</a></th>
</tr>";
}
else if ($_SESSION['dir'] == "DESC")
{
sort_first_table();
}
}
}
}
}
else
{
"<table bgcolor=#EEEEEE border=1 align=center width='920'><tr>
<th>LP</th>
<th><a href='searchbooks.php?sortby=book_id&dir=ASC'>ID ∨</a></th>
<th><a href='searchbooks.php?sortby=book_name&dir=ASC'>Book Name ∨</a></th>
<th><a href='searchbooks.php?sortby=author&dir=ASC'>Author ∨</a></th>
<th><a href='searchbooks.php?sortby=publishing_house&dir=ASC'>Publishing house ∨</a></th>
<th><a href='searchbooks.php?sortby=year_of_publication&dir=ASC'>Year of publication ∨</a></th>
<th><a href='searchbooks.php?sortby=binding&dir=ASC'>Binding ∨</a></th>
<th><a href='searchbooks.php?sortby=availability&dir=ASC'>Availability ∨</a></th></tr>";
}
?>