yzh
2022-03-14 1fbfe94790a03ab58ac8dee37f5095ff611ec3d8
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gwspupdate.aspx.cs" Inherits="_GwSpUpdate" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="renderer" content="webkit" /><meta http-equiv="Cache-Control" content="no-siteapp" />
<title>GWSPUPDATE</title>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet" /><link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet" />
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet" /><link href="css/animate.min.css" rel="stylesheet" />
    <link href="css/style.min862f.css?v=4.1.0" rel="stylesheet" /><link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet" />
    <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet" /><link href="css/jquery.numberedtextarea.css" rel="stylesheet" />
    <script src="js/loading.js" type="text/javascript"></script>
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/json.js"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
    <script src="js/plugins/iCheck/icheck.min.js"></script>
    <script src="js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
    
    <!--下面这里的JS在调试的时候要注意一下,前面需要加/web/ 例如 src="/web/js/jquery-loading.js" -->
    <!--发布版本的时候,不需要加/web/-->
    <script type="text/javascript" src="js/jquery-loading.js"></script>
    <script type="text/javascript" src="js/jquery-form.js"></script>
    <script type="text/javascript" src="js/jquery.numberedtextarea.js"></script>
    <script type="text/javascript" src="js/mytek-pager.js"></script>
    <script src="js/mytek-pagination.js?r=11" type="text/javascript"></script>
    
    <style>
        body { font-size: 12px; color: #111111; }
        .mask { position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777; z-index: 1002; left: 0px; opacity: 0.5; -moz-opacity: 0.5; text-align: center; display: none; }
        .mask span { height: 70%; display: inline-block; vertical-align: middle; }
        .mask span img { vertical-align: middle; }
    </style>
    <script>
        (function ($) {
            $.ajaxBak = $.ajax;
 
            $.ajax = function (options) {
                options.timeout = 300000;
                options.url = options.url + (options.url.indexOf("?") > 0 ? "&" : "?") + "r=" + Math.random();
 
                options.complete = function (e) {
                    $("body").hideLoading();
                }
 
                if (options.showloading !== false) {
                    $("body").showLoading();
                }
 
                try {
                    return $.ajaxBak.call(this, options);
                } catch (e) {
                    if (options.showloading !== false) {
                        $("body").hideLoading();
                    }
                }
                return this;
            }
        })(jQuery);
 
       $(document).ready(function(){
            $(".icheck-me").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});
            $(".input-group.date").datepicker({todayBtn:"linked",keyboardNavigation:!1,forceParse:!1,calendarWeeks:!0,autoclose:!0});
            $("[data-toggle='tooltip']").tooltip();
            $("[data-toggle=popover]").popover()
       });
    </script>
    
    <script>
           $(document).ready(function () {
            $(".action-back").on("click",function(){
                history.go(-1);
            });
 
          $("#accessCodeMode").on("change",function(){
        var accessCodeMode =$("#accessCodeMode").val();
 
          if(accessCodeMode==1)
          {
          $("#DiverterID").attr("disabled",true);
          }else{
           $("#DiverterID").attr("disabled",false); 
          }
          })
 
         var enabled=$("#enabled").val();
         if(enabled==1)
         {
         $("#control_patterncontent").show();
         }else
         {
         $("#control_patterncontent").hide();
         }
          $("#enabled").on("change",function(){
              var enabled=$(this).val();
              if(enabled==1)
              {
              $("#control_patterncontent").show();
              }else{
              $("#control_patterncontent").hide();
              }
          });
 
 
                  var resendEnabled = $("#resendEnabled").val();
                  if (resendEnabled == 1) {
                      $("#control_resendContent").show();
                  } else {
                      $("#control_resendContent").hide();
                  }
                  $("#resendEnabled").on("change", function () {
                      var resendEnabled = $(this).val();
                      if (resendEnabled == 1) {
                          $("#control_resendContent").show();
                      } else {
                          $("#control_resendContent").hide();
                      }
                  });
 
 
 
          var signatureMode=$("#signatureMode").val();
               if(signatureMode!=0)
              {
              $("#signatures-msg").show();
              }else{
              $("#signatures-msg").hide();
              }
          $("#signatureMode").on("change",function(){
              var signatureMode=$(this).val();
               if(signatureMode!=0)
              {
              $("#signatures-msg").show();
              }else{
              $("#signatures-msg").hide();
              }
          })
 
          $("#DiverterID").on("change",function(){
                var accessCodeMode =$("#accessCodeMode").val();
                
                if(accessCodeMode==1)
                {
                $("#RouterTypedisabled").attr("disabled",true);
                }else
                {
                  $("#RouterType").attr("disabled",false);
                }
 
          })
 
            $("#RouterType").on("change",function(){
                $(".router-type-span").hide();
                $(".router-type-span-" + $(this).val()).show();
            });
                     
            $("#RouterType").trigger("change");
 
            function toggleTarget(value, target) {
                if (value) {
                    $(target).show();
                }
                else {
                    $(target).hide();
                }
            }
 
            function randomString(len) {
                len = len || 32;
                var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
                var maxPos = $chars.length;
                var pwd = '';
                for (i = 0; i < len; i++) {
                pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
                }
                return pwd;
            }
 
            Array.prototype.find = function (func) {
                for (var i = 0; i < this.length; i++) {
                    if (func(this[i])) {
                        return this[i];
                    }
                }
            }
  var serverIp =<%=Newtonsoft.Json.JsonConvert.SerializeObject(ConfigurationManager.AppSettings["serverIp"])%>;
  var apList =<%=Newtonsoft.Json.JsonConvert.SerializeObject(this.ApList)%>;
  var opList =<%=Newtonsoft.Json.JsonConvert.SerializeObject(this.OpList)%>;
  var diverterList =<%=Newtonsoft.Json.JsonConvert.SerializeObject(this.DiverterList)%>;
 
            function getAPAccessCode(apId,extNo) {
                var item = apList.find(function(e){return e.ApID == apId;});
 
                if(item == null) {
                    return "接入点配置不正确";
                }
 
                var accessCodes = item.AccessCode.split("|");
                var output = [];
                for(var n = 0 ; n < accessCodes.length ; n ++) {
                    output.push(accessCodes[n] + extNo);
                }
 
                return output.join("或者");
            }
 
            function getAPPort(apId) {
                    var item = apList.find(function(e){return e.ApID == apId;});
 
                if(item == null) {
                    return "接入点配置不正确";
                }
 
                return item.ApPort;
            }
 
            function getOPAccessCode(opId,extNo) {
                var item = opList.find(function(e){return e.OpID == opId;});
 
                if(item == null) {
                    return "通道配置不正确";
                }
 
                return item.AccessCode  + extNo;
            }
 
            $(".action-more-params").on("click",function(){
                $("#MoreParamsTable").toggle();
            });
 
            $(".generatorPassword").on("click",function(){
                var forTarget = $("#" + $(this).attr("for"));
                forTarget.val(randomString(6));
            });
 
            toggleTarget($("#AuditingMode")[0].value == 1 || $("#AuditingMode")[0].value == 2, "#deductSpan");
 
            $(".action-create-summary").on("click",function(){
             $("#chargeDialog").modal("show");
                createSpSummary();
            });
 
            function createSpSummary() {
                var apID = $("#ApID").val();
                var apName = $("#ApID  option:selected").text();
                var spID = $("#SpID").val();
                var unopID = $("#UNOPID").val();
                var ctopID = $("#CTOPID").val();
                var cmopID = $("#CMOPID").val();
                var extNo = $("#AccessCode").val();
                var clientIP  =$("#ClientIp").val();
                var password = $("#Password").val();
                var threshold = $("#Threshold").val();
                var maxConn  =$("#MaxConnCount").val();
                var mcpm = $("#MCPM").val();
                var diverterID = $("#DiverterID").val();
 
                var summary = [];
                var basePort =  getAPPort(apID);
                summary.push("<table class='table table-striped table-bordered table-hover'>");
                if(apID == 230002)
                {
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("接入方式1:SOAP57-HTTP协议(0214-SMS-软维SOAP接口)");
                    summary.push("</td>");
                    summary.push("</tr>");
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("WSDL地址:http://" + serverIp + ":" + basePort + "/sms?wsdl");
                    summary.push("</td>");
                    summary.push("</tr>");
 
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("接入方式2:HTTP-57SMS协议(0169-SMS-软维接口-HTTP)");
                    summary.push("</td>");
                    summary.push("</tr>");
                    summary.push("<tr>");
                    summary.push("<td>");
                    var httpBaseUrl = "http://" + serverIp + ":" + (basePort+2) + "/sms";
                    summary.push("下发地址:" + httpBaseUrl + "?action=send");
                     summary.push("<td>");
                     summary.push("</tr>");
                     summary.push("<tr>");
                      summary.push("<td>");
                     summary.push("报告地址:" + httpBaseUrl + "?action=report");
                      summary.push("</td>");
                     summary.push("</tr>");
                     summary.push("<tr>");
                     summary.push("<td>");
                     summary.push("上行地址:" + httpBaseUrl + "?action=mo");
                     summary.push("</td>");
                     summary.push("</tr>");
                     summary.push("<tr>");
                     summary.push("<td>");
                     summary.push("余额地址:" + httpBaseUrl + "?action=overage");
                     summary.push("</td>");
                     summary.push("</tr>");
                     summary.push("<tr>");
                     summary.push("<td>");
                     summary.push("以上两种接入方式可任选其一");
                     summary.push("</td>");
                     summary.push("</tr>");
                }
                else if(apID==230001) 
                {
                     summary.push("<tr>");
                     summary.push("<td>");
                     summary.push("接入方式:CMPP2.0");
                     summary.push("</td>");
                     summary.push("</tr>");
                     summary.push("<tr>");
                     summary.push("<td>");
                    summary.push("服务器地址:" +serverIp);
                    summary.push("</td>");
                    summary.push("</tr>");
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("服务器端口:" + basePort);
                    summary.push("</td>");
                     summary.push("</tr>");
                } else {
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("接入方式:SMPP3.3");
                    summary.push("</td>");
                    summary.push("</tr>");
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("服务器地址:" +serverIp);
                    summary.push("</td>");
                    summary.push("</tr>");
                    summary.push("<tr>");
                    summary.push("<td>");
                    summary.push("服务器端口:" + basePort);
                    summary.push("</td>");
                    summary.push("</tr>");
                }
 
                summary.push("");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("账号:" + spID);
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("密码:"  + password);
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("接入码:" +  getAPAccessCode(apID,extNo));
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("最大流量:" +  threshold + "条/秒");
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("最大连接数:" +  maxConn);
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("单号码最大下发次数:" +  mcpm + "次/半小时");
                summary.push("</td>");
                summary.push("</tr>");
 
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("客户绑定IP:" + (clientIP == "0.0.0.0" || !clientIP ? "不验证" : clientIP));
                summary.push("</td>");
                summary.push("</tr>");
 
                if(diverterID > 0)
                {
                    var diverter = diverterList.find(function(e){return e.DiverterID == diverterID;});
                    if(diverter != null)   {
                        var diverterItems = $.evalJSON(diverter.Content);
                        $.each(diverterItems,function(i){
                             summary.push("<tr>");
                             summary.push("<td>");
                            summary.push("当匹配关键字:" + this.Keywords + (this.SmMaxLength > 0  ?  "或者短信字数<=" + this.SmMaxLength+"字符" : "") +   (this.SmMinLength > 0 ? "或者短信字数>=" + this.SmMinLength +"字符" : ""));
                            summary.push("</td>");
                            summary.push("</tr>");
                            summary.push("<tr>");
                            summary.push("<td>");
                            summary.push("电信发送号码:" + getOPAccessCode(this.CTOPID,this.CTExtNo + extNo));
                            summary.push("</td>");
                            summary.push("</tr>");
                            summary.push("<tr>");
                            summary.push("<td>");
                            summary.push("移动发送号码:" + getOPAccessCode(this.CMOPID,this.CMExtNo + extNo));
                            summary.push("</td>");
                            summary.push("</tr>");
                            summary.push("<tr>");
                            summary.push("<td>");
                            summary.push("联通发送号码:" + getOPAccessCode(this.CUOPID,this.CUExtNo + extNo));
                            summary.push("</td>");
                            summary.push("</tr>");
                           
                        });
                    }
                }
 
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("默认情况下:");
                summary.push("电信发送号码:" + getOPAccessCode(ctopID,extNo));
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("移动发送号码:" + getOPAccessCode(cmopID,extNo));
                summary.push("</td>");
                summary.push("</tr>");
                summary.push("<tr>");
                summary.push("<td>");
                summary.push("联通发送号码:" + getOPAccessCode(unopID,extNo));
                 summary.push("</td>");
                summary.push("</tr>");
                summary.push("</table>");
                 $(".action-modal-body").html(summary.join("\r\n"));
//               mytek.alert(summary.join("\r\n"),"success");
            }
               
            $(".action-save").on("click",function(){
                $(this).parents("form").ajaxSubmit({
                    success: function(r){
                    if(r.OK)
                    {
                        mytek.alert(r.Message,r.OK,function(){
                                    window.location="GwSp.aspx";
                        });
                        }else
                        {
                        mytek.alert(r.Message);
                        }
                    }
                });
            }); 
           });
 
        function mySpIDAccessCode(obj) {    
            obj.value = obj.value.replace(/[^0-9]/g, '');
        }
    </script>
