<?php

$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('74');	//判断登录和权限

//include_once CORE_LIB.'/growth/GrowthCredit.php';
//include_once CORE_LIB.'/growth/GrowthCreditWay.php';
//include_once '';
//checkAuth('65');	//判断登录和权限
$growthCredit = new GrowthCredit();
$growthCreditWay = new GrowthCreditWay();
$growthCreditWayPackage = new GrowthCreditWayPackage();
//print_r($_POST);
//echo intval('-20');
if($_POST['action'] =='save') {
    if($_POST['data']) {
        $data = $_POST['data'];
        foreach ($data as $wp) {
            foreach ($wp as &$v) {
                $v = mysql_real_escape_string($v);
            }
            $result = $growthCreditWayPackage->save($wp);
            if($result) {
                $logMessage = "保存积分设置成功，data：".  json_encode($wp);
            } else {
                $logMessage = "保存积分设置失败，data：".  json_encode($wp);
            }
            $operateRecord->insertData('74', 'insert or update', 
                $logMessage, $_SESSION['esfadmin']['username']);
        }
    }
    
}
$result = array('result'=>'1');
echo json_encode($result);


?>
