Added Code for Prog Display
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
<?php // ###### FUNCTIONS ######
|
||||
function GetProgDropDownList()
|
||||
{
|
||||
$progDropDown = array();
|
||||
$dropDownModels = array();
|
||||
|
||||
$criteria = new CDbCriteria;
|
||||
$criteria->order = "add_date DESC";
|
||||
$criteria->limit = 3;
|
||||
foreach (Programme::model()->findAll($criteria) as $row) {
|
||||
$dropDownModels[] = $row;
|
||||
}
|
||||
$dropDownModels[] = null;
|
||||
|
||||
$criteria = new CDbCriteria;
|
||||
$criteria->order = "add_date DESC";
|
||||
$criteria->limit = 8;
|
||||
$criteria->condition = "Sterne=4 AND visible=1";
|
||||
foreach (Programme::model()->findAll($criteria) as $row) {
|
||||
$dropDownModels[] = $row;
|
||||
}
|
||||
|
||||
foreach ($dropDownModels as $row) {
|
||||
if (is_null($row))
|
||||
$progDropDown[] = TbHtml::menuDivider();
|
||||
else
|
||||
$progDropDown[] = array('label' => $row->attributes['Name'], 'url' => '/programme/' . $row->attributes['Name']);
|
||||
}
|
||||
return $progDropDown;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]>
|
||||
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
@@ -42,19 +74,17 @@
|
||||
'class' => 'bootstrap.widgets.TbNav',
|
||||
'items' =>
|
||||
[
|
||||
array('label' => 'Home', 'url' => '/', 'active' => ($this->selectedNav === 'index')),
|
||||
array('label' => 'Blog', 'url' => '#', 'active' => ($this->selectedNav === 'blog')),
|
||||
array('label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')),
|
||||
array('label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')),
|
||||
['label' => 'Home', 'url' => '/', 'active' => ($this->selectedNav === 'index')],
|
||||
['label' => 'Blog', 'url' => '#', 'active' => ($this->selectedNav === 'blog')],
|
||||
['label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')],
|
||||
['label' => '', 'items' => GetProgDropDownList(), 'htmlOptions' => ['class' => 'dropdown-append']],
|
||||
['label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')],
|
||||
],
|
||||
],
|
||||
|
||||
TbHtml::navbarSearchForm('search', '',
|
||||
[
|
||||
'class' => 'pull-right',
|
||||
|
||||
'placeholder' => 'Search',
|
||||
|
||||
'inputOptions' =>
|
||||
[
|
||||
'append' => TbHtml::submitButton(TbHtml::icon(TbHtml::ICON_SEARCH)),
|
||||
@@ -94,8 +124,8 @@
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
|
||||
<script src="<?php echo (YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js') ?>"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
<script src="javascript/scripts.js"></script>
|
||||
<script src="/js/plugins.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
<script src="/javascript/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,19 +4,31 @@
|
||||
?>
|
||||
|
||||
<?php
|
||||
$this->breadcrumbs=array(
|
||||
$this->breadcrumbs = array(
|
||||
'Programme',
|
||||
);
|
||||
|
||||
$this->menu=array(
|
||||
array('label'=>'Create Programme','url'=>array('create')),
|
||||
array('label'=>'Manage Programme','url'=>array('admin')),
|
||||
$this->menu = array(
|
||||
array('label' => 'Create Programme', 'url' => array('create')),
|
||||
array('label' => 'Manage Programme', 'url' => array('admin')),
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Programmes</h1>
|
||||
<div class="container">
|
||||
<div class="span12">
|
||||
<h1>My Prog's</h1>
|
||||
<br>
|
||||
<br>
|
||||
<?php
|
||||
|
||||
foreach (Programme::model()->findAll() as $record) {
|
||||
echo "<div class='well'>";
|
||||
echo nl2br(print_r($record->attributes, true));
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->widget('bootstrap.widgets.TbListView',array(
|
||||
'dataProvider'=>$dataProvider,
|
||||
'itemView'=>'_view',
|
||||
)); ?>
|
||||
@@ -19,7 +19,7 @@ $this->selectedNav = 'about';
|
||||
|
||||
<?php echo TbHtml::pageHeader('About Mikescher.de', ''); ?>
|
||||
|
||||
<div class="well cstm-background-white">
|
||||
<div class="well cstm-well-light">
|
||||
<p>Welcome to my private homepage.</p>
|
||||
|
||||
<p>My name is Mike Schwörer, and this is my homepage - here i upload programs i write in my free time and sometimes i even write a blog entry. </p>
|
||||
@@ -27,7 +27,7 @@ $this->selectedNav = 'about';
|
||||
<p>If you want you can look <?php echo TbHtml::link('here', '#'); // TODO Add Link ?> at the things I programmed </p>
|
||||
</div>
|
||||
|
||||
<div class="well cstm-background-white">
|
||||
<div class="well cstm-well-light">
|
||||
<?php
|
||||
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm',
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user