Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //load Dkp from User
- $sql['SELECT'] = '*';
- $sql['FROM'] = 'character';
- $db_raid->set_query('select', $sql, __FILE__, __LINE__);
- $char_id = $id;
- echo "<table width='750px'><tr><td width='80px'><b>Charname<b></td><td width='50px' align='center'><b>Level<b></td><td width='70px' align='center'><b>Aktuell</b></td><td width='70px' align='center'><b><font color='green'>Bekommen</font></b></td><td width='70px' align='center'><b><font color='red'>Ausgegeben</font></b></td><td width='70px' align='center'><b><font color='green'>Hinzufügen</font></b><td width='70px' align='center'><b><font color='red'>Abziehen</font></b></tr></table>";
- ## Hole alle Charakter ##
- while($data = $db_raid->fetch()){
- echo "<form action='index.php?option=com_dkp&do=update' method='post'>";
- echo "<input type='hidden' name='char' value='".$data['character_id']."'>";
- echo $name.$level.$aktuell.bekommen.$ausgegeben."<input type='text' name='dkp_in'><input type='text' name='dkp_out'><div class='button'><input type='submit' value='Update'></div>";
- echo "</form>";
- }
- if($_GET["do"] == "update"){
- ## Hier kannstnoch eine For oder while rein packen wenn du mehrerer ändern willst
- ### Update hier mit den Inputfeldern .. und WHERE charid = $_POST["char"] <-- Verstecktes Inputfeld
- $dkp = $data['dkp_new'];
- $dkp_in = $_POST['dkp_in'];
- $dkp_out = $_POST['dkp_out'];
- $dkp_erg1 = $dkp + $dkp_in;
- $dkp_erg2 = $dkp_erg1 - $dkp_out;
- $dkp_new = $dkp_erg2;
- $sql['UPDATE'] = 'character';
- $sql['VALUES'] = array(
- 'dkp' => $dkp,
- 'dkp_new' => $dkp_new,
- 'dkp_in' => $_POST['dkp_in'],
- 'dkp_out' => $_POST['dkp_out']
- );
- $sql['WHERE'] = 'character_id='.$_POST['char'];
- $db_raid->set_query('update', $sql, __FILE__, __LINE__);
- }
- ?>
Add Comment
Please, Sign In to add comment