Hallo,
die Komponente will ich nur zum laufen bringen! Ich weis sie entspricht nicht Joomla-Standart
!
Master.php wird im Frontend angezeigt. Wenn ich jetzt aber die Detailseite aufrufen will, bleibe ich auf der Master-Seite stehen.
Die Detailansicht öffne ich mit &mid='.$mission['missionid'].'&year='.$year.'"
master.php
PHP-Code:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
if(is_file(JPATH_COMPONENT.DS."Languages/General.php"))
include_once (JPATH_COMPONENT.DS."Languages/General.php");
else
die('File "Languages/General" could not be found');
echo '<div style="font-size: 16px; font-weight: bold; color: #F00; text-decoration: underline;" class="box1">'.show_page_title.'</div><p> </p>';
if(sizeof(GetMissions($config))==0)
echo '<div class="box1">'.Txt_NoMission.'</div>';
else
{
echo '<form name="Form_SelectYear" action="index.php?option=com_missionmanagement" method="get">
<input type="hidden" name="option" value="com_missionmanagement" />
<select name="year" onChange="form.submit();">';
foreach (GetAllYearsFromMissions($config) as $year)
{
if(isset($_GET['year'])&&($_GET['year']==$year['year']))
echo '<option selected="selected" value="'.$year['year'].'">'.$year['year'].'</option>';
else
echo '<option value="'.$year['year'].'">'.$year['year'].'</option>';
}
echo '</select></form>';
?>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<th>
<?php echo Name_TableHeadCategory; ?>
</th>
<th>
<?php echo Name_TableHeadMissionname; ?>
</th>
<th>
<?php echo Name_TableHeadAlarmdatetime; ?>
</th>
<th>
<?php echo Name_TableHeadShortdescription; ?>
</th>
<th>
<?php echo Name_TableHeadLink; ?>
</th>
</tr>
<?php
$years = GetAllYearsFromMissions($config);
$year = $years[0]['year'];
$missions = GetMissionsByYear($year,$config);
if(isset($_GET['year']))
$year = $_GET['year'];
$missions = GetMissionsByYear($year,$config);
foreach ($missions as $mission)
{
$category = GetCategoryById($mission['category'],$config);
echo '<tr>';
echo ' <td>';
if(isset($category['color'])&&($category['color']!=""))
echo '<span style="background:#'.$category['color'].';"> </span>';
else
echo '<span> </span>';
echo $category['abbreviation']." - ".$category['name'];
echo ' </td>';
echo ' <td>';
echo $mission['missionname'];
echo ' </td>';
echo ' <td>';
echo $mission['alarmdate'] .' '.ToShortTime($mission['alarmtime']);
echo ' </td>';
echo ' <td>';
echo $mission['shortdescription'];
echo ' </td>';
echo ' <td>';
if(isset($mission['report'])&&($mission['report']!=""))
echo '<a href="index.php?option=com_missionmanagement&mid='.$mission['missionid'].'&year='.$year.'"
title="'.Name_LinkDetail.'">'.Name_LinkDetail.'</a>';
else
echo '<a href="index.php?option=com_missionmanagement&mid='.$mission['missionid'].'&year='.$year.'"
title="'.Name_LinkNormal.'">'.Name_LinkNormal.'</a>';
echo ' </td>';
echo '</tr>';
}
echo '</table>';
}
?>
detail.php
PHP-Code:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
if(!isset($_GET['mid'])) die("Unknown error, no missionId requested");
$mission = GetMissionById($_GET['mid'],$config);
$category = GetCategoryById($mission['category'],$config);
?>
<style>
.detailview td {
border:1px solid #666;
padding:3px;
}
</style>
<table class="detailview" cellpadding="0" cellspacing="3" width="100%">
<tr>
<td rowspan="8" width="1" style=" border:none; background:#<?php echo $category['color']; ?>;">
</td>
<td width="30%"><b>Einsatz</b></td>
<td>
<span><?php echo $category['abbreviation'].' - '.$category['name']; ?></span>
<span style="margin-left:20px;"><?php echo $mission['missionname']; ?></span>
</td>
</tr>
<tr>
<td><b>Kurztext</b></td>
<td>
<span><?php echo $mission['shortdescription']; ?></span>
</td>
</tr>
<tr>
<td><b>Einsatzort</b></td>
<td>
<span><?php echo $mission['location']; ?></span>
</td>
</tr>
<tr>
<td><b>Alarmierung - Einsatz beendet</b></td>
<td>
<span><?php echo SetDateForLanguage($mission['alarmdate']).' '.ToShortTime($mission['alarmtime']); ?> Uhr</span>
bis
<span><?php
if($mission['recurrencedate']!= "0000-00-00")
echo SetDateForLanguage($mission['recurrencedate']).' ';
echo ToShortTime($mission['recurrencetime']); ?> Uhr</span>
</td>
</tr>
</tr>
<tr>
<td><b>Eingesetzte Einsatzkräfte</b></td>
<td>
<span><?php
if( (!isset($mission['numberoffirefighter'])) || ($mission['numberoffirefighter']!= "") )
echo 'Keine Angaben';
else
echo $mission['numberoffirefighter'];
?></span>
</td>
</tr>
</tr>
<tr>
<td><b>Einsatzleiter</b></td>
<td>
<span><?php
if( (!isset($mission['officerincharge'])) || ($mission['officerincharge']!= "") )
echo 'Keine Angaben';
else
echo $mission['officerincharge'];
?></span>
</td>
</tr>
</tr>
<tr>
<td><b>Eingesetzte Geräte</b></td>
<td>
<span><?php
if( (!isset($mission['equipment'])) || ($mission['equipment']!= "") )
echo 'Keine Angaben';
else
echo $mission['equipment'];
?></span>
</td>
</tr>
<?php
if(isset($mission['report'])&&($mission['report']!=""))
echo'
<tr>
<td><b>Bericht</b></td>
<td>
<span>
'.$mission['report'].'
</span>
</td>
</tr>
';
?>
</table>
<?php
if(isset($_GET['year']))
echo '<a href="index.php?option=com_missionmanagement&year='.$_GET['year'].'" title="Zurück">Zurück</a>';
else
echo '<a href="index.php?option=com_missionmanagement" title="Zurück">Zurück</a>';
?>
Weis jemand warum dies so ist?
Lesezeichen