Witam mam taki kod i nie wiem jak zrobić że każdy użytkownik moze z niego kożystać. Bo z tej funkcji może korzystac tylko Admin. Proszę o odpowiedź
<?PHP
if($_SESSION['user_admin']>=$adminRights['coins']) {
echo '<h2>Admin - Account bearbeiten</h2>'; if(isset($_POST['submit']) && $_POST['submit']=="aktualisieren") { if(checkInt($_POST['accID']) && checkInt($_POST['aktCoins']) && checkInt($_POST['coins']) && ($_POST['art']==1 OR $_POST['art']==0)) {
if($_POST['art']==1) $newCoins=$_POST['aktCoins']+$_POST['coins'];
else $newCoins=$_POST['aktCoins']-$_POST['coins'];
if($newCoins<0) $newCoins=0;
$sqlCmd = "UPDATE account.account SET coins='".$newCoins."' WHERE id='".$_POST['accID']."' LIMIT 1";
if($sqlQry) {
echo'<p class="meldung">Coins erfolgreich verändert. Neuer Wert: <b>'.$newCoins.'</b></p>'; }
}
else {
echo'<p class="meldung">Eingabe war falsch oder fehlerhaft. Nochmals versuchen.</p>'; }
}
{
$sqlCmd = "SELECT id,login,coins FROM account.account WHERE id='".$_GET['acc']."' LIMIT 1";
{
echo'<h3>Coins aufladen: "'.$accData->login.'"</h3>'; ?>
<p>Aktueller Kontostand: <b>
<?PHP echo $accData->coins; ?></b></p>
<div class="user">
<form action="index.php?p=admin&a=coins&acc=
<?PHP echo $accData->id; ?>" method="POST">
<input type="hidden" name="aktCoins" value="
<?PHP echo $accData->coins; ?>"/>
<input type="hidden" name="accID" value="
<?PHP echo $accData->id; ?>"/>
<table>
<tr>
<th class="topLine">Coins ändern:</th>
<td class="topLine">
<input type="text" size="11" maxlength="11" name="coins"/>
<select name="art">
<option value="1">aufladen</option>
<option value="0">abziehen</option>
</select>
</td>
<td class="topLine"><input type="submit" name="submit" value="aktualisieren"/></td>
</tr>
</table>
</form>
</div>
<?PHP
}
else
{
echo'<p>Die eingegebene Account-ID existiert nicht!</p>'; }
}
else
{
echo'<p class="meldung">Es wurde keine Account-ID eingegeben.</p>'; }
}
else {
echo'<p class="meldung">Kein Zugriff auf diesen Bereich!</p>'; }
?>