<?php
    session_start();
if(isset($_SESSION['userId'])){

}else{
header("location: ../login.php");
 
        }

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Home page</title>
    <!-- Bootstrap CSS -->
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
    <link href='css/style.css?version=0.2' rel="stylesheet"/>
     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900');

        :root{
            --theme-color:#5664d2;
        }
        body {
            font-family: 'Poppins', sans-serif;
            background: rgb(244, 245, 247);
            font-size: 0.8rem;
        }
        .btn-theme-type1{
            color:#fff!important;
            background-color:var(--theme-color)!important;
            border-radius:28px!important;
            font-size:10px!important;
            box-shadow:none!important;
        }
        .btn-theme-type1:hover{
            color:var(--theme-color)!important;
            background-color:#fff!important;
            border-color:var(--theme-color)!important;
        }       .btn-theme-type2{
            color:var(--theme-color);
            background-color:#fff;
            border-radius:28px;
            font-size:10px;
            border-color:var(--theme-color);
            box-shadow:none!important;
        }
        .btn-theme-type2:hover{
             color:#fff;
            background-color:var(--theme-color)!important;
        }
        .bg-theme-color{
                background-color: var(--theme-color);
                border-color:var(--theme-color);
        }
        #list .card {
            box-shadow: 1px 1px 13px 2px #00000012;
            border: none;
        }

        .navbar.navbar-expand-lg {
            background-color: #ffffff !important;
            box-shadow: 1px 1px 3px 1px #00000012;
            position: sticky;
            top: 0;
            z-index: 10;
        }


        .navbar a img {
            height: 60px;
            padding-left: 35px;
        }

        .navbar-light .navbar-nav .nav-link {
            color: #000;
        }

        .text-primary {
            color: var(--theme-color) !important;
        }

        /*
        #container .car-holder:nth-child(-n+3) {
            padding-top: 7px !important;
        }
*/

        .navbar-light .navbar-nav .nav-link:focus,
        .navbar-light .navbar-nav .nav-link:hover {
            color: var(--theme-color);
        }

        .navbar-light .navbar-nav .nav-link.active {
            color: var(--theme-color);
        }

        #searchText {
            text-align: center;
            border-radius: 19px;
            padding: 7px 20px;
            border-color: var(--theme-color);
            font-size: 12px;
        }
        
        .siteDetailCardTable .copyText_LatLng_Btn i{
                color:#d4d9ff;
        }
        .siteDetailCardTable tr td:nth-child(2) {
            padding-left: 15px;
        }

        #searchForm {
            margin-left: 3rem;
        }
        .siteDetailCardTable tr td:nth-child(2){
            word-break: break-all;
            width: 64%;
            }
            
        .loaderPopupWindow .loaderContainerWindow{
            width: 20%;
            height: 20%;
            background: #ffff;
            border-radius: 5px;
        }
        /*---------------media query-------------*/
        @media (min-width: 1200px) {

            .container,
            .container-lg,
            .container-md,
            .container-sm,
            .container-xl {
                    max-width: 1465px;
            }
        }
        @media (max-width:992px ){

        #searchForm {
            margin-left: 0;
        }
        }
/*         @media only screen and(max-width:575px ){*/
        @media only screen and (max-width: 575px) {

            #searchForm button{
                margin: auto;
            }
           
        }

    </style>
</head>

<body>
        <!------------------------------------- loader popup window ------------------------------>
        <div class="loaderPopupWindow vw-100 vh-100 position-fixed d-none" style=" background: #0a0a0a73; z-index: 100;">
            <div class="m-auto d-flex loaderContainerWindow">
                <div class="content w-100 d-flex">
                   
                </div>
            </div>
        </div>
        <!--------------------------------------->
    <!-- Navbar start -->
    <nav class="navbar navbar-expand-lg bg-dark navbar-light">
        <a class="navbar-brand" href="./index.php">
            <img src="public/pacslogo.jpg" alt="Navbar" />
        </a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav ml-auto">
                   <?php
                if($_SESSION['deviceType']=='PC'){
                echo '<li class="nav-item pr-2">'
                        .'<a class="nav-link" href="../">Home<span class="sr-only">(current)</span></a>'
                     .'</li>';
                }
                ?>
                <li class="nav-item pr-2">
                    <a class="nav-link active" href="index.php">All Sites <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item pr-2">
                    <a class="nav-link" href="html/addSite.php">Add Site</a>
                </li>
            </ul>
            <form id="searchForm" class="form-inline">
                <input class="form-control mr-sm-2" id="searchText" type="search" placeholder="Search by site ID" aria-label="Search" required />
                <button class="btn btn-theme-type1 my-2 my-sm-0 text-white px-4" type="submit" style="font-size:12px!important">
                    Search<i id="searchSiteIdSpinner" class="d-none fa fa-spinner fa-spin"></i>
                </button>
            </form>
        </div>
    </nav>

    <!-- Navbar end -->
    <div class="container" id="container">
        <h5 class="recent text-primary ml-2 mt-4">Recently Added Sites</h5>
        <div id="list" class="row">
        </div>
    </div>
    
    <script src="../js/constants.js?version= 1.9"></script>
    <script src="../js/checkInternet_connection.js?version= 1.6"></script>
	<script src="../js/uniqueEmployeeId.js?version=0.1"></script>
    <script src="js/httpRequest.js?version=1.6"></script>
    <script src="js/placeholder_loader.js?version= 1.7"></script>
    <script src="js/index.js?version= 1.7"></script>

</body>

</html>
