<!DOCTYPE html>
<% language=javascript %>
<html>
<head lang="en">
    <meta charset="GB2312">
    <title></title>
    <link href="css/style.css" title="style" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.6.3.min.js"></script>

</head>
<body style="background: #F3F3F3">
<div class='type1536 empty' style='margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-leak1.png" style="width: 100%;text-align: center;"></td>
    <td>
    <table width='100%'>
        <tr><td style='border: none'> <h1 class='smName'></h1></td></tr>
        <!--<tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID1536'> </span></td></tr>-->
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd1536'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State1536'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td >设备类型:&nbsp;&nbsp;<span class='Kind1536'></span></td></tr>
        <tr><td >报警状态:&nbsp;&nbsp;<span class='Status1536'></span></td></tr>
	    <tr><td >灵敏度:&nbsp;&nbsp;<span class='Lmd1536'></span></td></tr>
	</table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=1539;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbLeak where SID="+sid,0); %>;
var jname = <% db_QryAdv("select Name from tbSM where SID="+sid,0); %>
<% db_Close(); %>
$(".smName").html(jname.recs[0].Name);

$(function(){
    time=setInterval(ajax,tescape)
});
function ajax(){
    $.ajax({
        type: "POST",
        url: "omdev/smdat0.asp",
        data: "itype="+itype+"&sid="+sid,
        dataType:"json",
        success: function(msg){
            list3(msg)
        }
    });
}
list3(json);
function list3(data){
    $.each(data.recs,function(i,n){
        if(n.Kind==0){n.Kind="不定位"}else if(n.Kind==1){n.Kind="定位式"}
        if(n.Status==0){n.Status="正常"}else if(n.Status==1){n.Status="泄露"}
        if(n.LineRB==0){n.LineRB="正常"}else if(n.LineRB==1){n.LineRB="断路"}
        if(n.LineYG==0){n.LineYG="正常"}else if(n.LineYG==1){n.LineYG="断路"}

        $(".SID1536").html(n.SID);
        $(".Addr1536").html(n.Addr);
        $(".Port1536").html(n.Port%256);
        $(".DateUpd1536").html(n.DateUpd);
        $(".State1536").html(window.parent.parseState(n.State));
        var Locate=n.Locate/13; var Cable=n.Cable/13;

        $(".Kind1536").html(n.Kind);
        $(".Status1536").html(n.Status);
        //$(".LineRB1536").html(n.LineRB);
        //$(".LineYG1536").html(n.LineYG);
        //$(".Locate1536").html(Locate.toFixed(2)+"米");
        $(".Lmd1536").html(n.Lmd);
        //$(".Cable1536").html(Cable.toFixed(2)+"米");
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('泄露')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>