|
|
<?php
|
|
|
|
|
|
if (!defined('BASEPATH'))
|
|
|
exit('No direct script access allowed');
|
|
|
|
|
|
class Info_image_review extends CI_Controller
|
|
|
{
|
|
|
|
|
|
function __construct()
|
|
|
{
|
|
|
parent::__construct();
|
|
|
$this->permission->is_admin();
|
|
|
//$this->output->enable_profiler(TRUE);
|
|
|
//$this->load->model('Area_model');
|
|
|
//$this->load->model('InfoContents_model', 'icm');
|
|
|
//$this->load->model('InfoStructures_model', 'ism');
|
|
|
$this->load->model('infoImageReview_model', 'irm');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 导入信息图片
|
|
|
*
|
|
|
*/
|
|
|
public function lists($site_code='jp', $area_type='c')
|
|
|
{
|
|
|
$data['site_code'] = $site_code;
|
|
|
$data['area_type'] = $area_type;
|
|
|
|
|
|
//获取内容带图片的信息
|
|
|
$this->irm->ir_site_code = $site_code;
|
|
|
$this->irm->ir_ht_area_type = $area_type;
|
|
|
$data['infos'] = $this->irm->get_info_has_img();
|
|
|
|
|
|
//image_num, info_num
|
|
|
$data['info_num'] = count($data['infos']);
|
|
|
$data['image_num'] = 0;
|
|
|
|
|
|
//分离ic_content,ic_summary中的图片
|
|
|
foreach ($data['infos'] as $it)
|
|
|
{
|
|
|
$match = array();
|
|
|
$img_src_content = array();
|
|
|
$img_src_summary = array();
|
|
|
$patt = '/<img.+?src="(.+?)".+?>/';
|
|
|
//ic_content
|
|
|
preg_match_all($patt, $it->ic_content, $match);
|
|
|
$it->ic_content = '';
|
|
|
if (isset($match[1]))
|
|
|
{
|
|
|
$img_src_content = $match[1];
|
|
|
}
|
|
|
//ic_summary
|
|
|
preg_match_all($patt, $it->ic_summary, $match);
|
|
|
$it->ic_summary = '';
|
|
|
if (isset($match[1]))
|
|
|
{
|
|
|
$img_src_summary = $match[1];
|
|
|
}
|
|
|
$it->pic_array = array_merge($img_src_content, $img_src_summary);
|
|
|
$data['image_num'] += count($it->pic_array);
|
|
|
}
|
|
|
//$this->r_print($data['infos']);
|
|
|
|
|
|
$this->load->view('info_image_review', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 插入数据
|
|
|
*
|
|
|
*/
|
|
|
public function insert()
|
|
|
{
|
|
|
$this->irm->ir_ic_id = $this->input->post('ir_ic_id');
|
|
|
$this->irm->ir_is_id = $this->input->post('ir_is_id');
|
|
|
$this->irm->ir_img_src = $this->input->post('ir_img_src');
|
|
|
$this->irm->ir_img_replace = $this->input->post('ir_img_replace');
|
|
|
$this->irm->ir_state = $this->input->post('ir_state');
|
|
|
$this->irm->ir_ht_area_type = $this->input->post('ir_ht_area_type');
|
|
|
$this->irm->ir_ht_area_id = $this->input->post('ir_ht_area_id');
|
|
|
$this->irm->ir_site_code = $this->input->post('ir_site_code');
|
|
|
$id = $this->irm->insert();
|
|
|
echo($id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 测试:打印
|
|
|
*
|
|
|
*/
|
|
|
public function r_print($o)
|
|
|
{
|
|
|
echo('<pre>'.print_r($o, true).'</pre>');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|