</head>
<body class="white-bg">
     
    <div class="wrapper wrapper-content table-responsive">
        
    <form name="GwSpForm" method="post" action="gwsp.ashx" id="GwSpForm" enctype="multipart/form-data" class="form-horizontal">
    <div class="ibox">
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th colspan="4">
                       <%=ActionTitle%> 编辑账户
                    </th>
                </tr>
            </thead>
            <tr>
                <th>
                    状态
                </th>
                <td colspan="3">
                    
                    <select name="Status" id="Status">
                        <option value="0" <%if(GwSp.Status==0){ %>selected<%} %>>停用</option>
                        <option value="1" <%if(GwSp.Status==1){ %>selected<%} %>>启用</option>
                    </select>
                    
                </td>
            </tr>
            <tr>
                <th>
                    SPID:
                </th>
                <td>
                     
                    <%if (!string.IsNullOrEmpty(this.SpID))
                      { %>
                    <%=GwSp.SpID%>
                    <input type="hidden" name="SpID" id="SpID" maxlength="6" value="<%=GwSp.SpID%>" />
                    <input type="hidden" name="Action" id="Action" maxlength="6" value="update" />
                    <%}
                      else
                      {%>
                    <input type="hidden" name="Action" id="Action" maxlength="6" value="add" />
                    <input type="text" name="SpID" id="SpID" maxlength="6" value="" />
                    <%} %>
                    <span class="highlight">*</span> 6位数字,如922001
                    
                    
                </td>
                <th>
                    所属客户:
                </th>
                <td>
                    <select name="ClientID" id="ClientID">
                        <%=GetClientOptions(GwSp.ClientID)%>
                    </select>
                    <span class="highlight">*</span>
                </td>
            </tr>
            <tr>
                <th>
                    审核模式:
                </th>
                <td colspan="3">
                    <select name="AuditingMode" onchange="toggleTarget(this.value==1 || this.value==2,'#deductSpan');"
                        id="AuditingMode">
                        
                        
  <option value="0" <%if(GwSp.AuditingMode==0){ %>selected<%} %>>免审模式(所有信息直接通过,不需要审核(MA:0002))</option>
  <option value="1" <%if(GwSp.AuditingMode==1){ %>selected<%} %>>手工审核模式(只检查拦截策略,拦截则进行“拒绝模式判断”,否则以“手工审核”状态进入待审核)</option>
            
  <option value="2" <%if(GwSp.AuditingMode==2){ %>selected<%} %>>内容报备优先,拦截直接拒绝(先检查内容是否报备,报备则直接通过;否则进行拦截策略判断,不通过则直接产生拒绝报告(MA:0030),通过则进行“拒绝模式判断”)</option>
  <option value="3" <%if(GwSp.AuditingMode==3){ %>selected<%} %>>拦截策略+内容报备(先检查拦截策略,不通过则直接产生拒绝报告(MA:0024);否则继续检查内容是否报备,内容已报备,则直接通过,未报备则进行“拒绝模式判断”)</option>
 <option value="4" <%if(GwSp.AuditingMode==4){ %>selected<%} %>>内容报备优先,拦截写入待审核(先检查内容是否报备,报备则直接通过;否则进行拦截策略判断,不通过写待审核,通过则进行“拒绝模式判断”)</option>
   <option value="5" <%if(GwSp.AuditingMode==5){ %>selected<%} %>>报备优先+免审(报备直接通过;未被拦截直接通过;未报备被拦截写入待审核)
                        </option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>
                    拒绝模式:
                </th>
                <td>
                    <input type="checkbox" value="1" name="RejectIfForbidden" id="RejectIfForbidden"
                         <%=GwSp.RejectIfForbidden==1 ? "checked" : ""%> />是否直接拒绝非正常短信(时段异常/关键字拦截),否则该消息将作为待二次审核存入数据库
                </td>
                <th>
                    &nbsp; 拦截策略:
                </th>
                <td> 
                    <select name="StrategyId" id="StrategyId">
                        <%=GetStrategyOptions(GwSp.StrategyID)%>
                    </select>
                    
                    <span class="highlight">* 信息中如果包含拦截策略关键词,则转到待审核内容中待二次鉴定</span>
                </td>
            </tr>
            <tr>
                <th>
                    接入码鉴权模式:
                </th>
                <td colspan="3">
                    <select name="accessCodeMode" id="accessCodeMode">
                        <option value="0" selected>虚拟接入模式(接入点的接入码+网关账号扩展号)</option>
                        <option value="1" >通道直连模式(上级通道接入码+网关账号扩展号, 通道直连模式下群发、导流策略、通道组不可用)</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>
                    导流策略:
                </th>
                <td colspan="3">
                  
                    
                     <select name="DiverterID" id="DiverterID">
                        <%=GetDiverterOptions(GwSp.DiverterID)%>
                    </select>
                    
                    
                    <span class="highlight DiverterIDhighlight">*</span>
                </td>
            </tr>
            <tr>
                <th>验证码分流:</th>
                <td><input type="checkbox" value="1" name="VerCodeMode" id="VerCodeMode" <%=GwSp.VerCodeMode==1? "checked":"" %> />&nbsp;是否分流验证码类短信(验证码/校验码...)</td>
                <th>省网分流:</th>
                <td><input type="checkbox" value="1" name="ProvincialNetworkMode" id="ProvincialNetworkMode" <%=GwSp.ProvincialNetworkMode==1? "checked":"" %> />&nbsp;是否启用省网分流</td>
            </tr>
            
            <tr>
                <th>
                    客户接入协议: &nbsp;&nbsp;
                </th>
                <td>
                    
                    <select name="ApID" id="ApID">
                        <%=GetAPOptions(GwSp.ApID)%>
                    </select>
                    
                    
                </td>
                <th>
                    长短信合并模式:&nbsp;&nbsp;
                </th>
                <td>
                    <select name="CombinationMode" id="CombinationMode">
                      
              <%   
                  
                 __w.Write("<option value=\"0\" ");       
                if (this.GwSp.CombinationMode == 0)
                   __w.Write("selected");
                 __w.Write(">不合并</option>\r\n   <option value=\"1\" ");
               if (this.GwSp.CombinationMode == 1)
                   __w.Write("selected");
               __w.Write(">合并分条短信(合并客户提交带UDHI头的短信)</option>\r\n    ");
        %> 
                    </select>
                    
                    
                    
                    
                </td>
            </tr>
            <tr>
                <th>
                    通道信息:
                </th>
                <td colspan="3">
                
                    
                     <select name="RouterType" id="RouterType">
                        <option value="1" <%if(GwSp.RouterType==1){ %>selected<%} %>>指定通道路由</option>
                        <option value="3" <%if(GwSp.RouterType==3){ %>selected<%} %>>通道组路由模式</option>
                    </select>
                    
                    
                    <div class="router-type-span router-type-span-1">
                        <div style="padding: 5px">
                            移动:<select name="CMOPID" id="CMOPID">
                                 <%=GetOpOptions(GwSp.CMOPID)%>
                            </select>&nbsp;&nbsp; 扩展参数:<input type="text" name="CMparams" id="CMparams" maxlength="600"
                                value="<%=GwSp.CMextparms%>" style="width: 50%;" />
                        </div>
                        <div style="padding: 5px">
                            联通:<select name="UNOPID" id="UNOPID">
                                 <%=GetOpOptions(GwSp.UNOPID)%>
                             </select>&nbsp;&nbsp; 扩展参数:<input type="text" name="CDparams" id="CDparams" maxlength="600"
                                value="<%=GwSp.CUextparams%>" style="width: 50%;" />
                        </div>
                        <div style="padding: 5px">
                            电信:<select name="CTOPID" id="CTOPID"> 
                                   <%=GetOpOptions(GwSp.CTOPID)%>
                            </select>&nbsp;&nbsp; 扩展参数:<input type="text" name="CTparams" id="CTparams" maxlength="600"
                                value="<%=GwSp.CTextparams%>" style="width: 50%;" />
                        </div>
                    </div>
                    <div class="router-type-span router-type-span-3">
                        <div style="padding: 5px">
                            <label class="control-label ">
                                移动通道组</label>
                            <select name="CmGroupID" id="CmGroupID">
 
                             <%=GetOpGroupOptions(GwSp.CMGroupID) %>
                             </select></div>
                        <div style="padding: 5px">
                            <label class="control-label ">
                                联通通道组</label>
                            <select name="CuGroupID" id="CuGroupID">
                            
                             <%=GetOpGroupOptions(GwSp.CUGroupID)%>
                                </select></div>
                        <div style="padding: 5px">
                            <label class="control-label">
                                电信通道组</label>
                            <select name="CtGroupID" id="CtGroupID">
                            <%=GetOpGroupOptions(GwSp.CTGroupID)%>
                             </select></div>
                    </div>
                    <span class="router-type-span router-type-span-2">按“目的号码段路由”,当目的号码段无法找到相应路由时,将以下设置的“通道”路由</span>
                </td>
            </tr>
            <tr>
                <th>
                    密码:
                </th>
                <td colspan="3">
                    <input type="text" name="Password" id="Password" style="width: 150px;" maxlength="50"
                        value="<%=GwSp.Password%>" />
                    <a href="javascript:;" class="generatorPassword" for="Password">生成密码</a>
                </td>
            </tr>
            <tr>
                <th>
                    是否允许扩展子号:
                </th>
                <td>
                    <select name="extnoExteNsionMode" id="extnoExteNsionMode">
                   
                        <option value="0" <%if(GwSp.ExtnoExtensionMode==0){ %>selected<%} %>>允许客户在扩展号后继续扩展子号</option>
                        <option value="1" <%if(GwSp.ExtnoExtensionMode==1){ %>selected<%} %>>禁止客户在扩展号后继续扩展子号(短信不再校验扩展号,而使用固定的扩展号进行下发)</option>
                    </select>
                    
                </td>
                <th>
                    扩展号:
                </th>
                <td>
                    &nbsp;<input type="text" name="AccessCode" id="AccessCode" style="width: 150px;"
                        maxlength="16" onkeyup="mySpIDAccessCode(this)" value="<%=GwSp.AccessCode%>" />
                    <span class="highlight"></span>只能填数字
                </td>
            </tr>
            <tr>
                <th>
                    客户端IP:
                </th>
                <td>
                    <input type="text" name="ClientIp" id="ClientIp" style="width: 250px;" maxlength="500"
                        value="<%=GwSp.ClientIp%>" />
                    0.0.0.0 表示不限制客户端IP地址,多个IP 用英文竖线“|”隔开
                </td>
                <th>
                    客户端端口:
                </th>
                <td>
                    <input type="text" name="ClientPort" id="ClientPort" style="width: 50px;" maxlength="5"
                        value="<%=GwSp.ClientPort%>" onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                        oncontextmenu="return false" />&nbsp;如不限定客户端口,则默认0
                </td>
            </tr>
            <tr>
                <th>
                    单价:
                </th>
                <td>
                    <input type="text" name="Price" id="Price" style="width: 50px;" maxlength="5" value="<%=(double)GwSp.Price/1000%>"
                        onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                        oncontextmenu="return false" />
                    元/条<span class="highlight">*</span>
                </td>
                <th>
                    优先级:
                </th>
                <td>
                    <select name="Priority" id="Priority">
                      
                        
                        <option value="-2" <%if(GwSp.Priority==-2){ %>selected<%} %>>最低</option>
                        <option value="-1" <%if(GwSp.Priority==-1){ %>selected<%} %>>低</option>
                        <option value="0" <%if(GwSp.Priority==0){ %>selected<%} %>>普通</option>
                        <option value="1" <%if(GwSp.Priority==1){ %>selected<%} %>>高</option>
                        <option value="2" <%if(GwSp.Priority==2){ %>selected<%} %>>最高</option>
                        
                    </select>
                    <span class="highlight">*</span>
                </td>
            </tr>
            <tr>
                <th>
                    余额告警阈值:
                </th>
                <td>
                    <input type="text" name="BalanceThreshold" id="BalanceThreshold" style="width: 200px;"
                        maxlength="10" value="<%=GwSp.BalanceThreshold/1000%>" onkeyup="value=value.replace(/[^\d]/g,'')"
                        onpaste="value=value.replace(/[^\d]/g,'')" oncontextmenu="return false" />
                    元
                </td>
                <th>
                    余额告警号码:
                </th>
                <td>
                    <input type="text" name="AlarmMobile" id="AlarmMobile" style="width: 200px;" maxlength="50"
                        value="<%=GwSp.AlarmMobile%>" />
                </td>
            </tr>
            <tr>
                <th>
                    门限(账号提交速度):
                </th>
                <td>
                    <input type="text" name="Threshold" id="Threshold" style="width: 50px;" maxlength="5"
                        value="<%=GwSp.Threshold%>" onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                        oncontextmenu="return false" />条/每秒 <span class="highlight">*</span>
                </td>
                <th>
                    付费方式:
                </th>
                <td>
                    <select name="ChargeType" id="ChargeType">
                      
                         <option value="1" <%if(GwSp.ChargeType==1){ %>selected<%} %>>预付费</option>
                        <option value="2" <%if(GwSp.ChargeType==2){ %>selected<%} %>>后付费</option>
                        
                    </select>
                    <span class="highlight">*</span>
                </td>
            </tr>
            <tr>
                <th>
                    最大连接数:
                </th>
                <td>
                    <input type="text" name="MaxConnCount" id="MaxConnCount" style="width: 150px;" maxlength="2"
                        onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                        oncontextmenu="return false" value="<%=GwSp.MaxConnCount%>" />
                </td>
                <th>
                    允许时段:
                </th>
                <td>
                    <input type="text" name="TimePermitting" id="TimePermitting" style="width: 150px;"
                        maxlength="50" value="<%=GwSp.TimePermitting%>" />
                    &nbsp;格式如:(08:00-19:00)
                </td>
            </tr>
            <tr>
                <th>
                    全局黑名单 :
                </th>
                <td>
                    <select id="BlackMode" name="BlackMode">
                      
                        <option value="1" <%if(GwSp.BlackMode==1){ %>selected<%} %>>生效</option>
                        <option value="0" <%if(GwSp.BlackMode==0){ %>selected<%} %>>不生效</option>
                        
                    </select>
                </td>
                <th>是否启用携号转网</th>
                <td>
                    <select id="TransferFlag" name="TransferFlag">
                        <option value="0" <%if(GwSp.TransferFlag==0){ %>selected<%} %>>启用</option>
                        <option value="1" <%if(GwSp.TransferFlag==1){ %>selected<%} %>>不启用</option>
                    </select>
                </td>
 
            </tr>
            <tr>
                <th>
                    单号码下发次数
                </th>
                <td colspan="3" id="McExpression">
                    <div>
                        <input style="width: 50px;" type="text" name="MCPM1" id="MCPM1" maxlength="4" value="<%__w.Write(this.McCount(0, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/1分钟;
                        <input style="width: 50px;" type="text" name="MCPM2" id="MCPM2" maxlength="4" value="<%__w.Write(this.McCount(1, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/5分钟;
                        <input style="width: 50px;" type="text" name="MCPM3" id="MCPM3" maxlength="4" value="<%__w.Write(this.McCount(2, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/10分钟;
                        <input style="width: 50px;" type="text" name="MCPM4" id="MCPM4" maxlength="4" value="<%__w.Write(this.McCount(3, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/半小时;
                        <input style="width: 50px;" type="text" name="MCPM5" id="MCPM5" maxlength="4" value="<%__w.Write(this.McCount(4, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/1小时;
                        <input style="width: 50px;" type="text" name="MCPM6" id="MCPM6" maxlength="4" value="<%__w.Write(this.McCount(5, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/2小时;
                        <input style="width: 50px;" type="text" name="MCPM7" id="MCPM7" maxlength="4" value="<%__w.Write(this.McCount(6, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/4小时;
                        <input style="width: 50px;" type="text" name="MCPM8" id="MCPM8" maxlength="4" value="<%__w.Write(this.McCount(7, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条/12小时;
                        <input style="width: 50px;" type="text" name="MCPM9" id="MCPM9" maxlength="4" value="<%__w.Write(this.McCount(8, this.GwSp.McExpression));%>"
                            onkeyup="value=value.replace(/[^\d]/g,'')" onpaste="value=value.replace(/[^\d]/g,'')"
                            oncontextmenu="return false" />条24小时;
                    </div>
                    <div class="text-muted">
                        为零时表示该条件不生效</div>
                </td>
            </tr>
            <tr>
                <th>
                    强制签名
                </th>
                <td colspan="3">
                    <span class="highlight" style="margin-left: 5px;">只限于SMS57/SOAP57协议</span>
                    <div style="margin-top: 5px; margin-left: 5px;">
                        <select name="ForceSignFlag" id="ForceSignFlag" style="width: 70px;">
                        
                            
                            <option value="0" <%if(GwSp.ForceSignFlag==0){ %>selected<%} %>>停用</option>
                            <option value="1" <%if(GwSp.ForceSignFlag==1){ %>selected<%} %>>前置</option>
                            <option value="2" <%if(GwSp.ForceSignFlag==2){ %>selected<%} %>>后置</option>
                        </select>&nbsp;&nbsp;&nbsp;签名:<input type="text" name="ForceSign" id="ForceSign"
                            value="<%=GwSp.ForceSign%>" style="width: 40%" />
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    启用签名
                </th>
                <td colspan="3">
                    <select id="signatureMode" name="signatureMode">
                    
                         <option value="2" <%if(GwSp.SignatureMode==2){ %>selected<%} %>>校检前置签名</option>
                         <option value="1" <%if(GwSp.SignatureMode==1){ %>selected<%} %>>校检后置签名</option>
                         <option value="0" <%if(GwSp.SignatureMode==0){ %>selected<%} %>>不校检签名</option>
                         
                         
                       
                    </select>
                    <span class="highlight"></span>签名,每行一个签名,签名必须带“【】”,签名后面可以跟扩展号实现一客一签,其中扩展号必须以客户账号扩展号开头;例如“【签名1】1234”
                </td>
            </tr>
            <tr style="display: none;" id="signatures-msg">
                <th>
                    报备签名:
                </th>
                <td colspan="3">
                    <textarea name="signatures" id="signatures" style="width: 100%" cols="100" rows="8"><%__w.Write(this.GwSp.Signatures); %></textarea>
                </td>
            </tr>
            <tr>
                <th>是否开启内容报备 :
                </th>
                <td colspan="3">
                    <select id="enabled" name="enabled">
                        <%     
                            __w.Write("<option value=\"1\" ");
                            if (this.GetGwspEnabled(this.GwSp.SpID) == 1)
                                __w.Write("selected");
                            __w.Write(">开启免审内容报备</option>\r\n   <option value=\"0\" ");
                            if (this.GetGwspEnabled(this.GwSp.SpID) == 0)
                                __w.Write("selected");
                            __w.Write(">关闭免审内容报备</option>\r\n   ");
                        %>
                    </select><span class="highlight"></span>免审核报备内容,每行一条内容,“*” 号代替 0-10个字符,单行报备长度不要超过70字
                </td>
            </tr>
            <tr style="display: none;" id="control_patterncontent">
                <th>
                    内容报备:
                </th>
                <td colspan="3">
                    <textarea name="patternContent" id="patternContent" style="width: 100%" cols="100"
                        rows="8"><%__w.Write(this.GetGwspCtpattern(this.GwSp.SpID)); %></textarea>
                </td>
            </tr>
 
            <!-- 自动补发配置 -->
            <tr>
                <th>是否开启自动补发:
                </th>
                <td colspan="3">
                    <select id="resendEnabled" name="resendEnabled">
                        <%     
                            __w.Write("<option value=\"1\" ");
                            if (this.GwSp.RESEND_STATUS == 1)
                                __w.Write("selected");
                            __w.Write(">开启失败自动补发</option>\r\n   <option value=\"0\" ");
                            if (this.GwSp.RESEND_STATUS == 0)
                                __w.Write("selected");
                            __w.Write(">关闭失败自动补发</option>\r\n   ");
                        %>
                    </select><span class="highlight"></span>开启自动补发功能,失败的号码会自动从已配置的失败补发通道发送一次
                </td>
            </tr>
            <!--自动补发通道组配置显示-->
          <%--  <tr  style="display: none;" id="control_resendContent">
                <th>
                    通道组信息:
                </th>
                <td colspan="3">
                    <div>
                        <div style="padding: 5px">
                            <label class="control-label ">
                                移动-补发通道组</label>
                            <select name="ReSendCmGroupID" id="ReSendCmGroupID">
 
                             <%=GetOpGroupOptions(GwSp.RESEND_CM_GROUPID) %>
                             </select></div>
                        <div style="padding: 5px">
                            <label class="control-label ">
                                联通-补发通道组</label>
                            <select name="ReSendCuGroupID" id="ReSendCuGroupID">
                            
                             <%=GetOpGroupOptions(GwSp.RESEND_CU_GROUPID)%>
                                </select></div>
                        <div style="padding: 5px">
                            <label class="control-label">
                                电信-补发通道组</label>
                            <select name="ReSendCtGroupID" id="ReSendCtGroupID">
                            <%=GetOpGroupOptions(GwSp.RESEND_CT_GROUPID)%>
                             </select></div>
                    </div>
                </td>
            </tr>--%>
            <!-- 自动补发配置-end -->
 
            <tr>
                <th>
                    备注:
                </th>
                <td colspan="3">
                    <textarea name="Remark" id="Remark" style="width: 100%" cols="100" rows="8"><%=GwSp.Remark%></textarea>
                </td>
            </tr>
        </table>
        <div style="padding: 10px; text-align: right;">
            <a class="btn btn-primary action-save" href="javascript:;">保存</a> <a class="btn btn-default  action-back"
                href="javascript:;">返回</a>
            
        </div>
    </div>
    </form>
    <div class="modal inmodal fade" id="chargeDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog form-horizontal">
            <div class="modal-content animated ">
                <div class="modal-header">
                    <span class="title">账号摘要</span><a class="close" data-dismiss="modal" aria-hidden="true">×</a></div>
                <div class="modal-body action-modal-body" style="color: #797979; font-size: 16px;
                    font-weight: 300; position: relative; text-align: inherit; float: none; margin: 0px;
                    padding: 0px; line-height: normal;">
                </div>
                <div class="modal-footer">
                    <button class="btn-default btn" data-dismiss="modal" aria-hidden="true">
                        关闭</button>&nbsp;&nbsp;
                </div>
            </div>
        </div>
    </div>
 
        <div id="mask" class="mask">
            <span></span>
            <img src="img/spinning-circles.svg" alt="载入中..." /></div>
    </div>
</body>
</html>