<?php

/**
 * 通用模板管理
 * */
class TmplsAction extends UserAction {

    public function index() {
        $db = D('Wxuser');
        $where['token'] = session('token');
        $where['uid'] = session('uid');
        $info = $db->where($where)->find();
        $this->assign('info', $info);
        $this->display();
    }

    public function add() {
        $gets = $this->_get('style');
        $db = M('Wxuser');
        switch ($gets) {
            case 1:
                $data['tpltypeid'] = 1;
                $data['tpltypename'] = 'index1381';
                break;
            case 2:
                $data['tpltypeid'] = 2;
                $data['tpltypename'] = 'index1382';
                break;
            case 3:
                $data['tpltypeid'] = 3;
                $data['tpltypename'] = 'index1383';
                break;
            case 4:
                $data['tpltypeid'] = 4;
                $data['tpltypename'] = 'index1384';
                break;
            case 5:
                $data['tpltypeid'] = 5;
                $data['tpltypename'] = 'index1385';
                break;
            case 6:
                $data['tpltypeid'] = 6;
                $data['tpltypename'] = 'index1386';
                break;
            case 7:
                $data['tpltypeid'] = 7;
                $data['tpltypename'] = 'index1387';
                break;
            case 8:
                $data['tpltypeid'] = 8;
                $data['tpltypename'] = 'index1388';
                break;
            case 9:
                $data['tpltypeid'] = 9;
                $data['tpltypename'] = 'index1389';
                break;
            case 10:
                $data['tpltypeid'] = 10;
                $data['tpltypename'] = 'index13810';
                break;
            case 11:
                $data['tpltypeid'] = 11;
                $data['tpltypename'] = 'index13811';
                break;
            case 12:
                $data['tpltypeid'] = 12;
                $data['tpltypename'] = 'index13812';
                break;
            case 13:
                $data['tpltypeid'] = 13;
                $data['tpltypename'] = 'index13813';
                break;
            case 14:
                $data['tpltypeid'] = 14;
                $data['tpltypename'] = 'index13814';
                break;
			case 15:
                $data['tpltypeid'] = 15;
                $data['tpltypename'] = 'index13815';
                break;
			case 16:
                $data['tpltypeid'] = 16;
                $data['tpltypename'] = 'index13816';
                break;
			case 17:
                $data['tpltypeid'] = 17;
                $data['tpltypename'] = 'index13817';
                break;
			case 18:
                $data['tpltypeid'] = 18;
                $data['tpltypename'] = 'index13818';
                break;
			case 19:
                $data['tpltypeid'] = 19;
                $data['tpltypename'] = 'index13819';
                break;
			case 20:
                $data['tpltypeid'] = 20;
                $data['tpltypename'] = 'index13820';
                break;
			case 21:
                $data['tpltypeid'] = 21;
                $data['tpltypename'] = 'index13821';
                break;
			case 22:
                $data['tpltypeid'] = 22;
                $data['tpltypename'] = 'index13822';
                break;
			case 23:
                $data['tpltypeid'] = 23;
                $data['tpltypename'] = 'index13823';
                break;
			case 24:
                $data['tpltypeid'] = 24;
                $data['tpltypename'] = 'index13824';
                break;
			case 25:
                $data['tpltypeid'] = 25;
                $data['tpltypename'] = 'index13825';
                break;
			case 26:
                $data['tpltypeid'] = 26;
                $data['tpltypename'] = 'index13826';
                break;
			case 27:
                $data['tpltypeid'] = 27;
                $data['tpltypename'] = 'index13827';
                break;
			case 28:
                $data['tpltypeid'] = 28;
                $data['tpltypename'] = 'index13828';
                break;
			case 29:
                $data['tpltypeid'] = 29;
                $data['tpltypename'] = 'index13829';
                break;
			case 30:
                $data['tpltypeid'] = 30;
                $data['tpltypename'] = 'index13830';
                break;
			case 31:
                $data['tpltypeid'] = 31;
                $data['tpltypename'] = 'index13831';
                break;
			case 32:
                $data['tpltypeid'] = 32;
                $data['tpltypename'] = 'index13832';
                break;
			case 33:
                $data['tpltypeid'] = 33;
                $data['tpltypename'] = 'index13833';
                break;
			case 34:
                $data['tpltypeid'] = 34;
                $data['tpltypename'] = 'index13834';
                break;
			case 35:
                $data['tpltypeid'] = 35;
                $data['tpltypename'] = 'index13835';
                break;
			case 36:
                $data['tpltypeid'] = 36;
                $data['tpltypename'] = 'index13836';
                break;
			case 37:
                $data['tpltypeid'] = 37;
                $data['tpltypename'] = 'index13837';
                break;
			case 38:
                $data['tpltypeid'] = 38;
                $data['tpltypename'] = 'index13838';
                break;
			case 39:
                $data['tpltypeid'] = 39;
                $data['tpltypename'] = 'index13839';
                break;
			case 40:
                $data['tpltypeid'] = 40;
                $data['tpltypename'] = 'index13840';
                break;
			case 41:
                $data['tpltypeid'] = 41;
                $data['tpltypename'] = 'index13841';
                break;
			case 42:
                $data['tpltypeid'] = 42;
                $data['tpltypename'] = 'index13842';
                break;
			case 43:
                $data['tpltypeid'] = 43;
                $data['tpltypename'] = 'index13843';
                break;
			case 44:
                $data['tpltypeid'] = 44;
                $data['tpltypename'] = 'index13844';
                break;
			case 45:
                $data['tpltypeid'] = 45;
                $data['tpltypename'] = 'index13845';
                break;
			case 46:
                $data['tpltypeid'] = 46;
                $data['tpltypename'] = 'index13846';
                break;
            case 47:
                $data['tpltypeid'] = 47;
                $data['tpltypename'] = 'index13847';
                break;
			case 48:
                $data['tpltypeid'] = 48;
                $data['tpltypename'] = 'index13848';
                break;
			case 49:
                $data['tpltypeid'] = 49;
                $data['tpltypename'] = 'index13849';
                break;
			case 50:
                $data['tpltypeid'] = 50;
                $data['tpltypename'] = 'index13850';
                break;
			case 51:
                $data['tpltypeid'] = 51;
                $data['tpltypename'] = 'index13851';
                break;
			case 52:
                $data['tpltypeid'] = 52;
                $data['tpltypename'] = 'index13852';
                break;
			case 53:
                $data['tpltypeid'] = 53;
                $data['tpltypename'] = 'index13853';
                break;
			case 54:
                $data['tpltypeid'] = 54;
                $data['tpltypename'] = 'index13854';
                break;
			case 55:
                $data['tpltypeid'] = 55;
                $data['tpltypename'] = 'index13855';
                break;
			case 56:
                $data['tpltypeid'] = 56;
                $data['tpltypename'] = 'index13856';
                break;
			case 57:
                $data['tpltypeid'] = 57;
                $data['tpltypename'] = 'index13857';
                break;
			case 58:
                $data['tpltypeid'] = 58;
                $data['tpltypename'] = 'index13858';
                break;
			case 59:
                $data['tpltypeid'] = 59;
                $data['tpltypename'] = 'index13859';
                break;
			case 60:
                $data['tpltypeid'] = 60;
                $data['tpltypename'] = 'index13860';
                break;
			case 61:
                $data['tpltypeid'] = 61;
                $data['tpltypename'] = 'index13861';
                break;
			case 62:
                $data['tpltypeid'] = 62;
                $data['tpltypename'] = 'index13862';
                break;
			case 63:
                $data['tpltypeid'] = 63;
                $data['tpltypename'] = 'index13863';
                break;
			case 64:
                $data['tpltypeid'] = 64;
                $data['tpltypename'] = 'index13864';
                break;
			case 65:
                $data['tpltypeid'] = 65;
                $data['tpltypename'] = 'index13865';
                break;
			case 66:
                $data['tpltypeid'] = 66;
                $data['tpltypename'] = 'index13866';
                break;
			case 67:
                $data['tpltypeid'] = 67;
                $data['tpltypename'] = 'index13867';
                break;
			case 68:
                $data['tpltypeid'] = 68;
                $data['tpltypename'] = 'index13868';
                break;
			case 69:
                $data['tpltypeid'] = 69;
                $data['tpltypename'] = 'index13869';
                break;
			case 70:
                $data['tpltypeid'] = 70;
                $data['tpltypename'] = 'index13870';
                break;
			case 71:
                $data['tpltypeid'] = 71;
                $data['tpltypename'] = 'index13871';
                break;
			case 72:
                $data['tpltypeid'] = 72;
                $data['tpltypename'] = 'index13872';
                break;
			case 73:
                $data['tpltypeid'] = 73;
                $data['tpltypename'] = 'index13873';
                break;
			case 74:
                $data['tpltypeid'] = 74;
                $data['tpltypename'] = 'index13874';
                break;
			case 75:
                $data['tpltypeid'] = 75;
                $data['tpltypename'] = 'index13875';
                break;
				
        }
        $where['token'] = session('token');
        $db->where($where)->save($data);
        //
        M('Home')->where(array('token'=>session('token')))->save(array('advancetpl'=>0));
    }

