850895d7c00f8d2adc06bd77a21e927457ce6d20_0.file.setting.html.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?php
  2. /* Smarty version 3.1.30, created on 2018-05-07 13:23:21
  3. from "D:\phpStudy\WWW\workorder\application\views\templates\setting\setting.html" */
  4. /* @var Smarty_Internal_Template $_smarty_tpl */
  5. if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  6. 'version' => '3.1.30',
  7. 'unifunc' => 'content_5aefe2c9614c69_35366142',
  8. 'has_nocache_code' => false,
  9. 'file_dependency' =>
  10. array (
  11. '850895d7c00f8d2adc06bd77a21e927457ce6d20' =>
  12. array (
  13. 0 => 'D:\\phpStudy\\WWW\\workorder\\application\\views\\templates\\setting\\setting.html',
  14. 1 => 1525670593,
  15. 2 => 'file',
  16. ),
  17. ),
  18. 'includes' =>
  19. array (
  20. ),
  21. ),false)) {
  22. function content_5aefe2c9614c69_35366142 (Smarty_Internal_Template $_smarty_tpl) {
  23. ?>
  24. <!DOCTYPE html>
  25. <html lang="zh-CN">
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  28. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  29. <meta name="robots" content="noindex,nofollow">
  30. <title><?php echo $_smarty_tpl->tpl_vars['sys_name']->value;?>
  31. </title>
  32. <base href="<?php echo base_url();?>
  33. "/>
  34. <link href="static/css/bootstrap.min.css" rel="stylesheet">
  35. <link href="static/css/select2.min.css" rel="stylesheet">
  36. <link href="static/js/skins/all.css" rel="stylesheet">
  37. <link rel="stylesheet" href="static/css/style.css">
  38. <?php echo '<script'; ?>
  39. language="javascript" type="text/javascript"> var SITE_URL = "/";<?php echo '</script'; ?>
  40. >
  41. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  42. <!--[if lt IE 9]>
  43. <?php echo '<script'; ?>
  44. src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"><?php echo '</script'; ?>
  45. >
  46. <?php echo '<script'; ?>
  47. src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"><?php echo '</script'; ?>
  48. >
  49. <![endif]-->
  50. </head>
  51. <body style="background: #fff; min-width: auto;">
  52. <form class="form-horizontal bv-form" role="form" id="validateform" name="validateform" action="" method="post"
  53. novalidate="novalidate">
  54. <input type="hidden" name="setting_id" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['setting_id'];?>
  55. ">
  56. <div class="panel panel-default">
  57. <div class="panel-body">
  58. <fieldset>
  59. <div class="title">短信配置</div>
  60. <div class="form-group">
  61. <label class="col-sm-1 control-label">启用短信:</label>
  62. <div class="col-sm-4 radio">
  63. <input type="radio" name="is_sms" id="yes1" value="1" <?php if ($_smarty_tpl->tpl_vars['setting']->value['is_sms']) {?>checked<?php }?>><label for="yes1">是</label>
  64. <input type="radio" name="is_sms" id="no1" value="0" <?php if (!$_smarty_tpl->tpl_vars['setting']->value['is_sms']) {?>checked<?php }?>><label for="no1">否</label>
  65. </div>
  66. </div>
  67. <div class="form-group">
  68. <label class="col-sm-1 control-label">短信类型:</label>
  69. <div class="col-sm-4 radio">
  70. <input type="radio" name="sms_type" id="modem" value="10" <?php if ($_smarty_tpl->tpl_vars['setting']->value['sms_type'] == "10") {?>checked<?php }?>><label for="modem">短信猫</label>
  71. <input type="radio" name="sms_type" id="portal" value="20" <?php if ($_smarty_tpl->tpl_vars['setting']->value['sms_type'] == "20") {?>checked<?php }?>><label for="portal">短信平台</label>
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <label class="col-sm-1 control-label">测试号码:</label>
  76. <div class="col-sm-4">
  77. <input name="test_phone" class="form-control" id="test_phone" dragonfly="true" datatype="mobile" errormsg="请填写正确的电话号码,不需要加86。" placeholder="" size="45" type="text" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['test_phone'];?>
  78. ">
  79. </div>
  80. </div>
  81. <div id="sms_modem" <?php if ($_smarty_tpl->tpl_vars['setting']->value['sms_type'] != "10") {?>class="hidden"<?php }?>>
  82. <div class="form-group">
  83. <label class="col-sm-1 control-label">串口号:</label>
  84. <div class="col-sm-4">
  85. <select class="form-control" name="serial_port" id="serial_port">
  86. <?php
  87. $_smarty_tpl->tpl_vars['num'] = new Smarty_Variable(null, $_smarty_tpl->isRenderingCache);$_smarty_tpl->tpl_vars['num']->step = 1;$_smarty_tpl->tpl_vars['num']->total = (int) ceil(($_smarty_tpl->tpl_vars['num']->step > 0 ? 20+1 - (1) : 1-(20)+1)/abs($_smarty_tpl->tpl_vars['num']->step));
  88. if ($_smarty_tpl->tpl_vars['num']->total > 0) {
  89. for ($_smarty_tpl->tpl_vars['num']->value = 1, $_smarty_tpl->tpl_vars['num']->iteration = 1;$_smarty_tpl->tpl_vars['num']->iteration <= $_smarty_tpl->tpl_vars['num']->total;$_smarty_tpl->tpl_vars['num']->value += $_smarty_tpl->tpl_vars['num']->step, $_smarty_tpl->tpl_vars['num']->iteration++) {
  90. $_smarty_tpl->tpl_vars['num']->first = $_smarty_tpl->tpl_vars['num']->iteration == 1;$_smarty_tpl->tpl_vars['num']->last = $_smarty_tpl->tpl_vars['num']->iteration == $_smarty_tpl->tpl_vars['num']->total;?>
  91. <option value="<?php echo $_smarty_tpl->tpl_vars['num']->value;?>
  92. " <?php if ($_smarty_tpl->tpl_vars['num']->value == $_smarty_tpl->tpl_vars['setting']->value['serial_port']) {?>selected<?php }?>>COM<?php echo $_smarty_tpl->tpl_vars['num']->value;?>
  93. </option>
  94. <?php }
  95. }
  96. ?>
  97. </select>
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-1 control-label">波特率:</label>
  102. <div class="col-sm-4">
  103. <select class="form-control" name="baud_rate" id="baud_rate">
  104. <option value="9600" <?php if ($_smarty_tpl->tpl_vars['setting']->value['baud_rate'] == "9600") {?>selected<?php }?>>9600</option>
  105. <option value="115200" <?php if ($_smarty_tpl->tpl_vars['setting']->value['baud_rate'] == "115200") {?>selected<?php }?>>115200</option>
  106. </select>
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <label class="col-sm-1 control-label">短信中心号码:</label>
  111. <div class="col-sm-4">
  112. <input name="sms_cneter_num" class="form-control" id="sms_cneter_num" datatype="mobile" errormsg="请填写正确的电话号码,不需要加86。" placeholder="" size="45" type="text" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['sms_cneter_num'];?>
  113. ">
  114. </div>
  115. </div>
  116. </div>
  117. <div id="sms_server" <?php if ($_smarty_tpl->tpl_vars['setting']->value['sms_type'] != "20") {?>class="hidden"<?php }?>>
  118. <div class="form-group">
  119. <label class="col-sm-1 control-label">产品:</label>
  120. <div class="col-sm-4 radio">
  121. <input type="radio" name="product" id="product1" value="Dysmsapi" <?php if ($_smarty_tpl->tpl_vars['setting']->value['product'] == "Dysmsapi") {?>checked<?php }?>><label for="product1">阿里云通讯</label>
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <label class="col-sm-1 control-label">AccessKeyId:</label>
  126. <div class="col-sm-4">
  127. <input class="form-control" type="text" name="access_key_id" id="access_key_id" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['access_key_id'];?>
  128. ">
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="col-sm-1 control-label">AccessKeySecret:</label>
  133. <div class="col-sm-4">
  134. <input class="form-control" type="text" name="access_key_secret" id="access_key_secret" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['access_key_secret'];?>
  135. ">
  136. </div>
  137. </div>
  138. <div class="form-group">
  139. <label class="col-sm-1 control-label">短信签名:</label>
  140. <div class="col-sm-4">
  141. <input class="form-control" type="text" name="sign_name" id="sign_name" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['sign_name'];?>
  142. ">
  143. </div>
  144. </div>
  145. <div class="form-group">
  146. <label class="col-sm-1 control-label">模版CODE:</label>
  147. <div class="col-sm-4">
  148. create_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][0];?>
  149. ">
  150. sign_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][1];?>
  151. ">
  152. check_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][2];?>
  153. ">
  154. doit_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][3];?>
  155. ">
  156. reject_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][4];?>
  157. ">
  158. finish_workorder:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][5];?>
  159. ">
  160. test_sms:<input class="form-control" type="text" name="template_codes[]" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['template_codes'][6];?>
  161. ">
  162. </div>
  163. </div>
  164. </div>
  165. <div class="title">邮箱配置</div>
  166. <div class="form-group">
  167. <label class="col-sm-1 control-label">启用邮箱发送:</label>
  168. <div class="col-sm-4">
  169. <input type="radio" name="is_email" id="yes2" value="1" <?php if ($_smarty_tpl->tpl_vars['setting']->value['is_email']) {?>checked<?php }?>><label for="yes2">是</label>
  170. <input type="radio" name="is_email" id="no2" value="0" <?php if (!$_smarty_tpl->tpl_vars['setting']->value['is_email']) {?>checked<?php }?>><label for="no2">否</label>
  171. </div>
  172. </div>
  173. <div class="form-group">
  174. <label class="col-sm-1 control-label">服务器:</label>
  175. <div class="col-sm-4">
  176. <input name="server" type="text" datatype="*" class="form-control" id="server" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['server'];?>
  177. ">
  178. </div>
  179. </div>
  180. <div class="form-group">
  181. <label class="col-sm-1 control-label">安全协议:</label>
  182. <div class="col-sm-4">
  183. <select class="form-control" name="smtp_secure" id="smtp_secure">
  184. <option value="">无</option>
  185. <option value="ssl" <?php if ('ssl' == $_smarty_tpl->tpl_vars['setting']->value['smtp_secure']) {?>selected<?php }?>>SSL</option>
  186. <option value="tls" <?php if ('tls' == $_smarty_tpl->tpl_vars['setting']->value['smtp_secure']) {?>selected<?php }?>>TLS</option>
  187. </select>
  188. </div>
  189. </div>
  190. <div class="form-group">
  191. <label class="col-sm-1 control-label">端口号:</label>
  192. <div class="col-sm-4">
  193. <input name="port" type="text" datatype="n1-5" class="form-control" id="port" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['port'];?>
  194. ">
  195. </div>
  196. </div>
  197. <div class="form-group">
  198. <label class="col-sm-1 control-label">发信人:</label>
  199. <div class="col-sm-4">
  200. <input name="sender" type="text" datatype="e" class="form-control" id="sender" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['sender'];?>
  201. ">
  202. </div>
  203. </div>
  204. <div class="form-group">
  205. <label class="col-sm-1 control-label">安全验证码:</label>
  206. <div class="col-sm-4">
  207. <input name="secret_key" type="password" datatype="*" class="form-control" id="secret_key" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['secret_key'];?>
  208. ">
  209. </div>
  210. </div>
  211. <div class="form-group">
  212. <label class="col-sm-1 control-label">测试收信人:</label>
  213. <div class="col-sm-4">
  214. <input name="tester" type="text" datatype="e" class="form-control" id="tester" value="<?php echo $_smarty_tpl->tpl_vars['setting']->value['tester'];?>
  215. ">
  216. </div>
  217. </div>
  218. </fieldset>
  219. <div class="form-actions text-left">
  220. <button type="submit" id="dosubmit" class="btn btn-primary ">保存</button>
  221. <button type="button" id="test" class="btn btn-default">测试发送</button>
  222. <button type="button" id="clear_cahce" class="btn btn-default">清除缓存</button>
  223. </div>
  224. </div>
  225. </div>
  226. </form>
  227. <?php echo '<script'; ?>
  228. type="text/javascript" charset="utf-8" src="static/js/jquery.js"><?php echo '</script'; ?>
  229. >
  230. <?php echo '<script'; ?>
  231. type="text/javascript" charset="utf-8" src="static/js/bootstrap.js"><?php echo '</script'; ?>
  232. >
  233. <?php echo '<script'; ?>
  234. type="text/javascript" charset="utf-8" src="static/js/icheck.min.js"><?php echo '</script'; ?>
  235. >
  236. <?php echo '<script'; ?>
  237. type="text/javascript" charset="utf-8" src="static/js/select2.full.min.js"><?php echo '</script'; ?>
  238. >
  239. <?php echo '<script'; ?>
  240. type="text/javascript" charset="utf-8" src="static/js/layer/layer.js"><?php echo '</script'; ?>
  241. >
  242. <?php echo '<script'; ?>
  243. type="text/javascript" charset="utf-8" src="static/js/Validform_v5.3.2.min.js"><?php echo '</script'; ?>
  244. >
  245. <?php echo '<script'; ?>
  246. language="javascript" type="text/javascript">
  247. $(function () {
  248. $('input').iCheck({
  249. cursor : true,
  250. radioClass : 'iradio_square-blue',
  251. });
  252. if($('input[name="sms_type"]:checked').val()=='10'){
  253. $("#sms_cneter_num").attr("datatype","mobile");
  254. $("#sms_server").find("input").removeAttr("datatype");
  255. }else if($('input[name="sms_type"]:checked').val()=='20'){
  256. $("#sms_cneter_num").removeAttr("datatypee");
  257. $("#sms_server").find("input").attr("datatype","*");
  258. }
  259. $('input[name="sms_type"]').on("ifChecked",function () {
  260. if($('input[name="sms_type"]:checked').val()=='10'){
  261. $("#sms_cneter_num").attr("datatype","mobile");
  262. $("#sms_server").find("input").removeAttr("datatype");
  263. }else if($('input[name="sms_type"]:checked').val()=='20'){
  264. $("#sms_cneter_num").removeAttr("datatype");
  265. $("#sms_server").find("input").attr("datatype","*");
  266. }
  267. })
  268. $("select").select2({minimumResultsForSearch: -1});
  269. $("#validateform").Validform({
  270. tiptype: function (msg, o) {
  271. if (o.type == 3) {
  272. layer.tips(msg, o.obj, {
  273. tips: [1, '#ff6666'] //还可配置颜色
  274. });
  275. }
  276. },
  277. ignoreHidden:true,
  278. datatype: {
  279. 'mobile': /^[1][3,4,5,7,8][0-9]{9}$/
  280. },
  281. beforeSubmit: function (curform) {
  282. $("button").attr("disabled", "disabled");
  283. var data = $("#validateform").serializeArray();
  284. $.post("setting/setting", data, function (data) {
  285. layer.msg(data.msg, {icon: data.icon, time: 3000}, function () {
  286. if (data.code) {
  287. window.location.reload();
  288. }
  289. })
  290. })
  291. return false;
  292. }
  293. });
  294. $("input:radio[name='sms_type']").on("ifChecked",function () {
  295. var val = $(this).val();
  296. if(val == "10"){
  297. $("#sms_modem").removeClass("hidden").fadeIn();
  298. $("#sms_server").hide();
  299. }else if(val == "20"){
  300. $("#sms_server").removeClass("hidden").fadeIn();
  301. $("#sms_modem").hide();
  302. }
  303. })
  304. $("#test").click(function () {
  305. $("button").attr("disabled","disabled");
  306. $.post("setting/test", function (data) {
  307. layer.msg(data.msg, {icon: data.icon, time: 3000},function () {
  308. $("button").removeAttr("disabled");
  309. });
  310. }).error(function(xhr,errorText,errorType){
  311. layer.msg(errorType, {icon:2, time: 3000},function () {
  312. $("button").removeAttr("disabled");
  313. });
  314. });
  315. })
  316. $("#clear_cahce").click(function () {
  317. $("button").attr("disabled","disabled");
  318. $.post("setting/clearcache", function (data) {
  319. layer.msg(data.msg, {icon: data.icon, time: 3000},function () {
  320. $("button").removeAttr("disabled");
  321. window.location.reload();
  322. });
  323. }).error(function(xhr,errorText,errorType){
  324. layer.msg(errorType, {icon:2, time: 3000},function () {
  325. $("button").removeAttr("disabled");
  326. });
  327. });
  328. })
  329. })
  330. <?php echo '</script'; ?>
  331. >
  332. </body>
  333. </html><?php }
  334. }