<?php

Doo::loadController('base', true);
Doo::loadLibrary('formConnect');

# 兑换历史

class jifenorder extends base{
    
    public $tid = 43;
    public $name = 'jifenorder';
    
    public function index(){               
        $this->renderc($this->name.'/index', $this->data);
    }
    
    public function create(){
        $this->renderc($this->name.'/create', $this->data);
    }
    
    public function createAJAX(){
        if ($this->http_ajax_post('create'.$this->name)){
            $formConnect = new formConnect();
            $formConnect->base = $this;
            echo $formConnect->post($_POST);
            return;
        }
        echo '<越狱>非法请求';
    }
    
    public function edit(){
        $this->data['id'] = intval($this->request->get('id', 'int'));
        $this->renderc($this->name.'/edit', $this->data);
    }
    
    public function editAJAX(){
        if ($this->http_ajax_post('edit'.$this->name)){
            $formConnect = new formConnect();
            $formConnect->base = $this;
            echo $formConnect->post($_POST);
            return;
        }
        echo '<越狱>非法请求';
    }
    
    public function delete(){
        if ($this->http_ajax_post('delete'.$this->name)){
            $formConnect = new formConnect();
            $formConnect->base = $this;
            $id = intval($this->request->getPost('id', 'int'));
            echo $formConnect->delete($id, $this->tid);
            return;            
        }
        echo '<越狱>非法请求';
    }
}