<?php
if(!defined('APP_PATH')||!defined('I_PATH')){exit('Access Denied');}

class ld_molds extends controllerBase
{
	function __construct(){
		parent::__construct();
		$this->Get_c='ld_molds';
		$this->a=$this->sysParams('a',1);
		$this->db=func_get_iglobal(array('db','prefix'));
		$this->newrow = array(
			'moldname' => $this->sysParams('moldname',1),
			'isshow' => $this->sysParams('isshow'),
			'orders' => $this->sysParams('orders'),
			't_index' => $this->sysParams('t_index',1),
			't_list' => $this->sysParams('t_list',1),
			't_listimg' => $this->sysParams('t_listimg',1),
			't_listb' => $this->sysParams('t_listb',1),
			't_content' => $this->sysParams('t_content',1),
		);
	}
	function index(){
		$this->toptxt='频道管理';
		$this->lists = syDB('molds')->findAll(array('isshow'=>1));
		$this->lists_no = syDB('molds')->findAll(array('isshow'=>0));
		$this->display("molds.html");
	}
	function edit(){
		$this->d=syDB('molds')->find(array('mid'=>$this->sysParams('mid')));
		if ($this->sysParams('run')==1){
			if(syDB('molds')->update(array('mid'=>$this->d['mid']),$this->newrow)){
				message_a("频道修改成功","?c=".$this->Get_c);
			}else{message_a("频道修改失败,请重新提交");}
		}
		$this->toptxt='修改频道';
		$this->postgo='edit';
		$this->display("molds.html");
	}

}	