    public function lists() {
        $gets = $this->_get('style');
        $db = M('Wxuser');
        switch ($gets) {
            case 0:
                $data['tpllistid'] = 0;
                $data['tpllistname'] = '138wo_list0';
                break;
            case 1:
                $data['tpllistid'] = 1;
                $data['tpllistname'] = '138wo_list1';
                break;
			case 2:
                $data['tpllistid'] = 2;
                $data['tpllistname'] = '138wo_list2';
                break;
			case 3:
                $data['tpllistid'] = 3;
                $data['tpllistname'] = '138wo_list3';
                break;
			case 4:
                $data['tpllistid'] = 4;
                $data['tpllistname'] = '138wo_list4';
                break;
			case 5:
                $data['tpllistid'] = 5;
                $data['tpllistname'] = '138wo_list5';
                break;
			case 6:
                $data['tpllistid'] = 6;
                $data['tpllistname'] = '138wo_list6';
                break;
			case 7:
                $data['tpllistid'] = 7;
                $data['tpllistname'] = '138wo_list7';
                break;
			case 8:
                $data['tpllistid'] = 8;
                $data['tpllistname'] = '138wo_list8';
                break;
        }
        $where['token'] = session('token');
        $db->where($where)->save($data);
    }

    public function content() {
        $gets = $this->_get('style');
        $db = M('Wxuser');
        switch ($gets) {
            case 0:
                $data['tplcontentid'] = 0;
                $data['tplcontentname'] = '138wo_content0';
                break;
            case 1:
                $data['tplcontentid'] = 1;
                $data['tplcontentname'] = '138wo_content1';
                break;
			case 2:
                $data['tplcontentid'] = 2;
                $data['tplcontentname'] = '138wo_content2';
                break;
			case 3:
                $data['tplcontentid'] = 3;
                $data['tplcontentname'] = '138wo_content3';
                break;
        }
        $where['token'] = session('token');
        $db->where($where)->save($data);
    }
    
    public function background() {
        $data['color_id'] = $this->_get('style');
        $db = M('Wxuser');
        $where['token'] = session('token');
        $db->where($where)->save($data);
    }

    public function insert() {
        
    }

    public function upsave() {
	
    }

}

?>