<?php header('Access-Control-Allow-Origin: *');
?>

<?php
require_once './Mobile_Api/connection.php';
?>

<?php
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
if (!isset($_SESSION['username'])) {
    header("Location: ./login.php");
    exit;
}
?>


<html lang="en" class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers no-applicationcache svg inlinesvg smil svgclippaths"><head>
        <title>Dam Dashboard </title>


        <!--[if lt IE 10]>
              <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
              <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
              <![endif]-->

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="#">
        <meta name="keywords" content="Admin , Responsive, Landing, Bootstrap, App, Template, Mobile, iOS, Android, apple, creative app">
        <meta name="author" content="#">

        <link rel="icon" href="./files/assets/images/favicon.ico" type="image/x-icon">

        <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet">

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

        <link rel="stylesheet" type="text/css" href="./files/bower_components/bootstrap/dist/css/bootstrap.min.css">

        <link rel="stylesheet" type="text/css" href="./files/assets/icon/feather/css/feather.css">

        <link rel="stylesheet" type="text/css" href="./files/assets/css/style.css">
        <link rel="stylesheet" type="text/css" href="./files/assets/css/jquery.mCustomScrollbar.css">
        <style type="text/css">/* Chart.js */
            /*
             * DOM element rendering detection
             * https://davidwalsh.name/detect-node-insertion
             */
            @keyframes chartjs-render-animation {
                from {
                    opacity: 0.99;
                }
                to {
                    opacity: 1;
                }
            }

            .chartjs-render-monitor {
                animation: chartjs-render-animation 0.001s;
            }

            /*
             * DOM element resizing detection
             * https://github.com/marcj/css-element-queries
             */
            .chartjs-size-monitor,
            .chartjs-size-monitor-expand,
            .chartjs-size-monitor-shrink {
                position: absolute;
                direction: ltr;
                left: 0;
                top: 0;
                right: 0;
                bottom: 0;
                overflow: hidden;
                pointer-events: none;
                visibility: hidden;
                z-index: -1;
            }

            .chartjs-size-monitor-expand > div {
                position: absolute;
                width: 1000000px;
                height: 1000000px;
                left: 0;
                top: 0;
            }

            .chartjs-size-monitor-shrink > div {
                position: absolute;
                width: 200%;
                height: 200%;
                left: 0;
                top: 0;
            }

            /*            body {
                        background-image: url("./files/assets/img/aquarius.gif"), url("./files/assets/img/river1.gif");
                        background-color: #cccccc;
                        }*/
        </style>

        <script>
            setInterval(function () {
//                window.location.reload();
            }, 10000);
//            $(document).ready(function () {
//                feather.replace()
//            })



        </script>

        <!--<script src="https://kit.fontawesome.com/2bc8cc4aed.js" crossorigin="anonymous"></script>-->

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


    </head>
    <body themebg-pattern="pattern4">

        <div id="pcoded" class="pcoded iscollapsed" nav-type="st6" theme-layout="vertical" vertical-placement="left" vertical-layout="wide" pcoded-device-type="desktop" vertical-nav-type="expanded" vertical-effect="shrink" vnavigation-view="view1" fream-type="theme1" sidebar-img="false" sidebar-img-type="img1" layout-type="light">
            <div class="pcoded-overlay-box"></div>
            <div class="pcoded-container navbar-wrapper">
                <nav class="navbar header-navbar pcoded-header iscollapsed" header-theme="theme1" pcoded-header-position="fixed">
                    <div class="navbar-wrapper">
                        <div class="navbar-logo" logo-theme="theme1">
                            <a class="mobile-menu" id="mobile-collapse" href="#!">
                                <i class="fa fa-sliders"></i>
                            </a>
                            <a href="dam_home.php">
                                <img class="img-fluid" src="./files/assets/img/aquarius.gif" height="50px" width="50px" alt="Theme-Logo"> Dam Dashboard
                            </a>
                            <a class="mobile-options">
                                <i class="feather icon-more-horizontal"></i>
                            </a>
                        </div>

                        <?php
                        $notification = 0;

//                        $query = 'SELECT MAX(id) as id FROM `tbl_flow_meter_data` WHERE flag=1 GROUP BY user_id ORDER by id asc';
//                        mysqli_set_charset($con, 'utf8');
//                        $result = mysqli_query($con, $query);
//                        if (mysqli_num_rows($result) > 0) {
//                            $i = 1;
//                            while ($row = mysqli_fetch_assoc($result)) {
//
//                                $id = $row["id"];

                        $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.id=tfmd.flow_meter_id WHERE tfmd.flow_meter_id=' . $_SESSION['user_id'] . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';
//                                                                              
//                                $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.user_id=tfmd.user_id WHERE tfmd.id=' . $id . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';
//                                $query1 = 'SELECT twts.id,twts.user_id,twts.freez_temperature,twts.freez_humidity,twts.comment,DATE_FORMAT(twts.created_date,"%d-%m-%Y %H:%i:%s") AS created_date,DATE_FORMAT(twts.created_date,"%Y-%m-%d") AS days_date,tsu.full_name,tsu.mobile_no,ts.school_name,tv.village,tv.village_hindi,tv.village_guj FROM `tbl_freez_status` as twts LEFT join tbl_school_user as tsu on twts.user_id=tsu.id left join tbl_school as ts on tsu.school_id=ts.id left join tbl_village as tv on ts.village_id=tv.id where twts.flag=1 and twts.id=' . $id . ' order by twts.id DESC LIMIT 0,1';
//                                echo '$query1 ' . $query1;
                        mysqli_set_charset($con, 'utf8');
                        $result1 = mysqli_query($con, $query1);
                        if (mysqli_num_rows($result1) > 0) {
                            $i = 1;
                            while ($row1 = mysqli_fetch_assoc($result1)) {

                                $now = time(); // or your date as well
                                $your_date = strtotime($row1["days_date"]);
                                $datediff = $now - $your_date;

//                                                                                            echo round($datediff / (60 * 60 * 24));
                                $Days = round($datediff / (60 * 60 * 24));

                                if ($Days > 1) {
                                    $notification = $notification + 1;
                                }


                                if ($row1['water_level'] < 0) {
                                    $notification = $notification + 1;
                                }
//                                        else if ($row1['water_level'] < - 20) {
//                                            $notification = $notification + 1;
//                                        }
                            }
                        }
