信呼OA版本v2.3.8
This commit is contained in:
209
webmain/system/sms/rock_sms_cog.php
Normal file
209
webmain/system/sms/rock_sms_cog.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var utype = '0';
|
||||
var c={
|
||||
init:function(){
|
||||
var o = get('btnss{rand}');
|
||||
o.value='加载中...';
|
||||
js.ajax(js.getajaxurl('gettotal','{mode}','{dir}'),false,function(ret){
|
||||
var curl = '';
|
||||
if(ret.success){
|
||||
$('#stotal{rand}').html(ret.data.smsinfo);
|
||||
$('#typetext{rand}').html(ret.data.typetext);
|
||||
//if(ret.data.automy=='1')$('#tessh{rand}').show();
|
||||
curl = ret.data.chongurl;
|
||||
utype = ret.data.type;
|
||||
}else{
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
|
||||
get('sms_iscb_{rand}').value=ret.sms_iscb;
|
||||
get('sms_cbnum_{rand}').value=ret.sms_cbnum;
|
||||
get('sms_apikey_{rand}').value=ret.sms_apikey;
|
||||
get('sms_txnum_{rand}').value=ret.sms_txnum;
|
||||
get('sms_mknum_{rand}').value=ret.sms_mknum;
|
||||
get('sms_qmnum_{rand}').value=ret.sms_qmnum;
|
||||
|
||||
get('sms_yanzm_{rand}').value=ret.sms_yanzm;
|
||||
if(ret.sms_dirtype!=''){
|
||||
$('#stotal{rand}').html('请到对应短信平台下查看');
|
||||
curl='https://www.aliyun.com';
|
||||
$('#tessh{rand}').hide();
|
||||
get('sms_apikey_{rand}').value='';
|
||||
}
|
||||
|
||||
get('chong{rand}').href=curl;
|
||||
o.value='刷新';
|
||||
var arr = ret.pingtarr;
|
||||
if(arr.length>0){
|
||||
var oo2 = get('sms_dirtype_{rand}');
|
||||
oo2.length=1;
|
||||
js.setselectdata(oo2, arr,'value');
|
||||
}
|
||||
|
||||
//短信驱动
|
||||
get('sms_dirtype_{rand}').value=ret.sms_dirtype;
|
||||
|
||||
},'get,json');
|
||||
},
|
||||
ceshi:function(){
|
||||
if(get('sms_apikey_{rand}').value!=''){
|
||||
js.alert('设置了“短信APIKEY”不需要测试发送。');
|
||||
return;
|
||||
}
|
||||
js.prompt('测试发短信','输入手机号码(测试成功会扣除一条短信)',function(lx,txt){
|
||||
if(lx=='yes'&&txt)c.sheniokx(txt)
|
||||
});
|
||||
},
|
||||
sheniokx:function(sj){
|
||||
js.msg('wait','发送中...');
|
||||
var lxs = get('sms_dirtype_{rand}').value;
|
||||
js.ajax(js.getajaxurl('testsend','{mode}','{dir}'),{mobile:sj,dirtype:lxs},function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','测试发送成功');
|
||||
c.init();
|
||||
}else{
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
|
||||
save:function(){
|
||||
var lxs = get('sms_dirtype_{rand}').value;
|
||||
var da = {
|
||||
sms_iscb:get('sms_iscb_{rand}').value,
|
||||
sms_cbnum:get('sms_cbnum_{rand}').value,
|
||||
sms_apikey:'',
|
||||
sms_mknum:get('sms_mknum_{rand}').value,
|
||||
sms_qmnum:get('sms_qmnum_{rand}').value,
|
||||
sms_txnum:get('sms_txnum_{rand}').value,
|
||||
sms_yanzm:get('sms_yanzm_{rand}').value,
|
||||
sms_dirtype:lxs
|
||||
};
|
||||
|
||||
if(da.sms_qmnum=='' && lxs!=''){
|
||||
js.msg('msg','使用短信签名不能为空,请输入如:信呼OA,更多查看帮助');
|
||||
return;
|
||||
}
|
||||
|
||||
if(lxs=='alisms' && da.sms_cbnum.substr(0,4)!='SMS_'){
|
||||
js.msg('msg','流程短信催办模版编号格式不对,必须SMS_开头,请查看帮助');
|
||||
return;
|
||||
}
|
||||
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('cogsave','{mode}','{dir}'),da,function(ret){
|
||||
js.msg('success','保存成功');
|
||||
},'post');
|
||||
},
|
||||
changetype:function(o1){
|
||||
var val = o1.value;
|
||||
if(val!=''){
|
||||
if(utype=='0'){
|
||||
js.alert('不是官网vip用户无法切换短信平台');
|
||||
o1.value='';
|
||||
return;
|
||||
}
|
||||
$('#stotal{rand}').html('请到对应短信平台下查看');
|
||||
}else{
|
||||
$('#stotal{rand}').html('请到刷新查看');
|
||||
}
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
$('#sms_dirtype_{rand}').change(function(){
|
||||
c.changetype(this);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
<table cellspacing="0" width="550" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">基本信息
|
||||
</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信发送平台:</td>
|
||||
<td class="tdinput"><select id="sms_dirtype_{rand}" style="width:200px" class="form-control"><option value="">信呼短信服务</option><option value="alisms">阿里云(短信服务)</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180">剩余短信:</td>
|
||||
<td class="tdinput"><span id="stotal{rand}">0.00元(0条)</span>,<a id="chong{rand}" class="btn btn-success btn-xs" href="<?=URLY?>user_index_sms_a.html" target="_blank">去充值</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180">官网用户类型:</td>
|
||||
<td class="tdinput"><span id="typetext{rand}">普通用户</span></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="display:none" id="tessh{rand}">
|
||||
<td align="right">短信APIKEY:</td>
|
||||
<td class="tdinput"><input id="sms_apikey_{rand}" placeholder="这是从短信平台上获取,可不用写" style="width:250px" class="form-control"> <a href="<?=URLY?>view_smsapi.html" target="_blank">如何获取?</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" ></td>
|
||||
<td class="tdinput">
|
||||
<input type="button" click="init" id="btnss{rand}" value="刷新" class="btn btn-default">
|
||||
<a href="<?=URLY?>view_dxto.html" target="_blank">[使用帮助]</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">功能设置</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">使用短信签名编号:</td>
|
||||
<td class="tdinput"><input id="sms_qmnum_{rand}" placeholder="编号到[短信签名]下获取,可不用设置。" maxlength="50" value="" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">流程是否开短信催办:</td>
|
||||
<td class="tdinput"><select id="sms_iscb_{rand}" style="width:200px" class="form-control"><option value="0">不开启</option><option value="1">开启</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信验证码模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_yanzm_{rand}" maxlength="50" value="" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">流程短信催办模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_cbnum_{rand}" maxlength="50" value="defnum" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信提醒给<font color=white>:</font><br>审批人模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_txnum_{rand}" maxlength="50" placeholder="编号到[短信模版]下获取,建议使用:default" class="form-control"><div style="padding-top:0" class="tishi">设置了,有流程的模块当申请人提交时会短信提醒给审批人</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">要提醒的模块编号:</td>
|
||||
<td class="tdinput"><textarea id="sms_mknum_{rand}" style="height:60px" class="form-control"></textarea><div style="padding-top:0" class="tishi">编号到[流程模块→流程模块列表]下获取,多个用,分开,写all代表所有模块。</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
|
||||
<input type="button" click="ceshi" id="test{rand}" value="测试发送" class="btn btn-default">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<div class="tishi"></div>
|
||||
</div>
|
||||
</div>
|
||||
106
webmain/system/sms/rock_sms_qian.php
Normal file
106
webmain/system/sms/rock_sms_qian.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('getqian','{mode}','{dir}'),statuschange:false,
|
||||
columns:[{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'签名',dataIndex:'cont'
|
||||
},{
|
||||
text:'是否公开',dataIndex:'isgk',type:'checkbox'
|
||||
},{
|
||||
text:'状态',dataIndex:'statustext'
|
||||
},{
|
||||
text:'来源',dataIndex:'fromstr'
|
||||
}],
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemclick:function(d){
|
||||
var bo = (d.isedit==1)?false:true;
|
||||
btn(bo);
|
||||
},
|
||||
load:function(d){
|
||||
if(!isempt(d.dirtype)){
|
||||
btn(true);
|
||||
get('btn1_{rand}').disabled=true;
|
||||
get('btn2_{rand}').disabled=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'短信签名',height:400,width:400,
|
||||
tablename:'sms',isedit:lx,
|
||||
url:js.getajaxurl('saveqian','{mode}','{dir}'),
|
||||
submitfields:'cont,isgk,num,explain',
|
||||
items:[{
|
||||
labelText:'签名名称',name:'cont',required:true,blankText:'3-8个字符,需要与自己单位相关'
|
||||
},{
|
||||
labelText:'',name:'num',type:'hidden'
|
||||
},{
|
||||
labelText:'申请说明',name:'explain',required:true,blankText:'如提供单位名/产品官网网址等',type:'textarea'
|
||||
},{
|
||||
name:'isgk',labelBox:'公开(让其他用户也可以使用)',type:'checkbox',checked:false
|
||||
}],
|
||||
success:function(){
|
||||
js.msg('success','保存成功');
|
||||
a.reload();
|
||||
},
|
||||
submitcheck:function(d){
|
||||
var len=d.cont.length;
|
||||
if(len<3)return '签名必须3个字符以上';
|
||||
if(len>8)return '签名不能超过8个字符';
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('cont').focus();
|
||||
},
|
||||
reloadszt:function(){
|
||||
js.msg('wait','刷新中...');
|
||||
js.ajax(js.getajaxurl('reloadsign','{mode}','{dir}'),false, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','刷新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" id="btn1_{rand}" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="reloadszt" id="btn2_{rand}" type="button"><i class="icon-refresh"></i> 刷新状态/获取签名</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">短信签名模版使用帮助,<a href="<?=URLY?>view_smsqian.html" target="_blank">查看帮助和规则限制?</a>,如果您超3个月未使用短信,我们将会删除自定义的签名。</div>
|
||||
51
webmain/system/sms/rock_sms_record.php
Normal file
51
webmain/system/sms/rock_sms_record.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('getrecord','{mode}','{dir}'),checked:true,
|
||||
columns:[{
|
||||
text:'短信内容',dataIndex:'cont',align:'left',
|
||||
},{
|
||||
text:'发给手机号',dataIndex:'tomobile',align:'left',renderstyle:function(v,d){
|
||||
return 'word-wrap:break-word;word-break:break-all;white-space:normal;';
|
||||
}
|
||||
},{
|
||||
text:'发送条数',dataIndex:'count'
|
||||
},{
|
||||
text:'发送时间',dataIndex:'adddt'
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delrecord','{mode}','{dir}'),checked:true});
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
||||
<button class="btn btn-danger" click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">默认值显示最近50条记录。</div>
|
||||
124
webmain/system/sms/rock_sms_tpl.php
Normal file
124
webmain/system/sms/rock_sms_tpl.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('gettpl','{mode}','{dir}'),statuschange:false,
|
||||
columns:[{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'模版内容',dataIndex:'cont',align:'left'
|
||||
},{
|
||||
text:'是否公开',dataIndex:'isgk',type:'checkbox'
|
||||
},{
|
||||
text:'状态',dataIndex:'statustext',renderer:function(v,d){
|
||||
if(d.status=='0')v+='<a href="javascript:;" onclick="urelsd{rand}(\''+d.num+'\')">[刷新状态]</a>';
|
||||
return v;
|
||||
}
|
||||
},{
|
||||
text:'来源',dataIndex:'fromstr'
|
||||
}],
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemclick:function(d){
|
||||
var bo = (d.isedit==1)?false:true;
|
||||
btn(bo);
|
||||
},
|
||||
load:function(d){
|
||||
if(!isempt(d.dirtype)){
|
||||
btn(true);
|
||||
get('btn1_{rand}').disabled=true;
|
||||
get('btn2_{rand}').disabled=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'短信模版',height:400,width:400,
|
||||
tablename:'sms',isedit:lx,
|
||||
url:js.getajaxurl('savetpl','{mode}','{dir}'),
|
||||
submitfields:'cont,num',
|
||||
items:[{
|
||||
labelText:'模版内容',type:'textarea',name:'cont',required:true,blankText:'请严格按照规范填写,变量用#name#格式。',height:150
|
||||
},{
|
||||
labelText:'',name:'num',type:'hidden'
|
||||
}],
|
||||
success:function(){
|
||||
js.msg('success','保存成功');
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('cont').focus();
|
||||
},
|
||||
del:function(){
|
||||
js.confirm('确定要删除此模版吗?',function(jg){
|
||||
if(jg=='yes')c.dels();
|
||||
});
|
||||
},
|
||||
dels:function(){
|
||||
var num = a.changedata.num;
|
||||
js.msg('wait','删除中...');
|
||||
js.ajax(js.getajaxurl('deltpl','{mode}','{dir}'),{num:num}, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','删除成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
getztss:function(bh){
|
||||
js.msg('wait','刷新中...');
|
||||
js.ajax(js.getajaxurl('relaodtpl','{mode}','{dir}'),{num:bh}, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','刷新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
reloadszt:function(){
|
||||
this.getztss('');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
urelsd{rand}=function(bh){
|
||||
c.getztss(bh);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" id="btn1_{rand}" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="reloadszt" id="btn2_{rand}" type="button"><i class="icon-refresh"></i> 刷新状态/获取模版</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">短信签名模版使用帮助,<a href="<?=URLY?>view_smsqian.html" target="_blank">查看帮助和使用规则?</a></div>
|
||||
187
webmain/system/sms/smsAction.php
Normal file
187
webmain/system/sms/smsAction.php
Normal file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
class smsClassAction extends Action
|
||||
{
|
||||
public function initAction()
|
||||
{
|
||||
$this->smsobj = c('xinhuapi');
|
||||
}
|
||||
|
||||
public function gettotalAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','smstotal');
|
||||
$barr['sms_iscb'] = $this->option->getval('sms_iscb','0');
|
||||
$barr['sms_cbnum'] = $this->option->getval('sms_cbnum','defnum');
|
||||
$barr['sms_apikey'] = $this->option->getval('sms_apikey');
|
||||
$barr['sms_txnum'] = $this->option->getval('sms_txnum');
|
||||
$barr['sms_mknum'] = $this->option->getval('sms_mknum');
|
||||
$barr['sms_qmnum'] = $this->option->getval('sms_qmnum');
|
||||
$barr['sms_dirtype'] = $this->option->getval('sms_dirtype');
|
||||
$barr['sms_yanzm'] = $this->option->getval('sms_yanzm');
|
||||
$barr['pingtarr'] = $this->option->getdata('syssmsplat');
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//保存设置
|
||||
public function cogsaveAjax()
|
||||
{
|
||||
$sms_dirtype = $this->post('sms_dirtype');
|
||||
if(isempt($sms_dirtype) || $sms_dirtype=='null')$sms_dirtype = '';
|
||||
$this->option->setval('sms_iscb', $this->post('sms_iscb','0'));
|
||||
$this->option->setval('sms_cbnum', $this->post('sms_cbnum')); //催办编号
|
||||
$this->option->setval('sms_apikey', $this->post('sms_apikey'));
|
||||
$this->option->setval('sms_txnum', $this->post('sms_txnum')); //审批提醒模块编号
|
||||
$this->option->setval('sms_mknum', $this->post('sms_mknum')); //要提醒的模块编号
|
||||
$this->option->setval('sms_qmnum', $this->post('sms_qmnum')); //签名
|
||||
$this->option->setval('sms_dirtype', $sms_dirtype);
|
||||
$this->option->setval('sms_yanzm', $this->post('sms_yanzm'));//验证码的短信编号
|
||||
$this->option->delete("`num` like 'alisms\_%'");
|
||||
}
|
||||
|
||||
//测试
|
||||
public function testsendAjax()
|
||||
{
|
||||
$mobile = $this->get('mobile');
|
||||
$dirtype = $this->get('dirtype');
|
||||
$lxss = $this->option->getval('sms_dirtype');
|
||||
if($dirtype!=$lxss)return returnerror('请先保存后在测试');
|
||||
|
||||
$parasm = array(
|
||||
'modename' => '模块测试',
|
||||
'sericnum' => 'AB-'.date('Ymd').'-001',
|
||||
'applyname' => $this->adminname,
|
||||
'code' => rand(100000,999999),
|
||||
);
|
||||
$bh = $this->option->getval('sms_cbnum', 'defurls');
|
||||
$barr = $this->smsobj->send($mobile, '' ,$bh, $parasm, ''.URL.'?d=we', false);
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//获取签名
|
||||
public function getqianAjax()
|
||||
{
|
||||
$type = $this->option->getval('sms_dirtype');
|
||||
if(!isempt($type)){
|
||||
$rows[] = array(
|
||||
'cont' => '非使用官网平台请到对应短信平台处理',
|
||||
'isgk' => 0
|
||||
);
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'dirtype' => $type
|
||||
);
|
||||
}
|
||||
$barr = $this->smsobj->getdata('sms','getqian');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
//获取发送记录
|
||||
public function getrecordAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','getrecord');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
//删除短信记录
|
||||
public function delrecordAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','delrecord', array(
|
||||
'id' => $this->post('id')
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//保存签名
|
||||
public function saveqianAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$cont = trim($this->post('cont'));
|
||||
$num = $this->post('num');
|
||||
$explain = trim(htmlspecialchars($this->post('explain')));
|
||||
$isgk = (int)$this->post('isgk',1);
|
||||
$barr = $this->smsobj->postdata('sms','saveqian', array(
|
||||
'cont' => $cont,
|
||||
'num' => $num,
|
||||
'isgk' => $isgk,
|
||||
'explain' => $explain,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//获取模版
|
||||
public function gettplAjax()
|
||||
{
|
||||
$type = $this->option->getval('sms_dirtype');
|
||||
if(!isempt($type)){
|
||||
$rows[] = array(
|
||||
'cont' => '非使用官网平台请到对应短信平台处理',
|
||||
'isgk' => 0
|
||||
);
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'dirtype' => $type
|
||||
);
|
||||
}
|
||||
$barr = $this->smsobj->getdata('sms','gettpl');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
//保存模版
|
||||
public function savetplAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$cont = $this->post('cont');
|
||||
$num = $this->post('num');
|
||||
$isgk = 1;
|
||||
$barr = $this->smsobj->postdata('sms','savetpl', array(
|
||||
'cont' => $cont,
|
||||
'num' => $num,
|
||||
'isgk' => 1,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//删除模版
|
||||
public function deltplAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$num = $this->post('num');
|
||||
$barr = $this->smsobj->getdata('sms','deltpl', array(
|
||||
'num' => $num,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//刷新模版状态
|
||||
public function relaodtplAjax()
|
||||
{
|
||||
$num = $this->post('num');
|
||||
$barr = $this->smsobj->getdata('sms','reloadtpl', array(
|
||||
'num' => $num,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//刷新状态
|
||||
public function reloadsignAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','reloadsign');
|
||||
return $barr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user