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 *****************************************
if (isset($_POST["Submit"])) {
$category = $_POST["category"];
if ($category == 'NPK') {
$npk=true;
$select_npk="SELECT * FROM npk_products";
$result_npk=mysqli_query($conn,$select_npk);
}
if ($category == 'Single Micro Nutrients Range') {
$single=true;
$select_single="SELECT * FROM micro_or_boron_products WHERE category='$category'" ;
$result_single=mysqli_query($conn,$select_single);
}
if ($category == 'Boron Compound') {
$boron=true;
$select_boron="SELECT * FROM micro_or_boron_products WHERE category='$category'";
$result_boron=mysqli_query($conn,$select_boron);
}
if ($category == 'Mix Micro Nutrients Range') {
$mix=true;
$select_mix="SELECT * FROM micro_or_boron_products WHERE category='$category'";
$result_mix=mysqli_query($conn,$select_mix);
}
if ($category == 'Liquid_fertilizer') {
$liquid=true;
$select_liquid="SELECT * FROM liquid_fertilizer";
$result_liquid=mysqli_query($conn,$select_liquid);
}
if ($category == 'Bio Fungicide & Pesticide') {
$bio=true;
$select_bio="SELECT * FROM bio_products WHERE category='$category'";
$result_bio=mysqli_query($conn,$select_bio);
}
if ($category == 'Plant Bio Stimulant Range') {
$plant=true;
$select_plantbio="SELECT * FROM bio_products WHERE category='$category'";
$result_plantbio=mysqli_query($conn,$select_plantbio);
}
}
?>
<!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">
<script src="https://kit.fontawesome.com/a319ab9648.js" crossorigin="anonymous"></script>
</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>
<a href="home.php">
<i class='bx bxs-dashboard'></i>
<span class="text">Dashboard</span>
</a>
</li>
<li class="active">
<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="#">Our Products</a>
</li>
</ul>
</div>
</div>
<ul class="box-info">
<li>
<i class='bx bxs-calendar-check'></i>
<span class="text">
<h3>Select Product Category</h3>
<form action="<?php htmlspecialchars($_SERVER["PHP_SELF"]) ?>" method="post">
<select style="width: 100%;padding:3%;border-radius:8px;margin-top:6%;" name="category" >
<option selected value="NPK">NPK 100% Water Soluble Fertilizer Range</option>
<option value="Single Micro Nutrients Range">Single Micro Nutrients Range</option>
<option value="Mix Micro Nutrients Range">Mix Micro Nutrients Range</option>
<option value="Boron Compound">Boron Compound</option>
<option value="Liquid_fertilizer">Liquid Fertilizer Range</option>
<option value="Bio Fungicide & Pesticide">Bio Fungicide & Pesticide</option>
<option value="Plant Bio Stimulant Range">Plant Bio Stimulant Range</option>
</select>
<button name="Submit" value="Submit" class="button-10" role="button">Submit</button>
</form>
</span>
</li>
<li>
<a style="cursor: pointer;" href="addproducts.php"><i class='bx bx-plus'></i></a>
<span class="text">
<h3>Add Products</h3>
<p>Click Here</p>
</span>
</li>
</ul>
<div class="table-data">
<div class="order">
<div class="head">
<h3> Products</h3>
</div>
<?php
if(isset($npk)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Packing</th>
<th>line-1</th>
<th>line-2</th>
<th>line-3</th>
<th>line-4</th>
<th>line-5</th>
<th>line-6</th>
<th>line-7</th>
<th>line-8</th>
<th>line-9</th>
<th>line-10</th>
<th>otherdetail</th>
<th>category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_npk = mysqli_fetch_assoc($result_npk)) {
?>
<tr>
<td><img width="95%" src="<?php echo $row_npk["front_img"] ?>" alt=""></td>
<td><img width="95%" src="<?php echo $row_npk["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_npk["product_name"] ?></p></td>
<td><?php echo $row_npk["packing"] ?></td>
<td><?php echo $row_npk["line_1"] ?></td>
<td><?php echo $row_npk["line_2"] ?></td>
<td><?php echo $row_npk["line_3"] ?></td>
<td><?php echo $row_npk["line_4"] ?></td>
<td><?php echo $row_npk["line_5"] ?></td>
<td><?php echo $row_npk["line_6"] ?></td>
<td><?php echo $row_npk["line_7"] ?></td>
<td><?php echo $row_npk["line_8"] ?></td>
<td><?php echo $row_npk["line_9"] ?></td>
<td><?php echo $row_npk["line_10"] ?></td>
<td><?php echo $row_npk["other_detail"] ?></td>
<td><?php echo $row_npk["category"] ?></td>
<td><a href="update_npk.php<?php echo "?id=$row_npk[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_npk[id] & category=npk"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($liquid)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Subtitle</th>
<th>Dose-1</th>
<th>Dose-2</th>
<th>line-1</th>
<th>line-2</th>
<th>line-3</th>
<th>line-4</th>
<th>line-5</th>
<th>line-6</th>
<th>line-7</th>
<th>category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_liquid = mysqli_fetch_assoc($result_liquid)) {
?>
<tr>
<td><img width="95%" src="<?php echo $row_liquid["front_img"] ?>" alt=""></td>
<td><img width="95%" src="<?php echo $row_liquid["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_liquid["p_name"] ?></p></td>
<td><p><?php echo $row_liquid["subtitle"] ?></p></td>
<td><?php echo $row_liquid["dose_1"] ?></td>
<td><?php echo $row_liquid["dose_2"] ?></td>
<td><?php echo $row_liquid["line_1"] ?></td>
<td><?php echo $row_liquid["line_2"] ?></td>
<td><?php echo $row_liquid["line_3"] ?></td>
<td><?php echo $row_liquid["line_4"] ?></td>
<td><?php echo $row_liquid["line_5"] ?></td>
<td><?php echo $row_liquid["line_6"] ?></td>
<td><?php echo $row_liquid["line_7"] ?></td>
<td><?php echo $row_liquid["category"] ?></td>
<td><a href="update_liquid.php<?php echo "?id=$row_liquid[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_liquid[id] & category=liquid"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($single)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Packing</th>
<th>Composition</th>
<th>Application</th>
<th>pH-Stability</th>
<th>Category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_single = mysqli_fetch_assoc($result_single)) {
?>
<tr>
<td><img width="60%" src="<?php echo $row_single["front_img"] ?>" alt=""></td>
<td><img width="60%" src="<?php echo $row_single["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_single["p_name"] ?></p></td>
<td><?php echo $row_single["packing"] ?></td>
<td><?php echo $row_single["Composition"] ?></td>
<td><?php echo $row_single["Application"] ?></td>
<td><?php echo $row_single["pH_stability"] ?></td>
<td><?php echo $row_single["category"] ?></td>
<td><a href="update_single.php<?php echo "?id=$row_single[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_single[id] & category=single"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($mix)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Packing</th>
<th>Chelate</th>
<th>Composition</th>
<th>Application</th>
<th>pH-Stability</th>
<th>Category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_mix = mysqli_fetch_assoc($result_mix)) {
?>
<tr>
<td><img width="95%" src="<?php echo $row_mix["front_img"] ?>" alt=""></td>
<td><img width="95%" src="<?php echo $row_mix["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_mix["p_name"] ?></p></td>
<td><?php echo $row_mix["packing"] ?></td>
<td ><?php echo $row_mix["Chelate"] ?></td>
<td><?php echo $row_mix["Composition"] ?></td>
<td><?php echo $row_mix["Application"] ?></td>
<td><?php echo $row_mix["pH_stability"] ?></td>
<td><?php echo $row_mix["category"] ?></td>
<td><a href="update_mix.php<?php echo "?id=$row_mix[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_mix[id] & category=mix"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($boron)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Packing</th>
<th>Chelate</th>
<th>Composition</th>
<th>Application</th>
<th>pH-Stability</th>
<th>Category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_boron = mysqli_fetch_assoc($result_boron)) {
?>
<tr>
<td><img width="60%" src="<?php echo $row_boron["front_img"] ?>" alt=""></td>
<td><img width="60%" src="<?php echo $row_boron["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_boron["p_name"] ?></p></td>
<td><?php echo $row_boron["packing"] ?></td>
<td ><?php echo $row_boron["Chelate"] ?></td>
<td><?php echo $row_boron["Composition"] ?></td>
<td><?php echo $row_boron["Application"] ?></td>
<td><?php echo $row_boron["pH_stability"] ?></td>
<td><?php echo $row_boron["category"] ?></td>
<td><a href="update_boron.php<?php echo "?id=$row_boron[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_boron[id] & category=boron"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($bio)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Subtitle</th>
<th>Details</th>
<th>Category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_bio = mysqli_fetch_assoc($result_bio)) {
?>
<tr>
<td><img width="50%" src="<?php echo $row_bio["front_img"] ?>" alt=""></td>
<td><img width="50%" src="<?php echo $row_bio["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_bio["p_name"] ?></p></td>
<td><?php echo $row_bio["subtitle"] ?></td>
<td ><?php echo $row_bio["details"] ?></td>
<td><?php echo $row_bio["category"] ?></td>
<td><a href="update_bio.php<?php echo "?id=$row_bio[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_bio[id] & category=bio"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if(isset($plant)){
?>
<table>
<thead>
<tr>
<th>Front_img</th>
<th>In_img</th>
<th>Product</th>
<th>Subtitle</th>
<th>Details</th>
<th>Category</th>
<th>edit</th>
</tr>
</thead>
<tbody>
<?php
while ($row_plant = mysqli_fetch_assoc($result_plantbio)) {
?>
<tr>
<td><img width="40%" src="<?php echo $row_plant["front_img"] ?>" alt=""></td>
<td><img width="40%" src="<?php echo $row_plant["in_img"] ?>" alt=""></td>
<td><p><?php echo $row_plant["p_name"] ?></p></td>
<td><?php echo $row_plant["subtitle"] ?></td>
<td ><?php echo $row_plant["details"] ?></td>
<td><?php echo $row_plant["category"] ?></td>
<td><a href="update_plant.php<?php echo "?id=$row_plant[id]"; ?>"><i style="color: #0A6EBD;cursor: pointer;" class="fa-solid fa-pen-to-square"></i></a>
<a href="deleteproduct.php<?php echo "?id=$row_plant[id] & category=plant"; ?>"><i style="color: #ED2B2A;cursor: pointer;" class="fa-solid fa-trash"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
</div>
</main>
<!-- MAIN -->
</section>
<!-- CONTENT -->
<script src="admin.js"></script>
</body>
</html>