If I'm understanding you right, then when the user asks for class "8", they get all the results where the class is 8; if they ask for class "9", they get all the results where the class is 9; but if they ask for class "7" they get all the results where the class is either 7 or 13.
$class=(int)$_GET['class'];
if ($class==7)
{ $condition="AND (`class`==7 OR `class`==13";
}
else
{
$condition="AND `class`==$class";
}
Except where you write
$condition="AND class LIKE '%'";
makes it look like you don't want to use the class in your WHERE conditions at all. If that's true, then
$class=(int)$_GET['class'];
if ($class==7)
{ $condition="AND (`class`==7 OR `class`==13";
}
should be enough.