. */ require_once("./include/CharSet.php"); class OpenSlides implements IExport { public function getDisplayName() { return "Open slides"; } public function getDescription() { return "This export contains only delegates with accepted status 'yes', 'confirmed', 'pending' and 'arrived'. Export contains ASCII only."; } public function hasAccess() { return in_array("export_openslides", $_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['FirstName'] = "first_name"; $columns['LastName'] = "last_name"; $columns['Body'] = "structure_level"; $columns['Groups'] = "groups"; $columns['IsActive'] = "is_active"; return $columns; } public function getData() { $data = array(); if( @mysql_num_rows( $res=doquery($this->getDataQuery()) )>0 ) { while( $row = mysql_fetch_assoc($res) ) { $row['FirstName'] = CharSet::get_utf8_to_ascii7($row['FirstName']); $row['LastName'] = CharSet::get_utf8_to_ascii7($row['LastName']); $row['Groups'] = 3; $row['IsActive'] = 1; $data[] = $row; } } return $data; } private function getDataQuery() { $query = "SELECT `p`.`FirstName`, `p`.`LastName`, CONCAT(`b`.`BodyNameAscii`, ' (', `p`.`BodyCode`, ')') AS `Body` "; $query .= "FROM `persons` `p` "; $query .= "INNER JOIN `ab_bodies` `b` ON `b`.`BodyCode` = `p`.`BodyCode` "; $query .= "WHERE `p`.`Accepted` IN ('yes', 'confirmed', 'pending', 'arrived') AND `p`.`ParticipantType` = 'delegate' "; $query .= "ORDER BY `p`.`BodyCode`, `p`.`FirstName`, `p`.`LastName`"; return $query; } } ?>