function countup($array) { $result = 0; foreach ($array as $a) { $result += is_array($a) ? countup($a) : count($a); } return $result; }
$strecke = 'hinweg'; if ($data['parsed'] == 1) { $restzeit = $data['return'] - date(U); $strecke = 'rückweg'; } if ($data['type'] == 1) { $mission = 'angreifen'; } elseif ($data['type'] == 2) { $mission = 'transportieren'; } elseif ($data['type'] == 3) { $mission = 'überführen'; } elseif ($data['type'] == 4) { $mission = 'sammeln'; } if (!$data['parsed']) { $abbruch = countup(date('U') - $data['started']); } else { $abbruch = '---'; } $content .= ' <br /><center><table border="1" cellspacing="0" class="standard"> <tr align="center"><th colspan="2" style="width:300px"><center><b>Missionsdetails für Mission ' . $_GET['id'] . ':</b><br /></th></tr> <tr class="standard" align="center"><td style="width:150px">Mission</td><td style="width:150px">' . $mission . ' (' . $strecke . ')</td></tr> <tr class="standard" align="center"><td style="width:150px">Ziel</td><td style="width:150px">' . $data['ziel'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Eisen</td><td style="width:150px">' . $data['eisen'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Titan</td><td style="width:150px">' . $data['titan'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Oel</td><td style="width:150px">' . $data['oel'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Uran</td><td style="width:150px">' . $data['uran'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Gold</td><td style="width:150px">' . $data['gold'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Chanje</td><td style="width:150px">' . $data['chanje'] . '</td></tr> <tr class="standard" align="center"><td style="width:150px">Rückkehr bei Abbruch</td><td style="width:150px">' . $abbruch . '</td></tr>