Пример #1
0
function resetRaffle($reset)
{
    $tickets = RaffleTicket::find('all');
    if ($reset == 'active') {
        //Reset all tickets to active
        foreach ($tickets as $ticket) {
            $ticket->active = 1;
            $ticket->save();
        }
    } elseif ($reset == 'delete') {
        //Delete all tickets
        foreach ($tickets as $ticket) {
            $ticket->delete();
        }
    }
}
Пример #2
0
						</th>
						<th>
							Username
						</th>
						<th>
							# of Tickets
						</th>
						<th>
							# of Wins
						</th>
					</tr>
				</thead>
				<tbody id="raffleTicketsUserBody">
		      <?php 
        foreach ($distinctUsers as $distinctUser) {
            $thisUserTickets = RaffleTicket::find('all', array('conditions' => array('assignedto = ? AND event = ?', $distinctUser->assignedto, $_SESSION['event'])));
            $thisUserInfo = User::find_by_userid($distinctUser->assignedto);
            echo '<tr>';
            echo '<td>';
            echo '</td>';
            echo '<td>';
            echo $thisUserInfo->username;
            echo '</td>';
            echo '<td>';
            echo count($thisUserTickets);
            echo '</td>';
            echo '<td>';
            echo 'TBC';
            echo '</td>';
            echo '</tr>';
        }