. */ class StatutoryVote implements IExport { public function getDisplayName() { return "Voting system"; } public function getDescription() { return "This export contains only delegates and envoys with accepted status 'yes', 'confirmed', 'pending' and 'arrived'."; } public function hasAccess() { return in_array("export_voters", $_SESSION['sess_functions']); } /** * Get an array with the column headers. The keys should match with the keys in getData() */ public function getHeaders() { global $ldap; $columns = array(); $columns['PersonID'] = "ID"; $columns['username'] = $ldap->getSystemName()." username"; $columns['FirstName'] = "First name"; $columns['LastName'] = "Family name"; $columns['BodyCode'] = "Body code"; $columns['ParticipantType'] = "Participant type"; return $columns; } public function getData() { $data = array(); if( @mysql_num_rows( $res=doquery($this->getDataQuery()) )>0 ) { while( $row = mysql_fetch_assoc($res) ) { $data[] = $row; } } return $data; } private function getDataQuery() { $query = "SELECT `PersonID`, `username`, `FirstName`, `LastName`, `BodyCode`, `ParticipantType` "; $query .= "FROM `persons` "; $query .= "WHERE `Accepted` IN ('yes', 'confirmed', 'pending', 'arrived') AND `ParticipantType` IN ('delegate', 'envoy') "; $query .= "ORDER BY `BodyCode`, `FirstName`, `LastName`"; return $query; } } ?>