Inserted data into frontend from models for some views

This commit is contained in:
2019-06-17 13:56:37 +02:00
parent 759f04d34f
commit 5179ea9de5
8 changed files with 128 additions and 101 deletions

View File

@@ -1,46 +1,61 @@
<?php
use Joomla\CMS\Router\Route;
// No direct access.
defined('_JEXEC') or die;
?>
<h1><?php echo $this->clubname; ?></h1>
<h1><?php echo htmlentities($this->club->getName()); ?></h1>
<div class='clubs_row'>
<div class='clubs_title_row'>Adresse</div>
<div class='clubs_content_row'><?php echo nl2br(htmlentities($this->address)); ?></div>
<div class='clubs_content_row'><?php echo nl2br(htmlentities($this->club->getAddress())); ?></div>
</div>
<div class='clubs_row'>
<div class='clubs_title_row'>Internet</div>
<div class='clubs_content_row'><?php echo htmlentities($this->internet); ?></div>
<div class='clubs_title_row'>Stadt</div>
<div class='clubs_content_row'><?php echo htmlentities($this->club->getCity()); ?></div>
</div>
<div class='clubs_row'>
<div class='clubs_title_row'>Kontaktperson</div>
<div class='clubs_content_row'><?php echo htmlentities($this->contactperson); ?></div>
<div class='clubs_title_row'>Homepage</div>
<div class='clubs_content_row'><a href='<?php echo htmlentities($this->club->getHomepage()); ?>' target='_blank'><?php echo htmlentities($this->club->getHomepage()); ?></a></div>
</div>
<div class='clubs_row'>
<div class='clubs_title_row'>Mail-Adresse</div>
<div class='clubs_content_row'><a href='mailto:<?php echo htmlentities($this->email); ?>'><?php echo htmlentities($this->email); ?></a></div>
<div class='clubs_content_row'><a href='mailto:<?php echo htmlentities($this->club->getMail()); ?>'><?php echo htmlentities($this->club->getMail()); ?></a></div>
</div>
<div class='clubs_row'>
<div class='clubs_title_row'>Telefon</div>
<div class='clubs_content_row'><?php echo htmlentities($this->phone); ?></div>
<div class='clubs_title_row'>IBAN / BIC</div>
<div class='clubs_content_row'><?php echo htmlentities($this->club->getIban()); ?> / <?php echo htmlentities($this->club->getBic()); ?></div>
</div>
<div class='clubs_row'>
<div class='clubs_title_row'>Gemeinn&uuml;tzigkeit</div>
<div class='clubs_content_row'><span class='icon-<?php echo $this->club->isCharitable() ? 'ok' : 'cancel'; ?>'></span> Der Verein ist <?php echo $this->club->isCharitable() ? '' : '<b>nicht</b>'; ?> gemeinn&uuml;tzig.</div>
</div>
<!--<div class='clubs_row'>
<div class='clubs_title_row'>Telefon</div>
<div class='clubs_content_row'><?php echo htmlentities('$this->phone'); ?></div>
</div>-->
<div class='clubs_row'>
<div class='clubs_title_row'>Angebote</div>
<div class='clubs_content_row'>
<?php if($this->hasOptions):
<?php if($this->hasOffers):
// Put all options there
foreach($this->options as $k=>$v):
foreach($this->club->getOffers() as $o):
?>
<input type="checkbox" disabled="disabled" <?php if(isset($v)) echo 'checked="checked"'; ?>> <?php echo htmlentities($k); ?><br />
<span class='icon-<?php echo $o['valid'] ? 'ok' : 'cancel-2'; ?>'></span>&nbsp;
<?php if($o['valid']) echo '<b>'; ?>
<?php echo htmlentities($o['offer']->getName()); ?><br />
<?php if($o['valid']) echo '</b>'; ?>
<?php
endforeach;
@@ -52,47 +67,54 @@ endif; ?>
</div>
</div>
<?php if(count($this->trainingPlaces) > 0): ?>
<?php if(count($this->club->getPlaces()) > 0): ?>
<div class='clubs_row'>
<div class='clubs_title_row'>R&auml;umlichkeiten</div>
<?php foreach($this->trainingPlaces as $p): ?>
<div class='clubs_content_row'>
<?php echo htmlentities($p['name']); ?><br />
<?php echo htmlentities($p['street']); ?><br />
<?php echo htmlentities($p['plz'] . " " . $p['city']); ?>
</div>
<?php foreach($this->club->getPlaces() as $p): ?>
<div class='clubs_content_row'>
<b><?php echo htmlentities($p->getName()); ?></b><br />
<i>Adresse</i>
<?php //echo nl2br(htmlentities($p->getAddress())); ?>
<?php echo $p->getArea() === null ? '' : '<br />Fl&auml;che: ' . htmlentities($p->getArea()) . 'qm'; ?>
</div>
<?php endforeach; ?>
<div class='clubs_content_row'><a href='<?php echo ""; ?>'><span class='icon-new'></span>&nbsp; Neue Assoziation anlegen</a></div>
</div>
<?php endif; ?>
<?php if(count($this->persons) > 0) : ?>
<div class='clubs_row'>
<div class='clubs_title_row'>Pr&auml;sident</div>
<div class='clubs_content_row'>
<a href='<?php echo Route::_("index.php?view=user&userid={$this->club->getPresident()->getId()}"); ?>'>
<?php echo htmlentities("{$this->club->getPresident()->getName()} ({$this->club->getPresident()->getCity()})"); ?>
</a>
</div>
</div>
<?php if(count($this->club->getUsers()) > 0) : ?>
<div class='clubs_row'>
<div class='clubs_title_row'>Assoziierte Personen</div>
<div class='clubs_content_row'>
<ul>
<?php foreach($this->persons as $p): ?>
<li>
<a href='?option=com_clubs&view=user&id=<?php echo $p['id']; ?>'><?php echo htmlentities($p['name']); ?></a>:
<?php echo htmlentities($p['position']); ?>
<?php if ($p['modify']) echo ' (Club-Admin)'; ?>
<?php if($this->canModify): ?>
<a href='?option=com_clubs&view=clubassoc&assoc=<?php echo $p['assoc']; ?>'>&Auml;ndern</a>
<a href='?option=com_clubs&task=club.delassoc&assoc=<?php echo $p['assoc']; ?>'>L&ouml;schen</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php foreach($this->club->getUsers() as $uassoc): ?>
<li>
<a href='?option=com_clubs&view=user&id=<?php echo $uassoc->getUser()->getId(); ?>'>
<?php echo htmlentities($uassoc->getUser()->getName()); ?>
</a>:
<?php echo htmlentities($uassoc->getPosition()->getName()); ?>
<?php if ($uassoc->isAdmin()) echo ' (Club-Admin)'; ?>
<!--<?php //if($this->canModify): ?>
<a href='?option=com_clubs&view=clubassoc&assoc=<?php //echo $p['assoc']; ?>'>&Auml;ndern</a>
<a href='?option=com_clubs&task=club.delassoc&assoc=<?php //echo $p['assoc']; ?>'>L&ouml;schen</a>-->
<?php //endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php if($this->canModify): ?>
<a href='<?php echo $this->urlNewPerson; ?>'>Neue Assoziation anlegen</a>
<?php endif; ?>
<?php //if($this->canModify): ?>
<a href='<?php echo ""; ?>'><span class='icon-new'></span>&nbsp; Neue Assoziation anlegen</a>
<?php //endif; ?>
</div>
</div>
<?php endif; ?>
<?php if($this->canModify): ?>
<div class='clubs_row'>
<a href="?option=com_clubs&view=clubdata&clubid=<?php echo $this->clubid; ?>">Stammdaten anpassen</a><br />
<a href="?option=com_clubs&view=clubplaces&clubid=<?php echo $this->clubid; ?>">R&auml;umlichkeiten anpassen</a><br />
</div>
<?php endif; ?>