Commit 8fa22c06 authored by Leif Andersson's avatar Leif Andersson
Browse files

Ändrade utskrift till html

parent 4ef63538
......@@ -12,31 +12,32 @@ $HEAD = <<<EOS
<title>Grupp $ID</title>
<!-- meta http-equiv="Content-Type" content="text/html"/ -->
</head>
<body>
<table>
<tr><td>Kolumn1</td><td>Kolumn2</td><td>Kolumn3</td><td>Kolumn4</td>
<td>Kolumn5</td><td>Kolumn6</td></tr>
EOS;
$members = Person::getGroupMembers($ID);
$addresses = array();
$addresses[] = 'Kolumn1;Kolumn2;Kolumn3;Kolumn4;Kolumn5;Kolumn6';
foreach ($members as $member) {
$adr = '';
if (trim($member->Namn)) $adr .= $member->Namn.';';
$adr = '<tr>';
if (trim($member->Namn)) $adr .= '<td>'.$member->Namn.'</td>';
if ($member->SkolaForetag) $adr .= $member->SkolaForetag.';';
if ($member->Avdelning) $adr .= $member->Avdelning.';';
if ($member->SkolaForetag) $adr .= '<td>'.$member->SkolaForetag.'</td>';
if ($member->Avdelning) $adr .= '<td>'.$member->Avdelning.'</td>';
if ($member->Adress) {
$aas = explode("\n",$member->Adress);
foreach($aas as $aa) $adr .= $aa .';';
foreach($aas as $aa) $adr .= '<td>'. $aa .'</td>';
}
$addresses[] = rtrim($adr,';');
$adr .= '</tr>';
$addresses[] = $adr;
}
//print_r($addresses);
echo $HEAD;
echo '<body>'.PHP_EOL;
echo '<pre>'.PHP_EOL;
foreach ($addresses as $adr) echo $adr.PHP_EOL;
echo '</pre>';
echo '</body></html>';
exit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment