<?php
if(!isset($_GET['check']) || empty($_GET['check'])) die;
$admin=$_GET['check'];

$sumfingIncl=true;
require '../config.thing.php';
$set = get_adm_opts();
// Set timezone
date_default_timezone_set($set->timezone);
include 'translate.php';

$user = is_user_fakeid($admin);
if($user->isadmin != 1) die(_("Not admin!"));
$winners = get_winners_admin($admin);

$i=1;
?>
<div><h3><?php echo _("Raffle winners");?></h3></div>
<div class="accordion" id="accordion">
<?php
foreach($winners as $win) { ?>
  <div class="accordion-group">
    <div class="accordion-heading">
      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapse_<?php echo $i;?>">
        <?php echo _("Raffle #: ").$win[0]. ' &bull; ' . _("Date:") . date("d-m-Y H:i:s",$win[2]);?>
      </a>
    </div>
    <div id="collapse_<?php echo $i;?>" class="accordion-body collapse">
      <div class="accordion-inner" style="background:#EEE">
		<?php
        
        foreach($win[1] as $k) {
            
            echo '<p><strong>'.$k['prize'].'</strong> <small>'. $k['time'].'</small></p>';
            $winn = unserialize($k['winners']);
            
            foreach($winn as $p) {
                $out = explode(':;:',$p);
                echo '&bull; <a href="https://facebook.com/'.$out[0].'" target="_blank">' .$out[1] . '</a> | ' . $out[2] . ' | ' . _("Ticket: ") . '<span class="label label-info">' . $out[3] . '</span><br>';
            }
			echo '<hr>';
        }
        
        ?>
      </div>
    </div>
  </div>


<?php 
++$i;
}?>
</div>

