<?php
/**
 * 限时促销
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author xiaogg <xiaogg@sina.cn>
 */
 
namespace Admin\Controller;
class PromoteController extends BaseController
{
    //轮播图列表
    public function img_list(){
    	/*$wher['code']='promote';
    	$pos_id=M('PosterPosition')->where($wher)->getField('id');
    	if(empty($pos_id)){
    		$data['code']='promote';
    		$data['status']=1;
    		$data['name']='限时促销广告';
    		$data['width']=1200;
    		$data['height']=392;
    		$data['tpl']='&lt;volist name=&quot;ad_list&quot; id=&quot;val&quot; &gt;
								&lt;li&gt;
								&lt;a class=&quot;img&quot; title=&quot;{$val.name}&quot; href=&quot;{$val.url}&quot;&gt;
								&lt;div style=&quot;background: url({$val.code|format_url}) no-repeat  50% 50%; height:{$height}px; width:{$width}px;&quot;&gt;
								&lt;/div&gt;
								&lt;/a&gt;
								&lt;/li&gt;
								&lt;/volist&gt;';
    		$result=M('PosterPosition')->add($data);
    		$pos_id=$result;
    	}
    	$map['position_id']=$pos_id;
    	$list = $this->lists('Poster',$map);
    	$this->assign('list', $list);
    	$this->assign('pos_id', $pos_id);
    	$this->display();*/
    }
    //添加编辑轮播图
    public function add_img(){
    	/*$id=I('get.id');
    	if(!empty($id)){
    		$map['id']=$id;
    		$poster=M('Poster')->where($map)->field(true)->find();
    		$this->assign($poster);
    	}
    	$wher['code']='promote';
    	$pos_id=M('PosterPosition')->where($wher)->getField('id');
    	$this->assign('pos_id',$pos_id);
    	$this->display();*/
    }
    //添加轮播图
    public function insert_img(){
    	/*$post=I('post.');
    	$map['name']=$post['name'];
    	$map['url']=$post['url'];
    	$map['code']=$post['code_image'];
    	$map['status']=$post['status'];
    	$map['position_id']=$post['pos_id'];
    	$result=M('Poster')->add($map);
    	if($result){
    		$this->success('添加成功',U('Promote/img_list'));
    	}else{
    		$this->error('添加失败',U('Promote/add_img'));
    	}*/
    }
    //编辑轮播图
    public function update_img(){
    	/*$post=I('post.');
    	$id=$post['id'];
    	$map['name']=$post['name'];
    	$map['url']=$post['url'];
    	$map['code']=$post['code_image'];
    	$map['status']=$post['status'];
    	$where['id']=$id;
    	$result=M('Poster')->where($where)->save($map);
    	if($result !==false){
    		$this->success('更新成功',U('Promote/img_list'));
    	}else{
    		$this->error('更新失败',U('Promote/add_img',array('id'=>$id)));
    	}*/
    }
    //删除轮播图
    public function delete_img(){
    	/*$id=I('get.id');
    	$where['id']=$id;
    	$result=M('Poster')->where($where)->delete();
    	if($result){
    		$this->success('删除成功',U('Promote/img_list'));
    	}else{
    		$this->error('删除失败',U('Promote/img_list'));
    	}*/
    }
}
?>