Attacken
Attacke erstellen
Attacke editieren
Attacke löschen
Attackenset-Conditions
Condition erstellen
Condition editieren
Condition löschen

Zum Hauptmenu
= 1){ deleteAttack($attackid, $depth); } else if($action == 'edit' && $depth == 1){ editAttack($attackname, $attackid, $Frucht, $starke, $verteidigung, $speed, $hp, $mp, $rassen, $level, $geld, $options, $type, $info, $req_atk, $req_lvl, $runden, $maxlvl); } } function searchfirstAttack($action) { ?>
Attacke suchen
Zum Hauptmenu
'; }?>
Attacke auswählen
Zum Hauptmenu
Attacke
ID:
Name: '>
Stärke: '>
Verteidigung: '>
Speed: '>
HP: '>
MP: '>
Rassen: '>
Level: '>
Geld: '>
Type:
Options: '>
Info: '>
Required Attacks:
Required Level: '>
Frucht:
Runden: '>
Maxlvl: '>
Zum Hauptmenu
"; echo "Attacke konnte nicht erstellt werden, syntax för options ist nicht korrekt!"; echo displayHistoryBackLink(); return; } if($Frucht != 0){ $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.addslashes($options).'\''; } else { $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.addslashes($options).'\''; } //echo $sql.'
'; if(!mysql_query($sql)){ echo "Fehler beim Erstellen der Attacke: Überprüfe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql"; return; } logaction('Attacke '.$attackname.' wurde erstellt!'); ?> Attacke sollte nun erstellt sein!!
Zum Hauptmenu
'; mysql_query($sql); mysql_query('Delete from lernen where at_id = '.$attackid); logaction('Attacke mit id = '.$attackid.' wurde geloescht!'); } else{ for($i=0;$i<$depth;$i++){ $wirklich .= 'wirklich '; } ?> Sind sie sich sicher?? ja
Zum Hauptmenu
"; echo "Attacke konnte nicht erstellt werden, syntax för options ist nicht korrekt!"; echo "
"; echo displayHistoryBackLink(); return; } if($Frucht != 0){ $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid; } else { $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid; } if($row['name'] != $attackname){ mysql_query('Update lernen set name = \''.$attackname.'\' WHERE at_id ='.$attackid); } //echo 'Debugnachricht: '.$sql.'
'; if(!mysql_query($sql)){ echo "Fehler beim Editieren der Attacke: Überprüfe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql"; return; } logaction('Attacke mit dem jetzigen Namen '.$attackname.' wurde editiert!'); ?> Zum Attackenmenü , Zum Hauptmenu
'."\n"; echo "\t".''."\n"; echo "\t".''."\n"; echo "\t".''."\n"; switch ($_REQUEST['action']) { case ACTION_EDIT: if($_REQUEST['task'] == TASK_EDIT) { editAttackentyp($_REQUEST['attid'], $_REQUEST['data']); displayAttackenTypenInfo(ACTION_EDIT, TASK_EDIT, $_REQUEST['attid']); } else { displayAttackenTypenInfo(ACTION_EDIT, TASK_EDIT, $_REQUEST['attid']); } break; case ACTION_CREATE: echo "\t".''."\n"; if($_REQUEST['task'] == TASK_CREATE) { createAttackentyp($_REQUEST['data']); } else { displayAttackenTypenInfo(ACTION_CREATE, TASK_CREATE, $_REQUEST['attid']); } break; case 'delete': if($_REQUEST['task'] == 'dodelete') { deleteAttackentyp($_REQUEST['attid']); } else { displayDeleteAttackentyp($_REQUEST['attid']); } break; default: displayAttackenTypenOverview($_REQUEST['page']); } echo "\t".''."\n"; echo "\t".'
Zum Hauptmenu
'."\n"; echo ''."\n"; } function displayAttackenTypenOverview($page) { $d_array = array('id', 'name', 'anzahl', 'farbe', 'kategorie'); $desc_array = array('ID', 'Name', 'Anzahl', 'Farbe', 'Kategorie'); $sql = 'SELECT '.join($d_array,',').' FROM attackentyp ORDER BY name LIMIT '.($page*20).', 20'; $qry = db_query($sql); $colspan = count($d_array)+1; echo "\t".'

Übersicht

'."\n";; echo "\t".''."\n"; for($i=0;$i'.$desc_array[$i].''."\n"; } echo "\t\t".'Bearbeiten'."\n"; echo "\t".''."\n"; echo "\t".'
'."\n"; while($row = mysql_fetch_assoc($qry)){ echo "\t".''."\n"; for($i=0;$i'.$row[$d_array[$i]].''."\n"; } echo "\t\t".''."\n"; // Echo the delete and the edit button :) echo "\t\t\t".'Edit, '."\n"; echo "\t\t\t".'Delete'."\n"; echo "\t\t".''."\n"; echo "\t".''."\n"; } $total = mysql_num_rows(db_query('SELECT '.join($d_array,',').' FROM attackentyp')); $url = '###LABEL###'; echo "\t".'
'."\n"; echo "\t".''.displayPagelinksNew(20, $total, $page, $url).''."\n"; echo "\t".'
'."\n"; echo "\t".'Create a new Type'."\n"; } function displayAttackenTypenInfo($action, $task, $attid) { //Form-Variablen echo "\t".''."\n"; echo "\t".''."\n"; //initialisierung der Variablen für Inhalt $d_array = array('id', 'name', 'anzahl', 'farbe', 'kategorie'); $desc_array = array('ID', 'Name', 'Anzahl', 'Farbe', 'Kategorie'); //initialisieren falls editiert wird (dort existieren schon Inhalte) if($task == TASK_EDIT) { $sql = 'SELECT * FROM attackentyp WHERE id = '.$attid.';'; $qry = db_query($sql); $row = mysql_fetch_assoc($qry); } $colspan = 2; if($task == TASK_EDIT) { echo "\t".'

