// *******************************************************************
// include/main.cats.php
// *******************************************************************
$cnt_array = sql_fetch_array(
sql_query("
select
Count(*) as Total
from
$tb_categories
where
PID='$PID'
")
);
$num_rows = $cnt_array[Total];
if($num_rows > 0){
if($colcount == 2){
$num_rows % 2 ? $num_rows += 1 : $num_rows;
$rows = $num_rows / 2;
$html = $main_table . "
\r\n\t\t\t| ";
$html .= build_cat("0", $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t
\r\n\t\t\r\n\r\n";
echo table("100%", "center", "", $html);
}
if($colcount == 3){
$num_rows % 3 ? $num_rows += 1 : $num_rows;
$num_rows % 3 ? $num_rows += 1 : $num_rows;
$rows = $num_rows / 3;
$rows2 = ($rows * 2);
$html = $main_table . "\r\n\t\t\t| ";
$html .= build_cat("0", $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows2, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t
\r\n\t\t\r\n\r\n";
echo table("100%", "center", "", $html);
}
if($colcount == 4){
$num_rows % 4 ? $num_rows += 1 : $num_rows;
$num_rows % 4 ? $num_rows += 1 : $num_rows;
$num_rows % 4 ? $num_rows += 1 : $num_rows;
$rows = $num_rows / 4;
$rows2 = ($rows * 2);
$rows3 = ($rows * 3);
$html = $main_table . "\r\n\t\t\t| ";
$html .= build_cat("0", $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows2, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t\t";
$html .= build_cat($rows3, $rows, $PID);
$html .= "\r\n\t\t\t | \r\n\t\t
\r\n\t\t\r\n\r\n";
echo table("100%", "center", "", $html);
}
}
$fortune = "N";
$html = $table4 . "\r\n\t\t\t| " . fortune();
$html .= " | \r\n\t\t
\r\n\t\t\r\n\r\n";
if($fortune == "Y" && $PID == 0){echo table("98%", "center", "", $html);}
?>