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"));
$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&ouml;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<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>');
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!', '<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{
displayErrorMessage(NULL,'Abreissen ist fehlgeschlagen!', displayHistoryBackLink());
}
}
if(!$charm)
{
@ -79,9 +79,9 @@ if(!$charm)
}
?>
<html>
<body>
<div align="center">
<center>
<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)){
$c_item[$row['item_id']] = 1;
}
$clan = getClan($user_ida['clan']);
while($row = mysql_fetch_array($item_name))
@ -133,7 +133,7 @@ if(!$charm)
?>
</tr>
<?php
}
?>
<tr>

Loading…
Cancel
Save