include_once('inc/sectorchange.php'); ?>
include_once('inc/header.php'); ?>
include_once('inc/nav.php'); ?>
//active recipe
if($recipeid) {
$Query = "SELECT * FROM recipes WHERE id = '$recipeid'";
} else {
$Query = "SELECT * FROM recipes WHERE category LIKE '$section' ORDER BY RAND() LIMIT 1";
}
$dbResult = mysqli_query($con,$Query);
$row = mysqli_fetch_array($dbResult);
$recipe_id = $row['id'];
$recipe_thumb = $row['thumb'];
$recipe_title = $row['title'];
$recipe_servings = $row['servings'];
$recipe_description = $row['description'];
$recipe_tips = $row['tips'];
$recipe_ing_heading = $row['ing_heading'];
$recipe_ing_measure = $row['ing_measure'];
$recipe_ing_ingredient = $row['ing_ingredient'];
$recipe_ing_metric_measure = $row['ing_metric_measure'];
$recipe_directions = $row['directions'];
$recipe_nutrition = $row['nutrition'];
$recipe_ing_heading = explode('{;}',$recipe_ing_heading);
$recipe_ing_measure = explode('{;}',$recipe_ing_measure);
$recipe_ing_ingredient = explode('{;}',$recipe_ing_ingredient);
$recipe_ing_metric_measure = explode('{;}',$recipe_ing_metric_measure);
$num = count($recipe_ing_heading);
for($i=0;$i<=$num;$i++) {
if(!$recipe_ing_measure[$i] && !$recipe_ing_ingredient[$i] && !$recipe_ing_metric_measure[$i]) {
if(!$recipe_ing_heading[$i]) {
unset($recipe_ing_heading[$i]);
unset($recipe_ing_measure[$i]);
unset($recipe_ing_ingredient[$i]);
unset($recipe_ing_metric_measure[$i]);
}
}
}
//end active recipe
?>
if($recipe_tips) { ?>
tip
print processYTiframe($recipe_tips) ?>
} ?>
style="margin-top:30px;" } ?>>Ingredients
if($recipe_ing_heading[0] == '') {
?>
}
$init = 1;
foreach($recipe_ing_heading as $key=>$val) {
?>
if($val) { ?>
| print $val ?> |
} else {
$init++;
$class = '';
if(is_int($init/2)) {
$class = 'class="rowColor"';
}
?>
>
| print $recipe_ing_measure[$key] ?> |
print $recipe_ing_ingredient[$key] ?> |
print $recipe_ing_metric_measure[$key] ?> |
} ?>
} ?>
Directions
print processYTiframe($recipe_directions) ?>
if($recipe_nutrition) { ?>
Nutritional Info
print processYTiframe($recipe_nutrition) ?>
} ?>
Try these other
great recipes
$numRecipes = 5; // up to 6 related and cross-sell recipes
// related recipes
$Query = "SELECT * FROM recipes WHERE approval = 'y' && category LIKE '%$section%' && id != '$recipeid' ORDER BY RAND() LIMIT 0,4";
$dbResult = mysqli_query($con,$Query);
while($row = mysqli_fetch_array($dbResult)) {
$numRecipes--;
$other_id = $row['id'];
$other_thumb = $row['thumb'];
$other_title = $row['title'];
?>
 |
print $other_title ?> |
} //related recipes ?>
// cross-sell recipes
$Query = "SELECT * FROM recipes WHERE approval = 'y' && category NOT LIKE '%$section%' && id != '$recipeid' ORDER BY RAND() LIMIT 0,$numRecipes";
$dbResult = mysqli_query($con,$Query);
while($row = mysqli_fetch_array($dbResult)) {
$other_id = $row['id'];
$other_thumb = $row['thumb'];
$other_title = $row['title'];
?>
 |
print $other_title ?> |
} //cross-sell recipes ?>