fixed compare

main
hecht 13 years ago
parent 0c50b9f624
commit b339c85b88

@ -24,13 +24,13 @@ if($charm == 3)
{ {
$item_info = mysql_fetch_assoc(mysql_query("SELECT * FROM clan_item WHERE id='$item_id' LIMIT 1")); $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]'")); $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']) { 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()); displayErrorMessage(NULL,'Nur der Leader und der Co-Leader kann Clanitems kaufen!', displayHistoryBackLink());
exit; exit;
} }
if($user['level'] >= $item_info['req_level']) { if($user['level'] < $item_info['req_level']) {
$fehler_m = 'Euer Clan hat nicht das n&ouml;tige Level'; $fehler_m = 'Euer Clan hat nicht das n&ouml;tige Level';
displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink()); displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink());
exit; exit;
@ -42,34 +42,34 @@ if($charm == 3)
$fehler_m = 'Euer Clan hat nicht genug Geld'; $fehler_m = 'Euer Clan hat nicht genug Geld';
displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink()); displayErrorMessage(NULL,$fehler_m, displayHistoryBackLink());
exit; exit;
} }
$new_geld = $user[geld] - $item_info[preis]; $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_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("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]."'"); mysql_query("INSERT INTO clan_ware SET item_id='".$item_info[id]."', clan='".$user[id]."'");
$fehler_m = "$item_name[name] erfolgreich gekauft<br>&nbsp;<br>Geld: $user[geld] - $item_info[preis] = $new_geld"; $fehler_m = "$item_name[name] erfolgreich gekauft<br>&nbsp;<br>Geld: $user[geld] - $item_info[preis] = $new_geld";
displayErrorMessage(NULL,$fehler_m, '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>'); displayErrorMessage(NULL,$fehler_m, '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>');
exit; exit;
} else if($charm == 5){ } else if($charm == 5){
$user = mysql_Fetch_array(mysql_query("SELECT leader, co_leader, geld, id FROM clan WHERE id='$user_ida[clan]'")); $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']) { 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()); displayErrorMessage(NULL,'Nur der Leader und der Co-Leader kann Clanitems abreissen!', displayHistoryBackLink());
exit; exit;
} }
mysql_query('Delete from clan_ware where clan = '.$user_ida['clan'].' and item_id = '.$item_id); mysql_query('Delete from clan_ware where clan = '.$user_ida['clan'].' and item_id = '.$item_id);
if(mysql_affected_rows() > 0){ if(mysql_affected_rows() > 0){
displayErrorMessage(NULL,'Abreissen erfolgreich!', '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>'); displayErrorMessage(NULL,'Abreissen erfolgreich!', '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>');
} else{ } else{
displayErrorMessage(NULL,'Abreissen ist fehlgeschlagen!', displayHistoryBackLink()); displayErrorMessage(NULL,'Abreissen ist fehlgeschlagen!', displayHistoryBackLink());
} }
} }
if(!$charm) if(!$charm)
{ {
@ -79,9 +79,9 @@ if(!$charm)
} }
?> ?>
<html> <html>
<body> <body>
<div align="center"> <div align="center">
<center> <center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="25"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="25">
@ -103,7 +103,7 @@ if(!$charm)
while($row = mysql_fetch_assoc($clan_items_query)){ while($row = mysql_fetch_assoc($clan_items_query)){
$c_item[$row['item_id']] = 1; $c_item[$row['item_id']] = 1;
} }
$clan = getClan($user_ida['clan']); $clan = getClan($user_ida['clan']);
while($row = mysql_fetch_array($item_name)) while($row = mysql_fetch_array($item_name))
@ -133,7 +133,7 @@ if(!$charm)
?> ?>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr> <tr>

Loading…
Cancel
Save