예제 #1
0
 * prints:
 * 1. a member list
 * 2. html clip code
 * 3. email list
 * 
 */
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
error_reporting(E_ALL);
ini_set('display_errors', '1');
!empty($_REQUEST['date']) ? $date = $_REQUEST['date'] : ($date = '');
!empty($_REQUEST['comps']) ? $comps = $_REQUEST['comps'] : ($comps = '');
!empty($_REQUEST['nbr-steps']) ? $nbrSteps = $_REQUEST['nbr-steps'] : ($nbrSteps = '');
!empty($_REQUEST['nbr-winners']) ? $nbrWinners = $_REQUEST['nbr-winners'] : ($nbrWinners = '');
!empty($_REQUEST['prevwinners']) ? $prevWinners = $_REQUEST['prevwinners'] : ($prevWinners = '0');
//echo $prevWinners .'  '.$nbrWinners . '  '.$nbrSteps .'  '.$comps .'  '.$date;
$winners = Medlem::getVeckoVinnare($date, $nbrWinners, $nbrSteps, $comps, $prevWinners);
$i = 0;
$winnertable = '<table id=""><tr>';
$winnertable .= '<tr><th></th><th>ID</th><th>Alias</th><th>Namn</th><th>epost</th><th>steg</th><th>Företag</th><th>Tävlingdatum</th><th>Tidigare vinst status</th><th>Vecka</th><th>Datum</th><tr/>';
foreach ($winners as $id => $medlem) {
    $i++;
    $winnertable .= '<tr >                    
                     <td class="mmList2">' . $i . '</td>
                     <td class="mmList1">' . $medlem["id"] . '</td>
                     <td class="mmList2">' . $medlem["aNamn"] . '</td>
                     <td class="mmList2">' . $medlem["fNamn"] . ' ' . $medlem["eNamn"] . '</td>
                     <td class="mmList1">' . $medlem["epost"] . '</td>
                     <td class="mmList2">' . $medlem["steg"] . '</td>
                     <td class="mmList1">' . $medlem["companyname"] . '</td>
                     <td class="mmList2">' . $medlem["startdatum"] . ' - ' . $medlem["slutdatum"] . '</td>                       
                     <td class="mmList1" id="win-date-' . $medlem["id"] . '">' . $medlem["veckotavling_status"] . '</td>