Attackentyp bearbeiten

'."\n"; } else { echo "\t".'

Attackentyp erstellen

'."\n"; } echo "\t\t".''.$desc_array[0].''.$row[$d_array[0]].''."\n"; $j = 0; //allgemeine informationen for($i = 1;$i'.$desc_array[$i].''."\n"; } //menü echo "\t".''."\n"; echo "\t".'Attackentyp Übersicht'."\n"; } function editAttackentyp($attid, $data) { $d_array = array('name', 'anzahl', 'farbe', 'kategorie'); $sql = 'UPDATE attackentyp SET '; for($i=0;$iFehler aufgetreten!'; } else{ echo "\t\t\t".'Änderungen wurden übernommen!'; $log++; } if($log >= 1) { logaction('Ein Attackentyp wurde geändert (id = '.$attid.','.encodeNoHTMLWithBB(join($data,',')).')'); } } function createAttackentyp($data) { if($data['name'] != null) { $sql = 'Insert into attackentyp (name, anzahl, farbe, kategorie) VALUES ('; $sql .= '\''.$data['name'].'\','; if($data['anzahl'] == null) { $data['anzahl'] = 1; } $sql .= $data['anzahl'].','; if($data['farbe'] == null) { $data['farbe'] = 'white'; } $sql .= '\''.$data['farbe'].'\','; if($data['kategorie'] == null) { $sql .= 'null'; } else { $sql .= '\''.$data['kategorie'].'\''; } $sql .= ');'; $identifier = mysql_query($sql); if($identifier == FALSE){ echo "\t".'Es gab Probleme beim erstellen des Attacktyps!'."\n"; } else { echo "\t".'Attackentyp '.$data['name'].' wurde erfolgreich erstellt!'."\n"; } } echo "\t".'Attackentypen Übersicht'."\n"; } function deleteAttackentyp($attid) { $colspan = 1; $sql = 'DELETE FROM attackentyp WHERE id = '.$attid.';'; $qry = db_query($sql); if($qry === FALSE || mysql_affected_rows() <= 0){ echo "\t".'Der Attackentyp '.$row['name'].' konnte nicht gelöscht werden!'."\n";; } else { echo "\t".'Der Attackentyp '.$row['name'].' wurde gelöscht!'."\n";; } echo "\t".'Attackentypen Übersicht'."\n"; } function displayDeleteAttackentyp($attid) { $colspan = 1; $sql = 'SELECT * FROM attackentyp WHERE id = '.$attid; $qry = db_query($sql); $row = mysql_fetch_assoc($qry); echo "\t".'

Attackentyp löschen

'."\n"; echo "\t".'Soll der Attackentyp '.$row['name'].' wirklich gelöscht werden?'."\n"; echo "\t".'ja, nein'."\n"; } ?>