From b339c85b884d9ca30a1e8ccdf29773c1fd9852fc Mon Sep 17 00:00:00 2001 From: hecht Date: Wed, 14 Dec 2011 18:47:02 +0000 Subject: [PATCH] fixed compare --- ag/clan/c_markt.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ag/clan/c_markt.php b/ag/clan/c_markt.php index 60aa986..ee8044a 100644 --- a/ag/clan/c_markt.php +++ b/ag/clan/c_markt.php @@ -24,13 +24,13 @@ if($charm == 3) { $item_info = mysql_fetch_assoc(mysql_query("SELECT * FROM clan_item WHERE id='$item_id' LIMIT 1")); $user = getClan($user_ida['clan']); // mysql_Fetch_array(mysql_query("SELECT leader, co_leader, geld, id FROM clan WHERE id='$user_ida[clan]'")); - + if($user['leader'] != $user_ida['id'] AND $user['co_leader'] != $user_ida['id']) { displayErrorMessage(NULL,'Nur der Leader und der Co-Leader kann Clanitems kaufen!', displayHistoryBackLink()); exit; - } + } - if($user['level'] >= $item_info['req_level']) { + if($user['level'] < $item_info['req_level']) { $fehler_m = 'Euer Clan hat nicht das nötige Level'; displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink()); exit; @@ -42,34 +42,34 @@ if($charm == 3) $fehler_m = 'Euer Clan hat nicht genug Geld'; displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink()); exit; - } + } $new_geld = $user[geld] - $item_info[preis]; - + mysql_query("UPDATE clan_item SET anzahl=anzahl-1 WHERE id=".$item_info[id]." LIMIT 1"); mysql_query("UPDATE clan SET geld='$new_geld' WHERE id=".$user[id]." LIMIT 1"); mysql_query("INSERT INTO clan_ware SET item_id='".$item_info[id]."', clan='".$user[id]."'"); - + $fehler_m = "$item_name[name] erfolgreich gekauft
 
Geld: $user[geld] - $item_info[preis] = $new_geld"; - + displayErrorMessage(NULL,$fehler_m, 'weiter'); exit; } else if($charm == 5){ $user = mysql_Fetch_array(mysql_query("SELECT leader, co_leader, geld, id FROM clan WHERE id='$user_ida[clan]'")); - + if($user['leader'] != $user_ida['id'] AND $user['co_leader'] != $user_ida['id']) { displayErrorMessage(NULL,'Nur der Leader und der Co-Leader kann Clanitems abreissen!', displayHistoryBackLink()); exit; - } - + } + mysql_query('Delete from clan_ware where clan = '.$user_ida['clan'].' and item_id = '.$item_id); if(mysql_affected_rows() > 0){ - displayErrorMessage(NULL,'Abreissen erfolgreich!', 'weiter'); + displayErrorMessage(NULL,'Abreissen erfolgreich!', 'weiter'); } else{ displayErrorMessage(NULL,'Abreissen ist fehlgeschlagen!', displayHistoryBackLink()); - + } - + } if(!$charm) { @@ -79,9 +79,9 @@ if(!$charm) } ?> - + - +
@@ -103,7 +103,7 @@ if(!$charm) while($row = mysql_fetch_assoc($clan_items_query)){ $c_item[$row['item_id']] = 1; } - + $clan = getClan($user_ida['clan']); while($row = mysql_fetch_array($item_name)) @@ -133,7 +133,7 @@ if(!$charm) ?>