<?php
session_start();
?>
<!DOCTYPE html>
<html>

<head>
    <title>Polytical Edge | Manage Users</title>
    <?php include 'css.php';
  include './assets/database/fetch.php'; ?>
</head>

<body>
    <div class="main-wrapper">
        <?php $currentPage = 'data-table';
    include 'sidebar.php'; ?>
        <div class="page-wrapper">
            <?php include 'header.php'; ?>
            <div class="page-content">
                <div class="row">
                    <div class="col-md-12 grid-margin stretch-card">
                        <div class="card add-row">
                            <div class="card-body">
                                <h6 class="card-title">Manage Users <a href="add-user.php"
                                        class="add-element add-element btn btn-primary">Add User</a></h6>
                                <div class="table-responsive">
                                    <table id="dataTableExample" class="table">
                                        <thead>
                                            <tr>
                                                <th>Sr.no</th>
                                                <th>User Name</th>
                                                <th>Email</th>
                                                <th>Mobile</th>
                                                <th>Role</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                      $data = fetch_Users();
                      $count = 1;
                      foreach ($data as $key => $values) {
                        echo '
                      <tr>
                        <td>' . $count . '</td>
                        <td>' . $values['Name'] . '</td>
                        <td>' . $values['Email'] . '</td>
                        <td>' . $values['Phone_Number'] . '</td>
                        <td>' . $values['Role'] . '</td>
                        <td>
                          <a href="edit-report.php?id=' . $values['id'] . '" class="edit btn btn-primary"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                          <a href="delete-report.php?id=' . $values['id'] . '" class="delete btn btn-danger"><i class="fa fa-trash" aria-hidden="true"></i></a>
                          <a href="view-report.php?id=' . $values['id'] . '" class="delete btn btn-info"><i class="fa fa-eye" aria-hidden="true"></i></a>
                        </td>
                      </tr>';
                        $count++;
                      } ?>
                                            <tr>
                                                <td colspan="1" class="text-right font-weight-bold">Total Reports:</td>
                                                <td colspan="2" class="text-left font-weight-bold">110</td>
                                                <td colspan="4" class="text-right font-weight-bold">Total rows:</td>
                                                <td colspan="2" class="text-left font-weight-bold">12200</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <?php include 'footer.php'; ?>
            <?php include 'js.php'; ?>
        </div>
    </div>
</body>

</html>