<?php
class Ecms extends Controller {
function Ecms()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
}
function index()
{
$this->load->database();
$data['title']="ECMS";
$data['heading']="报障内容系统";
$this->load->view('ecms_view',$data);
}
function product()
{
$this->load->database();
$data['title']="报障产品维护";
$data['heading']="报障产品";
$data['query']=$this->db->get('product');
$this->load->view('product_view',$data);
}
function product_insert()
{
$this->load->database();
$this->db->insert('product',$_POST);
redirect('ecms/product/');
}
function product_edit()
{
$this->load->database();
$data['title']="更新报障产品";
$data['heading']="更新报障产品";
$this->db->where('id',$this->uri->segment(3));
$data['query']=$this->db->get('product');
$this->load->view('product_edit',$data);
}
function product_update()
{
$this->load->database();
$this->db->set('products',$_POST['products_name']);
$this->db->where('id',$this->uri->segment(3));
$this->db->update('product');
redirect('ecms/product/');
}
}
?>