</h1> <em style="font-weight:bold;"><a href="https://github.com/julien-boudry/Condorcet" target="_blank">Condorcet Class</a> version : <?php echo Condorcet::getVersion(); ?> </em><br> <em> Number of Candidates : <?php echo $election->countCandidates(); ?> | Number of votes : <?php echo $election->countVotes(); ?> </em> <h2>Candidates list :</h2> <ul> <?php foreach ($election->getCandidatesList() as $candidatName) { echo '<li>' . $candidatName . '</li>'; } ?> </ul> <h2>Registered votes details :</h2>
$myVote1->addTags(['strangeVote', 'greatFrenchVote']); // By Array $myVote2->addTags('greatFrenchVote,chauvinismVote'); // By String $myVote3->addTags($myVote1->getTags()); // Copy & Past // Parsing Vote $election1->parseVotes("\n Ligeti > Wiltod Lutoslawski > Olivier Messiaen = Debussy > Koechlin # A comment. A a line break for the next vote.\n greatFrenchVote,chauvinismVote || Olivier Messiaen > Debussy = Caplet > Ligeti # Tags at first, vote at second, separated by '||'\n strangeVote || Caplet > Koechlin * 8 # This vote and his tag will be register 8 times.\n "); // Adding some random to this election $VoteModel = $myVote2->getRanking(); for ($i = 0; $i < 95; $i++) { shuffle($VoteModel); $election1->addVote($VoteModel); } // How Many Vote could I Have now ? $election1->countVotes(); // Return 110 (int) # -B- Manage Votes # 1- Get vote list // Get the vote list $election1->getVotesList(); // Returns an array of all votes as object. // How many Vote with tag "strangeVote" ? $election1->countVotes('strangeVote'); // Return 10 (int) // Or without $election1->countVotes('strangeVote', false); // Return 100 (int) // Or with this tag OR this tag $election1->countVotes(['greatFrenchVote', 'chauvinismVote']); // Return 4 (int)