"; print_r($_REQUEST);exit;
$todayDate = date("Y-m-d G:i:s") ;
$display = $_POST['directory'];
if ($display <> "Y"){ $display = "N"; }
$trialDate = date('Y-m-d') ;
$SQL = "INSERT INTO users (Country,meet_people, City, First_Name, Last_Name,Email,Family_User_Name, Password, Birth_Date, State_Reside, Zip, Gender, Marital_Status, Number_Of_Children, Comments, Anniversary, Photo, Bio, IP_Address, Last_Logon, date_joined,Trial_Date )
VALUES ('$_POST[country]', '$display' ,'" . $_REQUEST['City'] . "' , '" . $_REQUEST['First_Name'] . "' , '" . $_REQUEST['Last_Name'] . "' , '" . $_REQUEST['Email'] . "' , '" . $_REQUEST['Family_User_Name'] . "' , '" . $_REQUEST['Password'] . "' , '" . $Birthdate . "' , '" . $_REQUEST['State_Reside'] . "' , '" . $_REQUEST['Zip'] . "' , '" . $_REQUEST['Gender'] . "' , '" . $_REQUEST['Marital_Status'] . "' , '" . $_REQUEST['Number_Of_Children'] . "' , '" . $_REQUEST['Comments'] . "' , '" . $_REQUEST['Anniversary'] . "' , '" . $_REQUEST['Photo'] . "' , '" . $_REQUEST['Bio'] . "' , '" . $logged_string . "' , '" . $today . "', '$todayDate','$trialDate' )";
$result = mysql_query($SQL) or die(mysql_error());
//get id just inserted
$userID = mysql_insert_id();
$Email = $_REQUEST['Email'];
$_SESSION["sessionUserID"] = $userID;
$_SESSION["sessionFname"] = $_REQUEST['First_Name'];
$_SESSION["sessionLname"] = $_REQUEST['Last_Name'];
$_SESSION["sessionGender"] = $_REQUEST['Gender'];
$_SESSION["sessionEmail"] = $_REQUEST['Email'];
$_SESSION["sessionFamilyUserName"] = $_REQUEST['Family_User_Name'];
//$_SESSION["sessionEmail"] = $_REQUEST['Email'];
setcookie("cookieEmail", $_REQUEST["Email"], time()+3600*24*360 );
setcookie("cookiePassword", $_REQUEST["Password"], time()+3600*24*360 );
//***********************************
//if this user was invited
//***********************************
if( ($_SESSION["sessionRandom_Key"] > " ") && ($_SESSION["sessionInvid"] > " ") ){
$SQL2 = "UPDATE invitations SET Joined = 'Y', Accepted = 'Y', Friends_New_ID = '$userID' WHERE Random_Key = '" . $_SESSION["sessionRandom_Key"]. "' and ID = '" . $_SESSION["sessionInvid"] . "' ";
$result2 = mysql_query($SQL2) or die(mysql_error());
//get the invitors id
$sql3 = "select USER_ID from invitations WHERE Random_Key = '" . $_SESSION["sessionRandom_Key"]. "' and ID = '" . $_SESSION["sessionInvid"] . "' ";
$result3 = mysql_query($sql3) or die(mysql_error());
if($row = mysql_fetch_assoc($result3)) {
$invitorID = $row["USER_ID"];
$sql = "INSERT INTO privacy (user_id, friend_id,show_profile_page,photo,cookbook, grocery, blog, contacts)" ;
$sql = $sql . " VALUES ('$invitorID','$userID','Y','Y','Y','Y','Y','Y')" ;
$result1 = mysql_query($sql) or die(mysql_error());
$sql1 = "INSERT INTO privacy (friend_id, user_id,show_profile_page,photo,cookbook, grocery, blog, contacts)" ;
$sql1 = $sql1 . " VALUES ('$invitorID','$userID','Y','Y','Y','Y','Y','Y')" ;
$result4 = mysql_query($sql1) or die(mysql_error());
//put a message in the invitors inbox
$firstName = $_SESSION["sessionFname"] ;
$lastName = $_SESSION["sessionLname"] ;
$dateSent=date("Y-m-d") ;
$timeSent = date("H:i") ;
$msgTitle = "YadaHome Network" ;
$theText = "$firstName $lastName just accepted your invitation and joined your network!";
$sql4 = "insert into messages (From_ID, To_ID, Date_Sent, Time_Sent, The_Text, Type ,msg_title) values ( '$userID', '$invitorID', '$dateSent', '$timeSent', '$theText', '','$msgTitle' )";
$replyID = mysql_insert_id() ;
$sqlupdate = "Update messages Set Reply_ID='$replyID' where ID='$replyID'";
$result2 = mysql_query($sqlupdate) or die(mysql_error());
}
//**************************************************
// now see if the invitor has any premium slots open
//***************************************************
$selfID = $userID;
$SQLS = "select * from users_purchased_slots, users where (users.ID = '$invitorID') and (Prem_Ind = 'Y') and (users.ID = users_purchased_slots.USER_ID) and (NUMBER_LEFT > 0)";
$resultS = mysql_query($SQLS) or die(mysql_error());
if($myrowS=MySQL_fetch_array($resultS)){
$inv_slots_left = $myrowS["NUMBER_LEFT"];
$inv_slots_used = $myrowS["NUMBER_USED"];
$inv_date_purchased = $myrowS["DATE_PURCHASED"];
$sql = "update users set Prem_Ind = 'Y', MASTER_ACCOUNT = '$invitorID' where ID = '$selfID' ";
$result = mysql_query($sql) or die(mysql_error());
//now decrement the invitees slots
$sql = "update users_purchased_slots set NUMBER_LEFT = NUMBER_LEFT - 1, NUMBER_USED = NUMBER_USED + 1 where USER_ID = '$invitorID' ";
$result = mysql_query($sql) or die(mysql_error());
}
//end of prem slots
//IF THE USER WAS INVITED SEE OF THE PERSON WHO INVITED IS USING THE FULL APP, LITE APP, OR NEITHER
$sendEmailVersion = 'lite';
$sqlInv = "select * from users where ID = ' $invitorID' ";
$resultInv = mysql_query($sqlInv) or die(mysql_error());
if($myrowInv=MySQL_fetch_array($resultInv)){
if( ($myrowInv['iphone'] == 'Y') && ($myrowInv['IPHONE_FREE'] == "N") ){
$sendEmailVersion = 'full';
}
}
//END OF IF THE USER WAS INVITED SEE OF THE PERSON WHO INVITED IS USING THE FULL APP, LITE APP, OR NEITHER
//***********************************
//* end of invite process
//***********************************
}
//********************************************************************************
//* NOW SEND AN EMAIL TO USER ASKING THEM TO VERIFY THEIR EMAIL ADDRESS
//********************************************************************************
//change this to your email.
$password = $_REQUEST['Password'];
$to = $_REQUEST['Email'];
$from = "SignUp@yadahome.com";
$toName = $_REQUEST['First_Name'];
$fromName = $_REQUEST["yourName"];
include "emailTerms.php";
$subject = "Welcome to www.yadahome.com!";
//begin HTML message
$message = "
$subject
Your YadaHome Family Account Has Been Activated!
YadaHome's Collection of iPhone Apps, Web Apps
(BlackBerry, Android, Windows Mobile) And Its Website Are Designed To Keep You Organized On Any Device Wherever You Are.
You Can Also Share Your Calendars, Schedules, To Do Lists, And Shopping Lists At Home Or On-The-Go With Your Family In Real-Time.
Please Enjoy Your Membership!
Family Organizer:Shared Calendar And Lists For Families
BlackBerry / Android / Windows Mobile Applications www.yadahome.com/m
Manage Your Calendars And Lists On Any Smart Phone
Shared Calendars
Shared To Do Lists
Shared Grocery Lists
Real-Time Sync
Online Access
Email Alerts
Internet / Online Web Access www.yadahome.com
Manage Your Calendar And Lists From Any Computer
Shared Calendars
Shared To Do Lists
Shared Grocery Lists
Shared Recipes
Shared Photos
Shared Journals
Email Alerts
Networking and Sharing Instructions
How Do I Invite Family Members To My Network And Start Sharing?
On Your App:
Select The "Invite Family Members" Tab On Your App Home Screen
Follow The Instructions On The Following Screen
For More Tips On Getting The Most Out Of www.yadahome.com, Please Visit The FAQ Section Of The Website at www.yadahome.com/faqs.php, By Visiting The YadaHome Manual On Your My Fridge® Page Or By Writing Us At admin@yadahome.com !
YadaHome's Collection of iPhone Apps, Mobile Apps (BlackBerry, Android, Windows Mobile)
And Its Website Are Designed To Keep Your Family Organized On Any Device Wherever You Are.
Easily Share Your Family's Calendars, Schedules, To Do Lists, And Shopping Lists At Home Or On-The-Go.
BlackBerry / Android / Windows Mobile Applications Coming October 2010
Manage Your Calendars And Lists On Any Smart Phone
Shared Calendars
Shared To Do Lists
Shared Grocery Lists
Real-Time Sync
Shared Family Chat
Google Calendar™ Import
Offline/Online Access
Email Alerts
Internet / Online Web Access www.yadahome.com
Manage Your Calendar And Lists From Any Computer
Shared Calendars
Shared To Do Lists
Shared Grocery Lists
Shared Recipes
Auto Coupon Finder
Shared Family Chat
Google Calendar™ Import
Shared Photos
Shared Journals
Email Alerts
Networking and Sharing Instructions
How Do I Invite Family Members To My Network And Start Sharing?
Online:
After logging in to www.yadahome.com, click the 'Add Friends and Family' button at the top right
Add Your Family's Email Addresses And Press 'Send'
An Email Will Be Sent Inviting Them To Create An Account And Join Your Network
Once They Have Joined Your Network, You Can Start Sharing With Them
On Your App:
Select The "Add Family/Friends" Tab On Your App Home Screen
Add Your Family's Email Addresses And Press 'Send'
An Email Will Be Sent Inviting Them To Create An Account And Join Your Network
Once They Have Joined Your Network, You Can Start Sharing With Them
For More Tips On Getting The Most Out Of www.yadahome.com, Please Visit The FAQ Section Of The Website at www.yadahome.com/faqs.php, By Visiting The YadaHome Manual On Your My Fridge® Page Or By Writing Us At admin@yadahome.com !
";
$subject = "Take A Look At My Profile On A New Great Website I Discovered!";
}
if($_POST[msg] > " "){
$notes =
"".
$_POST[msg]
."
";
} else {
$notes = " ";
}
$message = "
$subject
" . $greeting . "
I've been using YadaHome, a great new website I recently discovered. It has lots of useful features including free organizational tools like shared grocery lists, to do lists, photos, and calendars. Plus, you can network with family and friends! It's free to join, and it would be great to add you to my new network!
Thanks!