<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Cache extends CI_Controller {

	function __construct(){
		parent::__construct();
        	$this->load->helper('url');
        	$this->load->helper('form');
                $this->load->library('session'); //加载session
		$this->load->model('CsdjDB');
		$this->load->model('CsdjAdmin');
	        $this->CsdjAdmin->Admin_Login();
	}


	public function index()
	{
            $data['str']="";
            $this->load->view('admin/cache',$data);
        }

	public function go()
	{
            $this->CsdjAdmin->Admin_Qx('43');
	    $id = $this->uri->segment(4);
            $this->load->helper('file');
            if($id=='web'){
                delete_files('./cache/'.Cache_Name.'/index/');
                delete_files('./cache/'.Cache_Name.'/home/');
                delete_files('./cache/'.Cache_Name.'/user/');
                $data['str']='<li>更新 <b>站点缓存</b> 成功</li>';
            }else{
                $this->CsdjAdmin->deldir('./cache/'.CS_Cache_Dir.'/','no');
                $data['str']='<li>更新 <b>数据库缓存</b> 成功</li>';
            }

            $this->load->view('admin/cache',$data);
        }
}

