$spin=$_GET["spin"];
i think this is the whole spin code
if($rid==2)
{
$tries2 = mysql_fetch_array(mysql_query("SELECT cards FROM ibwf_spincard"));
$mama2= $tries2[0];
if($mama2>0)
{
if($spin==2)
{
$tm = time();
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(spintime) FROM ibwf_users WHERE id='".$uid."'"));
$pmfl = $lastpm[0]+15;
if($pmfl<$tm)
{
}else{
$rema = $pmfl - $tm;
echo "Chat system:»*you can spin cards again after <b>$rema</b> seconds.*<br/>";
}
if(!spinned($uid))
{
$rpgd = mysql_query("SELECT id, no FROM ibwf_getcards ORDER by RAND() LIMIT 1");
while($rpgds=mysql_fetch_array($rpgd))
{
$cards =$rpgds[1];
}
if(getplusses(getuid_sid($sid))<10)
{
echo "You need 10 plusses in order to spin the wheel!";
}else{
mysql_query("UPDATE ibwf_users SET cards=cards+'$cards' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_spincard SET cards=cards-'$cards'");
mysql_query("UPDATE ibwf_users SET plusses=plusses-'1' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_users SET spintime='".time()."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_users SET spinned='1' WHERE id='".$uid."'");
$mycards = mysql_fetch_array(mysql_query("SELECT cards FROM ibwf_users WHERE id='".$uid."'"));
echo "Chat system:»*you got $cards card(s) for that spin wait after 20 sec to spin cards again. You have $mycards[0] total of cards.*<br/>";
}
}
}else{
$tm = time();
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(spintime) FROM ibwf_users WHERE id='".$uid."'"));
$pmfl = $lastpm[0]+20;
if($pmfl<$tm)
{
mysql_query("UPDATE ibwf_users SET spinned='0' WHERE id='".$uid."'");
$cinfo = mysql_fetch_array(mysql_query("SELECT cards from ibwf_spincard"));
echo "<a href=\"index.php?action=viewuser&who=1&sid=$sid\">system</a>»There are $cinfo[0] remaining cards. Click <a href=\"chat.php?spin=1&sid=$sid&rid=$rid\">spin the wheel</a> spin cards to get some cards. Each spin will cost 1 plusses, if you got the highest number of cards after the remaining cards goes to zero, you will get the 1000 plusses prize more info for game info.<br/>";
}else{
$rema = $pmfl - $tm;
echo "Chat system:»*you can spin cards again after <b>$rema</b> seconds.*<br/>";
}
}
}else{
$rpgd = mysql_query("SELECT id, cards FROM ibwf_users ORDER by cards DESC LIMIT 1");
while($rpgds=mysql_fetch_array($rpgd))
{
$winner =$rpgds[0];
$winner2 =$rpgds[1];
}
$unick2 = getnick_uid($winner);
mysql_query("UPDATE ibwf_spincard SET cards='500'");
mysql_query("INSERT INTO ibwf_chat SET chatter='133', timesent='".time()."', msgtext='$unick2 got $winner2 cards, and the 1000 plusses prize', perm='".$perm[0]."', rid='".$rid."';");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'1000' WHERE id='".$winner."'");
mysql_query("UPDATE ibwf_users SET cards='0'");
mysql_query("UPDATE ibwf_users SET spintime='0'");
}
}
if($cancel==1)
{
mysql_query("UPDATE ibwf_private SET unread='0' WHERE id='".$idn."'");
}
$unreadinbox=mysql_fetch_array(mysql_query("SELECT byuid, text, id FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
$pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
$unrd="(".$unreadinbox[0]."/".$pmtotl[0].")";
if ($unreadinbox[0]>0)
{
$text = parsepm($unreadinbox[1], $sid);
$by = getnick_uid($unreadinbox[0]);
echo "<b>$by: </b>$text<br/>";
echo "REPLY:<br/>";
echo "<form action=\"chat.php?action=sendpm&who=$unreadinbox[0]&sid=$sid&rid=$rid\" method=\"post\">";
echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form>";
echo "<br/><a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&cancel=1&idn=$unreadinbox[2]&time=$time\">Cancel</a>";
}