<?php if (isset($component)) { $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AppLayout::class, []); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
   <style>
      .total_sales_graph_box {
      box-sizing: content-box;
      height: 288px;
      width: 540px;
      margin-bottom: 20px;
      }
      .dashboard_page_content {
      flex-wrap: wrap;
      }
      .total_Sale .total_sales_box,
      .total_Sale .total_sales_box2 {
      margin-bottom: 20px;
      }
      .dashboard_page_content .inpt {
      width: 280px;
      }
      .custom-select {
      position: relative;
      width: 100%;
      }
      /*.custom-select  {*/
      /*    display: none;*/
      /*}*/
      .user_back_button,
      .user_back_button-2 {
      margin-top: -30px;
      margin-bottom: 10px;
      display: none;
      }
      .select-selected {
      background-color: #ffffff;
      color: #000000;
      font-size: 16px;
      font-weight: 700;
      padding: 0px 10px;
      cursor: pointer;
      min-width: 180px;
      max-width: fit-content;
      }
      .select-selected:after {
      position: absolute;
      content: "";
      top: 50%;
      right: 15px;
      margin-top: -3px;
      border-width: 4px 4px 0 4px;
      border-style: solid;
      border-color: #696D61 transparent transparent transparent;
      }
      .select-items,
      .select-items-2 {
      display: none;
      position: absolute;
      background-color: #fff;
      box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.1);
      /* border: 1px solid #F1F1F2; */
      width: 280px;
      padding: 15px;
      right: -10px;
      top: 30px;
      z-index: 1;
      border-radius: 5px 5px 10px 10px;
      }
      .select-items div {
      padding: 10px 20px;
      cursor: pointer;
      font-size: 14px;
      color: #000000;
      margin-bottom: 5px;
      //margin-left:-90px;
      display: flex;
      gap: 10px;
      font-weight: 500;
      }
      .select-items div:hover {
      background-color: #F2F7FF;
      border-radius: 11px;
      font-weight: 700;
      }
      .select-items-2 div:hover {
      font-weight: 700;
      }
      .select-items-2 div {
      padding: 10px 20px;
      cursor: pointer;
      font-size: 14px;
      color: #000000;
      margin-bottom: 5px;
      /*margin-left:-90px;*/
      display: flex;
      gap: 10px;
      font-weight: 500;
      }
      .dashboard_drop_select {
      position: relative;
      width: 100%;
      }
      .dashboard_drop_select select {
      display: none;
      }
      @media(max-width:1400px) {
      .total_sales_graph_box {
      width: 98%;
      }
      }
      .select-items,
      .select-items-2 {
      display: none;
      position: absolute;
      background-color: #fff;
      box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.1);
      /* border: 1px solid #F1F1F2; */
      width: 280px;
      padding: 15px;
      right: -10px;
      top: 30px;
      z-index: 1;
      border-radius: 5px 5px 10px 10px;
      box-shadow: 0px 0px 4px;
      }
      .Dashboard_header header .header_box {
      height: 103px;
      line-height: 103px;
      width: 97%;
      }
      #tog_svg {
      cursor: pointer;
      }
   </style>
   <header>
      <style>
         #total_sales_chart {
         height: 300px !important;
         /* Set height to 300px */
         margin-top: 10px;
         }
      </style>
      <div class="d-flex justify-content-between header_box">
         <h3>Dashboard</h3>
         <!--<div class="header_left_side">-->
         <!--   <span class="first">-->
         <!--      <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36"-->
         <!--         viewBox="0 0 36 36">-->
         <!--         <path class="clr-i-outline clr-i-outline-path-1" fill="currentColor"-->
         <!--            d="M32.51 27.83A14.4 14.4 0 0 1 30 24.9a12.63 12.63 0 0 1-1.35-4.81v-4.94A10.81 10.81 0 0 0 19.21 4.4V3.11a1.33 1.33 0 1 0-2.67 0v1.31a10.81 10.81 0 0 0-9.33 10.73v4.94a12.63 12.63 0 0 1-1.35 4.81a14.4 14.4 0 0 1-2.47 2.93a1 1 0 0 0-.34.75v1.36a1 1 0 0 0 1 1h27.8a1 1 0 0 0 1-1v-1.36a1 1 0 0 0-.34-.75M5.13 28.94a16.17 16.17 0 0 0 2.44-3a14.24 14.24 0 0 0 1.65-5.85v-4.94a8.74 8.74 0 1 1 17.47 0v4.94a14.24 14.24 0 0 0 1.65 5.85a16.17 16.17 0 0 0 2.44 3Z" />-->
         <!--         <path class="clr-i-outline clr-i-outline-path-2" fill="currentColor"-->
         <!--            d="M18 34.28A2.67 2.67 0 0 0 20.58 32h-5.26A2.67 2.67 0 0 0 18 34.28" />-->
         <!--         <path fill="none" d="M0 0h36v36H0z" />-->
         <!--      </svg>-->
         <!--   </span>-->
         <!--   <span class="second">-->
         <!--      <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22"-->
         <!--         viewBox="0 0 24 24">-->
         <!--         <path fill="currentColor"-->
         <!--            d="M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71M5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1" />-->
         <!--      </svg>-->
         <!--      Download-->
         <!--   </span>-->
         <!--</div>-->
      </div>
   </header>
   <div class="user_container" style="display: block">
      <div class="user_back_button">
         <a href="#">
            <svg width="33" height="33" viewBox="0 0 43 43" fill="none"
               xmlns="http://www.w3.org/2000/svg">
               <path
                  d="M9.40625 20.1562H36.2812C36.6376 20.1562 36.9794 20.2978 37.2314 20.5498C37.4834 20.8018 37.625 21.1436 37.625 21.5C37.625 21.8564 37.4834 22.1982 37.2314 22.4502C36.9794 22.7022 36.6376 22.8438 36.2812 22.8438H9.40625C9.04987 22.8438 8.70808 22.7022 8.45608 22.4502C8.20407 22.1982 8.0625 21.8564 8.0625 21.5C8.0625 21.1436 8.20407 20.8018 8.45608 20.5498C8.70808 20.2978 9.04987 20.1562 9.40625 20.1562Z"
                  fill="#333333" />
               <path
                  d="M9.96301 21.4997L21.1081 32.6421C21.3604 32.8944 21.5021 33.2367 21.5021 33.5935C21.5021 33.9503 21.3604 34.2925 21.1081 34.5449C20.8558 34.7972 20.5135 34.9389 20.1567 34.9389C19.7999 34.9389 19.4576 34.7972 19.2053 34.5449L7.11157 22.4511C6.98644 22.3263 6.88715 22.178 6.81941 22.0148C6.75167 21.8515 6.7168 21.6765 6.7168 21.4997C6.7168 21.323 6.75167 21.148 6.81941 20.9847C6.88715 20.8215 6.98644 20.6732 7.11157 20.5484L19.2053 8.45462C19.4576 8.2023 19.7999 8.06055 20.1567 8.06055C20.5135 8.06055 20.8558 8.2023 21.1081 8.45462C21.3604 8.70694 21.5021 9.04916 21.5021 9.40599C21.5021 9.76283 21.3604 10.105 21.1081 10.3574L9.96301 21.4997Z"
                  fill="#333333" />
            </svg>
         </a>
      </div>
      <div class="user_back_button-2">
         <a href="#">
            <svg width="33" height="33" viewBox="0 0 43 43" fill="none"
               xmlns="http://www.w3.org/2000/svg">
               <path
                  d="M9.40625 20.1562H36.2812C36.6376 20.1562 36.9794 20.2978 37.2314 20.5498C37.4834 20.8018 37.625 21.1436 37.625 21.5C37.625 21.8564 37.4834 22.1982 37.2314 22.4502C36.9794 22.7022 36.6376 22.8438 36.2812 22.8438H9.40625C9.04987 22.8438 8.70808 22.7022 8.45608 22.4502C8.20407 22.1982 8.0625 21.8564 8.0625 21.5C8.0625 21.1436 8.20407 20.8018 8.45608 20.5498C8.70808 20.2978 9.04987 20.1562 9.40625 20.1562Z"
                  fill="#333333" />
               <path
                  d="M9.96301 21.4997L21.1081 32.6421C21.3604 32.8944 21.5021 33.2367 21.5021 33.5935C21.5021 33.9503 21.3604 34.2925 21.1081 34.5449C20.8558 34.7972 20.5135 34.9389 20.1567 34.9389C19.7999 34.9389 19.4576 34.7972 19.2053 34.5449L7.11157 22.4511C6.98644 22.3263 6.88715 22.178 6.81941 22.0148C6.75167 21.8515 6.7168 21.6765 6.7168 21.4997C6.7168 21.323 6.75167 21.148 6.81941 20.9847C6.88715 20.8215 6.98644 20.6732 7.11157 20.5484L19.2053 8.45462C19.4576 8.2023 19.7999 8.06055 20.1567 8.06055C20.5135 8.06055 20.8558 8.2023 21.1081 8.45462C21.3604 8.70694 21.5021 9.04916 21.5021 9.40599C21.5021 9.76283 21.3604 10.105 21.1081 10.3574L9.96301 21.4997Z"
                  fill="#333333" />
            </svg>
         </a>
      </div>
      <div class="dashboard_page_content">
         <div class="d-flex flex-wrap mb-2">
            <div class="d-flex mb-2">
               <div class="">
                  <div id="reportrange" class="form-control inpt inpt_date mb-2"
                     style="background: #fff; cursor: pointer; padding: 10px 20px; border: 1px solid #ccc; width: 100%; display: flex;flex-direction: row;gap: 2px;">
                     <i class="fa fa-calendar"></i>&nbsp;
                     <span></span> <i class="fa fa-caret-down"></i>
                  </div>
               </div>
            </div>
         </div>
         <div>
            <button class="d-flex"
               >
            
             <i class="fa-solid fa-store fa-2x" style="color: #1B59F8;"></i>
            <span class="store_link">
            <a class="st_link" href="https://cleaneoapp.com/">Store Link</a>
            <a class="web_link" href="https://cleaneoapp.com/">cleaneoapp.com</a>
            </span>
            </button>
         </div>
      </div>
      <div class="row total_Sale mt-2">
         <div class="col-xl-6 col-lg-12 col-md-12 col-xl-6">
            <div class="total_sales_graph_box" style="">
               <h3 class="d-flex justify-content-between text_16 b_600 black"><span>Total Sales </span>
                  <span id="total_cost1">₹ 0</span>
               </h3>
               <div class="total_sales_graph" style="">
                  <canvas id="total_sales_chart" style="height:280px !important; margin-top:10px;"></canvas>
                  <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.chartdash-1','data' => []]); ?>
