AIPT/cms_admin/container/web_sec/dashboard.php

154 lines
6.3 KiB
PHP
Raw Permalink Normal View History

2024-10-29 11:42:53 +08:00
<div class="dashboard-main-body">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mb-24">
<h6 class="fw-semibold mb-0">Welcome to <b>AI Tool Path</b></h6>
<ul class="d-flex align-items-center gap-2">
<li class="fw-medium">
<a href="index" class="d-flex align-items-center gap-1 hover-text-primary">
<iconify-icon icon="solar:home-smile-angle-outline" class="icon text-lg"></iconify-icon>
Dashboard
</a>
</li>
</ul>
</div>
<div class="row row-cols-xxxl-5 row-cols-lg-3 row-cols-sm-2 row-cols-1 gy-4">
<div class="col">
<div class="card shadow-none border bg-gradient-start-1 h-100">
<div class="card-body p-20">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div>
<p class="fw-medium text-primary-light mb-1">Total Categories</p>
<h6 class="mb-0">
<?php
// Count total number of categories
$category_count_query = "SELECT COUNT(*) as total_categories FROM categories";
$category_count_result = mysqli_query($conn, $category_count_query);
if ($category_count_result) {
$category_count_row = mysqli_fetch_assoc($category_count_result);
$total_categories = $category_count_row['total_categories'];
} else {
$total_categories = 0;
}
echo $total_categories;
?>
</h6>
</div>
</div>
</div>
</div>
<!-- card end -->
</div>
<div class="col">
<div class="card shadow-none border bg-gradient-start-2 h-100">
<div class="card-body p-20">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div>
<p class="fw-medium text-primary-light mb-1">Total Products</p>
<h6 class="mb-0">
<?php
$product_count_query = "SELECT COUNT(*) as total_products FROM products";
$product_count_result = mysqli_query($conn, $product_count_query);
if ($product_count_result) {
$product_count_row = mysqli_fetch_assoc($product_count_result);
$total_products = $product_count_row['total_products'];
} else {
$total_products = 0;
}
echo $total_products;
?>
</h6>
</div>
</div>
</div>
</div>
<!-- card end -->
</div>
<div class="col">
<div class="card shadow-none border bg-gradient-start-3 h-100">
<div class="card-body p-20">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div>
<p class="fw-medium text-primary-light mb-1">Total Visitors</p>
<h6 class="mb-0">
<?php
// Query to count the total number of entries in the 'visitors' table
$count_query = "SELECT COUNT(*) as total FROM visitors";
$count_result = mysqli_query($conn, $count_query);
// Fetch the result and display the total number of entries
if ($count_result) {
$row = mysqli_fetch_assoc($count_result);
echo $row['total'];
} else {
echo "0";
}
?>
</h6>
</div>
</div>
</div>
</div>
<!-- card end -->
</div>
<div class="col">
<div class="card shadow-none border bg-gradient-start-4 h-100">
<div class="card-body p-20">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div>
<p class="fw-medium text-primary-light mb-1">Total Blogs</p>
<h6 class="mb-0">
<?php
// Query to count the total number of entries in the 'visitors' table
$count_query = "SELECT COUNT(*) as total FROM blogs";
$count_result = mysqli_query($conn, $count_query);
// Fetch the result and display the total number of entries
if ($count_result) {
$row = mysqli_fetch_assoc($count_result);
echo $row['total'];
} else {
echo "0";
}
?>
</h6>
</div>
</div>
</div>
</div>
<!-- card end -->
</div>
<div class="col">
<div class="card shadow-none border bg-gradient-start-5 h-100">
<div class="card-body p-20">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div>
<p class="fw-medium text-primary-light mb-1">Contact Form Entries</p>
<h6 class="mb-0">
<h6 class="mb-0">
<?php
// Query to count the total number of entries in the 'visitors' table
$count_query = "SELECT COUNT(*) as total FROM tools_submission";
$count_result = mysqli_query($conn, $count_query);
// Fetch the result and display the total number of entries
if ($count_result) {
$row = mysqli_fetch_assoc($count_result);
echo $row['total'];
} else {
echo "0";
}
?>
</h6>
</div>
</div>
</div>
</div>
<!-- card end -->
</div>
</div>