Server : LiteSpeed System : Linux in-mum-web1002.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u811747229 ( 811747229) PHP Version : 8.0.30 Disable Function : NONE Directory : /home/u811747229/domains/lakshiagrichem.com/public_html/admin/ |
<?php
include("../db.php");
session_start();
// *************************************** checking *****************************************
if(empty($_SESSION["admin_email"])){
header("location:../index.php");
}
// *************************************** users *****************************************
$select="SELECT * FROM users";
$result=mysqli_query($conn,$select);
// *************************************** Selecting *****************************************
$select_bio="SELECT * FROM bio_products";
$result_bio=mysqli_query($conn,$select_bio);
$select_liquid="SELECT * FROM liquid_fertilizer";
$result_liquid=mysqli_query($conn,$select_liquid);
$select_micro="SELECT * FROM micro_or_boron_products";
$result_micro=mysqli_query($conn,$select_micro);
$select_npk="SELECT * FROM npk_products";
$result_npk=mysqli_query($conn,$select_npk);
$total_p=mysqli_num_rows($result_bio)+mysqli_num_rows($result_liquid)+mysqli_num_rows($result_micro)+mysqli_num_rows($result_npk);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Boxicons -->
<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
<!-- My CSS -->
<link rel="stylesheet" href="admin.css">
<title>Lakshi Agrichem Admin Dashbord</title>
<!--
- favicon
-->
<link rel="shortcut icon" href="../assets//images/LOGO.png" type="image/svg+xml">
</head>
<body>
<!-- SIDEBAR -->
<section id="sidebar">
<a href="#" class="brand">
<img src="../assets//images/LOGO.png" style="margin-left: 10%;margin-top: 10%;" width="50%" alt="">
<span class="text"></span>
</a>
<ul class="side-menu top">
<li class="active">
<a href="home.php">
<i class='bx bxs-dashboard' ></i>
<span class="text">Dashboard</span>
</a>
</li>
<li>
<a href="product.php">
<i class='bx bxs-shopping-bag-alt' ></i>
<span class="text">Our Products</span>
</a>
</li>
</ul>
<ul class="side-menu">
<li>
<a href="../login/logout.php" class="logout">
<i class='bx bxs-log-out-circle' ></i>
<span class="text">Logout</span>
</a>
</li>
</ul>
</section>
<!-- SIDEBAR -->
<!-- CONTENT -->
<section id="content">
<!-- NAVBAR -->
<nav>
<i class='bx bx-menu' ></i>
<a href="#" class="nav-link">Categories</a>
</nav>
<!-- NAVBAR -->
<!-- MAIN -->
<main>
<div class="head-title">
<div class="left">
<h1>Dashboard</h1>
<ul class="breadcrumb">
<li>
<a href="#">Dashboard</a>
</li>
<li><i class='bx bx-chevron-right' ></i></li>
<li>
<a class="active" href="#">Home</a>
</li>
</ul>
</div>
</div>
<ul class="box-info">
<li>
<i class='bx bxs-calendar-check' ></i>
<span class="text">
<h3><?php if(isset($total_p)){
echo $total_p;
}else{
echo 0;
} ?></h3>
<p>Total Products</p>
</span>
</li>
<li>
<i class='bx bxs-group' ></i>
<span class="text">
<h3><?php if(mysqli_num_rows($result)>0){
echo mysqli_num_rows($result);
}else{
echo 0;
}
?></h3>
<p>Users</p>
</span>
</li>
<li>
<i class='bx bxs-contact ' style='color:#fd7238' ></i>
<span class="text">
<h3>0</h3>
<p>Total Contects</p>
</span>
</li>
</ul>
<div class="table-data">
<div class="order">
<div class="head">
<h3> Users</h3>
</div>
<table>
<thead>
<tr>
<th>User</th>
<th>email</th>
<th>Status</th>
<th>Update</th>
</tr>
</thead>
<tbody>
<?php
while($row=mysqli_fetch_assoc($result)){
?>
<tr>
<td>
<p><?php echo $row["username"] ?></p>
</td>
<td><?php echo $row["email"] ?></td>
<?php
if($row["type"]=='user'){
?>
<td><span class="status completed"><?php echo $row["type"] ?></span></td>
<form action="<?php htmlspecialchars($_SERVER["PHP_SELF"]) ?>" method="post">
<td><a href="update_user.php<?php echo "?id=$row[id]" ?>" class="button-10" role="button">Change</a></td>
</form>
<?php
}else{
?>
<td><span class="status pending"><?php echo $row["type"] ?></span></td>
<td><a href="update_user.php<?php echo "?id=$row[id]" ?>" class="button-10" role="button">Change</a></td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</main>
<!-- MAIN -->
</section>
<!-- CONTENT -->
<script src="admin.js"></script>
</body>
</html>