DROP TABLE IF EXISTS `premium`; CREATE TABLE `premium` ( `id` int(11) NOT NULL DEFAULT '0', `points` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Jak mam do tego dodaæ 1000 kodów (kody.wapacz.pl) ?
INSERT INTO `premium`(`id`,`points`) VALUES ('$id', '$points');
<?php $sql = "INSERT INTO `premium`(`id`,`points`) VALUES ;"; for($i=0; $i<count($tresc); $i++) { $sql .= "('$id', '$points'), "; } else ?>
<?php /** * File functions: * Clean city and earn money * * @name : premium.php * @copyright : (C) 2004-2005 EE Team for Vallheru Engine * @author : Klaus Korner <albitos.snape@gmail.com> * @version : 1.0.7 * @since : 30.10.2006 * */ // // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // $title = "Punkty premium"; require_once("includes/head.php"); /** * Get the localization for game */ require_once("languages/".$player -> lang."/premium.php"); $objBonus = $db -> Execute('SELECT points FROM premium WHERE id='.$player -> id); { $_GET['action'] = ''; "Landinfo2" => GOLD_COINS, "Awork" => A_WORK, "Points" => $objBonus -> fields['points'], "Times" => TIMES, "Codeinfo" => CODE_INFO)); } { { error(NO_AMOUNT); } { error (ERROR); } if ($objBonus -> fields['points'] < $_POST['amount']) { error (NO_ENERGY); } $db -> Execute("UPDATE players SET ".$_POST['what']."=".$_POST['what']."+".$arrBonus[$_POST['what']]*$_POST['amount']." WHERE id=".$player -> id); $db -> Execute("UPDATE premium SET points=points-".$_POST['amount']." WHERE id=".$player -> id); "Amount" => $_POST['amount'], "Inwork" => IN_WORK, "Inwork2" => IN_WORK2, "Goldcoins" => GOLD_COINS, "Aback" => A_BACK)); } { $_POST['code'] = $db -> qstr($_POST['code']); $objCheck = $db -> Execute('SELECT code FROM codes WHERE code='.$_POST['code']); { $kop = $db -> Execute('SELECT id FROM premium WHERE id='.$player -> id); if (!$kop -> fields['id']) { $db -> Execute("INSERT INTO premium (id, points) VALUES(".$player -> id.",10)"); } else { $db -> Execute("UPDATE premium SET points=points+10 WHERE id=".$player -> id); } $db -> Execute('DELETE FROM codes WHERE code='.$_POST['code']); error('Wymieni³e¶ kod na punkty premium.'); } else { error(NO_CODE); } } /** * Assign variables to template and display page */ $smarty -> assign ("Action", $_GET['action']); $smarty -> display ('premium.tpl'); require_once("includes/foot.php"); ?>