array urnStatus(string urnIDs)
The function urnStatus()
returns information regarding the status of the urns specified.
If an error occurs, for example, if there is no urn with the ID specified, the function returns false
. Otherwise, an array is returned with the following keys:
Index | Meaning |
---|---|
elements | Number of ballots (elements) in the urn |
drawn | Number of overall ballots already drawn and stored |
round | Number of time the urn has been emptied (begins with 1), corresponding to the return value of urnDraw() |
done | Numer of ballots already drawn in the current round. If all ballots have been drawn from the urn, the next round commences and the number of ballots drawn is reset to 0 |
togo | Number of ballots in the current round that can still be drawn. If this number reaches 0, a new round begins and the value is reset to the number of ballots |
$info = urnStatus('urn1'); html('<p>Still '.$info['togo'].' out of '.$info['elements'].' prize codes available.</p>');