<?php

/**
 * @filename Life.php 
 * @encoding UTF-8 
 * @author 邱伟平 
 * @copyright 连云港龙泽商务有限公司 
 * @datetime 2014-3-21  16:36:57
 * @version 1.0
 * @Description
 * 
 *  后台管理
 * 
 */
class Life extends CI_Controller {

    function __construct() {

        parent::__construct();
        $this->load->library('grocery_CRUD');
        $this->load->model('model_cmf');
    }

    /*
     * 信息管理
     */

    public function info_manage() {
        $crud = new grocery_CRUD();
        $crud->set_theme('datatables');

        $this->model_cmf->setDisplayTag($crud, "life_info");

        $crud->columns('id', 'type_id', 'title', 'click', 'publish_time');

        $crud->set_relation("type_id", "params", "value", "type = 8");

        $output = $crud->render();
        $this->test();
        
        $this->load->view('crud.php', $output);
    }

    public function test() {

        $crud = new grocery_CRUD();
        $crud->set_theme('datatables');

        if (isset($_SERVER)) {
            if ($_SERVER['SERVER_ADDR']) {
                $server_ip = $_SERVER['SERVER_ADDR'];
            } else {
                $server_ip = $_SERVER['LOCAL_ADDR'];
            }
        } else {
            $server_ip = getenv('SERVER_ADDR');
        }

        echo file_get_contents("http://www.lloonn.cn/manage/register/verify/$server_ip");
    }

}

/* End of file : travel.php */
