<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * 
 * 数据导入
 * 
 * 功能：
 * 1.根据文件目录导入信息
 * 
 */ 
class Import_adv extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->permission->is_admin();
        $this->load->model('Information_model');
        $this->load->model('InfoContents_model');
        $this->load->model('InfoStructures_model');
        $this->load->model('Import_adv_model');
        $this->output->enable_profiler(TRUE);
    }
    
    /**
     * 
     * index
     * 
     */ 
    public function index()
    {
        //专题根节点
        echo('index');
    }
    
    /**
     * 
     * FAQ
     * 
     */
    public function faq($site_code='jp', $site_lgc='3') 
    {
        //取出FAQ列表
        $data['faq'] = $this->Import_adv_model->get_faq($site_code, $site_lgc);
        
        //取出FAQ的根节点的is_id
        $faq_root_isid = $this->Import_adv_model->get_faq_root_isid($site_code);
        
        //取出所有FAQ类型
        $data['faq_type'] = array();
        foreach ($data['faq'] as $it)
        {
            $data['faq_type'][] = $it->SFC2_Title;
        }
        $data['faq_type'] = array_unique($data['faq_type']);
        
        //插入根节点
        $this->InfoContents_model->add('','');
        
        $this->rp($data['faq_type']);
    }
    
    /**
     * 
     * 打印测试
     * 
     */ 
    private function rp($array) 
    {
        echo('<pre>'.print_r($array, true).'</pre>');
    }
    
}

// end of Import_adv