• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need help. Shop system

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
I need help with shop system:

its mine shop system:
shops.jpg

when i press eg: buy demon armor

i got this error:

Fatal error: Call to undefined method DatabaseList::orderBy() in C:\xampp2\htdocs\xampp\pages\shopsystem.php on line 290

Code:
                       if($user_premium_points >= $buy_offer['points'])
                       {
                           $main_content .= '<h2>Select player</h2>
                           <table border="0" cellpadding="1" cellspacing="1" width="650">
                           <tr bgcolor="#b7a58a"><td colspan="2"><font color="#F1E0C6" size="4"><b>Selected offer</b></font></td></tr>
                           <tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
                           <tr bgcolor="#F1E0C6"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>
                           </table><br />
                           <form action="?subtopic=shopsystem&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
                           <table border="0" cellpadding="1" cellspacing="1" width="650">
                           <tr bgcolor="#b7a58a"><td colspan="2"><font color="#F1E0C6" size="4"><b>Give item/pacc* to player from your account</b></font></td></tr>
                           <tr bgcolor="#F1E0C6"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">';
                           $players_from_logged_acc = $account_logged->getPlayersList();
                           if(count($players_from_logged_acc) > 0)
                           {
                               $players_from_logged_acc->orderBy('name');
                               foreach($players_from_logged_acc as $player)
                               {
                                   $main_content .= '<option>'.$player->getName().'</option>';
                               }
                           }
                           else
                           {
                               $main_content .= 'You don\'t have any character on your account.';
                           }
                           $main_content .= '</select>&nbsp;<input type="submit" value="Give"></td></tr>
                           </table>
                           </form><br /><form action="?subtopic=shopsystem&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
                               <table border="0" cellpadding="1" cellspacing="1" width="650">
                               <tr bgcolor="#b7a58a"><td colspan="2"><font color="#F1E0C6" size="4"><b>Give item/pacc* to other player</b></font></td></tr>
                               <tr bgcolor="#F1E0C6"><td width="110"><b>To player:</b></td><td width="550"><input type="text" name="buy_name"> - name of player</td></tr>
                               <tr bgcolor="#F1E0C6"><td width="110"><b>From:</b></td><td width="550"><input type="text" name="buy_from">&nbsp;<input type="submit" value="Give"> - your nick, \'empty\' = Anonymous</td></tr>
                               </table><br />
                               </form>';
   
                           $main_content .= '*PACC is for all characters from account of selected player name';
                       }

please help me :)
 
PHP:
if($buy_offer['type'] != 'changename') {
          if($user_premium_points >= $buy_offer['points'])
          {
            $main_content .= '<h2>Select player</h2>
            <table border="1" cellpadding="1" cellspacing="1" width="580">
            <tr bgcolor="#b7a58a"><td colspan="2"><font color="black" size="4"><b>Selected offer</b></font></td></tr>
            <tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
            <tr bgcolor="#F1E0C6"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>
            </table><br />
            <form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
            <table border="1" cellpadding="1" cellspacing="1" width="580">
            <tr bgcolor="#b7a58a"><td colspan="2"><font color="#F1E0C6" size="4"><b>Give to player from your account</b></font></td></tr>
            <tr bgcolor="#F1E0C6"><td width="110"><b>Name:</b></td><td width="580"><select name="buy_name">';
            $players_from_logged_acc = $account_logged->getPlayersList();
            if(count($players_from_logged_acc) > 0)
            {
              $players_from_logged_acc->orderBy('name');
              foreach($players_from_logged_acc as $player)
              {
                $main_content .= '<option>'.$player->getName().'</option>';
              }
            }
            else
            {
              $main_content .= 'You don\'t have any character on your account.';
            }
            $main_content .= '</select>&nbsp;<input type="submit" value="Give"></td></tr>
            </table>
            </form><br /><form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
              <table border="1" cellpadding="1" cellspacing="1" width="580">
              <tr bgcolor="#b7a58a"><td colspan="2"><font color="black" size="4"><b>Give item to other player</b></font></td></tr>
              <tr bgcolor="#F1E0C6"><td width="110"><b>To player:</b></td><td width="550"><input type="text" name="buy_name"> - name of player on</td></tr>
              <tr bgcolor="#F1E0C6"><td width="110"><b>From:</b></td><td width="550"><input type="text" name="buy_from">&nbsp;<input type="submit" value="Give"> - your nick, \'empty\' = Anonymous</td></tr>
              </table><br />
              </form>';

            $main_content .= '*PACC is for all characters from account of selected player name';

Made by works
but i suggest you put script complete ,why not ever error are in specific lines.
 
Changed script same errors:

Fatal error: Call to undefined method DatabaseList::orderBy() in C:\xampp2\htdocs\xampp\pages\shopsystem.php on line 291
 
Back
Top