action.printGroup.php 834 Bytes
Newer Older
Leif Andersson's avatar
Leif Andersson committed
1
<?php
2
if( !defined('CMS_VERSION') ) exit;
Leif Andersson's avatar
Leif Andersson committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//echo '<pre>'; print_r($params); echo '</pre>';

$ID = $params['ID'];

$HEAD = <<<EOS
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Grupp $ID</title>
<meta http-equiv="Content-Type" content="text/plain"/>
</head>
EOS;


$members = Person::getGroupMembers($ID);
$addresses = array();
foreach ($members as $member) {
  $adr = '';
  if (trim($member->Namn)) $adr .= $member->Namn.PHP_EOL;
  
  if ($member->SkolaForetag) $adr .= $member->SkolaForetag.PHP_EOL;
  if ($member->Avdelning) $adr .= $member->Avdelning.PHP_EOL;
  if ($member->Adress) $adr .= $member->Adress.PHP_EOL;
  $addresses[] = $adr;
}
  
  



echo $HEAD;
echo '<body>'.PHP_EOL;
echo '<pre>';
foreach ($addresses as $adr) echo $adr.PHP_EOL;
 echo '</pre>';
echo '</body></html>';

exit;
?>