<?php
echo "<h2>Shop</h2>";
echo "Welcome to the " . $serverName . " Shop. " . $extraDescription;
if ($logged){
echo '<br /><br /><font color="green">Available Points:</font> '.$premiumPoints.' (<a href="'.$buyPointsURL.'">Buy More</a>)';
echo '<br />';
}
// Used for numbering and such.
$iPremium = 0;
$iItem = 0;
$iContainer = 0;
$iOther = 0;
$iSpecial = 0;
///////////////////////////////////////
// Special Account Services Offers
///////////////////////////////////////
if ($showSpecialServices){
foreach($SQL->query('SELECT * FROM z_shop_offer WHERE offer_type="special"') as $data)
{
// Create the table if iSpecial == 0, only once!
if ($iSpecial == 0){
echo '<table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="'.$offerTypeBackgroundColor.'"><td colspan="3"><font size="4"><font color="'.$offerTypeTextColor.'"><b> Special Account Services</b></font></td></tr><tr bgcolor="'.$offerTableTitlesBackgroundColor.'"><td width="70%" align="left"><b><font color="'.$offerTableTitlesTextColor.'">Description</font></b></td><td width="30%" align="center"><center><font color="'.$offerTableTitlesTextColor.'"><b>Select product</b></font></center></td></tr>';
}
// Populate the table with data
{
echo '<tr bgcolor="'.$offerMainBackgroundColor.'"><td><font color="'.$offerMainTextColor.'"><b>'.$data['offer_name'].'</b> ('.$data['points'].' points)<br />'.$data['offer_description'].'</font></td><td align="center">';
if(!$logged)
{
echo '<center><font color="'.$offerMainTextColor.'"><b>Login to buy</b></font></center>';
}
else
{
echo '<center><font color="'.$offerMainTextColor.'"><form action="/index.php/p/v/shop/character_select" method=POST><input type="hidden" name="buy_id" value="'.$data['id'].'"><input type="submit" value="Buy Offer"><br><b>for '.$data['points'].' points</b></form></font></center>';
}
echo '</td></tr>';
}
$iSpecial++;
}
// Close the table if iSpecial != 0. (or, there was data added in other words).
if ($iSpecial != 0){
echo '</table>';
echo "*Special account services will performed by the administrator as soon as possible.<br /><br />";
}
}
///////////////////////////////////////
// Premium Account Offers
///////////////////////////////////////
foreach($SQL->query('SELECT * FROM z_shop_offer WHERE offer_type="pacc"') as $data)
{
// Create the table if iPremium == 0, only once!
if ($iPremium == 0){
echo '<table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="'.$offerTypeBackgroundColor.'"><td colspan="3"><font color="'.$offerTypeTextColor.'" size="4"><b> Premium Account</b></font></td></tr><tr bgcolor="'.$offerTableTitlesBackgroundColor.'"><td width="10%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Days</font></b></center></td><td width="60%" align="left"><b><font color="'.$offerTableTitlesTextColor.'">Description</font></b></td><td width="30%" align="center"><center><font color="'.$offerTableTitlesTextColor.'"><b>Select Product</b></font></center></td></tr>';
}
// Populate the table with data
{
echo '<tr bgcolor="'.$offerMainBackgroundColor.'"><td><font color="'.$offerMainTextColor.'"><center>'.$data['count1'].'</center></font></td><td><font color="'.$offerMainTextColor.'"><b>'.$data['offer_name'].'</b> ('.$data['points'].' points)<br />'.$data['offer_description'].'</font></td><td align="center">';
if(!$logged)
{
echo '<center><font color="'.$offerMainTextColor.'"><b>Login to buy</b></font></center>';
}
else
{
echo '<center><font color="'.$offerMainTextColor.'"><form action="/index.php/p/v/shop/character_select" method=POST><input type="hidden" name="buy_id" value="'.$data['id'].'"><input type="submit" value="Buy Offer"><br><b>for '.$data['points'].' points</b></form></font></center>';
}
echo '</td></tr>';
}
$iPremium++;
}
// Close the table if iPremium != 0. (or, there was data added in other words).
if ($iPremium != 0){
echo '</table><br />';
}
///////////////////////////////////////
// Item Offers
///////////////////////////////////////
foreach($SQL->query('SELECT * FROM z_shop_offer WHERE offer_type="item"') as $data)
{
// Create the table if iItem == 0, only once!
if ($iItem == 0){
echo '<table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="'.$offerTypeBackgroundColor.'"><td colspan="3"><font color="'.$offerTypeTextColor.'" size="4"><b> Items</b></font></td></tr><tr bgcolor="'.$offerTableTitlesBackgroundColor.'"><td width="10%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Pic</font></b></center></td><td width="60%" align="left"><font color="'.$offerTableTitlesTextColor.'"><b>Description</b></font></td><td width="30%" align="center"><center><font color="'.$offerTableTitlesTextColor.'"><b>Select Product</b></font></center></td></tr>';
}
// Populate the table with data
{
echo '<tr bgcolor="'.$offerMainBackgroundColor.'"><td align="center"><center></center></td><td><font color="'.$offerMainTextColor.'"><b>'.$data['offer_name'].'</b> ('.$data['points'].' points)<br />'.$data['offer_description'].'</font></td><td align="center">';
if(!$logged)
{
echo '<center><font color="'.$offerMainTextColor.'"><b>Login to buy</b></font></center>';
}
else
{
echo '<center><font color="'.$offerMainTextColor.'"><form action="/index.php/p/v/shop/character_select" method=POST><input type="hidden" name="buy_id" value="'.$data['id'].'"><input type="submit" value="Buy Offer"><br><b>for '.$data['points'].' points</b></form></font></center>';
}
echo '</td></tr>';
}
$iItem++;
}
// Close the table if iItem != 0. (or, there was data added in other words).
if ($iItem!= 0){
echo '</table><br />';
}
///////////////////////////////////////
// Container Offers
///////////////////////////////////////
foreach($SQL->query('SELECT * FROM z_shop_offer WHERE offer_type="container"') as $data)
{
// Create the table if iContainer == 0, only once!
if ($iContainer == 0){
echo '<table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="'.$offerTypeBackgroundColor.'"><td colspan="3"><font color="'.$offerTypeTextColor.'" size="4"><b> Items</b></font></td></tr><tr bgcolor="'.$offerTableTitlesBackgroundColor.'"><td width="10%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Pic</font></b></center></td><td width="60%" align="left"><b><font color="'.$offerTableTitlesTextColor.'">Description</font></b></td><td width="30%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Select Product</font></b></center></td></tr>';
}
// Populate the table with data
{
echo '<tr bgcolor="'.$offerMainBackgroundColor.'"><td align="center"><center></center></td><td><font color="'.$offerMainTextColor.'"><b>'.$data['offer_name'].'</b> ('.$data['points'].' points)<br />'.$data['offer_description'].'</font></td><td align="center">';
if(!$logged)
{
echo '<center><font color="'.$offerMainTextColor.'"><b>Login to buy</b></font></center>';
}
else
{
echo '<center><font color="'.$offerMainTextColor.'"><form action="/index.php/p/v/shop/character_select" method=POST><input type="hidden" name="buy_id" value="'.$data['id'].'"><input type="submit" value="Buy Offer"><br><b>for '.$data['points'].' points</b></form></font></center>';
}
echo '</td></tr>';
}
$iContainer++;
}
// Close the table if iContainer != 0. (or, there was data added in other words).
if ($iContainer != 0){
echo '</table><br />';
}
///////////////////////////////////////
// OTHER Offers
///////////////////////////////////////
foreach($SQL->query('SELECT * FROM z_shop_offer WHERE offer_type="other"') as $data)
{
// Create the table if $iOther == 0, only once!
if ($iOther == 0){
echo '<table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="'.$offerTypeBackgroundColor.'"><td colspan="3"><font color="'.$offerTypeTextColor.'" size="4"><b> Other</b></font></td></tr><tr bgcolor="'.$offerTableTitlesBackgroundColor.'"><td width="10%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Pic</font></b></center></td><td width="60%" align="left"><b><font color="'.$offerTableTitlesTextColor.'">Description</font></b></td><td width="30%" align="center"><center><b><font color="'.$offerTableTitlesTextColor.'">Select Product</font></b></center></td></tr>';
}
// Populate the table with data
{
echo '<tr bgcolor="'.$offerMainBackgroundColor.'"><td align="center"><center><img src="'.$data['imageURL'].'"></center></td><td><font color="'.$offerMainTextColor.'"><b>'.$data['offer_name'].'</b> ('.$data['points'].' points)<br />'.$data['offer_description'].'</font></td><td align="center">';
if(!$logged)
{
echo '<center><font color="'.$offerMainTextColor.'"><b>Login to buy</b></font></center>';
}
else
{
echo '<center><font color="'.$offerMainTextColor.'"><form action="/index.php/p/v/shop/character_select" method=POST><input type="hidden" name="buy_id" value="'.$data['id'].'"><input type="submit" value="Buy Offer"><br><b>for '.$data['points'].' points</b></form></font></center>';
}
echo '</td></tr>';
}
$iOther++;
}
// Close the table if iContainer != 0. (or, there was data added in other words).
if ($iOther != 0){
echo '</table><br />';
}
///////////////////////////////////////
// END OFFERS (that was fun... right?)
///////////////////////////////////////
?>