<?php
require_once THEME."theme.php"
require_once THEMES."templates/header.php";

// Gruppe-ID der DJ-Gruppe angeben:
$dj_groupid = 2;

//require_once THEMES."templates/admin_header.php";
if(!checkgroup($dj_groupid) && !iSUPERADMIN) redirect("../../index.php");

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."musicwishbox_panel/locale/".$settings['locale'].".php")) {
   // Load the locale file matching the current site locale setting.
   include INFUSIONS."musicwishbox_panel/locale/".$settings['locale'].".php";
} else {
   // Load the infusion's default locale file.
   include INFUSIONS."musicwishbox_panel/locale/English.php";
}

if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>".$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta name='description' content='".$settings['description']."'>
<meta name='keywords' content='".$settings['keywords']."'>
<meta http-equiv='refresh' content='60'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>
</head>
<body>";

opentable($locale['mwb_108']);

//erledigte loeschen
if(IsSet($_POST['deletewish'])) {
$delwish_id = trim(stripinput($_POST['wish_id']));
$result = dbquery("DELETE FROM ".$db_prefix."musicwishbox WHERE ID='$delwish_id'");
redirect(FUSION_SELF);
}

//Liste ausgeben
$result = dbquery("SELECT * FROM ".$db_prefix."musicwishbox ORDER BY musicwish_time");
   $numrows = dbrows($result);
   while ($data = dbarray($result)) { 
  echo '
<hr>
 <table width="100%" border="0" cellspacing="10" cellpadding="0">
  <tr>
    <td valign="top"><strong>'.$data['musicwish_song'].'</strong></td>
  </tr>
  <tr>
    <td valign="top">'.$locale['mwb_110'].': <strong>'.$data['musicwish_from'].'</strong> um '.date("H:i", $data['musicwish_time']).' Uhr</td>
  </tr>
  <tr>   
    <td valign="top">'.$locale['mwb_111'].': '.$data['musicwish_greet'].'</td>
  </tr>
  <tr>
    <td align="center">
    <form name="wishbox" method="post" action="'.FUSION_SELF.'">
    <input name="wish_id" class="textbox" type="hidden" id="wish_id" value="'.$data['ID'].'">
    <input name="deletewish" class="button" type="submit" id="deletewish" value="'.$locale['mwb_109'].'">
    </form>
    </td>
  </tr>
 </table>
  ';
  }


closetable();
require_once THEMES."templates/footer.php";
echo "</body></html>";
?>