' ') order by recipes.TXN_TS desc"; //if looking for a subcat then narrow the search if( $_REQUEST["subCat"] > " "){ $theSubCat = $_REQUEST["subCat"]; $sqlrp = "select recipes_recipes_sub_cat.recipe_sub_cat_ID, recipes.ID, recipes.Brief, recipes.Recipe_Name,recipes.winner, recipes.Prep_Time_Hours, recipes.Prep_Time_Minutes, recipes.Photo, users.First_Name, users.State_Reside from recipes_recipes_sub_cat, recipes, users where (users.ID = recipes.User_ID) and (recipes.Category = '$catID') and (Recipe_Name > ' ') and (recipes_recipes_sub_cat.recipe_ID = recipes.ID) and (recipes_recipes_sub_cat.recipe_sub_cat_ID = '$theSubCat') order by recipes.TXN_TS desc"; } $result = mysql_query($sqlrp) or die(mysql_error()); $numrows=mysql_num_rows($result); // how many rows to show per page $rowsPerPage = 5; // 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 = " [Prev] "; $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] "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } //end of paging if( $_REQUEST["ta"] == "vote"){ //check if user is logged in if( ! $_SESSION['loggedIn'] ){ header("Location: logonFridge.php"); exit ; }else{ //see if user voted for this recipe already today $today = date("Y-m-d") ; $sqlUser = "select * from votes where (USER_ID = '" . $_SESSION["sessionUserID"] . "') and (DATE_ADDED = '$today') and (RECIPE_ID = '" . $_REQUEST["recid"] . "')"; $resultUser = mysql_query($sqlUser) or die(mysql_error()); if($myrowUser=MySQL_fetch_array($resultUser)){ //user has already voted for this recipe today - don't record the vote - show message $voteMessage = "You've already voted for this recipe today. Please try again tomorrow.

"; }else{ //this is the first time the user has voted for this recipe today - DO record the vote - show message $sqlInsert = "INSERT INTO votes (USER_ID, DATE_ADDED, RECIPE_ID, IP_ADDRESS) values ('" . $_SESSION["sessionUserID"] . "', '$today', '" . $_REQUEST["recid"] . "', '$logged_string')"; $resultInsert = mysql_query($sqlInsert) or die(mysql_error()); $voteMessage = "Thanks for voting! Remember you can vote for all of your favorite recipes!

"; } } } ?> Recipes for <?= $_REQUEST["mainCat"] ?> " /> , free product samples, save on groceries, free grocery samples, clip free grocery coupons" />
yada home
recipes
 
explore recipes
  search recipes:  
   
 
Appetizers
Main Dishes
Side Dishes
Breakfast/Brunch
Beverages
Desserts
Kids Dishes
Soups/ Stews/ Chilis
Healthy/Lite
Condiments
Sandwiches/ Burgers
Snacks
Barbeque
Other/ Suggestions
 
[go to my cookbook]

.jpg" alt="great recipes" width="498" height="338" />
free coupons

 

.jpg" alt="side dish recipes" />
 
want to narrow your selection?  

' ') order by recipes.TXN_TS desc LIMIT $offset, $rowsPerPage"; //if looking for a subcat then narrow the search if( $_REQUEST["subCat"] > " "){ $theSubCat = $_REQUEST["subCat"]; $sqlrp = "select recipes_recipes_sub_cat.recipe_sub_cat_ID, recipes.ID, recipes.Brief, recipes.Recipe_Name,recipes.winner, recipes.Prep_Time_Hours, recipes.Prep_Time_Minutes, recipes.Photo, users.First_Name, users.State_Reside from recipes_recipes_sub_cat, recipes, users where (users.ID = recipes.User_ID) and (recipes.Category = '$catID') and (Recipe_Name > ' ') and (recipes_recipes_sub_cat.recipe_ID = recipes.ID) and (recipes_recipes_sub_cat.recipe_sub_cat_ID = '$theSubCat') order by recipes.TXN_TS desc LIMIT $offset, $rowsPerPage"; } $resultrp = mysql_query($sqlrp) or die(mysql_error()); while($myrowrp=mysql_fetch_array($resultrp)){ //get rating $rating = 3; //get recipe rating $recid $sqlr = "select round(avg(Rating)) as Rating from ratings where For_Recipe_ID = '$myrowrp[ID]'"; $resultr = mysql_query($sqlr) or die(mysql_error()); if($myrowr=MySQL_fetch_array($resultr)){ $rating = $myrowr["Rating"]; if($rating < 1){ $rating = 1;} if($rating > 5){ $rating = 5;} if($myrowr["Rating"] == 0){$rating = 3;} } //end of rating $winner = $myrowrp["winner"]; ?> " "){ ?> "0000-00-00"){?> Style="position:relative; left:-25px;" > "0000-00-00"){?>
winner
); background-position:top; background-repeat:no-repeat">"><?= $myrowrp[" />
 
" " ){ echo $myrowrp["Brief"] . "
"; } ?> Prep time :
Rating:
Votes this week: = '$firstd') and (RECIPE_ID = '$myrowrp[ID]') "; $resultv = mysql_query($sqlv) or die(mysql_error()); if($myrowv=MySQL_fetch_array($resultv)){ echo $myrowv[thecount]; } ?>
Submitted by " "){ echo "of " . $myrowrp["State_Reside"]; } ?>

" class="rightTopNavLinks style30">[Find out the recipe]

"0000-00-00"){?> Style="position:relative; left:-25px;" > "0000-00-00"){?>
winner
 
" " ){ echo $myrowrp["Brief"] . "
"; } ?> Prep time :
Rating:
Votes this week: = '$firstd') and (RECIPE_ID = '$myrowrp[ID]') "; $resultv = mysql_query($sqlv) or die(mysql_error()); if($myrowv=MySQL_fetch_array($resultv)){ echo $myrowv[thecount]; } ?>
Submitted by " "){ echo "of " . $myrowrp["State_Reside"]; } ?>

" class="rightTopNavLinks style30">[Find out the recipe]



 

 
share recipes