<?php
namespace app\admin\controller;

use app\admin\BaseController;
use app\common\model\Alisms as AlismsModel;

class Alisms extends BaseController
{
	
	public function index()
	{
		$alisms = AlismsModel::where(1)->find();
		return view('set/alisms',[
			'alisms' => $alisms 
		]);
	}
	
	public function editAlisms()
	{
		$alisms = AlismsModel::where(1)->find();
		$data = array(
			'accesskeyid'		=> input('accesskeyid/s'),
			'accesskeysecret'	=> input('accesskeysecret/s'),
			'signname'			=> input('signname/s'),
			'register'			=> input('register/s'),
			'getpassword'		=> input('getpassword/s'),
			'mobilelogin'		=> input('mobilelogin/s')
		);
		if ($alisms==null){
			AlismsModel::create($data);
		}else{
			$data['id'] = $alisms->id;
			AlismsModel::update($data);
		}
		exit(json_encode(array(
			'code' 	=> 0,
			'msg'   => ""
		)));
	}
	
}
	