<?php requireonce '../../config/config.php'; requireonce '../../config/database.php';…
- User
<!-- Customers Table --> <div class="table-responsive"> <table id="customersTable" class="table table-striped"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Total Sales</th> <th>Status</th> <th>Actions</th> </tr> </thead> </table> </div> </div> </div> </div><hr> <div class="contact-info text-start"> <p><i class="fas fa-envelope"></i> <?php echo htmlspecialchars($customer['email']); ?></p> <p><i class="fas fa-phone"></i> <?php echo htmlspecialchars($customer['phone']); ?></p> <p><i class="fas fa-map-marker-alt"></i> <?php echo formatAddress($customer); ?></p> </div> </div> </div> <!-- Quick Actions --> <div class="card mt-3"> <div class="card-header"> <h5>Quick Actions</h5> </div> <div class="card-body"> <div class="d-grid gap-2"> <button class="btn btn-primary" onclick="createInvoice(<?php echo $customer_id; ?>)"> <i class="fas fa-file-invoice"></i> New Invoice </button> <button class="btn btn-info" onclick="sendEmail(<?php echo $customer_id; ?>)"> <i class="fas fa-envelope"></i> Send Email </button> <button class="btn btn-success" onclick="addPayment(<?php echo $customer_id; ?>)"> <i class="fas fa-money-bill"></i> Record Payment </button> </div> </div> </div> </div> <!-- Main Content --> <div class="col-md-9"> <!-- Statistics Cards --> <div class="row"> <div class="col-md-3"> <div class="card bg-primary text-white"> <div class="card-body"> <h6>Total Sales</h6> <h3><?php echo formatCurrency($customer['total_sales']); ?></h3> </div> </div> </div> <div class="col-md-3"> <div class="card bg-success text-white"> <div class="card-body"> <h6>Total Invoices</h6> <h3><?php echo $customer['total_invoices']; ?></h3> </div> </div> </div> <div class="col-md-3"> <div class="card bg-info text-white"> <div class="card-body"> <h6>Average Invoice</h6> <h3><?php echo formatCurrency($customer['avg_invoice_value']); ?></h3> </div> </div> </div> <div class="col-md-3"> <div class="card bg-warning text-white"> <div class="card-body"> <h6>Outstanding</h6> <h3><?php echo formatCurrency($customer['outstanding_amount']); ?></h3> </div> </div> </div> </div> <!-- Tabs Section --> <div class="card mt-3"> <div class="card-body"> <ul class="nav nav-tabs" id="customerTabs"> <li class="nav-item"> <a class="nav-link active" data-bs-toggle="tab" href="#invoices">Invoices</a> </li> <li class="nav-item"> <a class="nav-link" data-bs-toggle="tab" href="#transactions">Transactions</a> </li> <li class="nav-item"> <a class="nav-link" data-bs-toggle="tab" href="#contacts">Contacts</a> </li> <li class="nav-item"> <a class="nav-link" data-bs-toggle="tab" href="#documents">Documents</a> </li> </ul> <div class="tab-content mt-3"> <!-- Invoices Tab --> <div class="tab-pane fade show active" id="invoices"> <table class="table table-striped" id="invoicesTable"> <thead> <tr> <th>Invoice #</th> <th>Date</th> <th>Due Date</th> <th>Amount</th> <th>Status</th> <th>Actions</th> </tr> </thead> </table> </div> <!-- Transactions Tab --> <div class="tab-pane fade" id="transactions"> <table class="table table-striped" id="transactionsTable"> <thead> <tr> <th>Date</th> <th>Type</th> <th>Reference</th> <th>Amount</th> <th>Balance</th> </tr> </thead> </table> </div> <!-- Contacts Tab --> <div class="tab-pane fade" id="contacts"> <button class="btn btn-primary mb-3" onclick="addContact()"> <i class="fas fa-plus"></i> Add Contact </button> <div id="contactsList"> <!-- Will be populated via AJAX --> </div> </div> <!-- Documents Tab --> <div class="tab-pane fade" id="documents"> <form id="uploadDocumentForm" class="mb-3"> <div class="row"> <div class="col-md-4"> <select class="form-select" name="document_type" required> <option value="">Select Document Type</option> <option value="contract">Contract</option> <option value="id_proof">ID Proof</option> <option value="tax_document">Tax Document</option> <option value="other">Other</option> </select> </div> <div class="col-md-6"> <input type="file" class="form-control" name="document" required> </div> <div class="col-md-2"> <button type="submit" class="btn btn-primary w-100">Upload</button> </div> </div> </form> <div id="documentsList"> <!-- Will be populated via AJAX --> </div> </div> </div> </div> </div> </div> - Assistant
- User
Need sample data for Above
- Assistant
- User
rewrite Index.php properly
- Assistant
- User
- Assistant
- User
index need to match above database
- Assistant
- User
From above index php and database make proper api.php
- Assistant