some fixes for admin panel

This commit is contained in:
unknown
2012-05-20 15:29:04 +03:00
parent 3bcc09d110
commit 5d82ddb51a
8 changed files with 89 additions and 16 deletions
+1 -1
View File
@@ -25,5 +25,5 @@ if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not
mysql_query("UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id = ".$id."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."&g=ok");
header("Location: ../../../Admin/admin.php?p=usergold&g");
?>
+1 -1
View File
@@ -29,7 +29,7 @@ for($i=1;$i<=$amt;$i++) {
$cp = $pop-1;
$q = "insert into `s1_vdata`(`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`,`natar`) values ('$wid','3','WW village',0,$pop,$cp,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,$time,1)";
mysql_query($q) or die(mysql_error());
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,0,'World Wonder')";
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,40,'World Wonder')";
mysql_query($q);
$database->addUnits($wid);
$database->addTech($wid);
+9 -9
View File
@@ -196,25 +196,25 @@ class adm_DB {
}
function DelVillage($wref){
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 1;";
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result) > 0){
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 1;";
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."units WHERE `vref` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."units WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."bdata WHERE `wid` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."bdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."abdata WHERE `wid` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."abdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."fdata WHERE `vref` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."fdata WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."training WHERE `vref` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."training WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."movement WHERE `from` = $wref;";
$q = "DELETE FROM ".TB_PREFIX."movement WHERE `from` = $wref";
mysql_query($q, $this->connection);
$q = "UPDATE ".TB_PREFIX."wdata SET `occupied` = '0' WHERE `id` = $wref;";
$q = "UPDATE ".TB_PREFIX."wdata SET `occupied` = '0' WHERE `id` = $wref";
mysql_query($q, $this->connection);
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ ob_start();
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if(!file_exists('GameEngine/config.php') && !file_exists('../../GameEngine/config.php')) {header("Location: install/");}
if(!file_exists('GameEngine/config.php') && !file_exists('../../GameEngine/config.php') && !file_exists('../../config.php')) {header("Location: install/");}
$script_name = ($_SERVER['REQUEST_URI'] == 'karte.php') ? 'karte' : $_SERVER['REQUEST_URI'];
include ("Battle.php");