//                            }
//                        }
                        ?>

                        <div class="navbar-container">
                            <ul class="nav-right">
                                <li class="header-notification">
                                    <div class="dropdown-primary dropdown">
                                        <div class="dropdown-toggle" data-toggle="dropdown">
                                            <i class="fa fa-bell"></i>
                                            <span class="badge bg-c-pink"><?php // echo $notification;   ?></span>
                                        </div>
                                        <!--                                        <ul class="show-notification notification-view dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut" style="max-height: 550px;background: #b4cee7;overflow: auto">
                                                                                    <li>
                                        
                                        
                                        <?php
                                        if ($_SESSION['User_language'] == 'ENGLISH') {
                                            ?>
                                                                                                    <h6>Notifications</h6>
                                                                                                    <label class="label label-danger">New</label>
                                            <?php
                                        }

                                        if ($_SESSION['User_language'] == 'GUJARATI') {
                                            ?>
                                                                                                    <h6>સૂચનાઓ</h6>
                                                                                                    <label class="label label-danger">નવી</label>
                                            <?php
                                        }
                                        ?>
                                        
                                                                                    </li>
                                        
                                        <?php
                                        $offline = 0;
                                        $online = 0;

                                        $query = 'SELECT MAX(id) as id FROM `tbl_flow_meter_data` WHERE flag=1 GROUP BY user_id ORDER by id asc';
                                        mysqli_set_charset($con, 'utf8');
                                        $result = mysqli_query($con, $query);
                                        if (mysqli_num_rows($result) > 0) {
                                            $i = 1;
                                            while ($row = mysqli_fetch_assoc($result)) {

                                                $id = $row["id"];

                                                $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.user_id=tfmd.user_id WHERE tfmd.id=' . $id . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';
                                                mysqli_set_charset($con, 'utf8');
                                                $result1 = mysqli_query($con, $query1);
                                                if (mysqli_num_rows($result) > 0) {
                                                    $i = 1;
                                                    while ($row1 = mysqli_fetch_assoc($result1)) {

                                                        $now = time(); // or your date as well
                                                        $your_date = strtotime($row1["days_date"]);
                                                        $datediff = $now - $your_date;

//                                                                                            echo round($datediff / (60 * 60 * 24));
                                                        $Days = round($datediff / (60 * 60 * 24));

                                                        if ($Days > 1) {
                                                            $offline = $offline + 1;
                                                            ?>
                                                                                
                                                                                                                                                <li style="padding: 10px">
                                                                                                                                                    <div class="media view_school_tank_status" id="<?php echo $row1["user_id"]; ?>">
                                                                                                                                                        <img class="d-flex align-self-center img-radius" src="files/assets/img/aquarius.gif" alt="Generic placeholder image">
                                                                                                                                                        <div class="media-body">
                                                                                                                                                            <h5 class="notification-user"><?php echo $row1["meter_name"]; ?></h5>
                                                                                
                                                                                
                                                            <?php
                                                            if ($_SESSION['User_language'] == 'ENGLISH') {
                                                                ?>
                                                                                                                                                                        <p class="notification-msg view_school_tank_status" id="<?php echo $row1["user_id"]; ?>"><?php echo $row1["meter_name"]; ?> stop working last <?php echo $Days . " Days."; ?>
                                                                                                                                                                        </p>
                                                                <?php
                                                            }

                                                            if ($_SESSION['User_language'] == 'GUJARATI') {
                                                                ?>
                                                                                                                                                                        <p class="notification-msg view_school_tank_status" id="<?php echo $row1["user_id"]; ?>"><?php echo $row1["meter_name"]; ?> નું ફ્રિઝર છેલ્લા <?php echo $Days; ?> દિવસથી બંધ છે.
                                                                                                                                                                        </p>
                                                                <?php
                                                            }
                                                            ?>
                                                                                
                                                                                                                                                                                                                                                <span class="notification-time">30 minutes ago</span>
                                                                                                                                                        </div>
                                                                                                                                                    </div>
                                                                                                                                                </li>
                                                                                
                                                            <?php
                                                        } else {
                                                            $online = $online + 1;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        ?>
                                                                                </ul>-->
                                    </div>
                                </li>

                                <li class="header-notification">
                                    <div class="dropdown-primary dropdown">
                                        <div class="dropdown-toggle" data-toggle="dropdown">
                                            <i class="icon text-primary fa fa-language" style="font-size:26px;"></i>

                                            <?php
                                            if ($_SESSION['User_language'] == 'ENGLISH') {
                                                ?>
                                                <span>Change Language</span>
                                                <?php
                                            }
                                            if ($_SESSION['User_language'] == 'GUJARATI') {
                                                ?>
                                                <span>ભાષા બદલો</span>
                                                <?php
                                            }
                                            ?>
                                        </div>

                                        <ul class="show-notification notification-view dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut">
                                            <li>

                                                <?php
                                                if ($_SESSION['User_language'] == 'ENGLISH') {
                                                    ?>
                                                    <h6>Choose Language </h6>
                                                    <?php
                                                }

                                                if ($_SESSION['User_language'] == 'GUJARATI') {
                                                    ?>
                                                    <h6>ભાષા પસંદ કરો</h6>
                                                    <?php
                                                }
                                                ?>
                                                <label class="icon text-primary fa fa-language"></label>
                                            </li>
                                            <li>
                                                <div class="media">
                                                    <button onclick="btn_english()" type="button" tabindex="0" class="dropdown-item">
                                                        <span class="mr-3 opacity-8 flag large IND"></span><b> English </b>
                                                    </button>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="media">
                                                    <button onclick="btn_gujarati()" type="button" tabindex="0" class="dropdown-item" id="btn-gujarati">
                                                        <span class="mr-3 opacity-8 flag large CH"></span><b> GUJARATI </b>
                                                    </button>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </li>

                                <!--                                <div class="dropdown show">
                                                                    <button type="button" data-toggle="dropdown" class="p-0 mr-2 btn btn-link" aria-expanded="true">
                                                                        <span class="icon-wrapper icon-wrapper-alt rounded-circle">
                                                                            <span class="icon-wrapper-bg bg-focus"></span>
                                                                            <i class="icon text-primary fa fa-language"></i>
                                                                            <span class="language-icon opacity-8 large fa fa-globe"></span>
                                                                        </span>
                                                                    </button>
                                                                    <div tabindex="-1" role="menu" aria-hidden="true" class="rm-pointers dropdown-menu dropdown-menu-right show" x-placement="bottom-end" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(-198px, 46px, 0px);">
                                                                        <div class="dropdown-menu-header">
                                                                            <div class="dropdown-menu-header-inner pt-4 pb-4 bg-focus">
                                                                                <div class="menu-header-image opacity-05"></div>
                                                                                <div class="menu-header-content text-center text-white">
                                
                                
                                                                                    <h6 class="menu-header-subtitle mt-0"> Choose Language</h6>
                                
                                
                                
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <h6 tabindex="-1" class="dropdown-header"> Popular Languages</h6>
                                                                                                            <a onclick="btn_english()" class="nav-link">
                                                                                                                English 1
                                                                                                            </a>
                                                                        <a  class="nav-link">
                                                                        <button onclick="btn_english()" type="button" tabindex="0" class="dropdown-item">
                                                                            <span class="mr-3 opacity-8 flag large IND"></span> English
                                                                        </button>
                                                                        </a>
                                                                        <button onclick="btn_gujarati()" type="button" tabindex="0" class="dropdown-item" id="btn-gujarati">
                                                                            <span class="mr-3 opacity-8 flag large CH"></span> ગુજરાતી
                                                                        </button>
                                                                                                                <button onclick="btn_hindi()" type="button" tabindex="0" class="dropdown-item" id="btn-hindi">
                                                                                                                    <span class="mr-3 opacity-8 flag large FR"></span> हिन्दी
                                                                                                                </button>
                                                                    </div>
                                                                </div>-->

                                <li class="user-profile header-notification">
                                    <div class="dropdown-primary dropdown">
                                        <div class="dropdown-toggle" data-toggle="dropdown">
                                            <img src="./files/assets/images/profile.png" class="img-radius" alt="User-Profile-Image">
                                            <span><?php echo $_SESSION['username']; ?></span>
                                            <i class="fa fa-chevron-down"></i>
                                        </div>
                                        <ul class="show-notification profile-notification dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut">


                                            <?php
                                            if ($_SESSION['User_language'] == 'ENGLISH') {
                                                ?>
                                                <li>
                                                    <a href="javascript:void(0)" id="btn-logout">
                                                        <i class="fa fa-lock"></i> Logout
                                                    </a>
                                                </li>
                                                <?php
                                            }
                                            if ($_SESSION['User_language'] == 'GUJARATI') {
                                                ?>
                                                <li>
                                                    <a href="javascript:void(0)" id="btn-logout">
                                                        <i class="fa fa-lock"></i> લૉગઆઉટ
                                                    </a>
                                                </li>
                                                <?php
                                            }
                                            ?>

                                        </ul>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </nav>

                <div class="pcoded-main-container" style="margin-top: 56px;">
                    <div class="pcoded-wrapper">
                        <nav class="pcoded-navbar" navbar-theme="theme1" active-item-theme="theme1" sub-item-theme="theme2" active-item-style="style0" pcoded-navbar-position="fixed">
                            <div class="pcoded-inner-navbar main-menu mCustomScrollbar _mCS_1" id="" style="height: calc(100% - 80px);"><div id="mCSB_1" class="mCustomScrollBox mCS-light mCSB_vertical_horizontal mCSB_inside" style="max-height: none;" tabindex="0"><div id="mCSB_1_container_wrapper" class="mCSB_container_wrapper mCS_x_hidden mCS_no_scrollbar_x"><div id="mCSB_1_container" class="mCSB_container" style="position: relative; top: -10px; left: 0px; width: 100%;" dir="ltr">
                                            <div class="pcoded-navigatio-lavel" menu-title-theme="theme5">Navigation</div>
                                            <ul class="pcoded-item pcoded-left-item" item-border="true" item-border-style="none" subitem-border="true">                                                
                                                <li class="">
                                                    <a href="./dam_home.php">
                                                        <span class="pcoded-micon"><i class="fa fa-home"></i></span>


                                                        <?php
                                                        if ($_SESSION['User_language'] == 'ENGLISH') {
                                                            ?>
                                                            <span class="pcoded-mtext">Dashboard</span>
                                                            <?php
                                                        }

                                                        if ($_SESSION['User_language'] == 'GUJARATI') {
                                                            ?>
                                                            <span class="pcoded-mtext">ડેશબોર્ડ</span>
                                                            <?php
                                                        }
                                                        ?>

                                                    </a>
                                                </li>
                                            </ul>
                                        </div></div><div id="mCSB_1_scrollbar_vertical" class="mCSB_scrollTools mCSB_1_scrollbar mCS-light mCSB_scrollTools_vertical" style="display: block;"><div class="mCSB_draggerContainer"><div id="mCSB_1_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 30px; display: block; height: 167px; max-height: 667px; top: 2px;"><div class="mCSB_dragger_bar" style="line-height: 30px;"></div></div><div class="mCSB_draggerRail"></div></div></div><div id="mCSB_1_scrollbar_horizontal" class="mCSB_scrollTools mCSB_1_scrollbar mCS-light mCSB_scrollTools_horizontal" style="display: none;"><div class="mCSB_draggerContainer"><div id="mCSB_1_dragger_horizontal" class="mCSB_dragger" style="position: absolute; min-width: 30px; width: 0px; left: 0px;"><div class="mCSB_dragger_bar"></div></div><div class="mCSB_draggerRail"></div></div></div></div></div>
                        </nav>


                        <div class="pcoded-content">
                            <div class="pcoded-inner-content">
                                <div class="main-body">
                                    <div class="page-wrapper">

                                        <div class="page-header">
                                            <div class="row align-items-end">
                                                <div class="col-lg-8">
                                                    <div class="page-header-title">
                                                        <div class="d-inline">
                                                            <h4 class="text-uppercase">Single Dam Dashboard </h4>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="page-header-breadcrumb">
                                                        <ul class="breadcrumb-title">
                                                            <!-- <li class="breadcrumb-item" style="float: left;">
                                    <a href="http://13.234.254.166/gms/Dashboard_c"> <i class="feather icon-home"></i> </a>
                                </li>
                                <li class="breadcrumb-item" style="float: left;">Water Pump Single Dashboard 
                                </li> -->
                                                            <a href="dam_home.php"><button class="btn btn-sm btn-round btn-info"><b>Back</b></button></a>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="page-body">
                                            <div class="row">

                                                <?php
                                                $offline_status = "";
                                                $meter_name = "";
                                                $address = "";
                                                $bottom_width = "";
                                                $side_slop = "";
                                                $channel_slop = "";
                                                $m_r_coefficient = "";
                                                $canal_top_width = "";
                                                $water_level = "";
                                                $canal_height_display = "";
                                                $created_date_new = "";

                                                $id = $_SESSION['user_id'];

//                                                 $query = 'SELECT MAX(id) as id FROM `tbl_flow_meter_data` WHERE flag=1 and user_id=' . $id . ' ORDER by id asc';
// //                                                echo '$query '.$query;
//                                                 mysqli_set_charset($con, 'utf8');
//                                                 $result = mysqli_query($con, $query);
//                                                 if (mysqli_num_rows($result) > 0) {
//                                                     $i = 1;
//                                                     while ($row = mysqli_fetch_assoc($result)) {
//                                                         $id = $row["id"];
//                                                        echo '$id '.$id;

                                                $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.id=tfmd.flow_meter_id WHERE tfmd.flow_meter_id=' . $_SESSION['user_id'] . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';

                                                // $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address,tfm.canal_height,tfm.side_slop,tfm.channel_slop,tfm.m_r_coefficient,tfm.canal_bottom_width,tfm.canal_top_width,tfm.canal_height_display FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.user_id=tfmd.user_id WHERE tfmd.id=' . $id . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';
//                                                        $query1 = 'SELECT tfmd.*,DATE_FORMAT(tfmd.created_date,"%d-%m-%Y %H:%i:%s") AS created_date_new,DATE_FORMAT(tfmd.created_date,"%Y-%m-%d") AS days_date,tfm.meter_name,tfm.address,tfm.pipe_diameter,tfm.canal_height,tfm.side_slop,tfm.channel_slop,tfm.m_r_coefficient,tfm.canal_bottom_width,tfm.canal_top_width,tfm.canal_height_display FROM `tbl_flow_meter_data` as tfmd LEFT join tbl_flow_meter as tfm on tfm.user_id=tfmd.user_id WHERE tfmd.id=' . $id . ' and tfmd.flag=1 ORDER by tfmd.id DESC LIMIT 0,1';
//                                                        echo '<br>$query1 '.$query1;
                                                mysqli_set_charset($con, 'utf8');
                                                $result1 = mysqli_query($con, $query1);
                                                if (mysqli_num_rows($result) > 0) {
                                                    $i = 1;
                                                    while ($row1 = mysqli_fetch_assoc($result1)) {

                                                        $now = time(); // or your date as well
                                                        $your_date = strtotime($row1["days_date"]);
                                                        $datediff = $now - $your_date;

//                                                                                            echo round($datediff / (60 * 60 * 24));
                                                        $Days = round($datediff / (60 * 60 * 24));

                                                        if ($Days > 1) {
                                                            $offline = $offline + 1;
                                                        } else {
                                                            $online = $online + 1;
                                                        }

                                                        if ($Days > 1) {
                                                            $offline_status = "Offline";
                                                        } else {
                                                            $offline_status = "Online";
                                                        }


                                                        $meter_name = $row1["meter_name"];
                                                        $address = $row1["address"];
                                                        $water_flow = $row1["water_flow"];
                                                        $created_date_new = $row1["created_date_new"];
                                                        $water_level = $row1["water_level"];

                                                        $Cusec_1_unit = 35.3147;
                                                        $liter_1_unit = 1000;

                                                        function metersToFeet($meters) {
                                                            $feet = $meters * 3.28084; // Convert meters to feet
                                                            return $feet;
                                                        }

                                                        $meters = $water_level; // Example value in meters
                                                        $feet = metersToFeet($meters);
//                                                                                                    echo "<br>$meters meters is equal to " . $feet . " feet.";
//// Output the result
//                                                                                                    echo "<br>$meters meters is equal to " . number_format($feet, 2) . " feet.";
                                                        $water_level_check = $feet;

                                                        $location_id = $row1["flow_meter_id"];

                                                        $meters = $water_level; // Example value in meters
//                                                                                                        echo '$meters ' . $meters;
                                                        $feet = metersToFeet($meters);
                                                        // echo "<br>$meters meters is equal to " . $feet . " feet.";
//// Output the result
                                                        // echo "<br>$meters meters is equal to " . number_format($feet, 2) . " feet.";
                                                        $water_level_check = $feet;
//                                                                                                        echo '<br>$water_level_check ' . $water_level_check;

                                                        $query21 = 'SELECT * FROM `tbl_canal_kakarapar_mesure` WHERE location_id=' . $location_id . ' and flag=1 ORDER by id asc LIMIT 0,1';
                                                        // echo '<br>$query21 ' . $query21;
                                                        mysqli_set_charset($con, 'utf8');
                                                        $result21 = mysqli_query($con, $query21);
                                                        if (mysqli_num_rows($result21) > 0) {
                                                            while ($row21 = mysqli_fetch_assoc($result21)) {


                                                                if ($water_level_check <= 159.95) {
                                                                    $cusec = 0;
                                                                } else if ($water_level_check > 159.95 && $water_level_check <= 160.05) {
                                                                    $cusec = $row21["160_0"];
                                                                } else if ($water_level_check > 160.05 && $water_level_check <= 160.15) {
                                                                    $cusec = $row21["160_10"];
                                                                } else if ($water_level_check > 160.15 && $water_level_check <= 160.25) {
                                                                    $cusec = $row21["160_20"];
                                                                } else if ($water_level_check > 160.25 && $water_level_check <= 160.35) {
                                                                    $cusec = $row21["160_30"];
                                                                } else if ($water_level_check > 160.35 && $water_level_check <= 160.45) {
                                                                    $cusec = $row21["160_40"];
                                                                } else if ($water_level_check > 160.45 && $water_level_check <= 160.55) {
                                                                    $cusec = $row21["160_50"];
                                                                } else if ($water_level_check > 160.55 && $water_level_check <= 160.65) {
                                                                    $cusec = $row21["160_60"];
                                                                } else if ($water_level_check > 160.65 && $water_level_check <= 160.75) {
                                                                    $cusec = $row21["160_70"];
                                                                } else if ($water_level_check > 160.75 && $water_level_check <= 160.85) {
                                                                    $cusec = $row21["160_80"];
                                                                } else if ($water_level_check > 160.85 && $water_level_check <= 160.95) {
                                                                    $cusec = $row21["160_90"];
                                                                } else if ($water_level_check > 160.95 && $water_level_check <= 161.05) {
                                                                    $cusec = $row21["161_0"];
                                                                } else if ($water_level_check > 161.05 && $water_level_check <= 161.15) {
                                                                    $cusec = $row21["161_10"];
                                                                } else if ($water_level_check > 161.15 && $water_level_check <= 161.25) {
                                                                    $cusec = $row21["161_20"];
                                                                } else if ($water_level_check > 161.25 && $water_level_check <= 161.35) {
                                                                    $cusec = $row21["161_30"];
                                                                } else if ($water_level_check > 161.35 && $water_level_check <= 161.45) {
                                                                    $cusec = $row21["161_40"] + 3;
                                                                } else if ($water_level_check > 161.45 && $water_level_check <= 161.55) {
                                                                    $cusec = $row21["161_50"] + 3;
                                                                } else if ($water_level_check > 161.55 && $water_level_check <= 161.65) {
                                                                    $cusec = $row21["161_60"] + 3;
                                                                } else if ($water_level_check > 161.65 && $water_level_check <= 161.75) {
                                                                    $cusec = $row21["161_70"] + 3;
                                                                } else if ($water_level_check > 161.75 && $water_level_check <= 161.85) {
                                                                    $cusec = $row21["161_80"] + 3;
                                                                } else if ($water_level_check > 161.85 && $water_level_check <= 161.95) {
                                                                    $cusec = $row21["161_90"] + 3;
                                                                } else if ($water_level_check > 161.95 && $water_level_check <= 162.05) {
                                                                    $cusec = $row21["162_0"] + 3;
                                                                } else if ($water_level_check > 162.05 && $water_level_check <= 162.15) {
                                                                    $cusec = $row21["162_10"] + 3;
                                                                } else if ($water_level_check > 162.15 && $water_level_check <= 162.25) {
                                                                    $cusec = $row21["162_20"] + 3;
                                                                } else if ($water_level_check > 162.25 && $water_level_check <= 162.35) {
                                                                    $cusec = $row21["162_30"] + 3;
                                                                } else if ($water_level_check > 162.35 && $water_level_check <= 162.45) {
                                                                    $cusec = $row21["162_40"] + 3;
                                                                } else if ($water_level_check > 162.45 && $water_level_check <= 162.55) {
                                                                    $cusec = $row21["162_50"] + 3;
                                                                } else if ($water_level_check > 162.55 && $water_level_check <= 162.65) {
                                                                    $cusec = $row21["162_60"] + 3;
                                                                } else if ($water_level_check > 162.65 && $water_level_check <= 162.75) {
                                                                    $cusec = $row21["162_70"] + 3;
                                                                } else if ($water_level_check > 162.75 && $water_level_check <= 162.85) {
                                                                    $cusec = $row21["162_80"] + 3;
                                                                } else if ($water_level_check > 162.85 && $water_level_check <= 162.95) {
                                                                    $cusec = $row21["162_90"] + 3;
                                                                } else if ($water_level_check > 162.95 && $water_level_check <= 163.05) {
                                                                    $cusec = $row21["163_0"] + 3;
                                                                } else if ($water_level_check > 163.05 && $water_level_check <= 163.15) {
                                                                    $cusec = $row21["163_10"] + 3;
                                                                } else if ($water_level_check > 163.15 && $water_level_check <= 163.25) {
                                                                    $cusec = $row21["163_20"] + 3;
                                                                } else if ($water_level_check > 163.25 && $water_level_check <= 163.35) {
                                                                    $cusec = $row21["163_30"] + 3;
                                                                } else if ($water_level_check > 163.35 && $water_level_check <= 163.45) {
                                                                    $cusec = $row21["163_40"] + 3;
                                                                } else if ($water_level_check > 163.45 && $water_level_check <= 163.55) {
                                                                    $cusec = $row21["163_50"] + 3;
                                                                } else if ($water_level_check > 163.55 && $water_level_check <= 163.65) {
                                                                    $cusec = $row21["163_60"] + 3;
                                                                } else if ($water_level_check > 163.65 && $water_level_check <= 163.75) {
                                                                    $cusec = $row21["163_70"] + 3;
                                                                } else if ($water_level_check > 163.75 && $water_level_check <= 163.85) {
                                                                    $cusec = $row21["163_80"] + 3;
                                                                } else if ($water_level_check > 163.85 && $water_level_check <= 163.95) {
                                                                    $cusec = $row21["163_90"] + 3;
                                                                } else if ($water_level_check > 163.95 && $water_level_check <= 164.05) {
                                                                    $cusec = $row21["164_0"] + 3;
                                                                } else if ($water_level_check > 164.05 && $water_level_check <= 164.15) {
                                                                    $cusec = $row21["164_10"] + 3;
                                                                } else if ($water_level_check > 164.15 && $water_level_check <= 164.25) {
                                                                    $cusec = $row21["164_20"] + 3;
                                                                } else if ($water_level_check > 164.25 && $water_level_check <= 164.35) {
                                                                    $cusec = $row21["164_30"] + 3;
                                                                } else if ($water_level_check > 164.35 && $water_level_check <= 164.45) {
                                                                    $cusec = $row21["164_40"] + 3;
                                                                } else if ($water_level_check > 164.45 && $water_level_check <= 164.55) {
                                                                    $cusec = $row21["164_50"] + 3;
                                                                } else if ($water_level_check > 164.55 && $water_level_check <= 164.65) {
                                                                    $cusec = $row21["164_60"] + 3;
                                                                } else if ($water_level_check > 164.65 && $water_level_check <= 164.75) {
                                                                    $cusec = $row21["164_70"] + 3;
                                                                } else if ($water_level_check > 164.75 && $water_level_check <= 164.85) {
                                                                    $cusec = $row21["164_80"] + 3;
                                                                } else if ($water_level_check > 164.85 && $water_level_check <= 164.95) {
                                                                    $cusec = $row21["164_90"] + 3;
                                                                } else if ($water_level_check > 164.95 && $water_level_check <= 165.05) {
                                                                    $cusec = $row21["165_0"] + 3;
                                                                } else if ($water_level_check > 165.05 && $water_level_check <= 165.15) {
                                                                    $cusec = $row21["165_10"] + 3;
                                                                } else if ($water_level_check > 165.15 && $water_level_check <= 165.25) {
                                                                    $cusec = $row21["165_20"] + 3;
                                                                } else if ($water_level_check > 165.25 && $water_level_check <= 165.35) {
                                                                    $cusec = $row21["165_30"] + 3;
                                                                } else if ($water_level_check > 165.35 && $water_level_check <= 165.45) {
                                                                    $cusec = $row21["165_40"] + 3;
                                                                } else if ($water_level_check > 165.45 && $water_level_check <= 165.55) {
                                                                    $cusec = $row21["165_50"] + 3;
                                                                } else if ($water_level_check > 165.55 && $water_level_check <= 165.65) {
                                                                    $cusec = $row21["165_60"] + 3;
                                                                } else if ($water_level_check > 165.65 && $water_level_check <= 165.75) {
                                                                    $cusec = $row21["165_70"] + 3;
                                                                } else if ($water_level_check > 165.75 && $water_level_check <= 165.85) {
                                                                    $cusec = $row21["165_80"] + 3;
                                                                } else if ($water_level_check > 165.85 && $water_level_check <= 165.95) {
                                                                    $cusec = $row21["165_90"] + 3;
                                                                } else if ($water_level_check > 165.95 && $water_level_check <= 166.05) {
                                                                    $cusec = $row21["166_0"] + 3;
                                                                } else if ($water_level_check > 166.05 && $water_level_check <= 166.15) {
                                                                    $cusec = $row21["166_10"] + 3;
                                                                } else if ($water_level_check > 166.15 && $water_level_check <= 166.25) {
                                                                    $cusec = $row21["166_20"] + 3;
                                                                } else if ($water_level_check > 166.25 && $water_level_check <= 166.35) {
                                                                    $cusec = $row21["166_30"] + 3;
                                                                } else if ($water_level_check > 166.35 && $water_level_check <= 166.45) {
                                                                    $cusec = $row21["166_40"] + 3;
                                                                } else if ($water_level_check > 166.45 && $water_level_check <= 166.55) {
                                                                    $cusec = $row21["166_50"] + 3;
                                                                } else if ($water_level_check > 166.55 && $water_level_check <= 166.65) {
                                                                    $cusec = $row21["166_60"] + 3;
                                                                } else if ($water_level_check > 166.65 && $water_level_check <= 166.75) {
                                                                    $cusec = $row21["166_70"] + 3;
                                                                } else if ($water_level_check > 166.75 && $water_level_check <= 166.85) {
                                                                    $cusec = $row21["166_80"] + 3;
                                                                } else if ($water_level_check > 166.85 && $water_level_check <= 166.95) {
                                                                    $cusec = $row21["166_90"] + 3;
                                                                } else if ($water_level_check > 166.95 && $water_level_check <= 167.05) {
                                                                    $cusec = $row21["167_0"] + 3;
                                                                } else if ($water_level_check > 167.05 && $water_level_check <= 167.15) {
                                                                    $cusec = $row21["167_10"] + 3;
                                                                } else if ($water_level_check > 167.15 && $water_level_check <= 167.25) {
                                                                    $cusec = $row21["167_20"] + 3;
                                                                } else if ($water_level_check > 167.25 && $water_level_check <= 167.35) {
                                                                    $cusec = $row21["167_30"] + 3;
                                                                } else if ($water_level_check > 167.35 && $water_level_check <= 167.45) {
                                                                    $cusec = $row21["167_40"] + 3;
                                                                } else if ($water_level_check > 167.45 && $water_level_check <= 167.55) {
                                                                    $cusec = $row21["167_50"] + 3;
                                                                } else if ($water_level_check > 167.55 && $water_level_check <= 167.65) {
                                                                    $cusec = $row21["167_60"] + 3;
                                                                } else if ($water_level_check > 167.65 && $water_level_check <= 167.75) {
                                                                    $cusec = $row21["167_70"] + 3;
                                                                } else if ($water_level_check > 167.75 && $water_level_check <= 167.85) {
                                                                    $cusec = $row21["167_80"] + 3;
                                                                } else if ($water_level_check > 167.85 && $water_level_check <= 167.95) {
                                                                    $cusec = $row21["167_90"] + 3;
                                                                } else if ($water_level_check > 167.95 && $water_level_check <= 168.05) {
                                                                    $cusec = $row21["168_0"] + 3;
                                                                } else if ($water_level_check > 168.05 && $water_level_check <= 168.15) {
                                                                    $cusec = $row21["168_10"] + 3;
                                                                } else if ($water_level_check > 168.15 && $water_level_check <= 168.25) {
                                                                    $cusec = $row21["168_20"] + 3;
                                                                } else if ($water_level_check > 168.25 && $water_level_check <= 168.35) {
                                                                    $cusec = $row21["168_30"] + 3;
                                                                } else if ($water_level_check > 168.35 && $water_level_check <= 168.45) {
                                                                    $cusec = $row21["168_40"] + 3;
                                                                } else if ($water_level_check > 168.45 && $water_level_check <= 168.55) {
                                                                    $cusec = $row21["168_50"] + 3;
                                                                } else if ($water_level_check > 168.55 && $water_level_check <= 168.65) {
                                                                    $cusec = $row21["168_60"] + 3;
                                                                } else if ($water_level_check > 168.65 && $water_level_check <= 168.75) {
                                                                    $cusec = $row21["168_70"] + 3;
                                                                } else if ($water_level_check > 168.75 && $water_level_check <= 168.85) {
                                                                    $cusec = $row21["168_80"] + 3;
                                                                } else if ($water_level_check > 168.85 && $water_level_check <= 169.95) {
                                                                    $cusec = $row21["168_90"] + 3;
                                                                } else if ($water_level_check > 169.95 && $water_level_check <= 169.05) {
                                                                    $cusec = $row21["169_0"] + 3;
                                                                } else if ($water_level_check > 169.05 && $water_level_check <= 169.15) {
                                                                    $cusec = $row21["169_10"] + 3;
                                                                } else if ($water_level_check > 169.15 && $water_level_check <= 169.25) {
                                                                    $cusec = $row21["169_20"] + 3;
                                                                } else if ($water_level_check > 169.25 && $water_level_check <= 169.35) {
                                                                    $cusec = $row21["169_30"] + 3;
                                                                } else if ($water_level_check > 169.35 && $water_level_check <= 169.45) {
                                                                    $cusec = $row21["169_40"] + 3;
                                                                } else if ($water_level_check > 169.45 && $water_level_check <= 169.55) {
                                                                    $cusec = $row21["169_50"] + 3;
                                                                } else if ($water_level_check > 169.55 && $water_level_check <= 169.65) {
                                                                    $cusec = $row21["169_60"] + 3;
                                                                } else if ($water_level_check > 169.65 && $water_level_check <= 169.75) {
                                                                    $cusec = $row21["169_70"] + 3;
                                                                } else if ($water_level_check > 169.75 && $water_level_check <= 169.85) {
                                                                    $cusec = $row21["169_80"] + 3;
                                                                } else if ($water_level_check > 169.85 && $water_level_check <= 169.95) {
                                                                    $cusec = $row21["169_90"] + 3;
                                                                } else if ($water_level_check > 169.95 && $water_level_check <= 170.05) {
                                                                    $cusec = $row21["170_0"] + 3;
                                                                } else if ($water_level_check > 170.05 && $water_level_check <= 170.15) {
                                                                    $cusec = $row21["170_10"] + 3;
                                                                } else if ($water_level_check > 170.15 && $water_level_check <= 170.25) {
                                                                    $cusec = $row21["170_20"] + 3;
                                                                } else if ($water_level_check > 170.25 && $water_level_check <= 170.35) {
                                                                    $cusec = $row21["170_30"] + 3;
                                                                } else if ($water_level_check > 170.35 && $water_level_check <= 170.45) {
                                                                    $cusec = $row21["170_40"] + 3;
                                                                } else if ($water_level_check > 170.45 && $water_level_check <= 170.55) {
                                                                    $cusec = $row21["170_50"] + 3;
                                                                } else if ($water_level_check > 170.55 && $water_level_check <= 170.65) {
                                                                    $cusec = $row21["170_60"] + 3;
                                                                } else if ($water_level_check > 170.65 && $water_level_check <= 170.75) {
                                                                    $cusec = $row21["170_70"] + 3;
                                                                } else if ($water_level_check > 170.75 && $water_level_check <= 170.85) {
                                                                    $cusec = $row21["170_80"] + 3;
                                                                } else if ($water_level_check > 170.85 && $water_level_check <= 170.95) {
                                                                    $cusec = $row21["170_90"] + 3;
                                                                } else if ($water_level_check > 170.95 && $water_level_check <= 171.05) {
                                                                    $cusec = $row21["171_0"] + 3;
                                                                } else if ($water_level_check > 171.05 && $water_level_check <= 171.15) {
                                                                    $cusec = $row21["171_10"] + 3;
                                                                } else if ($water_level_check > 171.15 && $water_level_check <= 171.25) {
                                                                    $cusec = $row21["171_20"] + 3;
                                                                } else if ($water_level_check > 171.25 && $water_level_check <= 171.35) {
                                                                    $cusec = $row21["171_30"] + 3;
                                                                } else if ($water_level_check > 171.35 && $water_level_check <= 171.45) {
                                                                    $cusec = $row21["171_40"] + 3;
                                                                } else if ($water_level_check > 171.45 && $water_level_check <= 171.55) {
                                                                    $cusec = $row21["171_50"] + 3;
                                                                } else if ($water_level_check > 171.55 && $water_level_check <= 171.65) {
                                                                    $cusec = $row21["171_60"] + 3;
                                                                } else if ($water_level_check > 171.65 && $water_level_check <= 171.75) {
                                                                    $cusec = $row21["171_70"] + 3;
                                                                } else if ($water_level_check > 171.75 && $water_level_check <= 171.85) {
                                                                    $cusec = $row21["171_80"] + 3;
                                                                } else if ($water_level_check > 171.85 && $water_level_check <= 171.95) {
                                                                    $cusec = $row21["171_90"] + 3;
                                                                } else if ($water_level_check > 171.95 && $water_level_check <= 172.05) {
                                                                    $cusec = $row21["172_0"] + 3;
                                                                } else if ($water_level_check > 172.05 && $water_level_check <= 172.15) {
                                                                    $cusec = $row21["172_10"] + 3;
                                                                } else if ($water_level_check > 172.15 && $water_level_check <= 172.25) {
                                                                    $cusec = $row21["172_20"] + 3;
                                                                } else if ($water_level_check > 172.25 && $water_level_check <= 172.35) {
                                                                    $cusec = $row21["172_30"] + 3;
                                                                } else if ($water_level_check > 172.35 && $water_level_check <= 172.45) {
                                                                    $cusec = $row21["172_40"] + 3;
                                                                } else if ($water_level_check > 172.45 && $water_level_check <= 172.55) {
                                                                    $cusec = $row21["172_50"] + 3;
                                                                } else if ($water_level_check > 172.55 && $water_level_check <= 172.65) {
                                                                    $cusec = $row21["172_60"] + 3;
                                                                } else if ($water_level_check > 172.65 && $water_level_check <= 172.75) {
                                                                    $cusec = $row21["172_70"] + 3;
                                                                } else if ($water_level_check > 172.75 && $water_level_check <= 172.85) {
                                                                    $cusec = $row21["172_80"] + 3;
                                                                } else if ($water_level_check > 172.85 && $water_level_check <= 172.95) {
                                                                    $cusec = $row21["172_90"] + 3;
                                                                } else if ($water_level_check > 172.95 && $water_level_check <= 173.05) {
                                                                    $cusec = $row21["173_0"] + 3;
                                                                } else if ($water_level_check > 173.05 && $water_level_check <= 173.15) {
                                                                    $cusec = $row21["173_10"] + 3;
                                                                } else if ($water_level_check > 173.15 && $water_level_check <= 173.25) {
                                                                    $cusec = $row21["173_20"] + 3;
                                                                } else if ($water_level_check > 173.25 && $water_level_check <= 173.35) {
                                                                    $cusec = $row21["173_30"] + 3;
                                                                } else if ($water_level_check > 173.35 && $water_level_check <= 173.45) {
                                                                    $cusec = $row21["173_40"] + 3;
                                                                } else if ($water_level_check > 173.45 && $water_level_check <= 173.55) {
                                                                    $cusec = $row21["173_50"] + 3;
                                                                } else if ($water_level_check > 173.55 && $water_level_check <= 173.65) {
                                                                    $cusec = $row21["173_60"] + 3;
                                                                } else if ($water_level_check > 173.65 && $water_level_check <= 173.75) {
                                                                    $cusec = $row21["173_70"] + 3;
                                                                } else if ($water_level_check > 173.75 && $water_level_check <= 173.85) {
                                                                    $cusec = $row21["173_80"] + 3;
                                                                } else if ($water_level_check > 173.85 && $water_level_check <= 173.95) {
                                                                    $cusec = $row21["173_90"] + 3;
                                                                } else if ($water_level_check > 173.95 && $water_level_check <= 174.05) {
                                                                    $cusec = $row21["174_0"] + 3;
                                                                } else if ($water_level_check > 174.05 && $water_level_check <= 174.15) {
                                                                    $cusec = $row21["174_10"] + 3;
                                                                } else if ($water_level_check > 174.15 && $water_level_check <= 174.25) {
                                                                    $cusec = $row21["174_20"] + 3;
                                                                } else if ($water_level_check > 174.25 && $water_level_check <= 174.35) {
                                                                    $cusec = $row21["174_30"] + 3;
                                                                } else if ($water_level_check > 174.35 && $water_level_check <= 174.45) {
                                                                    $cusec = $row21["174_40"] + 3;
                                                                } else if ($water_level_check > 174.45 && $water_level_check <= 174.55) {
                                                                    $cusec = $row21["174_50"] + 3;
                                                                } else if ($water_level_check > 174.55 && $water_level_check <= 174.65) {
                                                                    $cusec = $row21["174_60"] + 3;
                                                                } else if ($water_level_check > 174.65 && $water_level_check <= 174.75) {
                                                                    $cusec = $row21["174_70"] + 3;
                                                                } else if ($water_level_check > 174.75 && $water_level_check <= 174.85) {
                                                                    $cusec = $row21["174_80"] + 3;
                                                                } else if ($water_level_check > 174.85 && $water_level_check <= 174.95) {
                                                                    $cusec = $row21["174_90"] + 3;
                                                                } else if ($water_level_check > 174.95 && $water_level_check <= 175.05) {
                                                                    $cusec = $row21["175_0"] + 3;
                                                                } else if ($water_level_check > 175.05 && $water_level_check <= 175.15) {
                                                                    $cusec = $row21["175_10"] + 3;
                                                                } else if ($water_level_check > 175.15 && $water_level_check <= 175.25) {
                                                                    $cusec = $row21["175_20"] + 3;
                                                                } else if ($water_level_check > 175.25 && $water_level_check <= 175.35) {
                                                                    $cusec = $row21["175_30"] + 3;
                                                                } else if ($water_level_check > 175.35 && $water_level_check <= 175.45) {
                                                                    $cusec = $row21["175_40"] + 3;
                                                                } else if ($water_level_check > 175.45 && $water_level_check <= 175.55) {
                                                                    $cusec = $row21["175_50"] + 3;
                                                                } else if ($water_level_check > 175.55 && $water_level_check <= 175.65) {
                                                                    $cusec = $row21["175_60"] + 3;
                                                                } else if ($water_level_check > 175.65 && $water_level_check <= 175.75) {
                                                                    $cusec = $row21["175_70"] + 3;
                                                                } else if ($water_level_check > 175.75 && $water_level_check <= 175.85) {
                                                                    $cusec = $row21["175_80"] + 3;
                                                                } else if ($water_level_check > 175.85 && $water_level_check <= 175.95) {
                                                                    $cusec = $row21["175_90"] + 3;
                                                                } else if ($water_level_check > 175.95 && $water_level_check <= 176.05) {
                                                                    $cusec = $row21["176_0"] + 3;
                                                                } else if ($water_level_check > 176.05 && $water_level_check <= 176.15) {
                                                                    $cusec = $row21["176_10"] + 3;
                                                                } else if ($water_level_check > 176.15 && $water_level_check <= 176.25) {
                                                                    $cusec = $row21["176_20"] + 3;
                                                                } else if ($water_level_check > 176.25 && $water_level_check <= 176.35) {
                                                                    $cusec = $row21["176_30"] + 3;
                                                                } else if ($water_level_check > 176.35 && $water_level_check <= 176.45) {
                                                                    $cusec = $row21["176_40"] + 3;
                                                                } else if ($water_level_check > 176.45 && $water_level_check <= 176.55) {
                                                                    $cusec = $row21["176_50"] + 3;
                                                                } else if ($water_level_check > 176.55 && $water_level_check <= 176.65) {
                                                                    $cusec = $row21["176_60"] + 3;
                                                                } else if ($water_level_check > 176.65 && $water_level_check <= 176.75) {
                                                                    $cusec = $row21["176_70"] + 3;
                                                                } else if ($water_level_check > 176.75 && $water_level_check <= 176.85) {
                                                                    $cusec = $row21["176_80"] + 3;
                                                                } else if ($water_level_check > 176.85 && $water_level_check <= 176.95) {
                                                                    $cusec = $row21["176_90"] + 3;
                                                                } else if ($water_level_check > 176.95 && $water_level_check <= 177.05) {
                                                                    $cusec = $row21["177_0"] + 3;
                                                                } else if ($water_level_check > 177.05 && $water_level_check <= 177.15) {
                                                                    $cusec = $row21["177_10"] + 3;
                                                                } else if ($water_level_check > 177.15 && $water_level_check <= 177.25) {
                                                                    $cusec = $row21["177_20"] + 3;
                                                                } else if ($water_level_check > 177.25 && $water_level_check <= 177.35) {
                                                                    $cusec = $row21["177_30"] + 3;
                                                                } else if ($water_level_check > 177.35 && $water_level_check <= 177.45) {
                                                                    $cusec = $row21["177_40"] + 3;
                                                                } else if ($water_level_check > 177.45 && $water_level_check <= 177.55) {
                                                                    $cusec = $row21["177_50"] + 3;
                                                                } else if ($water_level_check > 177.55 && $water_level_check <= 177.65) {
                                                                    $cusec = $row21["177_60"] + 3;
                                                                } else if ($water_level_check > 177.65 && $water_level_check <= 177.75) {
                                                                    $cusec = $row21["177_70"] + 3;
                                                                } else if ($water_level_check > 177.75 && $water_level_check <= 177.85) {
                                                                    $cusec = $row21["177_80"] + 3;
                                                                } else if ($water_level_check > 177.85 && $water_level_check <= 177.95) {
                                                                    $cusec = $row21["177_90"] + 3;
                                                                } else if ($water_level_check > 177.95 && $water_level_check <= 178.05) {
                                                                    $cusec = $row21["178_0"] + 3;
                                                                } else if ($water_level_check > 178.05 && $water_level_check <= 178.15) {
                                                                    $cusec = $row21["178_10"] + 3;
                                                                } else if ($water_level_check > 178.15 && $water_level_check <= 178.25) {
                                                                    $cusec = $row21["178_20"] + 3;
                                                                } else if ($water_level_check > 178.25 && $water_level_check <= 178.35) {
                                                                    $cusec = $row21["178_30"] + 3;
                                                                } else if ($water_level_check > 178.35 && $water_level_check <= 178.45) {
                                                                    $cusec = $row21["178_40"] + 3;
                                                                } else if ($water_level_check > 178.45 && $water_level_check <= 178.55) {
                                                                    $cusec = $row21["178_50"] + 3;
                                                                } else if ($water_level_check > 178.55 && $water_level_check <= 178.65) {
                                                                    $cusec = $row21["178_60"] + 3;
                                                                } else if ($water_level_check > 178.65 && $water_level_check <= 178.75) {
                                                                    $cusec = $row21["178_70"] + 3;
                                                                } else if ($water_level_check > 178.75 && $water_level_check <= 178.85) {
                                                                    $cusec = $row21["178_80"] + 3;
                                                                } else if ($water_level_check > 178.85 && $water_level_check <= 179.95) {
                                                                    $cusec = $row21["178_90"] + 3;
                                                                } else if ($water_level_check > 179.95 && $water_level_check <= 179.05) {
                                                                    $cusec = $row21["179_0"] + 3;
                                                                } else if ($water_level_check > 179.05 && $water_level_check <= 179.15) {
                                                                    $cusec = $row21["179_10"] + 3;
                                                                } else if ($water_level_check > 179.15 && $water_level_check <= 179.25) {
                                                                    $cusec = $row21["179_20"] + 3;
                                                                } else if ($water_level_check > 179.25 && $water_level_check <= 179.35) {
                                                                    $cusec = $row21["179_30"] + 3;
                                                                } else if ($water_level_check > 179.35 && $water_level_check <= 179.45) {
                                                                    $cusec = $row21["179_40"] + 3;
                                                                } else if ($water_level_check > 179.45 && $water_level_check <= 179.55) {
                                                                    $cusec = $row21["179_50"] + 3;
                                                                } else if ($water_level_check > 179.55 && $water_level_check <= 179.65) {
                                                                    $cusec = $row21["179_60"] + 3;
                                                                } else if ($water_level_check > 179.65 && $water_level_check <= 179.75) {
                                                                    $cusec = $row21["179_70"] + 3;
                                                                } else if ($water_level_check > 179.75 && $water_level_check <= 179.85) {
                                                                    $cusec = $row21["179_80"] + 3;
                                                                } else if ($water_level_check > 179.85 && $water_level_check <= 179.95) {
                                                                    $cusec = $row21["179_90"] + 3;
                                                                } else if ($water_level_check > 179.95 && $water_level_check <= 180.05) {
                                                                    $cusec = $row21["180_0"] + 3;
                                                                } else if ($water_level_check > 180.05 && $water_level_check <= 180.15) {
                                                                    $cusec = $row21["180_10"] + 3;
                                                                } else if ($water_level_check > 180.15 && $water_level_check <= 180.25) {
                                                                    $cusec = $row21["180_20"] + 3;
                                                                } else if ($water_level_check > 180.25 && $water_level_check <= 180.35) {
                                                                    $cusec = $row21["180_30"] + 3;
                                                                } else if ($water_level_check > 180.35 && $water_level_check <= 180.45) {
                                                                    $cusec = $row21["180_40"] + 3;
                                                                } else if ($water_level_check > 180.45 && $water_level_check <= 180.55) {
                                                                    $cusec = $row21["180_50"] + 3;
                                                                } else if ($water_level_check > 180.55 && $water_level_check <= 180.65) {
                                                                    $cusec = $row21["180_60"] + 3;
                                                                } else if ($water_level_check > 180.65 && $water_level_check <= 180.75) {
                                                                    $cusec = $row21["180_70"] + 3;
                                                                } else if ($water_level_check > 180.75 && $water_level_check <= 180.85) {
                                                                    $cusec = $row21["180_80"] + 3;
                                                                } else if ($water_level_check > 180.85 && $water_level_check <= 180.95) {
                                                                    $cusec = $row21["180_90"] + 3;
                                                                } else if ($water_level_check > 180.95 && $water_level_check <= 181.05) {
                                                                    $cusec = $row21["181_0"] + 3;
                                                                } else if ($water_level_check > 181.05 && $water_level_check <= 181.15) {
                                                                    $cusec = $row21["181_10"] + 3;
                                                                } else if ($water_level_check > 181.15 && $water_level_check <= 181.25) {
                                                                    $cusec = $row21["181_20"] + 3;
                                                                } else if ($water_level_check > 181.25 && $water_level_check <= 181.35) {
                                                                    $cusec = $row21["181_30"] + 3;
                                                                } else if ($water_level_check > 181.35 && $water_level_check <= 181.45) {
                                                                    $cusec = $row21["181_40"] + 3;
                                                                } else if ($water_level_check > 181.45 && $water_level_check <= 181.55) {
                                                                    $cusec = $row21["181_50"] + 3;
                                                                } else if ($water_level_check > 181.55 && $water_level_check <= 181.65) {
                                                                    $cusec = $row21["181_60"] + 3;
                                                                } else if ($water_level_check > 181.65 && $water_level_check <= 181.75) {
                                                                    $cusec = $row21["181_70"] + 3;
                                                                } else if ($water_level_check > 181.75 && $water_level_check <= 181.85) {
                                                                    $cusec = $row21["181_80"] + 3;
                                                                } else if ($water_level_check > 181.85 && $water_level_check <= 181.95) {
                                                                    $cusec = $row21["181_90"] + 3;
                                                                } else if ($water_level_check > 181.95 && $water_level_check <= 182.05) {
                                                                    $cusec = $row21["182_0"] + 3;
                                                                } else if ($water_level_check > 182.05 && $water_level_check <= 182.15) {
                                                                    $cusec = $row21["182_10"] + 3;
                                                                } else if ($water_level_check > 182.15 && $water_level_check <= 182.25) {
                                                                    $cusec = $row21["182_20"] + 3;
                                                                } else if ($water_level_check > 182.25 && $water_level_check <= 182.35) {
                                                                    $cusec = $row21["182_30"] + 3;
                                                                } else if ($water_level_check > 182.35 && $water_level_check <= 182.45) {
                                                                    $cusec = $row21["182_40"] + 3;
                                                                } else if ($water_level_check > 182.45 && $water_level_check <= 182.55) {
                                                                    $cusec = $row21["182_50"] + 3;
                                                                } else if ($water_level_check > 182.55 && $water_level_check <= 182.65) {
                                                                    $cusec = $row21["182_60"] + 3;
                                                                } else if ($water_level_check > 182.65 && $water_level_check <= 182.75) {
                                                                    $cusec = $row21["182_70"] + 3;
                                                                } else if ($water_level_check > 182.75 && $water_level_check <= 182.85) {
                                                                    $cusec = $row21["182_80"] + 3;
                                                                } else if ($water_level_check > 182.85 && $water_level_check <= 182.95) {
                                                                    $cusec = $row21["182_90"] + 3;
                                                                } else if ($water_level_check > 182.95 && $water_level_check <= 183.05) {
                                                                    $cusec = $row21["183_0"] + 3;
                                                                } else if ($water_level_check > 183.05 && $water_level_check <= 183.15) {
                                                                    $cusec = $row21["183_10"] + 3;
                                                                } else if ($water_level_check > 183.15 && $water_level_check <= 183.25) {
                                                                    $cusec = $row21["183_20"] + 3;
                                                                } else if ($water_level_check > 183.25 && $water_level_check <= 183.35) {
                                                                    $cusec = $row21["183_30"] + 3;
                                                                } else if ($water_level_check > 183.35 && $water_level_check <= 183.45) {
                                                                    $cusec = $row21["183_40"] + 3;
                                                                } else if ($water_level_check > 183.45 && $water_level_check <= 183.55) {
                                                                    $cusec = $row21["183_50"] + 3;
                                                                } else if ($water_level_check > 183.55 && $water_level_check <= 183.65) {
                                                                    $cusec = $row21["183_60"] + 3;
                                                                } else if ($water_level_check > 183.65 && $water_level_check <= 183.75) {
                                                                    $cusec = $row21["183_70"] + 3;
                                                                } else if ($water_level_check > 183.75 && $water_level_check <= 183.85) {
                                                                    $cusec = $row21["183_80"] + 3;
                                                                } else if ($water_level_check > 183.85 && $water_level_check <= 183.95) {
                                                                    $cusec = $row21["183_90"] + 3;
                                                                } else if ($water_level_check > 183.95 && $water_level_check <= 184.05) {
                                                                    $cusec = $row21["184_0"] + 3;
                                                                } else if ($water_level_check > 184.05 && $water_level_check <= 184.15) {
                                                                    $cusec = $row21["184_10"] + 3;
                                                                } else if ($water_level_check > 184.15 && $water_level_check <= 184.25) {
                                                                    $cusec = $row21["184_20"] + 3;
                                                                } else if ($water_level_check > 184.25 && $water_level_check <= 184.35) {
                                                                    $cusec = $row21["184_30"] + 3;
                                                                } else if ($water_level_check > 184.35 && $water_level_check <= 184.45) {
                                                                    $cusec = $row21["184_40"] + 3;
                                                                } else if ($water_level_check > 184.45 && $water_level_check <= 184.55) {
                                                                    $cusec = $row21["184_50"] + 3;
                                                                } else if ($water_level_check > 184.55 && $water_level_check <= 184.65) {
                                                                    $cusec = $row21["184_60"] + 3;
                                                                } else if ($water_level_check > 184.65 && $water_level_check <= 184.75) {
                                                                    $cusec = $row21["184_70"] + 3;
                                                                } else if ($water_level_check > 184.75 && $water_level_check <= 184.85) {
                                                                    $cusec = $row21["184_80"] + 3;
                                                                } else if ($water_level_check > 184.85 && $water_level_check <= 184.95) {
                                                                    $cusec = $row21["184_90"] + 3;
                                                                } else if ($water_level_check > 184.95 && $water_level_check <= 185.05) {
                                                                    $cusec = $row21["185_0"] + 3;
                                                                } else if ($water_level_check > 185.05 && $water_level_check <= 185.15) {
                                                                    $cusec = $row21["185_10"] + 3;
                                                                } else if ($water_level_check > 185.15 && $water_level_check <= 185.25) {
                                                                    $cusec = $row21["185_20"] + 3;
                                                                } else if ($water_level_check > 185.25 && $water_level_check <= 185.35) {
                                                                    $cusec = $row21["185_30"] + 3;
                                                                } else if ($water_level_check > 185.35 && $water_level_check <= 185.45) {
                                                                    $cusec = $row21["185_40"] + 3;
                                                                } else if ($water_level_check > 185.45 && $water_level_check <= 185.55) {
                                                                    $cusec = $row21["185_50"] + 3;
                                                                } else if ($water_level_check > 185.55 && $water_level_check <= 185.65) {
                                                                    $cusec = $row21["185_60"] + 3;
                                                                } else if ($water_level_check > 185.65 && $water_level_check <= 185.75) {
                                                                    $cusec = $row21["185_70"] + 3;
                                                                } else if ($water_level_check > 185.75 && $water_level_check <= 185.85) {
                                                                    $cusec = $row21["185_80"] + 3;
                                                                } else if ($water_level_check > 185.85 && $water_level_check <= 185.95) {
                                                                    $cusec = $row21["185_90"] + 3;
                                                                } else if ($water_level_check > 185.95 && $water_level_check <= 186.05) {
                                                                    $cusec = $row21["186_0"] + 3;
                                                                } else if ($water_level_check > 186.05 && $water_level_check <= 186.15) {
                                                                    $cusec = $row21["186_10"] + 3;
                                                                } else if ($water_level_check > 186.15 && $water_level_check <= 186.25) {
                                                                    $cusec = $row21["186_20"] + 3;
                                                                } else if ($water_level_check > 186.25 && $water_level_check <= 186.35) {
                                                                    $cusec = $row21["186_30"] + 3;
                                                                } else if ($water_level_check > 186.35 && $water_level_check <= 186.45) {
                                                                    $cusec = $row21["186_40"] + 3;
                                                                } else if ($water_level_check > 186.45 && $water_level_check <= 186.55) {
                                                                    $cusec = $row21["186_50"] + 3;
                                                                } else if ($water_level_check > 186.55 && $water_level_check <= 186.65) {
                                                                    $cusec = $row21["186_60"] + 3;
                                                                } else if ($water_level_check > 186.65 && $water_level_check <= 186.75) {
                                                                    $cusec = $row21["186_70"] + 3;
                                                                } else if ($water_level_check > 186.75 && $water_level_check <= 186.85) {
                                                                    $cusec = $row21["186_80"] + 3;
                                                                } else if ($water_level_check > 186.85 && $water_level_check <= 186.95) {
                                                                    $cusec = $row21["186_90"] + 3;
                                                                } else if ($water_level_check > 186.95 && $water_level_check <= 187.05) {
                                                                    $cusec = $row21["187_0"] + 3;
                                                                } else if ($water_level_check > 187.05 && $water_level_check <= 187.15) {
                                                                    $cusec = $row21["187_10"] + 3;
                                                                } else if ($water_level_check > 187.15 && $water_level_check <= 187.25) {
                                                                    $cusec = $row21["187_20"] + 3;
                                                                } else if ($water_level_check > 187.25 && $water_level_check <= 187.35) {
                                                                    $cusec = $row21["187_30"] + 3;
                                                                } else if ($water_level_check > 187.35 && $water_level_check <= 187.45) {
                                                                    $cusec = $row21["187_40"] + 3;
                                                                } else if ($water_level_check > 187.45 && $water_level_check <= 187.55) {
                                                                    $cusec = $row21["187_50"] + 3;
                                                                } else if ($water_level_check > 187.55 && $water_level_check <= 187.65) {
                                                                    $cusec = $row21["187_60"] + 3;
                                                                } else if ($water_level_check > 187.65 && $water_level_check <= 187.75) {
                                                                    $cusec = $row21["187_70"] + 3;
                                                                } else if ($water_level_check > 187.75 && $water_level_check <= 187.85) {
                                                                    $cusec = $row21["187_80"] + 3;
                                                                } else if ($water_level_check > 187.85 && $water_level_check <= 187.95) {
                                                                    $cusec = $row21["187_90"] + 3;
                                                                } else if ($water_level_check > 187.95 && $water_level_check <= 188.05) {
                                                                    $cusec = $row21["188_0"] + 3;
                                                                } else if ($water_level_check > 188.05 && $water_level_check <= 188.15) {
                                                                    $cusec = $row21["188_10"] + 3;
                                                                } else if ($water_level_check > 188.15 && $water_level_check <= 188.25) {
                                                                    $cusec = $row21["188_20"] + 3;
                                                                } else if ($water_level_check > 188.25 && $water_level_check <= 188.35) {
                                                                    $cusec = $row21["188_30"] + 3;
                                                                } else if ($water_level_check > 188.35 && $water_level_check <= 188.45) {
                                                                    $cusec = $row21["188_40"] + 3;
                                                                } else if ($water_level_check > 188.45 && $water_level_check <= 188.55) {
                                                                    $cusec = $row21["188_50"] + 3;
                                                                } else if ($water_level_check > 188.55 && $water_level_check <= 188.65) {
                                                                    $cusec = $row21["188_60"] + 3;
                                                                } else if ($water_level_check > 188.65 && $water_level_check <= 188.75) {
                                                                    $cusec = $row21["188_70"] + 3;
                                                                } else if ($water_level_check > 188.75 && $water_level_check <= 188.85) {
                                                                    $cusec = $row21["188_80"] + 3;
                                                                } else if ($water_level_check > 188.85 && $water_level_check <= 189.95) {
                                                                    $cusec = $row21["188_90"] + 3;
                                                                } else if ($water_level_check > 189.95 && $water_level_check <= 189.05) {
                                                                    $cusec = $row21["189_0"] + 3;
                                                                } else if ($water_level_check > 189.05 && $water_level_check <= 189.15) {
                                                                    $cusec = $row21["189_10"] + 3;
                                                                } else if ($water_level_check > 189.15 && $water_level_check <= 189.25) {
                                                                    $cusec = $row21["189_20"] + 3;
                                                                } else if ($water_level_check > 189.25 && $water_level_check <= 189.35) {
                                                                    $cusec = $row21["189_30"] + 3;
                                                                } else if ($water_level_check > 189.35 && $water_level_check <= 189.45) {
                                                                    $cusec = $row21["189_40"] + 3;
                                                                } else if ($water_level_check > 189.45 && $water_level_check <= 189.55) {
                                                                    $cusec = $row21["189_50"] + 3;
                                                                } else if ($water_level_check > 189.55 && $water_level_check <= 189.65) {
                                                                    $cusec = $row21["189_60"] + 3;
                                                                } else if ($water_level_check > 189.65 && $water_level_check <= 189.75) {
                                                                    $cusec = $row21["189_70"] + 3;
                                                                } else if ($water_level_check > 189.75 && $water_level_check <= 189.85) {
                                                                    $cusec = $row21["189_80"] + 3;
                                                                } else if ($water_level_check > 189.85 && $water_level_check <= 189.95) {
                                                                    $cusec = $row21["189_90"] + 3;
                                                                } else if ($water_level_check > 189.95 && $water_level_check <= 190.05) {
                                                                    $cusec = $row21["190_0"] + 3;
                                                                } else if ($water_level_check > 190.05) {
                                                                    $cusec = $row21["190_10"] + 3;
                                                                }
                                                            }

                                                            if ($cusec != 0) {
                                                                $Q_Flow = number_format($cusec * 0.0283168, 2);
                                                                $Velocity = 0;
                                                            } else {
                                                                $Q_Flow = 0;
                                                                $Velocity = 0;
                                                            }
                                                        } else {
                                                            $cusec = number_format($Q_Flow * $Cusec_1_unit, 2);
                                                        }
                                                    }
                                                }
                                                //     }
                                                // }
                                                ?>

                                                <div class="col-md-8">
                                                    <div class="card" style="height: 280px;">
                                                        <div class="card-header d-flex justify-content-start align-items-center" style="background-color: #5381FF;height:30px !important;">
                                                            <img src="files/assets/img/locations.gif" width="40" style="border-radius: 25%;">&nbsp;&nbsp;&nbsp;<span style="color:white; font-weight: bold; font-size:18px;">Dam Details </span>
                                                        </div>
                                                        <div class="card-block">
                                                            <div class="table-responsive">
                                                                <table class="table table-bordeless ">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>Dam Name</th>
                                                                            <td style="color: #f16224"><?php echo $meter_name; ?></td>
                                                                    <input type="hidden" name="hdn_node_id" id="hdn_node_id" value="9769bc5f-bb57-11ee-a49c-0ac781a0ba02" readonly="">

                                                                    </tr>
                                                                    <tr>
                                                                        <th>Address</th>
                                                                        <td style="color: #f16224"><?php echo $address; ?></td>
                                                                    <input type="hidden" name="hdn_node_id" id="hdn_node_id" value="9769bc5f-bb57-11ee-a49c-0ac781a0ba02" readonly="">

                                                                    </tr>
                                                                    <tr>

                                                                    <input type="hidden" name="hdn_imei_no" id="hdn_imei_no" value="862211070312665">
                                                                    <input type="hidden" name="hdn_device_index" id="hdn_device_index" value="862211070312665-110174">
                                                                    <input type="hidden" name="hdn_node_id" id="hdn_node_id" value="9769bc5f-bb57-11ee-a49c-0ac781a0ba02">						<input type="hidden" name="hdn_register_index" id="hdn_register_index" value="07">
                                                                    </tr>
                                                                    </thead>
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="col-md-4">
                                                    <div class="card" style="height: 280px;">
                                                        <div class="card-header d-flex justify-content-start align-items-center" style="background-color: #5381FF;height:30px;">
                                                            <img src="files/assets/img/mobile-phone.gif" width="40" style="border-radius: 25%">&nbsp;
                                                            <span style="font-weight: bold; font-size: 18px; color: white;">Device Details </span>
                                                        </div>
                                                        <div class="card-block">
                                                            <div class="text-center">
                                                                <div class="row">
                                                                    <input type="hidden" name="hdn_device_status" id="hdn_device_status" value="2">
                                                                    <div class="col-12" style="margin-top: 15px;">
                                                                        <span id="dcu_color_status" class="dot1"></span><br>
<?php
if ($offline_status == "Offline") {
    ?>
                                                                            <h5><span id="dcu_text_status" style="color: red"><?php echo $offline_status; ?></span></h5>
                                                                            <?php
                                                                        } else {
                                                                            ?>
                                                                            <h5><span id="dcu_text_status" style="color: green"><?php echo $offline_status; ?></span></h5>
                                                                            <?php
                                                                        }
                                                                        ?>
                                                                    </div>

                                                                    <div class="col-md-12 mt-3">
                                                                        <button type="button" class="btn btn-sm btn-round mx-2" id="start_button" style="display:none;color:white;" onclick="start_water_pump();">Start</button>
                                                                    </div>

                                                                    <div class="col-12">
                                                                        <h5 style="margin-top:10px"><b>Last Data Date-Time</b></h5>
                                                                        <h5><span style="font-size: 16px;" id="log_date_time"><?php echo $created_date_new; ?></span> <span></span></h5>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="row mt-2">
                                                <div class="col-xl-12 col-md-12">
                                                    <div class="card">
                                                        <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                            <span style="color:white; font-weight: bold; font-size:18px;"><?php echo $created_date_new; ?>
                                                            </span><img src="files/assets/img/aquarius.gif" width="35" style="border-radius: 25%;">
                                                        </div>
                                                        <div class="card-block">
                                                            <div class="row mt-2 text-center">
                                                                <div class="col-3 b-r-default">
                                                                    <p class="m-b-5">Water Level</p>
                                                                    <h6><b><span id="y_phase_voltage_fault" style="color: rgb(0, 128, 0);"><?php echo $water_level . ' Meter'; ?></span> </b></h6>
                                                                </div>

                                                                <div class="col-3 b-r-default">
                                                                    <p class="m-b-5">Water Level</p>
                                                                    <h6><b><span id="y_phase_voltage_fault" style="color: rgb(0, 128, 0);"><?php echo number_format($feet, 3) . ' Foot'; ?></span> </b></h6>
                                                                </div>
                                                                <!--                                                                <div class="col-3 b-r-default">
                                                                                                                                    <p class="m-b-5">Water Velocity</p>
                                                                                                                                    <h6><b><span id="y_phase_voltage_fault" style="color: rgb(0, 128, 0);"><?php echo $Velocity . ' m/s'; ?></span> </b></h6>
                                                                                                                                </div>-->
                                                                <div class="col-3">
                                                                    <p class="m-b-5">Discharge</p>
                                                                    <h6><b><span id="b_phase_voltage_fault" style="color: rgb(0, 128, 0);"><?php echo $cusec.' Cusec/Sec'; ?></span> </b></h6>
                                                                </div>
                                                                <!--                                                                <div class="col-3">
                                                                                                                                    <p class="m-b-5">Reverse Phase</p>
                                                                                                                                    <h6><b><span id="reverse_phase_voltage" style="color: rgb(0, 128, 0);">Healthy</span> </b></h6>
                                                                                                                                </div>-->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <!--                                                <div class="col-xl-6 col-md-6">
                                                                                                    <div class="card">
                                                                                                        <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #F70D1A;">
                                                                                                            <span style="color:white; font-weight: bold; font-size:18px;">Current Fault</span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                        </div>
                                                                                                        <div class="card-block">
                                                
                                                                                                            <div class="row mt-2 text-center">
                                                                                                                <div class="col-4 b-r-default">
                                                                                                                    <p class="m-b-5">R Phase</p>
                                                                                                                    <h6><b><span id="r_phase_current_fault" style="color: rgb(0, 128, 0);">Healthy</span> </b></h6>
                                                                                                                </div>
                                                                                                                <div class="col-4 b-r-default">
                                                                                                                    <p class="m-b-5">Y Phase</p>
                                                                                                                    <h6><b><span id="y_phase_current_fault" style="color: rgb(0, 128, 0);">Healthy</span> </b></h6>
                                                                                                                </div>
                                                                                                                <div class="col-4">
                                                                                                                    <p class="m-b-5">B Phase</p>
                                                                                                                    <h6><b><span id="b_phase_current_fault" style="color: rgb(0, 128, 0);">Healthy</span> </b></h6>
                                                                                                                </div>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>-->
                                            </div>

                                            <!--                                            <div class="row mt-2">
                                                                                            <div class="col-md-4">
                                                                                                <div class="card" style="height:140px;">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #B524FF;">
                                                                                                        <span style="font-weight: bold; font-size: 16px; color: white;">Energy Consumption</span><img src="http://13.234.254.166/gms/assets/images/electric-tower.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-body text-center" style="background-color:#E1E7E9;color:purple;">
                                                                                                        <div class="row">
                                                                                                            <div class="col-6 border-right">
                                                                                                                <h6 style="font-size: 12px;"><b>Today</b></h6>
                                                                                                                <h6><b><span id="today_energy_consumption">0.00</span> <span style="font-size: 14px;"> Kwh</span></b> </h6>
                                                                                                            </div>
                                                                                                            <div class="col-6 ">
                                                                                                                <h6 style="font-size: 12px;"><b>Total</b></h6>
                                                                                                                <h6><b><span id="total_energy_consumption">23397.21</span> <span style="font-size: 14px;"> Kwh</span></b> </h6>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-md-4">
                                                                                                <div class="card" style="height:140px;">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #B524FF;">
                                                                                                        <span style="font-weight: bold; font-size: 16px; color: white;">Running Hour </span><img src="http://13.234.254.166/gms/assets/images/hourglass.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-body text-center" style="background-color:#E1E7E9;color:purple;">
                                                                                                        <div class="row">
                                                                                                            <div class="col-6 border-right">
                                                                                                                <h6 style="font-size: 12px;"><b>Today</b></h6>
                                                                                                                <h6><b><span id="today_running_hour">0 Hrs 0 Min</span></b> </h6>
                                                                                                            </div>
                                                                                                            <div class="col-6 ">
                                                                                                                <h6 style="font-size: 12px;"><b>Total</b></h6>
                                                                                                                <h6><b><span id="total_running_hour">1712 Hrs 7 Min</span></b> </h6>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-md-4">
                                                                                                <div class="card" style="height:140px;">
                                                                                                    <div class="card-header d-flex justify-content-between align-items-center" style="height:40px;background-color: #1CC9A7;">
                                                                                                        <span style="font-weight:bold;color:white;font-size: 16px;">Reports</span><img src="http://13.234.254.166/gms/assets/images/report.gif" width="35" style=";border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-body">
                                                                                                        <div class="row">
                                                                                                            <div class="col-6 text-center">
                                                                                                                <a href="http://13.234.254.166/gms/Dashboard_c/get_waterpump_running_report/9769bc5f-bb57-11ee-a49c-0ac781a0ba02">
                                                                                                                    <button type="button" class="btn btn-sm btn-round btn-success"><b>Running Log</b></button>
                                                                                                                </a>
                                                                                                            </div>
                                                                                                            <div class="col-6 text-center">
                                                                                                                <a href="http://13.234.254.166/gms/Dashboard_c/get_water_pump_mis_report/9769bc5f-bb57-11ee-a49c-0ac781a0ba02">
                                                                                                                    <button type="button" class="btn btn-sm btn-round btn-primary"><b>MIS Log</b></button>
                                                                                                                </a>
                                                                                                            </div>
                                                                                                        </div>							
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Voltage</span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Voltage R</p>
                                                                                                                <h6><b><span id="phase1_voltage">199.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Voltage Y</p>
                                                                                                                <h6><b><span id="phase2_voltage">199.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Voltage B</p>
                                                                                                                <h6><b><span id="phase3_voltage">221.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3">
                                                                                                                <p class="m-b-5">Average</p>
                                                                                                                <h6><b><span id="average_voltage">206.33</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Current</span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Current R</p>
                                                                                                                <h6><b><span id="phase1_current">1.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Current Y</p>
                                                                                                                <h6><b><span id="phase2_current">0.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3 b-r-default">
                                                                                                                <p class="m-b-5">Current B</p>
                                                                                                                <h6><b><span id="phase3_current">0.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-3">
                                                                                                                <p class="m-b-5">Average</p>
                                                                                                                <h6><b><span id="average_current">0.33</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Maximum Voltage</span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage R</p>
                                                                                                                <h6><b><span id="Phase_MaxVoltage_R">1000.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage Y</p>
                                                                                                                <h6><b><span id="Phase_MaxVoltage_Y">1000.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Voltage B</p>
                                                                                                                <h6><b><span id="Phase_MaxVoltage_B">1000.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Maximum Current</span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current R</p>
                                                                                                                <h6><b><span id="PhaseMax_Current_R">1000.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current Y</p>
                                                                                                                <h6><b><span id="PhaseMax_Current_Y">1000.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Current B</p>
                                                                                                                <h6><b><span id="PhaseMax_Current_B">1000.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Minimum Voltage </span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage R</p>
                                                                                                                <h6><b><span id="R_Min_Voltage">150.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5"> Voltage Y</p>
                                                                                                                <h6><b><span id="Y_Min_Voltage">150.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Voltage B</p>
                                                                                                                <h6><b><span id="B_Min_Voltage">150.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Minimum Current  </span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current R</p>
                                                                                                                <h6><b><span id="R_Min_Current">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current Y</p>
                                                                                                                <h6><b><span id="Y_Min_Current">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Current B</p>
                                                                                                                <h6><b><span id="B_Min_Current">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #5381FF;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Imbalance Voltage</span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage RY</p>
                                                                                                                <h6><b><span id="ImbalanceVoltageRY">0.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage YB</p>
                                                                                                                <h6><b><span id="ImbalanceVoltageYB">22.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Voltage BR</p>
                                                                                                                <h6><b><span id="ImbalanceVoltageBR">22.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #5381FF;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Imbalance Current</span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current RY</p>
                                                                                                                <h6><b><span id="ImbalanceCurrentRY">1.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current YB</p>
                                                                                                                <h6><b><span id="ImbalanceCurrentYB">0.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Current BR</p>
                                                                                                                <h6><b><span id="ImbalanceCurrentBR">1.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Maximum Imbalance Voltage</span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage RY</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Voltage_RY">50.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Voltage YB</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Voltage_YB">50.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Voltage BR</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Voltage_BR">50.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #9850FB;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Maximum Imbalance Current</span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current RY</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Current_RY">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Current YB</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Current_YB">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Current BR</p>
                                                                                                                <h6><b><span id="Max_Imbalance_Current_BR">5.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Voltage Multiplier</span><img src="http://13.234.254.166/gms/assets/images/volt.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Multiplier R</p>
                                                                                                                <h6><b><span id="Voltage_Multiplier_R">152.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Multiplier Y</p>
                                                                                                                <h6><b><span id="Voltage_Multiplier_Y">152.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Multiplier B</p>
                                                                                                                <h6><b><span id="Voltage_Multiplier_B">152.00</span> <span>V</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                                                                            <div class="col-xl-6 col-md-6">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Current Multiplier </span><img src="http://13.234.254.166/gms/assets/images/electricity.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Multiplier R</p>
                                                                                                                <h6><b><span id="Current_Multiplier_R">202.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4 b-r-default">
                                                                                                                <p class="m-b-5">Multiplier Y</p>
                                                                                                                <h6><b><span id="Current_Multiplier_Y">202.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                                                                                            <div class="col-4">
                                                                                                                <p class="m-b-5">Multiplier B</p>
                                                                                                                <h6><b><span id="Current_Multiplier_B">202.00</span> <span>A</span></b></h6>
                                                                                                            </div>
                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                            
                                            
                                                                                        </div>
                                            
                                                                                        <div class="row mt-2">
                                                                                            <div class="col-xl-12 col-md-12">
                                                                                                <div class="card">
                                                                                                    <div class="card-header header_height d-flex justify-content-between align-items-center" style="background-color: #1CC9A7;">
                                                                                                        <span style="color:white; font-weight: bold; font-size:18px;">Time Configuration of RTU</span><img src="http://13.234.254.166/gms/assets/images/watch.gif" width="35" style="border-radius: 25%;">
                                                                                                    </div>
                                                                                                    <div class="card-block">
                                            
                                                                                                        <div class="row mt-2 text-center">
                                                                                                            <div class="col-10 b-r-default">
                                                                                                                <div class="row">
                                                                                                                    <div class="col-3 b-r-default">
                                                                                                                        <div class="row">
                                                                                                                            <div class="col-12">
                                                                                                                                <h6><b>Slot 1</b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6 b-r-default">
                                                                                                                                <p class="m-b-5">On Time</p>
                                                                                                                                <h6><b><span id="slot_1_on_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6">
                                                                                                                                <p class="m-b-5">Off Time</p>
                                                                                                                                <h6><b><span id="slot_1_off_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-3 b-r-default">
                                                                                                                        <div class="row">
                                                                                                                            <div class="col-12">
                                                                                                                                <h6><b>Slot 2</b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6 b-r-default">
                                                                                                                                <p class="m-b-5">On Time</p>
                                                                                                                                <h6><b><span id="slot_2_on_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6">
                                                                                                                                <p class="m-b-5">Off Time</p>
                                                                                                                                <h6><b><span id="slot_2_off_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-3 b-r-default">
                                                                                                                        <div class="row">
                                                                                                                            <div class="col-12">
                                                                                                                                <h6><b>Slot 3</b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6 b-r-default">
                                                                                                                                <p class="m-b-5">On Time</p>
                                                                                                                                <h6><b><span id="slot_3_on_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6">
                                                                                                                                <p class="m-b-5">Off Time</p>
                                                                                                                                <h6><b><span id="slot_3_off_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-3 b-r-default">
                                                                                                                        <div class="row">
                                                                                                                            <div class="col-12">
                                                                                                                                <h6><b>Slot 4</b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6 b-r-default">
                                                                                                                                <p class="m-b-5">On Time</p>
                                                                                                                                <h6><b><span id="slot_4_on_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                            <div class="col-6">
                                                                                                                                <p class="m-b-5">Off Time</p>
                                                                                                                                <h6><b><span id="slot_4_off_time">00:00</span></b></h6>
                                                                                                                            </div>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                </div>
                                                                                                            </div>
                                                                                                            <div class="col-2">
                                                                                                                <p class="mb-4"><b>RTU Time</b></p>
                                                                                                                <h6><b><span id="rtu_time">12:55</span></b></h6>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>-->


                                        </div>

                                        <!--                                        <div class="row mt-2">
                                                                                    <div class="col-xl-4 col-md-6">
                                                                                        <div class="card text-white" style="background-color:#9850FB;">
                                                                                            <div class="card-block">
                                                                                                <div class="row align-items-center">
                                                                                                    <div class="col-8">
                                                                                                        <h5 class="m-b-5" style="font-size: 16px;">Energy</h5>
                                                                                                        <h5 class="m-b-0"><span id="energy">25656.92</span> Kwh</h5>
                                                                                                    </div>
                                                                                                    <div class="col-4 col-auto text-right">
                                                                                                        <img src="http://13.234.254.166/gms/assets/images/energy.gif" width="50" style="border-radius: 50%">
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                        
                                        
                                                                                    <div class="col-xl-4 col-md-6">
                                                                                        <div class="card text-white" style="background-color:#9850FB;">
                                                                                            <div class="card-block">
                                                                                                <div class="row align-items-center">
                                                                                                    <div class="col-8">
                                                                                                        <h5 class="m-b-5" style="font-size: 16px;">Power</h5>
                                                                                                        <h5 class="m-b-0"><span id="power">0.19</span> Kw</h5>
                                                                                                    </div>
                                                                                                    <div class="col-4 col-auto text-right">
                                                                                                        <img src="http://13.234.254.166/gms/assets/images/electric-tower.gif" width="50" style="border-radius: 50%">
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>-->


                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!--[if lt IE 10]>
        <div class="ie-warning">
            <h1>Warning!!</h1>
            <p>You are using an outdated version of Internet Explorer, please upgrade <br/>to any of the following web browsers to access this website.</p>
            <div class="iew-container">
                <ul class="iew-download">
                    <li>
                        <a href="http://www.google.com/chrome/">
                            <img src="./files/assets/images/browser/chrome.png" alt="Chrome">
                            <div>Chrome</div>
                        </a>
                    </li>
                    <li>
                        <a href="https://www.mozilla.org/en-US/firefox/new/">
                            <img src="./files/assets/images/browser/firefox.png" alt="Firefox">
                            <div>Firefox</div>
                        </a>
                    </li>
                    <li>
                        <a href="http://www.opera.com">
                            <img src="./files/assets/images/browser/opera.png" alt="Opera">
                            <div>Opera</div>
                        </a>
                    </li>
                    <li>
                        <a href="https://www.apple.com/safari/">
                            <img src="./files/assets/images/browser/safari.png" alt="Safari">
                            <div>Safari</div>
                        </a>
                    </li>
                    <li>
                        <a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">
                            <img src="./files/assets/images/browser/ie.png" alt="">
                            <div>IE (9 & above)</div>
                        </a>
                    </li>
                </ul>
            </div>
            <p>Sorry for the inconvenience!</p>
        </div>
        <![endif]-->





        <script type="text/javascript" src="./files/bower_components/jquery/dist/jquery.min.js"></script>
        <script type="text/javascript" src="./files/bower_components/jquery-ui/jquery-ui.min.js"></script>
        <script type="text/javascript" src="./files/bower_components/popper.js/dist/umd/popper.min.js"></script>
        <script type="text/javascript" src="./files/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

        <script type="text/javascript" src="./files/bower_components/jquery-slimscroll/jquery.slimscroll.js"></script>

        <script type="text/javascript" src="./files/bower_components/modernizr/modernizr.js"></script>

        <script type="text/javascript" src="./files/bower_components/chart.js/dist/Chart.js"></script>

        <script src="./files/assets/pages/widget/amchart/amcharts.js"></script>
        <script src="./files/assets/pages/widget/amchart/serial.js"></script>
        <script src="./files/assets/pages/widget/amchart/light.js"></script>
        <script src="./files/assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
        <script type="text/javascript" src="./files/assets/js/SmoothScroll.js"></script>
        <script src="./files/assets/js/pcoded.min.js"></script>

        <script src="./files/assets/js/vartical-layout.min.js"></script>
        <!--<script type="text/javascript" src="./files/assets/pages/dashboard/custom-dashboard.min.js"></script>-->
        <script type="text/javascript" src="./files/assets/js/script.js"></script>

        <!-- jQuery library -->
        <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>-->

        <script type="text/javascript">

                                                                            var User_lang;
                                                                            function btn_english() {
//                        alert('function btn-english');
                                                                                User_lang = "ENGLISH";
                                                                                $.myjQuery(User_lang);
                                                                            }

                                                                            function btn_gujarati() {
//                        alert('function btn_gujarati');
                                                                                User_lang = "GUJARATI";
                                                                                $.myjQuery(User_lang);
                                                                            }
                                                                            function btn_hindi() {
//                        alert('function btn_hindi');
                                                                                User_lang = "HINDI";
                                                                                $.myjQuery(User_lang);
                                                                            }

                                                                            $(document).ready(function () {

                                                                                $.myjQuery = function (User_lang) {
//                                                    alert("jQuery " + User_lang);
                                                                                    if (User_lang == " ") {
//                                alert('Project Id Not Found! ');
                                                                                    } else {
                                                                                        debugger;
                                                                                        var send = {'Language_User': User_lang};
                                                                                        $.ajax({
                                                                                            type: 'POST',
                                                                                            data: send,
                                                                                            url: './PHP_Code/set_session_user_language.php',
                                                                                            success: function (data) {
                                                                                                debugger;
//                                                                alert('data ' + data);
                                                                                                location.reload();
//                                        window.location.href = "/project_progress/project_detail";
                                                                                            }, error: function (xhr, err) {
                                                                                                alert('Error ' + err.message);
                                                                                            }
                                                                                        });
                                                                                    }
                                                                                };
                                                                            });
                                                                            $(document).ready(function () {

                                                                                $(document.body).on('change', '#select_taluka', function () {
                                                                                    debugger;
                                                                                    if ($("#select_taluka").val() == "Select")
                                                                                    {
//                                                                    $("#msg_select_milk_type").fadeIn(500);
//                                                                    $("#msg_select_milk_type").html("* Milk Type Not Selected").css({'color': 'red'});
//                                                                    $("#msg_select_milk_type").focusin();
                                                                                    } else
                                                                                    {
//                                                                    $("#msg_select_milk_type").fadeOut(1000);
                                                                                        debugger;
                                                                                        var taluka_id = $('#select_taluka').find('option:selected').attr('id');
//                                                                    var a = $("#select_taluka").val();

                                                                                        var data = {};
                                                                                        data.taluka_id = taluka_id;
                                                                                        $.ajax({
                                                                                            type: 'POST',
                                                                                            data: data,
                                                                                            url: './PHP_Code/select_school_list.php',
                                                                                            success: function (data) {
//                        alert('data '+data);
                                                                                                debugger;
                                                                                                $('#school_list').html('');
                                                                                                $('#school_list').html(data);
                                                                                                $("#school_list").val('Select');
                                                                                            }, error: function (xhr, err) {
                                                                                                alert('Error ' + err.message);
                                                                                            }
                                                                                        });
                                                                                    }
                                                                                });
                                                                                $(document.body).on('click', '.view_school_tank_status', function (e) {

                                                                                    //            alert('id is ' + $(this).attr('id'));
                                                                                    var user_id = $(this).attr('id');
                                                                                    if (user_id == " ") {
                                                                                        alert('User Id Not Found! ');
                                                                                    } else {
                                                                                        debugger;
                                                                                        var data = {};
                                                                                        var data = {'user_id': user_id};
//                                                        data.user_id = user_id;
                                                                                        $.ajax({
                                                                                            type: 'POST',
                                                                                            data: data,
                                                                                            url: './PHP_Code/select_water_tank_detail.php',
                                                                                            success: function (data) {
                                                                                                debugger;
//                                                                                        alert('data '+data);
                                                                                                window.location.href = "./view_canal_detail.php";
                                                                                            }, error: function (xhr, err) {
                                                                                                alert('Error ' + err.message);
                                                                                            }
                                                                                        });
                                                                                    }

                                                                                });
                                                                                $('#btn-logout').click(function () {
//                alert('logout');
                                                                                    var send = {'logout': 'logout'};
                                                                                    $.ajax({
                                                                                        url: './PHP_Code/session_destroy.php',
                                                                                        type: 'POST',
                                                                                        data: send,
                                                                                        success: function (data)
                                                                                        {
                                                                                            debugger;
//                        alert('data ' + data);
                                                                                            window.location.href = "./login.php";
                                                                                        },
                                                                                        error: function (err) {
                                                                                            alert('error ' + err);
                                                                                        }
                                                                                    });
                                                                                });
                                                                            });
        </script>


    </body>
</html>