include_once "includes/dbConnNew.php";
include_once "includes/loggedOn.php";
import_request_variables("gp", "");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
if($_REQUEST['fid'] > " " ){
$userID = $_REQUEST['fid'];
//MAKE SURE THIS USER IS SUPPOSED TO SEE THIS
$SelectStr = "select * from privacy where (privacy.deleted = 0) AND ((privacy.user_id = '" . $_REQUEST['fid'] . "') and (privacy.friend_id = '" . $_SESSION["sessionUserID"] . "') and (cookbook = 'Y') )";
$result = mysql_query($SelectStr) or die(mysql_error());
if($myrow=MySQL_fetch_array($result)){
$friendok = 'y';
$friendPhoto = $myrow["photo"] ;
$friendBlog = $myrow["blog"] ;
$friendContact = $myrow["contacts"] ;
$friendCook = $myrow["cookbook"] ;
$friendProfile = $myrow["show_profile_page"] ;
$SelectFr = "SELECT Photo,DATE_FORMAT(Last_Logon, '%M %d, %Y') as lastLog,First_Name,Last_Name,ID FROM users where ID = '" . $_REQUEST['fid'] . "' ";
$resultFr = MySQL($dbName,$SelectFr) or die(mysql_error());
if($myrowFr=MySQL_fetch_array($resultFr)){
$First_Name = ucfirst($myrowFr["First_Name"]);
$Last_Name = ucfirst($myrowFr["Last_Name"]);
$lastLog = $myrowFr["lastLog"] ;
}
} else {
$SelectFr = "SELECT Photo,DATE_FORMAT(Last_Logon, '%M %d, %Y') as lastLog,First_Name,Last_Name,ID FROM users where ID = '" . $_SESSION["sessionUserID"] . "' ";
$resultFr = MySQL($dbName,$SelectFr) or die(mysql_error());
if($myrowFr=MySQL_fetch_array($resultFr)){
$First_Name = ucfirst($myrowFr["First_Name"]);
$Last_Name = ucfirst($myrowFr["Last_Name"]);
$lastLog = $myrowFr["lastLog"] ;
}
}
} else {
$SelectFr = "SELECT Photo,DATE_FORMAT(Last_Logon, '%M %d, %Y') as lastLog,First_Name,Last_Name,ID FROM users where ID = '" . $_SESSION["sessionUserID"] . "' ";
$resultFr = MySQL($dbName,$SelectFr) or die(mysql_error());
if($myrowFr=MySQL_fetch_array($resultFr)){
$First_Name = ucfirst($myrowFr["First_Name"]);
$Last_Name = ucfirst($myrowFr["Last_Name"]);
$lastLog = $myrowFr["lastLog"] ;
$myProfile = "y";
}
}
// add to mycookbook
if($_REQUEST["act"] == "y" && $_REQUEST["recid"] > " " && $_SESSION["sessionUserID"] > " "){
$recid = $_REQUEST["recid"] ;
$sql = "select * from cookbook where (Recipe_ID='$recid' and User_ID = '" . $_SESSION["sessionUserID"] . "')";
$result = mysql_query($sql) or die(mysql_error());
if($myrow=MySQL_fetch_array($result)){
$added = "The recipe was added to your Cookbook." ;
} else {
$sqlR = "INSERT INTO cookbook (User_ID, Recipe_ID) VALUES ('" . $_SESSION['sessionUserID'] . "', '$recid')";
$result = mysql_query($sqlR) or die(mysql_error());
$added = "The recipe was added to your Cookbook." ;
}
}
?>
YadaHome | Sharing Center
include 'beforeEndHead.php'; ?>
 |
 |
 |
 |
include "topSignIn.php"; ?> |
 |
include "nav-new.php" ;?>
 |
 |
| |
|
| |
|
|
if($friendok == "y"){$userID = $_REQUEST['fid'];}else{$userID = $_SESSION["sessionUserID"];};
if ($myrowFr["Photo"] > " ") {
?>
" alt="profile" class="profileImage" />
} else {?>
}?>
include "profileNavLeft.php"; ?>
|
| include "profileNav.php"; ?> |
|
|
| |
Cookbook Recipes
if($friendok == "y"){$userID = $_REQUEST['fid'];}else{$userID = $_SESSION["sessionUserID"];};
$sqlrp = "select users.First_Name, users.Last_Name, recipes.* from recipes, cookbook,users where (users.ID = recipes.User_ID) and (cookbook.Recipe_ID = recipes.ID) and (cookbook.User_ID = '$userID') and (recipes.Recipe_Name > ' ') order by recipes.TXN_TS desc";
$resultrp = mysql_query($sqlrp) or die(mysql_error());
while($myrowrp=MySQL_fetch_array($resultrp)){
$rFirst = ucfirst($myrowrp["First_Name"]) ;
$rLast = ucfirst($myrowrp["Last_Name"]) ;
?>
&fid==$_REQUEST['fid']?>" class="blogLinks">= $myrowrp["Recipe_Name"] ?>
By =$rFirst?> =$rLast?>
}?>

|
$recid = $_REQUEST["recid"];
$sqlrp = "select users.First_Name, users.Last_Name, recipes.* from recipes, cookbook, users where (users.ID = recipes.User_ID) and (cookbook.Recipe_ID = recipes.ID) and (recipes.Recipe_Name > ' ') and (cookbook.ID = (select Max(ID) as lastID from cookbook where User_ID = '$userID'))";
$msg = "This is the last recipe added to $First_Name's Cookbook" ;
if($recid > " "){
$sqlrp = "select users.First_Name, users.Last_Name, recipes.* from recipes,users where (users.ID = recipes.User_ID) and (recipes.ID='$recid')";
$msg = " " ;
}
$resultrp = mysql_query($sqlrp) or die(mysql_error());
if($myrowrp=MySQL_fetch_array($resultrp)){
$recid = $myrowrp["ID"] ;
$rFirst = ucfirst($myrowrp["First_Name"]) ;
$rLast = ucfirst($myrowrp["Last_Name"]) ;
//rating
$sql = "select avg(Rating) as rating from ratings where (For_Recipe_ID ='$recid')";
$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" ;
}
?>
=$msg?>=$added?>

| This recipe was submitted by =$rFirst?> =$rLast?> |
| Prep Time: =$prepTime?> | Total Time: =$totTime?> | Serving Size: =$myrowrp["Serving_Size"]?> |
Current Rating |
 |
Ingredients
$sqlin = "select * from recipes_ingredients where (Recipe_ID='$recid')";
$resultin = mysql_query($sqlin) or die(mysql_error());
while($myrowin=MySQL_fetch_array($resultin)){
?>
=$myrowin["Amount"]?> =$myrowin["Ingredient"]?>
}?>
Instructions
=$myrowrp["Instructions"]?>
} else {?>
=$friendFirst?>'s cookbook is empty.
|
}?>
|
| To edit your cookbook, you must goto your fridge. |
if($friendok == "y"){?>
Remove as Friends
}?>
|
|
|
 |
| include "bottomLocalSearch.php"; ?> |
|
|
include "googAna.php"; ?>