<?php
session_start();
include(__DIR__ . "/includes/config.php");
include __DIR__ . '/includes/auth_check.php';
$sql = "SELECT * FROM yakit_takip ORDER BY tarih DESC";
$veriler = $pdo->query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<!-- [Head] start -->

<head>
  <title>Araç takip otomasyonu</title>
  <!-- [Meta] -->
  <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="Mantis is made using Bootstrap 5 design framework. Download the free admin template & use it for your project.">
  <meta name="keywords"
    content="Mantis, Dashboard UI Kit, Bootstrap 5, Admin Template, Admin Dashboard, CRM, CMS, Bootstrap Admin Template">
  <meta name="author" content="CodedThemes">

  <!-- [Favicon] icon -->
  <link rel="icon" href="../assets/images/favicon.svg" type="image/x-icon"> <!-- [Google Font] Family -->
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap"
    id="main-font-link">
  <!-- [Tabler Icons] https://tablericons.com -->
  <link rel="stylesheet" href="../aractakip/dist/assets/fonts/tabler-icons.min.css">
  <!-- [Feather Icons] https://feathericons.com -->
  <link rel="stylesheet" href="../aractakip/dist/assets/fonts/feather.css">
  <!-- [Font Awesome Icons] https://fontawesome.com/icons -->
  <link rel="stylesheet" href="../aractakip/dist/assets/fonts/fontawesome.css">
  <!-- [Material Icons] https://fonts.google.com/icons -->
  <link rel="stylesheet" href="../aractakip/dist/assets/fonts/material.css">
  <!-- [Template CSS Files] -->
  <link rel="stylesheet" href="../aractakip/dist/assets/css/style.css" id="main-style-link">
  <link rel="stylesheet" href="../aractakip/dist/assets/css/style-preset.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
  <style>
.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 200,
  'GRAD' 0,
  'opsz' 48
}

  </style>
</head>
<!-- [Head] end -->
<!-- [Body] Start -->