<?php $component->withName('chartdash-1'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
               </div>
            </div>
         </div>
         <script>
            $(document).ready(function() {
                // Function to load all vendors via AJAX
                function loadAllVendors() {
                    $.ajax({
                        url: "<?php echo e(route('fetch_all_vendors')); ?>",
                        type: "GET",
                        dataType: "json",
                        success: function(response) {
                            if (response.success) {
                                // Update total vendor count
                                $('#totalVendorCount').text(response.totalVendorCount);
                            } else {
                                console.error('Error fetching vendors');
                            }
                        },
                        error: function(xhr, status, error) {
                            console.error('Error fetching vendors:', error);
                        }
                    });
                }
            
                // Function to load all delivery agents via AJAX
                function loadAllDelivery() {
            $.ajax({
            url: 'https://drycleaneo.com/admin/delivery_api', // API endpoint
            type: 'GET',
            dataType: 'json',
            success: function(response) {
            if (response.success && response.totalAgents !== undefined) {
            // Display the total number of delivery agents
            $('#totalAgents').text(response.totalAgents);
            } else {
            console.warn('Unexpected response structure:', response);
            $('#totalAgents').text('N/A');
            }
            },
            error: function(xhr, status, error) {
            console.error('Error fetching delivery agents:', error);
            $('#totalAgents').text('0');
            }
            });
            }
            
            
                // Function to load all users via AJAX
                function loadAllUsers() {
                    $.ajax({
                        url: "<?php echo e(route('fetch_all_users')); ?>",
                        type: "GET",
                        dataType: "json",
                        success: function(response) {
                            if (response.success) {
                                // Update total user count
                                $('#totalUsersCount').text(response.totalUserCount);
                            } else {
                                console.error('Error fetching users');
                            }
                        },
                        error: function(xhr, status, error) {
                            console.error('Error fetching users:', error);
                        }
                    });
                }
            
                // Initial calls to load data
                loadAllVendors();
                loadAllDelivery();
                loadAllUsers();
            
                // Set intervals to update counts every 2 seconds
                setInterval(loadAllVendors, 2000);
                setInterval(loadAllDelivery, 2000);
            
            });
         </script>
         <script>
            $(document).ready(function() {
                // Function to load all vendors via AJAX
                function loadAllUsers() {
                    $.ajax({
                        url: "<?php echo e(route('fetch_all_users')); ?>",
                        type: "GET",
                        dataType: "json",
                        success: function(response) {
                            if (response.success) {
                                // Update total vendor count
                                $('#totalusersCount').text(response.totalUserCount);
                            } else {
                                console.error('Error fetching vendors');
                            }
                        },
                        error: function(xhr, status, error) {
                            console.error('Error fetching vendors:', error);
                        }
                    });
                }
            
                // Load all vendors on page load
                loadAllUsers();
                setInterval(loadAllUsers, 2000);
            });
         </script>
         <style>
            .total_Sale .total_sales_box .total_sales_icon {
            width: fit-content;
            }
            .total_Sale .total_sales_box,
            .total_Sale .total_sales_box2 {
            height: auto;
            }
         </style>
         <div class="col-xl-6 col-lg-12 col-md-12 col-xl-6">
            <div class="row ">
               <!-- ----- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('orders')); ?>">
                     <div class="total_sales_box">
                        <div class="total_sales_icon" href
                           style="
                           padding: 4px 8px 8px 8px">
                           <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px"
                              viewBox="0 0 24 24" style="color:#ffffff;">
                              <path fill="none" stroke="currentColor" stroke-linecap="round"
                                 stroke-width="1.5"
                                 d="m15.578 3.382l2 1.05c2.151 1.129 3.227 1.693 3.825 2.708C22 8.154 22 9.417 22 11.942v.117c0 2.524 0 3.787-.597 4.801c-.598 1.015-1.674 1.58-3.825 2.709l-2 1.049C13.822 21.539 12.944 22 12 22s-1.822-.46-3.578-1.382l-2-1.05c-2.151-1.129-3.227-1.693-3.825-2.708C2 15.846 2 14.583 2 12.06v-.117c0-2.525 0-3.788.597-4.802c.598-1.015 1.674-1.58 3.825-2.708l2-1.05C10.178 2.461 11.056 2 12 2s1.822.46 3.578 1.382ZM21 7.5l-4 2M12 12L3 7.5m9 4.5v9.5m0-9.5l4.5-2.25l.5-.25m0 0V13m0-3.5l-9.5-5" />
                           </svg>
                        </div>
                        <div class="content_box mt-3">
                           <h3 id="total_orders">0</h3>
                           <span class="mb-0">Total Orders</span>
                           <p class="blue mb-0">Profit of Cleaneo <span id="clea_profit">0</span> </p>
                           <p class="blue mb-0">Worth <span id="total_cost">0</span> </p>
                        </div>
                     </div>
                  </a>
               </div>
               <!-- ----- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('orders')); ?>">
                     <div class="total_sales_box">
                        <div class="total_sales_icon" style="padding: 6px 10px;">
                           <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
                              style="color:#ffffff;" viewBox="0 0 24 24">
                              <path fill="currentColor"
                                 d="M19 2H5C3.3 2 2 3.3 2 5v14c0 1.7 1.3 3 3 3h14c1.7 0 3-1.3 3-3V5c0-1.7-1.3-3-3-3M8 17c0 .6-.4 1-1 1s-1-.4-1-1v-4c0-.6.4-1 1-1s1 .4 1 1zm5 0c0 .6-.4 1-1 1s-1-.4-1-1V7c0-.6.4-1 1-1s1 .4 1 1zm5 0c0 .6-.4 1-1 1s-1-.4-1-1v-6c0-.6.4-1 1-1s1 .4 1 1z" />
                           </svg>
                        </div>
                        <div class="content_box mt-3">
                           <h3 id="delivered_orders">0</h3>
                           <span class="mb-0">Delivered Orders</span>
                           <p class="blue mb-0">Worth <span id="delivered_total_cost">0</span> </p>
                        </div>
                     </div>
                  </a>
               </div>
               <!-- ----- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('orders')); ?>" alt="">
                     <div class="total_sales_box">
                        <div class="total_sales_icon" style="padding: 6px 10px;">
                           <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
                              style="color:#ffffff;" viewBox="0 0 24 24">
                              <path fill="currentColor"
                                 d="M19 2H5C3.3 2 2 3.3 2 5v14c0 1.7 1.3 3 3 3h14c1.7 0 3-1.3 3-3V5c0-1.7-1.3-3-3-3M8 17c0 .6-.4 1-1 1s-1-.4-1-1v-4c0-.6.4-1 1-1s1 .4 1 1zm5 0c0 .6-.4 1-1 1s-1-.4-1-1V7c0-.6.4-1 1-1s1 .4 1 1zm5 0c0 .6-.4 1-1 1s-1-.4-1-1v-6c0-.6.4-1 1-1s1 .4 1 1z" />
                           </svg>
                        </div>
                        <div class="content_box mt-3">
                           <h3 id="pending_orders">0</h3>
                           <span class="mb-0">Pending Orders</span>
                           <p class="blue mb-0">Worth <span id="pending_total_cost">0</span></p>
                        </div>
                     </div>
                  </a>
               </div>
               <!-- --- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('user_management')); ?>" alt="">
                     <div class="total_sales_box2">
                        <div class="total_sales_icon"
                           style="padding: 6px 10px; background-color: #1b59f8;
                           color: #fff;
                           width: fit-content;
                           border-radius: 50%;">
                           <svg width="20px" xmlns="http://www.w3.org/2000/svg" fill="#fff"
                              viewBox="0 0 24 24">
                              <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                              <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round">
                              </g>
                              <g id="SVGRepo_iconCarrier">
                                 <path
                                    d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z">
                                 </path>
                              </g>
                           </svg>
                        </div>
                        <div class="content_box ">
                           <span class="gry">Total User</span>
                           <h5 class="mt-1" id="totalusersCount">0 </span></h5>
                        </div>
                     </div>
                  </a>
               </div>
               <!-- --- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('vendors')); ?>" alt="">
                     <div class="total_sales_box2">
                        <div class="total_sales_icon"
                           style="padding: 6px 10px; background-color: #1b59f8;
                           color: #fff;
                           width: fit-content;
                           border-radius: 50%;">
                           <svg width="20px" fill="#ffffff" height="20px" width="" version="1.2"
                              baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
                              xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 256 256"
                              xml:space="preserve" stroke="#ffffff">
                              <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                              <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round">
                              </g>
                              <g id="SVGRepo_iconCarrier">
                                 <title>Bratwurstbike</title>
                                 <title>Layer 1</title>
                                 <g>
                                    <path
                                       d="M199.5,204.4c-0.1,0-0.1,0-0.2,0h-0.1c-0.9,0-1.8,0.2-2.7,0.6c-2.9,1.1-4.8,4-4.8,7.1c0,4.3,3.5,7.8,7.8,7.8 c4.3,0,7.8-3.5,7.8-7.8S203.8,204.4,199.5,204.4z">
                                    </path>
                                    <path
                                       d="M237.6,122.2H148V54.5c0-0.1,0-0.2,0-0.4l76,0.3l0,0c1.4,0,2.7-1,3-2.3l-1.6-3.5L148,9.5c-0.8-0.4-1.8-0.4-2.7,0L63.1,47.9 c-1.3,0.6-2,2-1.7,3.5s1.5,2.4,3,2.4l77.6,0.3c0,0.1,0,0.2,0,0.4v149.1h-25l10.2-15.6h5.1c1.7,0,3.1-1.4,3.1-3.1 c0-1.6-1.4-3.1-3.1-3.1h-13.8c-1.7,0-3.1,1.4-3.1,3.1c0,1.6,1.4,3.1,3.1,3.1h1.2l-8.3,12.6l-37.6-75.2h8.4c1.7,0,3.1-1.4,3.1-3.1 c0-1.6-1.4-3.1-3.1-3.1H59c-1.7,0-3.1,1.4-3.1,3.1c0,1.6,1.4,3.1,3.1,3.1h8.1l19.7,39.5l-0.2-0.2L75.5,175 c-7.7-6.9-17.8-11.1-28.9-11.1c-23.7,0-43,19.3-43,43s19.2,42.8,42.9,42.8c22.7,0,41.2-17.7,42.9-39.9h16l-10.2,15.6h-5.2 c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1h13.8c1.7,0,3.1-1.4,3.1-3.1c0-1.7-1.4-3.1-3.1-3.1h-1.1l10.2-15.6h47.3 c0,0.4,0,0.8,0,1.2c0,21.6,17.6,39.2,39.2,39.2s39.2-17.6,39.2-39.2c0-1.4-0.1-2.9-0.3-4.3h12.8v-54.1v-30.4h-13.3V122.2z M46.5,243.5c-20.3,0-36.8-16.5-36.8-36.8s16.5-36.8,36.8-36.8c9.3,0,17.9,3.5,24.3,9.2l-25,23.3c-0.3-0.1-0.6-0.1-1-0.1 c-2.4,0-4.5,2-4.5,4.5c0,2.4,2,4.5,4.5,4.5c1.3,0,2.4-0.5,3.3-1.4h35.1C81.6,228.6,65.8,243.5,46.5,243.5z M53.4,203.6L75,183.5 c4.5,5.6,7.5,12.6,8.1,20.1H53.4z M89.3,203.6c-0.6-9.2-4.2-17.6-9.8-24.3l9.8-9.1l16.6,33.4L89.3,203.6L89.3,203.6z M199.3,244 c-18.2,0-33-14.8-33-33c0-0.4,0-0.8,0-1.2c0.1-1.5,0.2-3,0.4-4.4c0.1-0.6,0.2-1.2,0.3-1.7c3.4-14.7,16.5-25.6,32.2-25.6 c16.3,0,30,11.9,32.6,27.6c0.3,1.7,0.4,3.6,0.4,5.4C232.2,229.1,217.4,244,199.3,244z">
                                    </path>
                                 </g>
                              </g>
                           </svg>
                        </div>
                        <div class="content_box ">
                           <span class="gry">Total Vendors</span>
                           <h5 class="mt-1" id="totalVendorCount">0</span></h5>
                        </div>
                     </div>
                  </a>
               </div>
               <!-- --- -->
               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
                  <a href="<?php echo e(route('delivery')); ?>" alt="">
                     <div class="total_sales_box2">
                        <div class="total_sales_icon"
                           style="padding: 6px 10px; background-color: #1b59f8;
                           color: #fff;
                           width: fit-content;
                           border-radius: 50%;">
                           <svg width="20px" viewBox="0 0 400 400" fill="none"
                              xmlns="http://www.w3.org/2000/svg">
                              <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                              <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round">
                              </g>
                              <g id="SVGRepo_iconCarrier">
                                 <path
                                    d="M252.644 56.915C295.342 38.4482 320.69 113.363 271.651 123.522C231.551 131.832 216.845 78.0154 247.144 58.0544"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path
                                    d="M330.482 265.712C341.911 277.397 345.967 295.564 330.334 311.241C305.977 335.671 271.834 312.649 271.756 285.037"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path
                                    d="M192.293 285.199C193.35 293.668 190.602 302.807 182.127 311.229C159.576 333.641 128.721 316.163 123.655 291.812"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M231 133C206.612 161.128 194.495 179.606 187 209" stroke="#fff"
                                    stroke-opacity="0.9" stroke-width="16" stroke-linecap="round"
                                    stroke-linejoin="round"></path>
                                 <path d="M231.268 139C230.078 174.935 230.842 200.382 278 181.706"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M270.454 181.27C277.648 203.747 292.95 234.179 296.436 257.918"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path
                                    d="M198.698 209.851C179.8 211.119 147.038 219.427 133.916 234.11C126.125 242.825 100.697 270.714 108.106 285.446C112.07 293.339 163.502 289.662 170.276 288.7C200.718 284.374 240.691 289.662 270.337 285.446C276.764 284.532 267.42 277.198 275.865 277.198C288.469 277.198 350.064 262.896 339.366 250.123C314.559 220.523 257.393 244.451 266.097 274.746"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M200.303 212.449C207.9 229.886 214.057 274.576 214.593 278.703"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M200.303 208.553C255.045 208.309 257.332 233.927 223.294 274.806"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M169.124 213.748C142.024 230.768 99.6067 221.459 67.7939 231.936"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path d="M60 128.007C68.4342 143.576 60 224.334 63.5625 228.038"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                                 <path
                                    d="M63.8965 128.233C105.69 123.275 132.857 122.22 136.014 128.233C139.17 134.247 139.17 171.658 130.567 218.945"
                                    stroke="#fff" stroke-opacity="0.9" stroke-width="16"
                                    stroke-linecap="round" stroke-linejoin="round"></path>
                              </g>
                           </svg>
                        </div>
                        <div class="content_box ">
                           <span class="gry">Total Agents</span>
                           <h5 class="mt-1" id="totalAgents">0 </h5>
                        </div>
                     </div>
                  </a>
               </div>
            </div>
         </div>
      </div>
      <div class="row mt-5">
         <!-- User Leaderboard -->
         <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 mb-3">
            <div class="customer_list_table">
               <h4>User Leaderboard</h4>
               <div id="user-leaderboard" class="row">
                  <div class="col-lg-12">
                     <?php $__currentLoopData = $topUsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                     <div class="customer_list_row d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center">
                           <!-- Display profile image, fallback to a default image if none exists -->
                           <img src="<?php echo e(asset('IMAGES/users/one.jpg')); ?>" 
                              alt="Profile Image" 
                              class="w-12 h-12 rounded-full mr-3">
                           <!-- User details -->
                           <div class="det">
                              <h6><?php echo e($user->name ?? 'Unknown'); ?></h6>
                              <span><?php echo e($user->total_orders ?? '0'); ?> Points</span>
                           </div>
                        </div>
                        <!-- Rank with conditional styling for top 3 users -->
                        <span class="num d-flex align-items-center <?php echo e($index < 3 ? 'text-success' : 'text-danger'); ?>">
                        <?php echo e($index + 1); ?>

                        </span>
                     </div>
                     <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </div>
               </div>
            </div>
         </div>
         <!-- Vendor Leaderboard -->
         <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 mb-3">
            <div class="customer_list_table">
               <h4>Vendor Leaderboard</h4>
               <div id="vendor-leaderboard" class="row">
                  <div class="col-lg-12">
                     <?php $__currentLoopData = $topVendors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                     <div class="customer_list_row d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center">
                           <!-- Display profile image, fallback to a default image if none exists -->
                           <img src="<?php echo e(asset('IMAGES/users/one.jpg')); ?>" 
                              alt="Profile Image" 
                              class="w-12 h-12 rounded-full mr-3">
                           <!-- User details -->
                           <div class="det">
                              <h6><?php echo e($user->name ?? 'Unknown'); ?></h6>
                              <span><?php echo e($user->total_orders ?? '0'); ?> Points</span>
                           </div>
                        </div>
                        <!-- Rank with conditional styling for top 3 users -->
                        <span class="num d-flex align-items-center <?php echo e($index < 3 ? 'text-success' : 'text-danger'); ?>">
                        <?php echo e($index + 1); ?>

                        </span>
                     </div>
                     <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </div>
               </div>
            </div>
         </div>
         <!-- Delivery Agent Leaderboard -->
         <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 mb-3">
            <div class="customer_list_table">
               <h4>Agent Leaderboard</h4>
               <div id="delivery-agent-leaderboard" class="row">
                  <div class="col-lg-12">
                     <?php $__currentLoopData = $topAgents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                     <div class="customer_list_row d-flex justify-content-between align-items-center mb-3">
                        <div class="d-flex align-items-center">
                           <!-- Display profile image, fallback to a default image if none exists -->
                           <img src="<?php echo e(asset('IMAGES/users/one.jpg')); ?>" 
                              alt="Profile Image" 
                              class="w-12 h-12 rounded-full mr-3">
                           <!-- User details -->
                           <div class="det">
                              <h6><?php echo e($user->name ?? 'Unknown'); ?></h6>
                              <span><?php echo e($user->total_orders ?? '0'); ?> Points</span>
                           </div>
                        </div>
                        <!-- Rank with conditional styling for top 3 users -->
                        <span class="num d-flex align-items-center <?php echo e($index < 3 ? 'text-success' : 'text-danger'); ?>">
                        <?php echo e($index + 1); ?>

                        </span>
                     </div>
                     <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
   <script>

