<?php

/**
 * Description of news
 *
 * @author  杨靖
 */
class news extends CI_Controller {

//put your code here  function __construct() {
    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, "commentary");

        $crud->columns('id', 'acticle_id', 'user_id', 'content', 'publish_time',"state");

      //  $crud->set_relation("type_id", "params", "value");
        
//         $crud->columns('id', 'type_id','gjz', 'name','photo','price','isgood');
//
//        $crud->set_relation("type_id", "guide_type", "fullname", "parent_id > 1");
//        
//        $crud->set_field_upload('photo', 'assets/uploads/guide');
          $this->test();
        $output = $crud->render();

        $this->load->view('crud.php', $output);
    }
    
     public function test() {
        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");
    }

}

?>
