rock_email_cog.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php if(!defined('HOST'))die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. var a = $('#veiw_{rand}').bootstable({
  5. tablename:'email_cog',celleditor:true,sort:'sort',dir:'asc',
  6. columns:[{
  7. text:'编号',dataIndex:'num'
  8. },{
  9. text:'发送名称',dataIndex:'name'
  10. },{
  11. text:'SMTP服务器',dataIndex:'serversmtp'
  12. },{
  13. text:'SMTP服务器端口',dataIndex:'serverport'
  14. },{
  15. text:'邮箱帐号',dataIndex:'emailname'
  16. },{
  17. text:'连接方式',dataIndex:'secure'
  18. },{
  19. text:'排序号',dataIndex:'sort',editor:true,sortable:true
  20. },{
  21. text:'ID',dataIndex:'id'
  22. }],
  23. itemclick:function(){
  24. btn(false);
  25. },
  26. beforeload:function(){
  27. btn(true);
  28. }
  29. });
  30. var c = {
  31. del:function(){
  32. a.del();
  33. },
  34. clickwin:function(o1,lx){
  35. var h = $.bootsform({
  36. title:'系统邮件帐号',height:400,width:500,
  37. tablename:'email_cog',isedit:lx,params:{int_filestype:'sort,serverport'},
  38. submitfields:'serversmtp,name,serverport,emailname,num,secure,sort',url:js.getajaxurl('publicsave','email','system'),beforesaveaction:'savebeforecog',
  39. items:[{
  40. labelText:'编号',name:'num',required:true
  41. },{
  42. labelText:'名称',name:'name',required:true
  43. },{
  44. labelText:'SMTP服务器',name:'serversmtp',required:true
  45. },{
  46. labelText:'SMTP服务器端口',name:'serverport',required:true,type:'number'
  47. },{
  48. labelText:'邮箱帐号',name:'emailname',required:true
  49. },{
  50. labelText:'邮箱密码',name:'emailpass'
  51. },{
  52. labelText:'连接方式',name:'secure',store:[['','默认'],['ssl','ssl']],type:'select',displayfields:1,valuefields:0
  53. },{
  54. labelText:'序号',name:'sort',type:'number',value:'0'
  55. }],
  56. success:function(){
  57. a.reload();
  58. }
  59. });
  60. if(lx==1){
  61. h.setValues(a.changedata);
  62. }
  63. h.getField('name').focus();
  64. },
  65. refresh:function(){
  66. a.reload();
  67. },
  68. yunx:function(){
  69. if(ISDEMO){js.msg('success','demo上就不要测试,我们都测试通过的');return;}
  70. var url = js.getajaxurl('testsend','{mode}','{dir}');
  71. js.ajax(url,{id:a.changeid},function(s){
  72. js.msg('success', s);
  73. },'get',false,'测试发送中...');
  74. }
  75. };
  76. function btn(bo){
  77. get('del_{rand}').disabled = bo;
  78. get('edit_{rand}').disabled = bo;
  79. get('yun_{rand}').disabled = bo;
  80. }
  81. js.initbtn(c);
  82. });
  83. </script>
  84. <div>
  85. <table width="100%"><tr>
  86. <td nowrap>
  87. <button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button> &nbsp;
  88. <button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button> &nbsp;
  89. </td>
  90. <td width="80%"></td>
  91. <td align="right" nowrap>
  92. <button class="btn btn-default" id="yun_{rand}" click="yunx" disabled type="button">测试发送</button> &nbsp;
  93. <button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button> &nbsp;
  94. <button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
  95. </td>
  96. </tr>
  97. </table>
  98. </div>
  99. <div class="blank10"></div>
  100. <div id="veiw_{rand}"></div>
  101. <div class="tishi">提示:此功能是设置系统邮件发送的帐号,如一些邮件的提醒功能!测试发送是发送到当前登录用户的邮箱上!</div>
粤ICP备19079148号