<?php
include('wlrb_files/functions/functions_general.php');
include('wlrb_files/config.php');
//$custom_vars = getCustomVars();
$result = mysql_query('
SELECT *
FROM wlrb_categories
ORDER BY wlrb_categories_title ASC');
while ($category = mysql_fetch_array($result)) {
$sub_result = mysql_query('
SELECT wlrb_recipes_id
FROM wlrb_recipes
WHERE wlrb_categories_id = "' . $category['wlrb_categories_id'] . '"
and wlrb_recipes_approved = 1');
$total = mysql_num_rows($sub_result);
$category_list .= '<a href="wlrb-recipes.php?category=' . $category['wlrb_categories_id'] . '">' . $category['wlrb_categories_title'] . '</a> (' . $total . ' recipes)<br />';
}
$sub_result = mysql_query('
SELECT wlrb_recipes_id
FROM wlrb_recipes
WHERE wlrb_categories_id = "0"
and wlrb_recipes_approved = 1');
$total = mysql_num_rows($sub_result);
$category_list .= '<a href="wlrb-recipes.php?category=0">Miscellaneous</a> (' . $total . ' recipes)<br />';
?>
<html>
<head>
<title>Weight Loss Recipe Book</title>
<link rel="stylesheet" type="text/css" href="wlrb_files/styles/default.css">
</head>
<body>
<div class="align-center">
<a href="wlrb-recipe-categories.php"><img src="wlrb_files/images/browse_categories.gif" alt="Browse Categories" /></a> <a href="wlrb-submit.php"><img src="wlrb_files/images/submit_recipe.gif" alt="Submit Recipe" /></a></div>
<div class="main">
<?php echo $result_div; ?>
<h1>Weight Loss Recipe Book Categories</h1>
<?php echo $category_list; ?>
</div>
<p class="align-center">Powered by <a href="http://www.my-health-and-fitness.org">My-Health-and-Fitness.org</a></p>
</body>
</html>