项目

一般

简介

B1.html

苏 正成, 2018-11-29 11:32

 
1
<!DOCTYPE html>
2
<html>
3
<head lang="en">
4
    <meta charset="GB2312">
5
    <title></title>
6
    <link href="css/style.css" title="style" rel="stylesheet" type="text/css" />
7
    <script src="js/jquery-1.6.3.min.js"></script>
8

    
9
</head>
10
<body style="background: #F3F3F3">
11
<div>
12
<table width='100%' class="ofBTN">
13
    <tr><td style='border: none'> <h1>?豸????</h1></td></tr>
14
    <tr><td style='width: 200px;'>?Զ?????</td><td><a class="gray" zt="1" op="zdkzBtn" href="javascript:void(0)">????</a><a op="zdkzBtn" style="margin-left: 10px;" zt="0" class="gray" href="javascript:void(0)">?ر?</a><span style="line-height: 35px;background: #F3F3F3"> <span id="msgg" style="margin-left: 50px">?ֶ?????ǰ??ر??Զ?????</span></span></td></tr>
15
    <tr><td style='width: 200px;'>DO3</td><td><a id="aon3" class="gray" zt="1" op="jdc3Btn" href="javascript:void(0)">????</a><a id="aoff3" op="jdc3Btn" style="margin-left: 10px;" zt="0" class="gray" href="javascript:void(0)">?ر?</a></td></tr>
16
    <tr><td style='width: 200px;'>DO2</td><td><a id="aon2" class="gray" zt="1" op="jdc2Btn" href="javascript:void(0)">????</a><a id="aoff2" op="jdc2Btn" style="margin-left: 10px;" zt="0" class="gray" href="javascript:void(0)">?ر?</a></td></tr>
17
    <tr><td style='width: 200px;'>DO1</td><td><a id="aon1" class="gray" zt="1" op="jdc1Btn" href="javascript:void(0)">????</a><a id="aoff1" op="jdc1Btn" style="margin-left: 10px;" zt="0" class="gray" href="javascript:void(0)">?ر?</a></td></tr>
18
</table>
19
</div>
20
<a href='javascript:history.back()' class='back' style='color: #fff'>????</a>
21
<script>
22
$(function(){
23
 
24
    var arr=["green","redd"];
25
    $("a[op=zdkzBtn]").live("click",function(){
26
         var s="?Ƿ?ȷ?????????ƣ?";
27
  if(!confirm(s))
28
    return;
29
              var i=$("a[op=zdkzBtn]").index(this);
30
        $("a[op=zdkzBtn]:eq("+i+")").attr("class",arr[i]).siblings().attr("class","gray");
31
        var q=$(this).attr("zt");
32
        ajaxBtnof(3,q);
33
        if(i==0){
34
            $("#msgg").html("")
35
        }else{
36
            $("#msgg").html("??ʾ??<span  style='color: red;'>?Զ??????Ѿ??رգ?</span>?˳???ҳ??ǰ??ȷ?? ?? ?Զ????ƣ??????Զ?????ʧЧ??")
37
        }
38
    });
39
    $("a[op=jdc1Btn]").live("click",function(){
40
         var s="?Ƿ?ȷ?????????ƣ?";
41
  if(!confirm(s))
42
    return;
43
        var i=$("a[op=jdc1Btn]").index(this);
44
        $("a[op=jdc1Btn]:eq("+i+")").attr("class",arr[i]).siblings().attr("class","gray");
45
        var q=$(this).attr("zt");
46
        ajaxBtnof(1,q)
47
    });
48
    $("a[op=jdc2Btn]").live("click",function(){
49
         var s="?Ƿ?ȷ?????????ƣ?";
50
  if(!confirm(s))
51
    return;
52
        var i=$("a[op=jdc2Btn]").index(this);
53
        $("a[op=jdc2Btn]:eq("+i+")").attr("class",arr[i]).siblings().attr("class","gray");
54
        var q=$(this).attr("zt");
55
        ajaxBtnof(2,q)
56
    });
57
    $("a[op=jdc3Btn]").live("click",function(){
58
         var s="?Ƿ?ȷ?????????ƣ?";
59
  if(!confirm(s))
60
    return;
61
        var i=$("a[op=jdc3Btn]").index(this);
62
        $("a[op=jdc3Btn]:eq("+i+")").attr("class",arr[i]).siblings().attr("class","gray");
63
        var q=$(this).attr("zt");
64
        ajaxBtnof(4,q)
65
    });
66
    ajaxSt();
67
});
68

69
function ajaxSt(){
70
    $.ajax({
71
        type: "POST",
72
        url: "omdev/smdat0.asp",
73
        data: "itype=2304&sid=0",
74
        dataType:"json",
75
        success: function(msg){
76
            updSt(msg);
77
        }
78
    });
79
}
80
function updSt(data){
81
    $.each(data.recs,function(i,n){
82
        if (n.D09==1)
83
        {
84
            $("#aon1").attr("class","green");
85
            $("#aoff1").attr("class","gray");
86
        }
87
        else
88
        {
89
            $("#aon1").attr("class","gray");
90
            $("#aoff1").attr("class","redd");
91
        }
92
        if (n.D10==1)
93
        {
94
            $("#aon2").attr("class","green");
95
            $("#aoff2").attr("class","gray");
96
        }
97
        else
98
        {
99
            $("#aon2").attr("class","gray");
100
            $("#aoff2").attr("class","redd");
101
        }
102
        if (n.D11==1)
103
        {
104
            $("#aon3").attr("class","green");
105
            $("#aoff3").attr("class","gray");
106
        }
107
        else
108
        {
109
            $("#aon3").attr("class","gray");
110
            $("#aoff3").attr("class","redd");
111
        }
112
    });
113
}
114

115
function ajaxBtnof(wParam,lParam){
116
    $.ajax({
117
        type: "POST",
118
        url: "action/doctrl",
119
        data: "op="+wParam+"&value="+lParam+"",
120
        dataType: "json",
121
        success: function(msg){
122
            alert("ok!");
123
        }
124
    });
125
}
126
</script>
127
</body>
128
</html>