summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorAlisaLinUwU <alisalinuwu@gmail.com>2025-01-26 11:49:02 +0500
committerAlisaLinUwU <alisalinuwu@gmail.com>2025-01-26 11:49:02 +0500
commit628c97aaf508bbd615ef3a500f22fcdd1ca00f4d (patch)
tree2e30d83a1ea874fb2d94e16c5204dd0437332e88 /index.php
Initializemain
Diffstat (limited to 'index.php')
-rw-r--r--index.php117
1 files changed, 117 insertions, 0 deletions
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..1177956
--- /dev/null
+++ b/index.php
@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Qarz daftarcha</title>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
+ <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.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.6.1/dist/js/bootstrap.bundle.min.js"></script>
+</head>
+<body>
+
+<div class="jumbotron text-center">
+ <h1>Qarz daftarcha</h1>
+</div>
+
+<div class="container">
+ <form action="" method="get">
+ <div class="input-group mb-3">
+ <input type="text" class="form-control" placeholder="Jahongir" id="ism" name="ism">
+ <div class="input-group-append">
+ <button class="btn btn-primary" type="submit">Kidirish</button>
+ </div>
+ </div>
+ </form>
+
+ <a href="add_user.php" class="btn btn-success mb-3">Qoshish</a>
+
+ <p>Qarzdorlar:</p>
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Ism</th>
+ <th>Telefon nomer</th>
+ <th>Vaqt</th>
+ <th>Qarz</th>
+ <th>Harakatlar</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ $ism = null;
+
+ if (isset($_GET["ism"])) {
+ $ism = "'" . $_GET["ism"] . "'";
+ }
+
+ include "get_users.php";
+
+ if (isset($users)):
+ for ($i = 0; $i < sizeof($users); $i++): ?>
+ <tr>
+ <td><?= $users[$i]["ism"] ?></td>
+ <td>+<?= $users[$i]["telefon_nomer"] ?></td>
+ <td><?= $users[$i]["vaqt"] ?></td>
+ <td><span class="badge badge-danger badge-pill"><?= $users[$i]["miqdor"] ?> so'm</span></td>
+ <td><?php if ($users[$i]["miqdor"] == 0): ?><a href='delete_user.php?id=<?= $users[$i]["id"] ?>' class="btn btn-danger mr-1">Ochirish</a><?php endif; ?><a href='paid.php?id=<?= $users[$i]["id"] ?>' class="btn btn-success">Toladi</a></td>
+ </tr>
+ <?php
+ endfor;
+ endif;
+ ?>
+ </tbody>
+ </table>
+
+ <p class="mt-5">Statistika</p>
+ <ul class="list-group">
+ <p>Jami: <?= $sum_duty ?> so'm</p>
+ <p>Eng kam qarzdor:</p>
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Ism</th>
+ <th>Telefon nomer</th>
+ <th>Vaqt</th>
+ <th>Qarz</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php if (isset($min_user)): ?>
+ <tr>
+ <td><?= $min_user["ism"]; ?></td>
+ <td>+<?= $min_user["telefon_nomer"]; ?></td>
+ <td><?= $min_user["vaqt"] ?></td>
+ <td><span class="badge badge-danger badge-pill"><?= $min_user["miqdor"]; ?> so'm</span></td>
+ </tr>
+ <?php endif; ?>
+ </tbody>
+ </table>
+ <p>Eng ko'p qarzdor:</p>
+
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Ism</th>
+ <th>Telefon nomer</th>
+ <th>Vaqt</th>
+ <th>Qarz</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php if (isset($max_user)): ?>
+ <tr>
+ <td><?= $max_user["ism"]; ?></td>
+ <td>+<?= $max_user["telefon_nomer"]; ?></td>
+ <td><?= $max_user["vaqt"] ?></td>
+ <td><span class="badge badge-danger badge-pill"><?= $max_user["miqdor"]; ?> so'm</span></td>
+ </tr>
+ <?php endif; ?>
+ </tbody>
+ </table>
+ </ul>
+</div>
+
+</body>
+</html>