<?php
//Login To Database
include("Database.php");
include("OpenDatabase.php");
//Get The Functions
include("Functions.php");
//The Headers
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
?>

<?php

$username=$_GET['username'];
$password=$_GET['password'];

$birthday=$_GET['birthday'];
$likes=$_GET["likes"];
$dislikes=$_GET['dislikes'];
$email=$_GET["email"];
$site=$_GET['site'];
$language=$_GET["language"];
$country=$_GET['country'];

$check_username_password=mysql_fetch_array(mysql_query("SELECT * FROM members WHERE Id='$username' AND Password='$password'"));

////////////////////////////////////////UPDATE PROFILE!!!
if("$check_username_password[0]")
{

$delete_online="DELETE FROM online WHERE Id='$username'";
mysql_query($delete_online);
$online_list2 = "INSERT INTO `online` (`Id` ,`Where`) VALUES ('$username', 'User Cpanel!')";
mysql_query($online_list2);

//Page Title And CSS Theme
echo FlareXhead($uthm,$stitle);
echo "<p align=\"center\">";
echo "<small><p2>".date("D d M y - H:i",time() )."</a></p2></small><br/>";
$TimeZone="0"; ////Change the TimeZone accordingly!
$New_Time = time() + ($TimeZone * 60 * 60);

$show_date=date("D dS F, Y",$New_Time); 
$show_time=date("H:i",$New_Time); 
$Hour=date("G",$New_Time);
echo "</p>";
echo "<p>";
$update_profile=mysql_fetch_array(mysql_query("SELECT * FROM members WHERE Id='$username'"));
mysql_query("UPDATE members SET Birthday='$birthday',Likes='$likes',Dislikes='$dislikes',Email='$email',Site='$site',Language='$language',Country='$country' WHERE Birthday='$update_profile[10]',Likes='$update_profile[6]',Dislikes='$update_profile[7]',Email='$update_profile[11]',Site='$update_profile[12]',Language='$update_profile[9]',Country='$update_profile[8]'");
//Succsessfull
echo "Profile Updated Succssessfully</a><br/>";
//Link To Home
echo "<a href=\"Profiles.php?action=main&username=$username&password=$password&view_profile=$username\">View Your Profile</a><br/>";
echo "<a href=\"index.php?action=main&username=$username&password=$password\">Back To Home</a><br/>";
//End Of Page
echo FlareXfoot();
}else{
//Page Title And CSS Theme
echo FlareXhead($uthm,$stitle);
echo "<p align=\"center\">";
echo "<small><p2>".date("D d M y - H:i",time() )."</a></p2></small><br/>";
$TimeZone="0"; ////Change the TimeZone accordingly!
$New_Time = time() + ($TimeZone * 60 * 60);

$show_date=date("D dS F, Y",$New_Time); 
$show_time=date("H:i",$New_Time); 
$Hour=date("G",$New_Time);
echo "You Are Not Logged In!";
echo "<form action=\"Login.php?username=$username&password=$password\" method=\"GET\">";
echo "<p3>Username:</p3> <input type=\"text\" name=\"username\"><br/>";
echo "<p3>Password:</p3> <input type=\"password\" name=\"password\"><br/>";
echo "<input type=\"submit\" value=\"Login!\">"; 
echo "</form>";
echo FlareXfoot();
}
?>