<?php namespace Phpcmf\Controllers\Admin;

class Promotion_page extends \Phpcmf\Common
{
    public function index() {

        $page = intval(\Phpcmf\Service::L('Input')->get('page'));
        $data = \Phpcmf\Service::M('Mall', 'mall')->get_config('promotion_page', SITE_ID);

        if (IS_AJAX_POST) {
            $post = \Phpcmf\Service::L('Input')->post('data');
            \Phpcmf\Service::M('Mall', 'mall')->save_config('promotion_page', SITE_ID, $post);
            $this->_json(1, dr_lang('操作成功'));
        }

        \Phpcmf\Service::V()->assign([
            'page' => $page,
            'data' => $data,
            'form' => dr_form_hidden(['page' => $page]),
            'menu' => \Phpcmf\Service::M('Auth')->_admin_menu(
                [
                    '活动页面' => ['mall/promotion_page/index', 'fa fa-cog'],
                ]
            )
        ]);
        \Phpcmf\Service::V()->display('promotion_page_index.html');
    }


}
