Exemple #1
0
 function setconfig($key, $value)
 {
     $c = new cauhinh();
     $c->where('fieldname', $key);
     $c->get();
     if (!$c->exists()) {
         show_error('Could not find config field ' . $key);
     }
     $c->value = $value;
     $c->save();
 }
Exemple #2
0
                <td widtd="26%">
                  <div align="center">
                <?php 
        echo create_link_table('edit_icon', $this->admin_url . 'cauhinhs/edit/' . $row->id, 'Edit Config');
        echo create_link_table('delete_icon', $this->admin_url . 'cauhinhs/delete/' . $row->id, 'delete', 'return confirm ("Bạn có muốn xóa đối tượng này không ?")');
        ?>
</div>									</td>
            </tr>	
            <?php 
    }
    ?>
        <?php 
}
?>
         <?php 
$cauhinh = new cauhinh();
if (count($arr) > 0) {
    $cauhinh->where_not_in('id', $arr);
}
$cauhinh->get();
?>
			<?php 
foreach ($cauhinh->all as $row) {
    $i++;
    ?>
            <tr >
                <td widtd="6%"><div align="center"><?php 
    echo $i;
    ?>
</div></td>
                <td><div align="center"><input type="checkbox" value="<?php 
Exemple #3
0
 function MY_Controller()
 {
     parent::Controller();
     $this->load->library('enum');
     $this->load->config('fireignition');
     $this->load->helper('language');
     $this->lang->load('site');
     $this->load->library('hit_counter');
     $this->load->library('FirePHP');
     if ($this->config->item('fireignition_enabled')) {
         if (floor(phpversion()) < 5) {
             log_message('error', 'PHP 5 is required to run fireignition');
         } else {
             $this->load->library('FirePHP');
         }
     } else {
         $this->load->library('Firephp_fake');
         $this->firephp =& $this->firephp_fake;
     }
     //redirect from old website
     $this->redirectList();
     $cauhinh = new cauhinh();
     $cauhinh->get();
     $this->cauhinh = $cauhinh;
     if ($this->uri->segment(1, "") == "admin") {
         $this->logged_in_user = $this->_get_user();
         $this->admin = $this->config->item('admin');
         $this->admin_url = $this->config->item('admin_url');
         $this->admin_images = base_url() . "images/admin/";
         //LOAD HELPER
         $this->load_admin_resource();
         //check maintenance admin , only webmaster can login
         $this->resetNewsViewMost();
     } else {
         //check login user
         //$this->flogged_in_user=$this->_fget_user();
         $this->isCache = true;
         $this->userLoginFlag = 0;
         $userLogin = $this->session->userdata('userLogin');
         $userToken = $this->session->userdata('userToken');
         $customer = new Customer();
         $customer->get_by_username($userLogin);
         if ($customer->exists() && md5($customer->id) == trim($userToken)) {
             $loginUsername = $customer->username;
             $this->customer = $customer;
             if ($this->session->userdata('userloginFlag') == "1") {
                 $this->userLoginFlag = 1;
                 $this->session->set_userdata('userloginFlag', "0");
             }
         } else {
             $loginUsername = "";
         }
         $this->loginUsername = $loginUsername;
         $this->loginUser = $customer;
         $this->page_title = getconfigkey("defaultPageTitle");
         $this->load->helper('language');
         $this->show_analytic = TRUE;
         $this->page_keyword = getconfigkey("defaultKeyword");
         $this->page_description = getconfigkey("defaultDescription");
         $this->isRobotFollow = true;
         //------------------------------------------------
         // get data handler
         //------------------------------------------------
         $listAllCat = array();
         $newsCate = new Newscatalogue();
         $newsCate->order_by('position');
         $newsCate->where(array('recycle' => 0, 'parentcat_id' => 58));
         $newsCate->get_iterated();
         $this->newsCate = $newsCate;
         foreach ($newsCate as $row) {
             array_push($listAllCat, $row->id);
         }
         /*Get all business cat*/
         $businessCat = new Newscatalogue();
         $businessCat->order_by('position');
         $businessCat->where(array('recycle' => 0, 'parentcat_id' => 91));
         $businessCat->get_iterated();
         $this->businessCat = $businessCat;
         $guideCate = new Newscatalogue();
         $guideCate->order_by('position');
         $guideCate->where(array('recycle' => 0, 'parentcat_id' => 76));
         $guideCate->get_iterated();
         $this->guideCate = $guideCate;
         foreach ($guideCate as $row) {
             array_push($listAllCat, $row->id);
         }
         $this->listAllCat = $listAllCat;
         $projectsCate = new Newscatalogue();
         $projectsCate->order_by('position');
         $projectsCate->where(array('recycle' => 0, 'parentcat_id' => 83));
         $projectsCate->get_iterated();
         $this->projectsCate = $projectsCate;
         $arrayCateNewsId = array();
         foreach ($this->projectsCate as $row) {
             $arrayCateNewsId[] = $row->id;
         }
         $this->arrCateProject = $arrayCateNewsId;
         // project hot
         $projectHot = new Article();
         $projectHot->where('recycle', 0);
         $projectHot->where('hot', 1);
         $projectHot->where_in('newscatalogue_id', $arrayCateNewsId);
         $projectHot->order_by('created', 'desc');
         $projectHot->get(3);
         $this->projectHot = $projectHot;
         //get all housesale
         $typeHouseSale = new Estatetype();
         $typeHouseSale->where('estatecatalogue_id', 1);
         $typeHouseSale->order_by('position');
         $typeHouseSale->get_iterated();
         $this->typeHouseSale = $typeHouseSale;
         //get all houselease
         $typeHouseLease = new Estatetype();
         $typeHouseLease->where('estatecatalogue_id', 2);
         $typeHouseLease->order_by('position');
         $typeHouseLease->get_iterated();
         $this->typeHouseLease = $typeHouseLease;
         //get all housedemand
         $typeHouseDemand = new Estatetype();
         $typeHouseDemand->where('estatecatalogue_id', 3);
         $typeHouseDemand->order_by('position');
         $typeHouseDemand->get_iterated();
         $this->typeHouseDemand = $typeHouseDemand;
         // get all province
         $estateProvince = new Estatecity();
         $estateProvince->order_by('position', 'asc');
         $estateProvince->get_iterated();
         $this->estateProvince = $estateProvince;
         // get all Direction
         $estateDirection = new Estatedirection();
         $estateDirection->order_by('id', 'desc');
         $estateDirection->get_iterated();
         $this->estateDirection = $estateDirection;
         // get all Estatecatalogues
         $estateCatalogues = new Estatecatalogue();
         $estateCatalogues->order_by('position', 'asc');
         $estateCatalogues->get_iterated();
         $this->estateCatalogues = $estateCatalogues;
         // get all business world
         $businessWorld = new Article();
         $businessWorld->order_by('id', 'desc');
         $businessWorld->where(array('recycle' => 0, 'newscatalogue_id' => 78));
         $businessWorld->get(20);
         $this->businessWorld = $businessWorld;
         // get all project news
         $projectNews = new Article();
         $projectNews->order_by('id', 'desc');
         $projectNews->where(array('recycle' => 0, 'newscatalogue_id' => 71));
         $projectNews->get(6);
         $this->projectNews = $projectNews;
         $this->projectNewsFirst = $projectNews->limit(1);
         // get all legal advice
         $legalAdvices = new Article();
         $legalAdvices->order_by('id', 'desc');
         $legalAdvices->where(array('recycle' => 0, 'newscatalogue_id' => 82));
         $legalAdvices->get(11);
         $this->legalAdvices = $legalAdvices;
         // get all new STND
         $newsPrivate = new Article();
         $newsPrivate->order_by('id', 'desc');
         $newsPrivate->where(array('recycle' => 0, 'newscatalogue_id' => 75));
         $newsPrivate->get_iterated();
         $this->newsPrivate = $newsPrivate;
         // get all estateareas
         $estateareas = new Estatearea();
         $estateareas->order_by('position', 'asc');
         $estateareas->get_iterated();
         $this->estateareas = $estateareas;
         // get all estateprices
         $estateprices = new Estateprice();
         $estateprices->order_by('position', 'asc');
         $estateprices->get_iterated();
         $this->estateprices = $estateprices;
         //------------------------------------------------
         // Top Advertise
         //------------------------------------------------
         $banner = new banner();
         $banner->where('bannercat_id', 1);
         $banner->get_iterated();
         $this->banner = $banner;
         $bannerAdversiting = new Banner();
         $bannerAdversiting->where('bannercat_id', 19);
         $bannerAdversiting->get_iterated();
         $this->bannerAdversiting = $bannerAdversiting;
         $bannerLeft = new Banner();
         $bannerLeft->where('bannercat_id', 21);
         $bannerLeft->get_iterated();
         $this->bannerLeft = $bannerLeft;
         $bannerFooter = new Banner();
         $bannerFooter->where('bannercat_id', 20);
         $bannerFooter->get_iterated();
         $this->bannerFooter = $bannerFooter;
         $menu = new menu();
         $menu->order_by('position', 'asc');
         $menu->get_iterated(8);
         $this->menu = $menu;
         $productFooter = new menuitem();
         $productFooter->where('menu_id', 9);
         $productFooter->order_by('position', 'asc');
         $productFooter->get_iterated();
         $this->productFooter = $productFooter;
         $relation = new menuitem();
         $relation->order_by('position', 'asc');
         $relation->where('menu_id', 10);
         $relation->get_iterated();
         $this->relation = $relation;
         $this->_increaseVisiter();
         //load product manufacture
         $productManufacture = new Productmanufacture();
         $productManufacture->order_by('name', 'asc');
         $productManufacture->get_iterated();
         $this->productManufacture = $productManufacture;
         $adverHeader = new Banner();
         $adverHeader->where('bannercat_id', 25);
         $adverHeader->get(1);
         $this->adverHeader = $adverHeader;
         // get estates hot
         $newsHot = new Article();
         $newsHot->where_in('newscatalogue_id', array(71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82));
         $newsHot->order_by('id', 'desc');
         $newsHot->where('hotHome', 1);
         $newsHot->get(5);
         $this->newsHot = $newsHot;
     }
 }
Exemple #4
0
 function delete()
 {
     $id = $this->uri->segment(4);
     $cauhinh = new cauhinh($id);
     if (!$cauhinh->exists()) {
         show_404();
     }
     $cauhinh->delete();
     redirect($this->admin . 'cauhinhs/list_all/');
 }