if i did this so it would be like this
<?php
/*Made by Jcvenom
Do not resell this mod
Do not claim making this mod*/
/*------------includes--------------*/
include "globals.php";
/*------------includes--------------*/
echo "<center><main>Credit Exchange</main><hr width = '75%'>";
if($ir['jail'] > 1 || $ir['hospital'] > 1)
{
echo "Sorry this page is not viewable while in jail or hospital!<hr width='75%'/>";
exit($h->endpage());
}
$_GET['step'] = sprintf("%s",$_GET['step']);
if(!$_GET['step'])
{
//nowdoc is required here
echo "
Welcome to the Credit exchange,
you can come here to spend your credits on special items & gains such as </br />
will boost and much more!
<main>If you don't have any Credits ? <a href='donate.php' target = '_blank'> <font color=brown>Click Here</font></a> to buy Credit Card<hr width = '75%'><table width = '75%' class = 'rounded'><tr><td align = 'center'>
<table width = '95%' style = 'font-weight:800;'><tr bgcolor = '#999999'>
You have <b>".number_format($ir['credits'])."</b> credits.<hr width = '75%'>";
echo "<table width = '75%' class = 'rounded'><tr><td align = 'center'>
<table width = '95%' style = 'font-weight:800;'><tr bgcolor = '#999999'>
<td align = 'left'><center><font color=white>Description</td><td align = 'left'><center><font color=white>Info</td><td align = 'left'><center><font color=white>Cost</td></tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Xanax x 10<td align = 'left'><center> [<a href='cctrade.php?step=xanax'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>2 Credits</td>
</tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Happy Boost (+2500)<td align = 'left'><center> [<a href='cctrade.php?step=happy'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>6 Credits</td>
</tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Energy boost (+500)<td align = 'left'><center> [<a href='cctrade.php?step=booste'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>8 Credits</td>
</tr>
</table>
</td></tr></table>
<hr width = '75%'>><a href='explore.php'>Back</a><hr width = '75%'>";
}
else
{
if(!in_array($_GET['step'],array('xanax', 'happy', 'booste')))
{
echo "Error, Bad request.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if(strcmp($_GET['step'],'xanax')=== 0)
{
if(!$_POST['step'])
{
echo "<form action = 'cctrade.php?step=xanax' method = 'post'>
Are you sure you wish to swap <b>2</b> credits for x10 Xanax?
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < 2)
{
echo "Sorry, You dont have enough credits to purchase x10 Xanax.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
try {
$db->query("UPDATE `users` SET `credits`=`credits` - '1' WHERE userid=$userid");
$db->query("INSERT INTO inventory VALUES('',ITEMID-HERE,$userid,QUANTITY)");
event_add($ir['userid'],"Success, You have be credited x10 Xanax for 2 credits",$c);
} catch (Exception $e) {
echo $e->getMessage();
}
echo "Success, You have be credited x10 Xanax for 2 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
}
}
else if(strcmp($_GET['step'],'booste')=== 0)
{
if(!isset($_POST['step']))
{
echo "<form action = 'cctrade.php?step=booste' method = 'post'>
Are you sure you wish to swap <b>8</b> credits for 500 energy boost?
<i>Note: This is <b><u>not</u></b> an item, You will receive a 500 energy boost for a short time.</i>
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < 8)
{
echo "Sorry, You dont have enough credits to purchase a energy boost.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
try {
$db->query("UPDATE `users` SET `energy`=`energy` + '500` WHERE userid=$userid");
$db->query("UPDATE `users` SET `credits`=`credits` - '8' WHERE userid=$userid");
event_add($ir['userid'],"You have be credited with 500 energy boost for 8 credits",$c);
} catch (Exception $e) {
echo $e->getMessage();
}
echo "Success, You have be credited with 500 energy boost for 8 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
}
}
else if(strcmp($_GET['step'],'happy')=== 0)
{
if(!$_POST['step'])
{
echo "<form action = 'cctrade.php?step=happy' method = 'post'>
Are you sure you wish to swap <b>6</b> credits for 2500 happiness?
<i>Note: This is <b><u>not</u></b> an item, You will recieve 2500 happy for a short time.</i>
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < 6 )
{
echo "Sorry, You dont have enough credits to purchase a happy boost.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
try {
$db->query("UPDATE `users` SET `will`=`will` + '2500' WHERE userid=$userid");
$db->query("UPDATE `users` SET `credits`=`credits` - '6' WHERE userid=$userid");
event_add($ir['userid'],"You have be credited with 2500 happy for 6 credits",$c);
} catch (Exception $e) {
echo $e->getMessage();
}
echo "Success, You have be credited with 2500 happy for 6 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
}
}
else
{
echo "Error, Bad request.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
}
}
$h->endpage();
?>
This is not tested