<?php
// +----------------------------------------------------------------------
// | 云业内容管理系统 (云业CMS或yunyecms)
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2030 http://www.yunyecms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 云业科技 <kefu@yunyecms.com>
// +----------------------------------------------------------------------
//YmM0OWM5ZWY1ODk5ZGRkNzM0NUxxUjVMaWE1WWFGNWE2NTU2Nmg1NUNHNTdPNzU3dWZJQ2prdXBIa3VKcERUVlBtaUpaNWRXNTVaV050Y3lrc1EyOXdlWEpwWjJoMElDaGpLU0F5TURFMkxUSXdNekFnYUhSMGNEb3ZMM2QzZHk1NWRXNTVaV050Y3k1amIyMGdRV3hzSUhKcFoyaDBjeUJ5WlhObGNuWmxaQzRnUVhWMGFHOXlPaURsaUpqbW1aUHBvNTRnUERFMU1EQXpNakU1UUhGeExtTnZiVDQ9OGQ3ZTc5OTU5YjQ0MmEyNWQxNGVlMzg2ZmQyODM2OTkzNGE
//MD5:c610bc3d074f2ea0c833d32de3bfa0c3
// +----------------------------------------------------------------------
define('IN_YUNYECMSAdmin',true);
session_save_path(YUNYECMS_ADMSESSION);
session_start();
core::load_admin_fun('admin');
class YUNYE_addons_admin {
    public $lang_menu;
	public $hashurl;
    public $admuser;
	public $cfg;
	public $db;
    function __construct() {
		$this->db = core::load_model('common');
		$this->admuser=IsAdmLogin($this->db);
		$this->hashurl=GetyunyecmsHashStrAll();
		core::load_config('loaded');
		$this->cfg=getcfg();
		header("Content-type: text/html; charset=utf-8"); 
    }
    protected function infocheck($tablename,$fieldvar=1,$field="status") {
        $id = $_REQUEST ["id"];
		 if(!is_array($id)){
			  $id=compact('id');
		  }
		if(empty($tablename)){
			messagebox("非法操作!",url('index'),"warn");		
		}
		$idarray=$id;
        if (isset($idarray)){
				$data[$field]=$fieldvar;
			    foreach($idarray as $key=>$var){
				 		if(!is_numeric($var)){
					        messagebox("错误的参数！",'back',"warn");			
					    }
				        $idarray[$key]=usafestr($var);
		                $curinfo=$this->db->find("select *  from `#yunyecms_{$tablename}` where `id`= {$var}");
					    if($curinfo){
							if(!empty($curinfo['syn'])){
								$syn=$curinfo['syn'];
				                $retres =$this->db->update($data,"syn = $syn",$tablename);
							}else{
				                $retres =$this->db->update($data,"id = $var",$tablename);
							}
						}						
			   }
		return 	$retres;
	   }else{
		return 	false;
		}
    }
	


	
}