function list_all() { $dis['base_url'] = base_url(); $banner = new banner(); $banner->order_by('position', 'asc'); $banner->get(); $dis['view'] = 'banner/list'; $dis['menu_active'] = 'Hình quảng cáo'; $dis['title'] = "banner"; $dis['banner'] = $banner; $dis['nav_menu'] = array(array("type" => "add", "text" => "Thêm banner", "link" => "{$this->admin_url}banners/edit/", "onclick" => "")); $this->viewadmin($dis); }
function save($object = '', $related_field = '') { if (!$this->exists()) { $o = new banner(); $o->select_max('position'); $o->get(); if (count($o->all) != 0) { $max = $o->position + 1; $this->position = $max; } else { $this->postion = 1; } } return parent::save($object, $related_field); }
</ul> </div> </div> </div> </div> <div class="groupcol2"> <div class="constructioncol2"> <div class="titleconstructioncol2"><h1>Hình ảnh khác<?php //lang('galleries') ?> </h1></div> <?php foreach ($galleriesSame as $row) { $banner = new banner(); $banner->where('bannercat_id', $row->id); $banner->get(); ?> <div class="listgalleries"> <div class="imglistgalleries"> <a title="<?php echo $row->name; ?> " href="<?php echo $base_url . $this->lang->lang(); ?> /gallery/<?php echo $row->id; ?> "> <img src="<?php echo $base_url . $banner->image;