<?php

include("config.php");
include("core.php");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";

?>

<?php
$action = $_GET['action'];
$name = $_POST['name'];
$surname = $_POST['surname'];
$gamertag = $_POST['gamertag'];
///////////////////////////////////MAIN

if($action=="main")
{
echo webhead();
{
echo "<p align=\"center\">";
echo "<img src=\"../i/header.jpg\" alt=\"Xbox Live 360 ZA\"/><br/>";
echo "Xbox Live ZA Petition</a><br/>";
echo "<p>";
echo "<b>What We Want?</b><br/><br/>";
echo "*A Local Server Where South Africans Can Use Their Local Cap To Verse Others.<br/><br/>";
echo "*A Simple Way For South Africans To Make Payments For Their Memberships , Microsoft Points , Etc.<br/><br/>";
echo "*Local Xbox Support. This Includes Technical , Accounts , Billing And Any Others.<br/><br/>";
echo "*A Easy Way For South Africans To Migrate Their Accounts To South African Status And Country For FREE Or For A Maximum Of R100.<br/><br/>";
echo "<b>*This Should Be No Problem Since Neotel Is Offering Businesses GOOD Bandwidth Prices*</b><br/>";
echo "</p>";
echo "<br/><b>Petition Form</b><br/><br/>Enter Your Details Bellow<br/><br/>";
echo "<br/><a href=\"index.php?action=signed\">View Current Signatories</a><br/>";
echo "<font color=\"#0000FF\">Current Signatories: <b>$signatories</b></font><br/>";
echo "<form action=\"index.php?action=insert\" method=\"post\">";
echo "Name: <input type=\"text\" name=\"name\" /><br/>";
echo "Surname: <input type=\"text\" name=\"surname\" /><br/>";
echo "Gamertag: <input type=\"text\" name=\"gamertag\" /><br/>";
echo "<input type=\"submit\" value=\"Sign\" />";
echo "</form>";
echo webfoot();
}
///////////////////////////////////////INSERT
}else if($action=="insert")
{
echo webhead();
{
INSERT INTO petition (`name` , `surname` , `gamertag`) VALUES ('$name', '$surname', '$gamertag');
echo "Thank You $gamertag For Signing The Petition. You Have Just Helped Us Bring Xbox Live To S.A<br/>";
echo "<a href=\"index.php?action=main\">Click Here To Go Back To Petition Main Page<br/>";
echo "<a href=\"../index.html\">Click Here To Go Back To Site Main Page<br/>";
///////////////////////////////////////SIGNED
echo webfoot();
}
}else if($action=="signed")
{
echo webhead();
{
echo "<font color=\"#00ff00\">Current Signatories</font><br/>";
$query = "Select name , surname , gamertag From petition";
$sign = mysql_query($query);
while ($signed = mysql_fetch_array($sign))
{
echo "<font color=\"#FF0000\">Name:******<br/>";
echo "Surname:******<br/>";
echo "Gamertag: $signed[2]</font><br/>";
echo "<font color=\"#0000FF\">-----------------</font><br/>";
}
echo "<a href=\"index.php?action=main\">Click Here To Go Back To Petition Main Page<br/>";
echo "<a href=\"../index.html\">Click Here To Go Back To Site Main Page<br/>";
echo webfoot();

}
}else{
echo webhead();
{
echo "Request Not Found<br/>";
echo webfoot();
}
}

?>