Example #1
0
 public function actionIndex()
 {
     $this->render('layouts/header');
     $this->render('general/index', array('general' => $this->getGeneral(), 'messages' => $this->getMessages()), true);
     $this->render('pokemon/index', array('pokemon' => Pokemon::getPartyPokemon(), 'owned' => $this->getGeneral()->pokedex_owned, 'seen' => $this->getGeneral()->pokedex_seen), true);
     $this->render('badge/index', array('badges' => Badge::getBadges(null, 'LIMIT 0, 8')), true);
     $this->render('pokemon_box/index', array('pokemon' => Pokemon::getBoxPokemon()), true);
     $this->render('pokemon_daycare/index', array('pokemon' => Pokemon::getDaycarePokemon()), true);
     $this->render('item/index', array('items' => Item::getAllItems()), true);
     $this->render('pokemon_history/index', array('pokemon' => Pokemon::getHistoryPokemon()), true);
     $this->render('milestone/index', array('milestones' => Milestone::getMilestones()), true);
     $this->render('fact/index', array('facts' => Fact::getFacts()), true);
     $this->render('credit/index', array('credits' => Credit::getCredits()), true);
     $this->render('layouts/footer');
 }
Example #2
0
function getAllItemsDT()
{
    global $bdd, $_TABLES;
    if (!is_null($bdd) && !is_null($_TABLES)) {
        $content = '<thead>';
        $content .= '<tr>';
        $content .= '<th>Id</th>';
        $content .= '<th>Type Item</th>';
        $content .= '<th>Website Category</th>';
        $content .= '<th>Guid</th>';
        $content .= '<th>Url</th>';
        $content .= '<th>Title</th>';
        $content .= '<th>Width Image</th>';
        $content .= '<th>Height Image</th>';
        $content .= '<th>Image</th>';
        $content .= '<th>Alt Image</th>';
        $content .= '<th>Description</th>';
        $content .= '<th>Date Publication</th>';
        $content .= '<th>Author</th>';
        $content .= '<th>Action</th>';
        $content .= '</tr>';
        $content .= '</thead>';
        $content .= '<tbody>';
        $objItem = new Item($bdd, $_TABLES);
        $items = $objItem->getAllItems();
        if ($items) {
            foreach ($items as $key => $item) {
                $content .= '<tr item_id=' . $item->id . '>';
                $content .= '<td>' . $item->id . '</td>';
                $content .= '<td><select class="select_dt select_dt_type_item_id">';
                $objTypeItem = new TypeItem($bdd, $_TABLES);
                $types_items = $objTypeItem->getAllTypeItems();
                if ($types_items) {
                    foreach ($types_items as $key_ti => $type_item) {
                        $temp_content = '';
                        $temp_content .= '<option value="' . $type_item->id . '" ';
                        if ($type_item->id == $item->type_item_id) {
                            $temp_content .= 'selected>';
                        } else {
                            $temp_content .= '>';
                        }
                        $temp_content .= $type_item->type . '</option>';
                        $content .= $temp_content;
                    }
                }
                $content .= '</select></td>';
                $content .= '<td><select class="select_dt select_dt_website_category_id">';
                $objWebsiteCategory = new WebsiteCategory($bdd, $_TABLES);
                $websites_categories = $objWebsiteCategory->getAllWebsiteCategories();
                if ($websites_categories) {
                    foreach ($websites_categories as $key_wc => $website_category) {
                        $temp_content = '';
                        $temp_content .= '<option value="' . $website_category->id . '" ';
                        if ($website_category->id == $item->website_category_id) {
                            $temp_content .= 'selected>';
                        } else {
                            $temp_content .= '>';
                        }
                        $temp_content .= $website_category->category . '</option>';
                        $content .= $temp_content;
                    }
                }
                $content .= '</select></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_guid" value="' . $item->guid . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_url" value="' . $item->url . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_title" value="' . $item->title . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_width_image" value="' . $item->width_image . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_height_image" value="' . $item->height_image . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_image" value="' . $item->image . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_alt_image" value="' . $item->alt_image . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_description" value="' . $item->description . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_date_publication" value="' . $item->date_publication . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_author" value="' . $item->author . '" /></td>';
                $content .= "<td><input type='button' class='edit edit_item_dt' value='Save' />\n\t\t\t\t    <input type='button' class='delete delete_item_dt' value='Supprimer' /></td>";
                $content .= '</tr>';
            }
        }
        $content .= '</tbody>';
        return $content;
    } else {
        error_log("BDD ERROR : " . json_encode($bdd));
        error_log("TABLES ERROR : " . json_encode($_TABLES));
    }
}
Example #3
0
<?php

if (!Yii::app()->user->isGuest) {
    $this->menu = array(array('label' => 'Create Item', 'url' => array('create')), array('label' => 'My Items', 'url' => array('admin')));
}
?>

<h1>Items</h1>

<?php 
$item = new Item();
$this->widget('bootstrap.widgets.TbListView', array('dataProvider' => $item->getAllItems(), 'itemView' => '_view'));