' ')"; $result = mysql_query($sql) or die(mysql_error()); $numrows=mysql_num_rows($result); // how many rows to show per page $rowsPerPage = 4; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " $page "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " Previous Recipes "; $first = " [First Page] "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " Next Recipes "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } ?> Yada Home | Cookbook
yada home
my fridge

+ Add New Recipe Browse YadaHome Recipes


' ') order by recipes.TXN_TS desc LIMIT $offset, $rowsPerPage"; $resultrp = mysql_query($sqlrp) or die(mysql_error()); while($myrowrp=MySQL_fetch_array($resultrp)){ ?> " "){ ?>
); background-position:top; background-repeat:no-repeat">
" "){?>

&page=" class="rightTopNavLinks favoriteRecipesLinks">[Find out the recipe] " class="rightTopNavLinks favoriteRecipesLinks">[Edit]
" "){?>

&page=" class="rightTopNavLinks favoriteRecipesLinks">[Find out the recipe] " class="rightTopNavLinks favoriteRecipesLinks">[Edit]

' ') and cookbook.ID = (select Max(ID) as lastID from cookbook where User_ID = '" . $_SESSION["sessionUserID"] . "')"; $msg = "This is the last recipe added to your Cookbook" ; if($recid > " "){ $sqlrp = "select * from recipes where (ID='$recid')"; $msg = " " ; } $resultrp = mysql_query($sqlrp) or die(mysql_error()); if($myrowrp=MySQL_fetch_array($resultrp)){ $recipeID = $myrowrp["ID"] ; //rating $sql = "select avg(Rating) as rating from ratings where (For_Recipe_ID ='$recipeID')"; $result = mysql_query($sql) or die(mysql_error()); if($myrow=MySQL_fetch_array($result)){ $rate = substr($myrow["rating"],0,1) ; switch ($rate) { case "1.00": $image="1"; break; case "2.00": $image="2"; break; case "3.00": $image="3"; break; case "4.00": $image="4"; break; case "5.00": $image="5"; break; default: $image="3"; } } if(($myrowrp["Prep_Time_Hours"] > " ") && ($myrowrp["Prep_Time_Minutes"] > " ")){ $prepTime = $myrowrp["Prep_Time_Hours"]. ":". $myrowrp["Prep_Time_Minutes"] ; } if($myrowrp["Prep_Time_Hours"] > " " && $myrowrp["Prep_Time_Minutes"] < " "){ $prepTime = $myrowrp["Prep_Time_Hours"] . ":00" ; } if($myrowrp["Prep_Time_Hours"] < " " && $myrowrp["Prep_Time_Minutes"] > " "){ $prepTime = $myrowrp["Prep_Time_Minutes"] . "min" ; } if($myrowrp["Total_Time_Hours"] < " " && $myrowrp["Total_Time_Minutes"] > " "){ $totTime = $myrowrp["Total_Time_Minutes"] . "min" ; } if($myrowrp["Total_Time_Hours"] > " " && $myrowrp["Total_Time_Minutes"] > " "){ $totTime = $myrowrp["Total_Time_Hours"] . ":" . $myrowrp["Total_Time_Minutes"] ; } if($myrowrp["Total_Time_Hours"] > " " && $myrowrp["Total_Time_Minutes"] < " "){ $totTime = $myrowrp["Total_Time_Hours"] . ":00" ; } ?>

" class="recipeLinks style6">[edit recipe]
prep time: | total time: | serving size:

Current Rating
recipe rating
Ingredients

Instructions

Your cookbook is empty.
You can go to the recipe page to
view recipes and add them to your cookbook.

 
 
free profile