D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
inventory.tapaslights.com
/
Filename :
sellers.php
back
Copy
<?php include 'config.php'; // Handle deletion if (isset($_GET['delete_id'])) { $delete_id = intval($_GET['delete_id']); $delete_query = "DELETE FROM sellers WHERE id = $delete_id"; if (mysqli_query($conn, $delete_query)) { header("Location: sellers.php?success=Seller+deleted+successfully"); exit(); } else { $delete_message = "Error deleting seller: " . mysqli_error($conn); } } // Fetch all sellers $query = "SELECT * FROM sellers ORDER BY seller_name ASC"; $result = mysqli_query($conn, $query); // Messages $success_message = $_GET['success'] ?? ''; $error_message = $_GET['error'] ?? $delete_message ?? ''; ?> <!DOCTYPE html> <html lang="en"> <head> <?php include 'style.php'; ?> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" /> <style> /* Modern Color Scheme */ :root { --primary: #4361ee; --primary-light: #e0e7ff; --secondary: #3f37c9; --accent: #f72585; --light: #f8f9fa; --dark: #212529; --gray: #6c757d; --border: #dee2e6; } /* Base Styles */ body { background-color: #f5f7fb; font-family: 'Segoe UI', system-ui, sans-serif; } /* Card Design */ .seller-card { border: none; border-radius: 10px; box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05); transition: all 0.3s ease; overflow: hidden; margin-bottom: 25px; background: white; } .seller-card:hover { transform: translateY(-3px); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); } /* Card Header */ .seller-header { background: var(--primary); color: white; padding: 20px; display: flex; align-items: center; justify-content: space-between; position: relative; } .seller-header::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--primary)); } .seller-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, 0.2); margin-right: 15px; } .seller-title { flex: 1; } .seller-title h4 { margin: 0; font-weight: 600; } .seller-id { font-size: 13px; opacity: 0.9; margin-top: 5px; } /* Details Section */ .seller-details { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; } .detail-item { padding: 15px; background: var(--light); border-radius: 8px; border-left: 3px solid var(--primary); } .detail-item:hover { background: #f0f4ff; } .detail-label { font-size: 12px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; } .detail-value { font-size: 14px; color: var(--dark); font-weight: 500; } .detail-value a { color: var(--primary); text-decoration: none; } .detail-value a:hover { text-decoration: underline; } .detail-icon { color: var(--primary); margin-right: 10px; width: 20px; text-align: center; } /* Action Buttons */ .action-btns { padding: 15px 20px; background: #f8f9fa; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; } .btn { padding: 8px 16px; border-radius: 6px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; border: none; cursor: pointer; } .btn-view { background: var(--primary-light); color: var(--primary); } .btn-view:hover { background: #d7e0ff; } .btn-edit { background: #e6f7ee; color: #38a169; } .btn-edit:hover { background: #d0f0e0; } .btn-delete { background: #fee2e2; color: #e53e3e; } .btn-delete:hover { background: #fecaca; } /* Empty State */ .empty-state { text-align: center; padding: 50px 20px; background: white; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); } .empty-icon { font-size: 60px; color: #ced4da; margin-bottom: 20px; } /* Responsive */ @media (max-width: 768px) { .seller-header { flex-direction: column; text-align: center; } .seller-avatar { margin-right: 0; margin-bottom: 15px; } .seller-details { grid-template-columns: 1fr; } .action-btns { flex-direction: column; } .btn { justify-content: center; } } /* Animations */ @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .seller-card { animation: fadeIn 0.4s ease-out forwards; opacity: 0; } /* Stagger animations */ .seller-card:nth-child(1) { animation-delay: 0.1s; } .seller-card:nth-child(2) { animation-delay: 0.2s; } .seller-card:nth-child(3) { animation-delay: 0.3s; } .seller-card:nth-child(4) { animation-delay: 0.4s; } </style> </head> <body> <div class="main-wrapper"> <?php include 'header.php'; ?> <?php include 'sidebar.php'; ?> <div class="page-wrapper"> <div class="content container-fluid"> <div class="page-header"> <div class="row align-items-center"> <div class="col"> <h5 class="page-title">Seller Management</h5> <ul class="breadcrumb"> <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li> <li class="breadcrumb-item active">Sellers</li> </ul> </div> <div class="col-auto"> <a href="add_seller.php" class="btn btn-primary"> <i class="fas fa-plus"></i> Add Seller </a> </div> </div> </div> <!-- Messages --> <?php if ($success_message): ?> <div class="alert alert-success alert-dismissible fade show" role="alert"> <i class="fas fa-check-circle me-2"></i> <?php echo htmlspecialchars($success_message); ?> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> <?php elseif ($error_message): ?> <div class="alert alert-danger alert-dismissible fade show" role="alert"> <i class="fas fa-exclamation-circle me-2"></i> <?php echo htmlspecialchars($error_message); ?> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> <?php endif; ?> <div class="row"> <div class="col-12"> <?php if (mysqli_num_rows($result) > 0): ?> <?php while ($seller = mysqli_fetch_assoc($result)): ?> <div class="card seller-card"> <div class="seller-header"> <div class="d-flex align-items-center"> <img src="assets/images/man.png ?>" class="seller-avatar" alt="Seller"> <div class="seller-title"> <h4><?php echo htmlspecialchars($seller['seller_name']); ?></h4> <div class="seller-id"> <i class="fas fa-id-card"></i> ID: <?php echo $seller['id']; ?> <span class="ms-3"><i class="fas fa-calendar-alt"></i> Joined: <?php echo date('M d, Y', strtotime($seller['created_at'])); ?></span> </div> </div> </div> </div> <div class="card-body"> <div class="seller-details"> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-envelope"></i> </div> <div> <div class="detail-label">Email</div> <div class="detail-value"> <a href="mailto:<?php echo htmlspecialchars($seller['email']); ?>"> <?php echo htmlspecialchars($seller['email']); ?> </a> </div> </div> </div> </div> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-phone"></i> </div> <div> <div class="detail-label">Phone</div> <div class="detail-value"> <a href="tel:<?php echo htmlspecialchars($seller['phone']); ?>"> <?php echo htmlspecialchars($seller['phone']); ?> </a> </div> </div> </div> </div> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-building"></i> </div> <div> <div class="detail-label">Company</div> <div class="detail-value"> <?php echo !empty($seller['company_name']) ? htmlspecialchars($seller['company_name']) : 'N/A'; ?> </div> </div> </div> </div> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-file-invoice"></i> </div> <div> <div class="detail-label">GST Number</div> <div class="detail-value"> <?php echo !empty($seller['company_gst']) ? htmlspecialchars($seller['company_gst']) : 'N/A'; ?> </div> </div> </div> </div> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-university"></i> </div> <div> <div class="detail-label">Bank</div> <div class="detail-value"> <?php echo htmlspecialchars($seller['bank_name']); ?><br> A/C: <?php echo htmlspecialchars($seller['account_number']); ?> </div> </div> </div> </div> <div class="detail-item"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-code-branch"></i> </div> <div> <div class="detail-label">Branch</div> <div class="detail-value"> <?php echo htmlspecialchars($seller['branch_name']); ?><br> IFSC: <?php echo htmlspecialchars($seller['ifsc_code']); ?> </div> </div> </div> </div> <div class="detail-item" style="grid-column: 1 / -1;"> <div class="d-flex align-items-start"> <div class="detail-icon"> <i class="fas fa-map-marker-alt"></i> </div> <div> <div class="detail-label">Address</div> <div class="detail-value"> <?php echo !empty($seller['address']) ? nl2br(htmlspecialchars($seller['address'])) : 'Not provided'; ?> </div> </div> </div> </div> </div> <div class="action-btns"> <a href="seller_products.php?id=<?php echo $seller['id']; ?>" class="btn btn-view"> <i class="fas fa-box-open"></i> View Products </a> <a href="edit_seller.php?id=<?php echo $seller['id']; ?>" class="btn btn-edit"> <i class="fas fa-edit"></i> Edit </a> <a href="?delete_id=<?php echo $seller['id']; ?>" class="btn btn-delete" onclick="return confirm('Delete seller <?php echo addslashes($seller['seller_name']); ?>? This cannot be undone.');"> <i class="fas fa-trash-alt"></i> Delete </a> </div> </div> </div> <?php endwhile; ?> <?php else: ?> <div class="card"> <div class="card-body empty-state"> <div class="empty-icon"> <i class="fas fa-user-tie"></i> </div> <h4>No Sellers Found</h4> <p class="text-muted">You haven't added any sellers yet.</p> <a href="add_seller.php" class="btn btn-primary mt-3"> <i class="fas fa-plus me-2"></i> Add New Seller </a> </div> </div> <?php endif; ?> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?> <script> // Button click effect document.querySelectorAll('.btn').forEach(button => { button.addEventListener('mousedown', function() { this.style.transform = 'scale(0.98)'; }); button.addEventListener('mouseup', function() { this.style.transform = ''; }); button.addEventListener('mouseleave', function() { this.style.transform = ''; }); }); // Detail item hover effect document.querySelectorAll('.detail-item').forEach(item => { item.addEventListener('mouseenter', function() { this.style.borderLeftColor = 'var(--accent)'; }); item.addEventListener('mouseleave', function() { this.style.borderLeftColor = 'var(--primary)'; }); }); </script> </body> </html>