Nun habe ich folgendes Problem ich möchte gerne das man wenn man sich verklickt hat zb. bei Player1 hat gegen Player2 gewonnen und klickt auf Player2 WIN das man das mit einem Button zb. del versieht umdies wieder rückgänging zu machen.
Was müsste ich wo einfügen damit dies funktioniert.
<?php defined ('main') or die ( 'no direct access' ); defined ('admin') or die ('only admin access'); $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); include ("include/includes/config.php"); mysql_connect(DBHOST, DBUSER, DBPASS) or die ('keine verbindung zu mysql'); mysql_select_db(DBDATE) or die ('konnte nicht zu datenbank "'.DBDATE.'" verbinden'); include('include/includes/cup_abfragen.php'); ?> <table width="100%"> <tr> <td><a href="?cup">Anzeigen</a> | <a href="?cup&page=teams">Teams</a></td> </tr> <tr> <td> <? $page=$_GET['page']; switch($page) { case teams: { if($_REQUEST['add']) { $abf=mysql_query("SELECT * FROM ".DBPREF."cup_teams"); $id=mysql_num_rows($abf); echo $id; $id++; $name=$_POST['name']; $gruppe=$_POST['gruppe']; $anordnung=$_POST['anordnung']; mysql_query("INSERT INTO ".DBPREF."cup_teams VALUES ('".$id."','".$name."','".$gruppe."',0,'".$anordnung."')"); echo "Team wurde hinzugefügt"; } if($_REQUEST['do']=='del') { $id=$_GET['id']; mysql_query("DELETE FROM ".DBPREF."cup_teams WHERE id='".$id."'"); } if($_REQUEST['do']=='win') { $id=$_GET['id']; $abf=mysql_query("SELECT * FROM ".DBPREF."cup_teams WHERE id='".$id."'"); $erg=mysql_fetch_assoc($abf); $wins=$erg['win']; $wins++; mysql_query("UPDATE ".DBPREF."cup_teams SET win='".$wins."' WHERE id='".$id."'"); } ?> <form action="?cup&page=teams" method="post"> <table> <tr> <td>Name:</td> <td colspan="2" align="left"><input name="name" type="text" size="20" /></td> </tr> <tr> <td>Gruppe <br>/ Anordnung:</td> <td><input name="gruppe" type="text" size="1" /> / <input name="anordnung" type="text" size="2" /></td> <td> Gruppe 1:<br> Anordnung 1-4<br> <br> Gruppe 2:<br> Anordnung 5-8<br> <br> Gruppe 3:<br> Anordnung 9-12<br> <br> Gruppe 4:<br> Anordnung 13-16<br> <br> </td> </tr> <tr> <td colspan="3"><input name="add" type="submit" value="Hinzufügen" /></td></tr> </table> <? $abf=mysql_query("SELECT * FROM ".DBPREF."cup_teams ORDER by anordnung ASC"); echo "<table><tr><td>Name</td><td>Wins</td><td>Gruppe</td><td>Anordnung</td><td>DO</td></tr>"; while($erg=mysql_fetch_array($abf)) { echo "<tr><td>"; echo $erg['name']; echo "</td><td>"; echo $erg['win']; echo "</td><td>"; echo $erg['gruppe']; echo "</td><td>"; echo $erg['anordnung']; echo "</td><td>"; echo "<a href='?cup&page=teams&do=del&id=".$erg['id']."'>Löschen</a>"; echo "</td></tr>"; } } break; default: { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr valign="top"> <td class="Bhead">Vorunden<br>map1<br></td> <td class="Bhead">Viertelfinale<br>map2 <br> </td> <td class="Bhead">Hablfinale<br>map3 <br> </td> <td class="Bhead">Finale<br>map4<br> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody" colspan="4">Gruppe 1:</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan1_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan1_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_1_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_1_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan2_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan2_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td class="Bbody"> <?php echo $clan_halb_1_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_halb_1_id."'>WIN</a>"; ?> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan3_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan3_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_2_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_2_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan4_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan4_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody" colspan="3"> Gruppe 2: </td> <td class="Bbody"> <?php echo $clan_fin_1_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_fin_1_id."'>WIN</a>"; ?> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan5_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan5_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_3_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_3_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan6_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan6_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td class="Bbody"> <?php echo $clan_halb_2_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_halb_2_id."'>WIN</a>"; ?> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan7_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan7_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_4_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_4_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan8_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan8_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody" colspan="4">Gruppe 3:</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan9_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan9_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_5_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_5_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan10_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan10_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td class="Bbody"> <?php echo $clan_halb_3_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_halb_3_id."'>WIN</a>"; ?> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan11_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan11_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_6_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_6_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan12_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan12_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="3" class="Bbody">Gruppe 4:</td> <td class="Bbody"> <?php echo $clan_fin_2_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_fin_2_id."'>WIN</a>"; ?> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan13_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan13_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_7_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_7_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan14_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan14_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td class="Bbody"> <?php echo $clan_halb_4_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_halb_4_id."'>WIN</a>"; ?> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan15_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan15_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td class="Bbody"> <? echo $clan_vor_8_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan_vor_8_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> </tr> <tr> <td class="Bbody"> <?php echo $clan16_name; echo " | <a href='?cup&page=teams&do=win&id=".$clan16_id."'>WIN</a>"; ?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <? } } ?> </td> </tr> </table> <div align="center"> <p> Cupscript © by <a href="http://www.eugen-bolz.de"><b>Eugen Bolz</b></a><br> </p> </div> <? $design->footer(); ?>
Hier noch ein Bild von dem was ich meine
betroffene Homepage: externer Link