1
0
www.mikescher.com/www/protected/views/programs/index.php

57 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/* @var $this ProgramController */
/* @var $dataProvider CActiveDataProvider */
?>
<?php
2014-05-23 11:22:34 +02:00
$this->breadcrumbs = array(
'Programs',
);
2014-05-23 11:22:34 +02:00
$this->menu = array(
array('label' => 'Create Program', 'url' => array('create')),
array('label' => 'Manage Program', 'url' => array('admin')),
);
?>
2014-05-23 11:22:34 +02:00
<div class="container">
2014-05-28 21:29:49 +02:00
<h1>My Programs</h1>
<br><br>
2014-05-28 17:19:57 +02:00
<div class="row-fluid">
2014-05-23 11:22:34 +02:00
<?php
2014-05-28 21:29:49 +02:00
$criteria = new CDbCriteria;
$criteria->order = "add_date DESC";
$criteria->condition = "visible=1";
$all = Program::model()->findAll($criteria);
2014-05-28 17:19:57 +02:00
$rows = ceil((count($all) / 4));
2014-05-23 11:22:34 +02:00
2014-05-28 17:19:57 +02:00
for ($i = 0; $i < $rows; $i++) {
echo '<ul class="thumbnails">';
2014-05-23 11:22:34 +02:00
2014-05-28 21:29:49 +02:00
foreach (array_slice($all, $i * 4, 4) as $record) {
2014-05-28 17:19:57 +02:00
$this->widget('ThumbnailPreview',
[
'caption' => $record->attributes['Thumbnailname'],
2014-05-28 21:29:49 +02:00
'link' => '/programs/view/' . $record->attributes['Name'],
2014-05-28 17:19:57 +02:00
'description' => $record->attributes['Description'],
'category' => $record->attributes['Kategorie'],
'language' => explode("|", $record->attributes['Language']),
'image' => '/images/programs/thumbnails/' . $record->attributes['Name'] . '.jpg',
'starcount' => $record->attributes['Sterne'],
'downloads' => $record->attributes['Downloads'],
'date' => new DateTime($record->attributes['add_date']),
]);
}
2014-05-23 11:22:34 +02:00
2014-05-28 17:19:57 +02:00
echo '</ul>';
}
2014-05-23 11:22:34 +02:00
?>
2014-05-28 17:19:57 +02:00
2014-05-23 11:22:34 +02:00
</div>
</div>