<body data-pc-preset="preset-1" data-pc-direction="ltr" data-pc-theme="light">
  <!-- [ Pre-loader ] start -->
  <div class="loader-bg">
    <div class="loader-track">
      <div class="loader-fill"></div>
    </div>
  </div>
  <!-- [ Pre-loader ] End -->
  <!-- [ Sidebar Menu ] start -->
  <nav class="pc-sidebar">
    <div class="navbar-wrapper">
      <div class="m-header">
        <a href="../aractakip/index.php" class="b-brand text-primary">
          <!-- ========   Change your logo from here   ============ -->
          AKMERCAN
        </a>
      </div>
      <div class="navbar-content">
        <ul class="pc-navbar">
          <li class="pc-item">
            <a href="../aractakip/index.php" class="pc-link">
              <span class="pc-micon"><i class="ti ti-dashboard"></i></span>
              <span class="pc-mtext">Ana sayfa</span>
            </a>
          </li>

          <li class="pc-item pc-hasmenu"> <a href="#!" class="pc-link "><span class="pc-micon"><i
                  class="ti ti-dashboard"></i></span><span class="pc-mtext">Araç takibi</span> <span
                class="pc-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                  fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                  class="feather feather-chevron-right">
                  <polyline points="9 18 15 12 9 6"></polyline>
                </svg></span> </a>
            <ul class="pc-submenu">
              <li class="pc-item">
                <a href="../aractakip/yakit-bildirim.php" class="pc-link">
                  <span class="pc-micon"><i class="ti ti-typography"></i></span>
                  <span class="pc-mtext">Yakıt bildirimi</span>
                </a>
              </li>
              <li class="pc-item">
                <a href="../aractakip/km-bildirim.php" class="pc-link">
                  <span class="pc-micon"><i class="ti ti-color-swatch"></i></span>
                  <span class="pc-mtext">Km bildirimi</span>
                </a>
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </nav>
  <!-- [ Sidebar Menu ] end --> <!-- [ Header Topbar ] start -->
  <header class="pc-header">
    <div class="header-wrapper"> <!-- [Mobile Media Block] start -->
      <div class="me-auto pc-mob-drp">
        <ul class="list-unstyled">
          <!-- ======= Menu collapse Icon ===== -->
          <li class="pc-h-item pc-sidebar-collapse">
            <a href="#" class="pc-head-link ms-0" id="sidebar-hide">
              <i class="ti ti-menu-2"></i>
            </a>
          </li>
          <li class="pc-h-item pc-sidebar-popup">
            <a href="#" class="pc-head-link ms-0" id="mobile-collapse">
              <i class="ti ti-menu-2"></i>
            </a>
          </li>
        </ul>
      </div>
      <!-- [Mobile Media Block end] -->
      <div class="ms-auto">
        <ul class="list-unstyled">
          <li class="dropdown pc-h-item">
            <a class="pc-head-link dropdown-toggle arrow-none me-0" data-bs-toggle="dropdown" href="#" role="button"
              aria-haspopup="false" aria-expanded="false">
              <i class="ti ti-mail"></i>
            </a>
            <div class="dropdown-menu dropdown-notification dropdown-menu-end pc-h-dropdown">
              <div class="dropdown-header d-flex align-items-center justify-content-between">
                <h5 class="m-0">Message</h5>
                <a href="#!" class="pc-head-link bg-transparent"><i class="ti ti-x text-danger"></i></a>
              </div>
              <div class="dropdown-divider"></div>
              <div class="dropdown-header px-0 text-wrap header-notification-scroll position-relative"
                style="max-height: calc(100vh - 215px)">
                <div class="list-group list-group-flush w-100">
                  <a class="list-group-item list-group-item-action">
                    <div class="d-flex">
                      <div class="flex-shrink-0">
                        <img src="../aractakip/dist/assets/images/user/avatar-2.jpg" alt="user-image" class="user-avtar">
                      </div>
                      <div class="flex-grow-1 ms-1">
                        <span class="float-end text-muted">3:00 AM</span>
                        <p class="text-body mb-1">It's <b>Cristina danny's</b> birthday today.</p>
                        <span class="text-muted">2 min ago</span>
                      </div>
                    </div>
                  </a>
                  <a class="list-group-item list-group-item-action">
                    <div class="d-flex">
                      <div class="flex-shrink-0">
                        <img src="../aractakip/dist/assets/images/user/avatar-1.jpg" alt="user-image" class="user-avtar">
                      </div>
                      <div class="flex-grow-1 ms-1">
                        <span class="float-end text-muted">6:00 PM</span>
                        <p class="text-body mb-1"><b>Aida Burg</b> commented your post.</p>
                        <span class="text-muted">5 August</span>
                      </div>
                    </div>
                  </a>
                  <a class="list-group-item list-group-item-action">
                    <div class="d-flex">
                      <div class="flex-shrink-0">
                        <img src="../aractakip/dist/assets/images/user/avatar-3.jpg" alt="user-image" class="user-avtar">
                      </div>
                      <div class="flex-grow-1 ms-1">
                        <span class="float-end text-muted">2:45 PM</span>
                        <p class="text-body mb-1"><b>There was a failure to your setup.</b></p>
                        <span class="text-muted">7 hours ago</span>
                      </div>
                    </div>
                  </a>
                  <a class="list-group-item list-group-item-action">
                    <div class="d-flex">
                      <div class="flex-shrink-0">
                        <img src="../aractakip/dist/assets/images/user/avatar-4.jpg" alt="user-image" class="user-avtar">
                      </div>
                      <div class="flex-grow-1 ms-1">
                        <span class="float-end text-muted">9:10 PM</span>
                        <p class="text-body mb-1"><b>Cristina Danny </b> invited to join <b> Meeting.</b></p>
                        <span class="text-muted">Daily scrum meeting time</span>
                      </div>
                    </div>
                  </a>
                </div>
              </div>
              <div class="dropdown-divider"></div>
              <div class="text-center py-2">
                <a href="#!" class="link-primary">View all</a>
              </div>
            </div>
          </li>
          <li class="dropdown pc-h-item header-user-profile">
            <a class="pc-head-link dropdown-toggle arrow-none me-0" data-bs-toggle="dropdown" href="#" role="button"
              aria-haspopup="false" data-bs-auto-close="outside" aria-expanded="false">
              <img src="../aractakip/dist/assets/images/user/avatar-2.jpg" alt="user-image" class="user-avtar">
              <span>Recep K.</span>
            </a>
            <div class="dropdown-menu dropdown-user-profile dropdown-menu-end pc-h-dropdown">
              <div class="dropdown-header">
                <div class="d-flex mb-1">
                  <div class="flex-shrink-0">
                    <img src="../aractakip/dist/assets/images/user/avatar-2.jpg" alt="user-image" class="user-avtar wid-35">
                  </div>
                  <div class="flex-grow-1 ms-3">
                    <h6 class="mb-1">Recep KOCATEPE</h6>
                    <span>Bilgi işlem uzmanı</span>
                  </div>
                  <a href="#!" class="pc-head-link bg-transparent"><i class="ti ti-power text-danger"></i></a>
                </div>
              </div>
              <ul class="nav drp-tabs nav-fill nav-tabs" id="mydrpTab" role="tablist">
                <li class="nav-item" role="presentation">
                  <button class="nav-link active" id="drp-t1" data-bs-toggle="tab" data-bs-target="#drp-tab-1"
                    type="button" role="tab" aria-controls="drp-tab-1" aria-selected="true"><i class="ti ti-user"></i>
                    Profile</button>
                </li>
                <li class="nav-item" role="presentation">
                  <button class="nav-link" id="drp-t2" data-bs-toggle="tab" data-bs-target="#drp-tab-2" type="button"
                    role="tab" aria-controls="drp-tab-2" aria-selected="false"><i class="ti ti-settings"></i>
                    Setting</button>
                </li>
              </ul>
              <div class="tab-content" id="mysrpTabContent">
                <div class="tab-pane fade show active" id="drp-tab-1" role="tabpanel" aria-labelledby="drp-t1"
                  tabindex="0">
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-edit-circle"></i>
                    <span>Edit Profile</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-user"></i>
                    <span>View Profile</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-clipboard-list"></i>
                    <span>Social Profile</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-wallet"></i>
                    <span>Billing</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-power"></i>
                    <span>Logout</span>
                  </a>
                </div>
                <div class="tab-pane fade" id="drp-tab-2" role="tabpanel" aria-labelledby="drp-t2" tabindex="0">
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-help"></i>
                    <span>Support</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-user"></i>
                    <span>Account Settings</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-lock"></i>
                    <span>Privacy Center</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-messages"></i>
                    <span>Feedback</span>
                  </a>
                  <a href="#!" class="dropdown-item">
                    <i class="ti ti-list"></i>
                    <span>History</span>
                  </a>
                </div>
              </div>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </header>
  <!-- [ Header ] end -->



  <!-- [ Main Content ] start -->
  <div class="pc-container">
    <div class="pc-content">
      <!-- [ breadcrumb ] start -->
      <div class="page-header">
        <div class="page-block">
          <div class="row align-items-center">
            <div class="col-md-12">
              <div class="page-header-title">
                <h5 class="m-b-10">Ana sayfa</h5>
              </div>
              <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="../dashboard/index.html">Ana sayfa</a></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <!-- [ breadcrumb ] end -->
      <!-- [ Main Content ] start -->
      <div class="row">
        <!-- [ sample-page ] start -->
        <div class="col-md-6 col-xl-3">
            <a href="">
          <div class="card">
