Example #1
0
     core::$sql->changeDB('acc');
     $fromsilks = $_SESSION['username'];
     $toSilks = $_POST['silkstome'];
     if (!isset($_POST['submit'])) {
         echo "\r\n\t\t\t\t\t\t\t\t<form method='post'>\r\n\t\t\t\t\t\t\t\tUsername who recive the silks :<input type='text' name='silkstome'><br />\r\n\t\t\t\t\t\t\t\t<input type='checkbox' name='i agree'> I agree that i want to send the amount of silks above to the prospected user above \r\n\t\t\t\t\t\t\t\tby doing that , 10% of the amount of silks sended will be removed.\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t<font color='red'>\r\n\t\t\t\t\t\t\t\t*note that your ip,and reciver usernames is saved for security porpuse.\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t<input type='submit' name='submit' value='Yes, Send Silks!'>\r\n\t\t\t\t\t\t\t\t</font>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t";
     } else {
         if (strlen($_POST['silkstome']) < 3) {
             echo "Username is too short";
         } else {
             echo "Name is fine";
         }
     }
     break;
 case 'reset_stats':
     //echo "All items must be unequiped before you perform this action. This action costs ".$core -> aConfig['resetCharStatsSilkPrice']." silk.<br/>";
     if (char::isCharNaked($_GET['charname'])) {
         if (!isset($_POST['submit'])) {
             echo "Press this button if you really want to reset your characters stats. All items must be unequiped. This action costs " . $core->aConfig['resetCharStatsSilkPrice'] . " silk. Before performing this action, better log out. To see results of this function usage, relogin (if you were logged in while performing it).<br/>\r\n\t\t\t\t\t\t\t\t\t\t\t<form method='post'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' name='submit' value='Yes, i want to reset stats of my char !'>\r\n\t\t\t\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t\t\t\t\t";
         } else {
             if (user::getSilkByUsername($_SESSION['username']) > $core->aConfig['resetCharStatsSilkPrice']) {
                 core::$sql->changeDB('shard');
                 $aData = core::$sql->exec("select * from _Char where CharName16='{$_GET['charname']}'");
                 $aData = mssql_fetch_array($aData);
                 $nFreeStats = $aData['Strength'] + $aData['Intellect'] - 40;
                 core::$sql->exec("update _Char set RemainStatPoint = (RemainStatPoint + {$nFreeStats}),HP='200',MP='200',Strength='20',Intellect='20' where CharName16='{$_GET['charname']}'");
                 core::$sql->changeDB('acc');
                 core::$sql->exec("update SK_Silk set silk_own = (silk_own - " . $core->aConfig['resetCharStatsSilkPrice'] . ") where JID='" . user::accountJIDbyUsername($_SESSION['username']) . "'");
                 echo "Stats of {$_GET['charname']} resetted. You got {$nFreeStats} free stat points now.<br/>";
                 misc::redirect('?pg=ucp&act=mychars', 1);
             } else {
                 echo "Not enough silk.<br/>";