$(document).ready(function () {
    function fetchOrderDataAndUpdateUI() {
        $.ajax({
            url: 'https://drycleaneo.com/admin/order_api',
            type: 'GET',
            dataType: 'json',
            success: function (data) {
                if (data.success) {
                    let totalOrders = data.allOrders.length;
                    let totalCost = 0;
                    let deliveredCount = 0;
                    let deliveredTotalCost = 0;
                    let pendingCount = 0;
                    let pendingTotalCost = 0;
                    let cancelledCount = 0;
                    let cancelledTotalCost = 0;
                    let cleaneoProfit = 0;

                    // Define status categories
                    let deliveredStatuses = ["Delivered", "Completed"];
                    let pendingStatuses = ["Pending", "Accepted", "Pickup In Progress", "Picked Up", "At Vendor", "Ready for Delivery", "Delivery In Progress"];
                    
                    data.allOrders.forEach(order => {
                        let orderTotal = parseFloat(order.UserTotalCost);
                        totalCost += orderTotal;
                        cleaneoProfit += parseFloat(order.CleaneoProfit);
                        let orderStatuses = order.statuses.map(status => status.code);

                        if (orderStatuses.some(status => deliveredStatuses.includes(status))) {
                            deliveredCount++;
                            deliveredTotalCost += orderTotal;
                        } else if (orderStatuses.some(status => pendingStatuses.includes(status))) {
                            pendingCount++;
                            pendingTotalCost += orderTotal;
                        } else if (orderStatuses.includes("Cancelled")) {
                            cancelledCount++;
                            cancelledTotalCost += orderTotal;
                        }
                    });

                    function formatCurrency(amount) {
                        return amount.toLocaleString('en-IN', {
                            style: 'currency',
                            currency: 'INR'
                        });
                    }

                    $('#total_orders').text(totalOrders);
                    $('#total_cost').text(formatCurrency(totalCost));
                    $('#delivered_orders').text(deliveredCount);
                    $('#delivered_total_cost').text(formatCurrency(deliveredTotalCost));
                    $('#pending_orders').text(pendingCount);
                    $('#pending_total_cost').text(formatCurrency(pendingTotalCost));
                    $('#cancelled_orders').text(cancelledCount);
                    $('#cancelled_total_cost').text(formatCurrency(cancelledTotalCost));
                    $('#clea_profit').text(formatCurrency(cleaneoProfit));
                } else {
                    console.error('Error fetching orders');
                }
            },
            error: function (xhr, status, error) {
                console.error('Error fetching orders:', error);
            }
        });
    }

    fetchOrderDataAndUpdateUI();
    setInterval(fetchOrderDataAndUpdateUI, 60000);
});


   </script>
   <!------- lifetime custome select js  ------->
   <!------- lifetime custome select js  ------->
   <script>
      document.addEventListener("DOMContentLoaded", function() {
          var customSelects = document.querySelectorAll(".custom-select");
      
          customSelects.forEach(function(customSelect) {
              var selectElement = customSelect.querySelector("select");
              var selectedOption = document.createElement("div");
              selectedOption.classList.add("select-selected");
              selectedOption.innerHTML = selectElement.options[selectElement.selectedIndex].innerHTML;
              customSelect.appendChild(selectedOption);
      
              var selectItems = document.createElement("div");
              selectItems.classList.add("select-items");
              customSelect.appendChild(selectItems);
      
              var userBackButton = document.querySelector(".user_back_button");
              userBackButton.style.display = "none"; // Initially hide the back button
      
              for (var i = 0; i < selectElement.length; i++) {
                  var option = selectElement.options[i];
                  var optionDiv = document.createElement("div");
                  optionDiv.innerHTML = option.innerHTML;
                  optionDiv.setAttribute("data-value", option.value);
      
                  optionDiv.addEventListener("click", function() {
                      selectElement.value = this.getAttribute("data-value");
                      selectedOption.innerHTML = this.innerHTML;
                      selectItems.style.display = "none";
                      userBackButton.style.display =
                      "none"; // Hide the back button when an option is selected
                  });
      
                  selectItems.appendChild(optionDiv);
              }
      
              selectedOption.addEventListener("click", function() {
                  selectItems.style.display = (selectItems.style.display === "block") ? "none" :
                      "block";
                  // userBackButton.style.display = (selectItems.style.display === "block") ? "block" : "none"; // Show the back button only when the dropdown is clicked
              });
      
              userBackButton.addEventListener("click", function() {
                  selectItems.style.display = "none";
                  userBackButton.style.display = "none";
              });
      
              document.addEventListener("click", function(event) {
                  if (!customSelect.contains(event.target)) {
                      selectItems.style.display = "none";
                      userBackButton.style.display = "none";
                  }
              });
          });
      });
   </script>
   
   <script>
      document.addEventListener("DOMContentLoaded", function() {
          var customSelects = document.querySelectorAll(".dashboard_drop_select");
      
          customSelects.forEach(function(customSelect) {
              var selectElement = customSelect.querySelector("select");
              var selectedOption = document.createElement("div");
              selectedOption.classList.add("select-selected");
              selectedOption.innerHTML = selectElement.options[selectElement.selectedIndex].innerHTML;
              customSelect.appendChild(selectedOption);
      
              var selectItems = document.createElement("div");
              selectItems.classList.add("select-items-2");
              customSelect.appendChild(selectItems);
      
              var userBackButton = document.querySelector(".user_back_button-2");
              userBackButton.style.display = "none";
      
              for (var i = 0; i < selectElement.length; i++) {
                  var option = selectElement.options[i];
                  var optionDiv = document.createElement("div");
                  optionDiv.innerHTML = option.innerHTML;
                  optionDiv.setAttribute("data-value", option.value);
      
                  optionDiv.addEventListener("click", function() {
                      selectElement.value = this.getAttribute("data-value");
                      selectedOption.innerHTML = this.innerHTML;
                      selectItems.style.display = "none";
                      userBackButton.style.display = "none";
                  });
      
                  selectItems.appendChild(optionDiv);
              }
      
              selectedOption.addEventListener("click", function() {
                  selectItems.style.display = (selectItems.style.display === "block") ? "none" :
                      "block";
                  // userBackButton.style.display = (selectItems.style.display === "block") ? "block" : "none"; // Show the back button only when the dropdown is clicked
              });
      
              userBackButton.addEventListener("click", function() {
                  selectItems.style.display = "none";
                  userBackButton.style.display = "none";
              });
      
              document.addEventListener("click", function(event) {
                  if (!customSelect.contains(event.target)) {
                      selectItems.style.display = "none";
                      userBackButton.style.display = "none";
                  }
              });
          });
      });
   </script>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da)): ?>
<?php $component = $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da; ?>
<?php unset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da); ?>
<?php endif; ?><?php /**PATH C:\php\xampp\htdocs\admin\resources\views/dashboard.blade.php ENDPATH**/ ?>