<div class="card-body" style="
">
              <i class="bi bi-car-front" style="
    font-size: 40px;
    color: #1890ff;
"></i>
              <h4 class="mb-3">Araçlarım</h4>
<div class="progress">
                                        <div class="progress-bar bg-info" role="progressbar" style="width: 100%;height: 6px;border: 1px solid #e9e8bf;background-color: #1890ff !important" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
            </div>
            </div>
            </a>
            </div>
        <div class="col-md-6 col-xl-3">
            <a href="">
          <div class="card">
  <div class="card-body" style="">
    <i class="bi bi-journals" style="font-size: 40px;color: #1890ff;"></i>
    <h4 class="mb-3">Notlarım</h4>
    <div class="progress">
      <div class="progress-bar bg-info" role="progressbar"
        style="width: 100%;height: 6px;border: 1px solid #ecf5ff;background-color: #1890ff !important"
        aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
    </div>
  </div>
</div>
</a>
        </div>
        <div class="col-md-6 col-xl-3">
            <a href="">
          <div class="card">
  <div class="card-body" style="">
    <i class="bi bi-ui-checks-grid" style="font-size: 40px;color: #1890ff;"></i>
    <h4 class="mb-3">Sayaçlarım</h4>
    <div class="progress">
      <div class="progress-bar bg-info" role="progressbar"
        style="width: 100%;height: 6px;border: 1px solid #ecf5ff;background-color: #1890ff !important"
        aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
    </div>
  </div>
