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

}else{
header("location: ../../login.php");
        }
                                    
?>
<!DOCTYPE html>
<html>

<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 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
     <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" ></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" ></script>
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.7.7/xlsx.core.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xls/0.7.4-a/xls.core.min.js"></script>

    <style>
          @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900');
        :root{
            --theme-color:#5664d2;
        }
        .theme-color{
            color:var(--theme-color);
        }
        .btn-theme-type1{
            color:#fff!important;
            background-color:var(--theme-color)!important;
            border-radius:28px!important;
            font-size:12px!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{
            border-radius:28px!important;
            background-color:#fff!important;
            font-size:12px!important;
            box-shadow:none!important;
            border-color:var(--theme-color)!important;
            color:var(--theme-color)!important;
        }
        .btn-theme-type2:hover{
            color:#fff!important;
            background-color:var(--theme-color)!important;
        }

        body {
            font-family: 'Poppins', sans-serif;
            font-size: 13px;
            background: #f8f8f8;
        }
        .container, .container-md, .container-sm {
                max-width: 100%;
            }
        .bg-light-success{
            background-color:#d4ffde!important;
        }
        .bg-light-danger{
            background-color:rgba(255, 0, 0, 0.14)!important;
        }

        #exceltable,
        #exceltable select,
        #exceltable input {
            font-size: 10px!important;
        }
        #exceltable th, #exceltable td{
            padding: 0.25rem;
        }

        select.form-control {
            height: 30px;
            font-size: 12px;
        }

        thead th {
            text-transform: capitalize;
        }

        .table td,
        .table th {
            vertical-align: middle;
        }

        #exceltable.table tr.bg-warning,
        #exceltable.table .bg-warning {
            background-color: #ffefc1!important;
        }
        select option{
            background-color:#fff;
        }

        section.content {
            box-shadow: 0px 15px 16.83px 0.17px rgba(0, 0, 0, 0.05);
            border-radius: 14px;

        }

        .uploadExcelFile::-webkit-file-upload-button {
            background: #2222225c;
        }

        .uploadExcelFile {
            font-weight: 700;
            font-size: 13px;
            border-radius: 10px;        }

        .uploadExcelFile::-webkit-file-upload-button {
            color: white;
            display: inline-block;
            background: #212529e0;
            border: none;
            padding: 12px 15px;
            font-weight: 600;
            border-radius: 3px;
            white-space: nowrap;
            cursor: pointer;
            font-size: 13px;
        }
        .note h6{
            font-size:13px;
        }
        .note ol{
            font-size:10px;
        }
        .misMatchError{
            background-color:#ff000024;
        }
        #errorConsole{
            background-color:#f4f4f4;
            width:40%;
            border-radius:14px;
            padding:15px;
        }
        #exceltable .border-left{
            border-left:2px solid #dee2e6!important;
        }
        #exceltable .opertionsTd{
            font-size:12px;
        }
        #exceltable .opertionsTd i{
            cursor:pointer;
        }
        #exceltable .opertionsTd i.fa-trash:hover{
            color:red;
        }
         #exceltable .opertionsTd i.fa-eraser:hover{
            color:darkorange;
        }
         #exceltable .opertionsTd i.fa-clone:hover{
            color:#28a745;
        }

        /*.btn:hover {
            color: #fff;
            background-color: #222222;
            border-color: #222222;
            box-shadow: 1px 1px 5px #020202;
        }

        .btn {

            width: 20%;
            display: inline-block;
            background: #009edb;
            color: #fff;
            border-bottom: none;
            width: auto;
            padding: 15px 39px;
            border-radius: 5px;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            -o-border-radius: 5px;
            -ms-border-radius: 5px;
            margin-top: 25px;
            cursor: pointer;
            border: 0;
            box-shadow: 3px 2px 9px 2px #35333329;
        }*/
        .table tr th:nth-child(3){
            width:10%;
        }
        #submit:disabled{
         /*background: #009edb!important;*/
         /*   box-shadow:none;*/
            cursor: not-allowed;
        }
      /*  @media (min-width: 768px){
            .container, .container-md, .container-sm {
                max-width: 100%;
            }
              
        }*/
          @media (max-width: 768px){
           
              .uploadExcelFile::-webkit-file-upload-button,.uploadExcelFile,  #viewfile, #submit{
                   font-size: 10px;
              }
              #viewfile{
                  margin-left:0px!important;
              }
              .table td, .table th {
                vertical-align: middle;
                padding: 0;
                font-size: 10px;
                }
            .container, .container-md, .container-sm {
                width: fit-content;
                max-width: initial;
            }
            .customerNameTh{
            width: 18%;
            padding: 0 10px;
            }
               
          }
           @media (max-width: 410px){
                #viewfile{
                        margin-top: 15px !important;
                }
                
          }

    </style>

