Guest User

Untitled

a guest
Jun 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. <?php
  2. //load Dkp from User
  3. $sql['SELECT'] = '*';
  4. $sql['FROM'] = 'character';
  5. $db_raid->set_query('select', $sql, __FILE__, __LINE__);
  6. $char_id = $id;
  7.  
  8. 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>";
  9. ## Hole alle Charakter ##
  10. while($data = $db_raid->fetch()){
  11. echo "<form action='index.php?option=com_dkp&do=update' method='post'>";
  12. echo "<input type='hidden' name='char' value='".$data['character_id']."'>";
  13. 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>";
  14. echo "</form>";
  15.  
  16. }
  17.  
  18.  
  19.  
  20. if($_GET["do"] == "update"){
  21. ## Hier kannstnoch eine For oder while rein packen wenn du mehrerer ändern willst
  22. ### Update hier mit den Inputfeldern .. und WHERE charid = $_POST["char"] <-- Verstecktes Inputfeld
  23.  
  24. $dkp = $data['dkp_new'];
  25. $dkp_in = $_POST['dkp_in'];
  26. $dkp_out = $_POST['dkp_out'];
  27. $dkp_erg1 = $dkp + $dkp_in;
  28. $dkp_erg2 = $dkp_erg1 - $dkp_out;
  29. $dkp_new = $dkp_erg2;
  30. $sql['UPDATE'] = 'character';
  31. $sql['VALUES'] = array(
  32. 'dkp' => $dkp,
  33. 'dkp_new' => $dkp_new,
  34. 'dkp_in' => $_POST['dkp_in'],
  35. 'dkp_out' => $_POST['dkp_out']
  36. );
  37. $sql['WHERE'] = 'character_id='.$_POST['char'];
  38. $db_raid->set_query('update', $sql, __FILE__, __LINE__);
  39. }
  40.  
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment