<?php
/**
 * WebEngine Lottery Plugin
 * https://webenginecms.org/
 * 
 * @version 2.0.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2017 Lautaro Angelico, All Rights Reserved
 * @build 3a0d6d119a70a51f6c8dc25e5f3d37b5
 */

$Lottery = new \Plugin\Lottery\Lottery();
$stashList = $Lottery->getStashList();

echo '<h2>Lottery Stash List</h2>';
if(is_array($stashList)) {
	echo '<div class="col-md-6">';
		echo '<table class="table">';
			echo '<thead>';
				echo '<tr>';
					echo '<th>Account</th>';
					echo '<th>Credits</th>';
				echo '</tr>';
			echo '</thead>';
			echo '<tbody>';
			foreach($stashList as $stash) {
				echo '<tr>';
					echo '<td>'.$stash['memb___id'].'</td>';
					echo '<td>'.number_format($stash['credits']).'</td>';
				echo '</tr>';
			}
			echo '</tbody>';
		echo '</table>';
	echo '</div>';
} else {
	message('warning', 'There are no stashes.');
}