</head>

<body>

    <!--<div class="loader" style="position: fixed;background: #000000c4;width: 100VW;height: 100vH;top: 0;display: flex;">-->
    <!--    <div style="width: 15%;height: 15%;background: #fff;border-radius: 5px;margin: auto;display: flex;">-->
    <!--            <ul style="padding: 10px;text-align: center;margin: auto;list-style: none;">-->
    <!--                    <li><span class="d-block">Succesfully submitted </span><span class="text-success">records :10</span></li>-->
    <!--            </ul>-->
    <!--    </div>-->
    <!--</div>-->
    <div class="container">
        <section class="content my-5 bg-white p-4">
            <input type="file" id="excelfile" class="uploadExcelFile" />
            <input type="button" id="viewfile" value="Export To Table" class="btn btn-theme-type1 mt-0 p-2 px-3 ml-5"/>
            <table class="table table-hover my-5 bg-white mx-auto" id="exceltable">
            </table>
            
<!--            <p><span class="text-danger font-weight-bolder">Note:</span> Fill All Required Fields and Submit</p>-->

            <div id="errorConsole" class="d-none">
                <h6>Console</h6>
                <div class="content">
                    <ul>
                        <li>Total number of records.<span>:<b id="totalRecordsValue">200</b></span>
                        <li>Already existing records.<span>:</span><b id="noOfDuplicateRecords">10</b>
                            <button id="highlightBtn" class="btn btn-theme-type2">Highlight</button>
                        </li>
                        <li>No.of records to submit.<span>:</span><b id="noOfSubmitRecords">190</b></li>
                    </ul>
                </div>
            </div>
            <button class="btn btn-theme-type1 mb-2 mx-2 mt-3" id="submit">Submit<i class="fa fa-spinner fa-spin ml-2 d-none"></i></button>
            <button class="btn btn-theme-type1 mb-2 mx-2 mt-3" id="validateExcelData">Validate<i class="fa fa-spinner fa-spin ml-2 d-none"></i></button>
            <a id="triggerAnchr" href="" class="d-none">trigger</a>
            <p class="ml-2 text-success" id="resultMessage"><b></b></p>
            <div id="downloadTemplateLink"  class="font-weight-bold" style="font-size: 13px;">Click here to download Bulk site Details template<a href="../convert%20Excel%20to%20HTML/ADD-SITE TEMPLATE.xlsx" class="ml-2 font-weight-light theme-color">clik here</a></div>
        </section>
    </div>
    
    <div class="note px-4">
        <h6 class="font-weight-bold"> Note:-</h6>
        <ol>
            <li>Only one record allowed with same(SiteId, EmpId, SiteVisitDate) i.e Any employee cant visit a same site twice in a day.</li>
            <li>If Po details not available, skip assigning employee details(leave as empty cells).</li>
            <li>Site-Visit-Date formate (YYYY-MM-DD) in excel.</li>
        </ol>
    </div>
</body>
    <script>
        var loggedUserId=<?php session_start(); echo json_encode($_SESSION["userId"]) ?>;
        var loggedUserName=<?php session_start(); echo json_encode($_SESSION["userName"])?>;
    </script>
<script type="text/javascript" src="globalVariable.js?version= 1.6"></script>
<script type="text/javascript" src="sortRawData.js?version= 0.1"></script>
<script type="text/javascript" src="../../js/constants.js?version= 1.8"></script>
<script src="../../js/dynamicDropdown_of_project_&_stageOfAudit.js?version=1.0"></script>
<script src="../../js/HttpRequest.js?version=1.0"></script>
<script type="text/javascript" src="main.js?version= 2.0"></script>
<!--<script type="text/javascript" src="constants.js"></script>-->
<script type="text/javascript" src="DynamicTabledata.js?version= 1.7"></script>
<!--<script type="text/javascript" src="dropDownClass.js"></script>-->

</html>
