Jorge
If you are referring to creating a menu with pre-made searches to display a specific group of records, that is easy to do. Below is an example from one of my installations. This information is in a file I created called "nav.php" which I included in the header.php file.
<?
// get the number of XXX records in the database
$sql = "SELECT COUNT(Area) FROM contact where Area = 1";
// execute the select query
$AFC = execute_db($sql, $conn);
while ($count_row = fetch_row_db($AFC)){
$AFC_records = $count_row[0];
} // end while
$sql1 = "SELECT COUNT(Area) FROM contact where Area = 2";
$EmailDNS = execute_db($sql1, $conn);
while ($count_row = fetch_row_db($EmailDNS)){
$EmailDNS_records = $count_row[0];
}
$sql2 = "SELECT COUNT(Area) FROM contact where Area = 3";
$Netwatch = execute_db($sql2, $conn);
while ($count_row = fetch_row_db($Netwatch)){
$Netwatch_records = $count_row[0];
}
$sql3 = "SELECT COUNT(Area) FROM contact where Area = 4";
$PBX = execute_db($sql3, $conn);
while ($count_row = fetch_row_db($PBX)){
$PBX_records = $count_row[0];
}
$sql4 = "SELECT COUNT(Area) FROM contact where Area = 5";
$Tspt = execute_db($sql4, $conn);
while ($count_row = fetch_row_db($Tspt)){
$Tspt_records = $count_row[0];
}
$sql5 = "SELECT COUNT(Area) FROM contact where Area = 6";
$Switch = execute_db($sql5, $conn);
while ($count_row = fetch_row_db($Switch)){
$Switch_records = $count_row[0];
}
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=1&page=0\" class=\"menu\">Acs Fac & CPE <span class=\"small\">[".$AFC_records."]</span></a>";
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=2&page=0\" class=\"menu\">Email/DNS/AAA <span class=\"small\">[".$EmailDNS_records."]</span></a>";
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=3&page=0\" class=\"menu\">Netwatch <span class=\"small\">[".$Netwatch_records."]</span></a>";
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=4&page=0\" class=\"menu\">PBX <span class=\"small\">[".$PBX_records."]</span></a>";
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=5&page=0\" class=\"menu\">Transport <span class=\"small\">[".$Tspt_records."]</span></a>";
echo "<a href=\"".$dadabik_main_file."?function=search&table_name=".urlencode($table_name)."&where_clause=Area=6&page=0\" class=\"menu\">Switching <span class=\"small\">[".$Switch_records."]</span></a>"; }
?>
This example also displays the number of records beside the menu link. The classes used are custom classes I created for the menu and do not appear in the default DaDaBIK stylesheets.
This is only part of the entire navigation I built for this particular installation. The whole thing works on the two main tables in the DB and the menu displayed depends on which table the user is viewing at the time -- accomplished with 'if' statements surrounding the php echo lines. If you use the counts on more than one table, you'll have to create additional count sections also.
Hope this makes sense.
Debbie
(Latest version of DaDaBIK when this message was posted: 3.1 Beta)