servicepay.inc.php
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$serviceCertPaths = $this->getServiceCertPaths($_W['uniacid']);
$certfile = $serviceCertPaths[0];
$keyfile = $serviceCertPaths[1];
$item = pdo_get('cjdc_service_pay', array('uniacid' => $_W['uniacid']));
if (checksubmit('submit')) {
if ($_GPC['apiclient_cert']) {
file_put_contents($certfile, trim($_GPC['apiclient_cert']));
$data['apiclient_cert'] = $_GPC['apiclient_cert'];
}
if ($_GPC['apiclient_key']) {
file_put_contents($keyfile, trim($_GPC['apiclient_key']));
$data['apiclient_key'] = $_GPC['apiclient_key'];
}
$data['mchid']=trim($_GPC['mchid']);
$data['appid']=trim($_GPC['appid']);
$data['wxkey']=trim($_GPC['wxkey']);
$data['uniacid']=trim($_W['uniacid']);
$data['is_open']=$_GPC['is_open'];
if('' == $_GPC['id']) {
$res = pdo_insert('cjdc_service_pay',$data);
if($res || $res2){
message('添加成功',$this->createWebUrl('servicepay',array()),'success');
} else {
message('添加失败','','error');
}
} else {
$res = pdo_update('cjdc_service_pay', $data, array('id' => $_GPC['id']));
if ($res || $res2) {
message('编辑成功',$this->createWebUrl('servicepay',array()),'success');
} else {
message('编辑失败','','error');
}
}
}
include $this->template('web/servicepay');