</div>
</a>
        </div>
        <div class="col-md-6 col-xl-3">
            <a href="">
          <div class="card">
  <div class="card-body" style="">
    <i class="bi bi-calendar3-event" style="font-size: 40px;color: #1890ff;"></i>
    <h4 class="mb-3">Toplantı</h4>
    <div class="progress">
      <div class="progress-bar bg-info" role="progressbar"
        style="width: 100%;height: 6px;border: 1px solid #ecf5ff;background-color: #1890ff !important"
        aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
    </div>
  </div>
</div>
</a>
        </div>


        <div class="col-md-12 col-xl-4">
          <h5 class="mb-3">Yakıt kullanım grafiği</h5>
          <div class="card">
            <div class="card-body">
              <h6 class="mb-2 f-w-400 text-muted">Aylık grafik</h6>
              <h3 class="mb-3">$7,650</h3>
              <div id="income-overview-chart"></div>
            </div>
          </div>
        </div>
        <div class="col-md-12 col-xl-8">
          <h5 class="mb-3">Yakıt harcamaları</h5>
          <div class="card tbl-card">
            <div class="card-body">
              <div class="table-responsive">
                <table class="table table-hover table-borderless mb-0">
                  <thead>
                    <tr>
                      <th>TARİH</th>
                      <th>PLAKA</th>
                      <th>AD SOYAD</th>
                      <th>KİLOMETRE</th>
                      <th>LİTRE</th>
                      <th class="text-end">TOPLAM TUTAR</th>
                    </tr>
                  </thead>
                  <tbody>
                        <?php foreach ($veriler as $satir): ?>
    <tr>
      <td><?= date("d.m.Y", strtotime($satir['tarih'])) ?></td>
      <td><?= htmlspecialchars($satir['plaka']) ?></td>
      <td><?= htmlspecialchars($satir['km']) ?></td>
      <td><?= number_format($satir['alinanyakit'], 0, ',', '.') ?></td>
      <td><?= $satir['plaka'] ?> LT.</td>
      <td><?= $satir['toplamtutar'] ?> TL</td>
    </tr>
  <?php endforeach; ?>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
       

        
        
      </div>
    </div>
  </div>
  <!-- [ Main Content ] end -->
  <footer class="pc-footer">
    <div class="footer-wrapper container-fluid">
      <div class="row">
        <div class="col-sm my-1">
          <p class="m-0">Copyright © stama</p>
        </div>
        <div class="col-auto my-1">
          <ul class="list-inline footer-link mb-0">
            <li class="list-inline-item"><a href="../index.html">Home</a></li>
          </ul>
        </div>
      </div>
    </div>
  </footer>

  <!-- [Page Specific JS] start -->
  <script src="../aractakip/dist/assets/js/plugins/apexcharts.min.js"></script>
  <script src="../aractakip/dist/assets/js/pages/dashboard-default.js"></script>
  <!-- [Page Specific JS] end -->
  <!-- Required Js -->
  <script src="../aractakip/dist/assets/js/plugins/popper.min.js"></script>
  <script src="../aractakip/dist/assets/js/plugins/simplebar.min.js"></script>
  <script src="../aractakip/dist/assets/js/plugins/bootstrap.min.js"></script>
  <script src="../aractakip/dist/assets/js/fonts/custom-font.js"></script>
  <script src="../aractakip/dist/assets/js/pcoded.js"></script>
  <script src="../aractakip/dist/assets/js/plugins/feather.min.js"></script>





  <script>layout_change('light');</script>




  <script>change_box_container('false');</script>



  <script>layout_rtl_change('false');</script>


  <script>preset_change("preset-1");</script>


  <script>font_change("Public-Sans");</script>



</body>
<!-- [Body] end -->

</html>