📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
ads
/
assets
/
images
/
Great-Features
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
25529.16 KB
0644
🗑️
⬇️
✏️
🔒
Editing: invoice.php
<?php $this->load->view('manager/template/header'); ?> <?php $this->load->view('manager/template/nav'); ?> <script src="https://js.paystack.co/v1/inline.js"></script> <!-- START: Main Content--> <main> <div class="container-fluid site-width"> <!-- START: Breadcrumbs--> <div class="row"> <div class="col-12 align-self-center"> <div class="sub-header mt-3 py-3 align-self-center d-sm-flex w-100 rounded"> <div class="w-sm-100 mr-auto"> <h4 class="mb-0">Invoice</h4> <p><?php echo $invoice['reference'] ?></p> </div> <ol class="breadcrumb bg-transparent align-self-center m-0 p-0"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item"><a href="#">Orders</a></li> <li class="breadcrumb-item active">Invoice</li> </ol> </div> </div> </div> <!-- END: Breadcrumbs--> <!-- START: Card Data--> <?php if ($this->session->flashdata('alert_danger')) : echo '<p class="alert alert-danger" style="text-align:center;"><button type="button" class="close" data-dismiss="alert">×</button>' . $this->session->flashdata('alert_danger') . '</p>'; ?> <?php endif; ?> <?php if ($this->session->flashdata('alert_success')) : echo '<p class="alert alert-success" style="text-align:center;"><button type="button" class="close" data-dismiss="alert">×</button>' . $this->session->flashdata('alert_success') . '</p>'; ?> <?php endif; ?> <div class="row" id="printable"> <div class="col-md-4 mt-3"> <div class=""> <div class="card-header d-flex justify-content-between align-items-center"> <h2 class="card-title">Order Info.</h2> </div> <div class="card-content"> <div class="card-body p-0"> <ul class="list-group list-unstyled"> <li class="p-2 border-bottom text-left"> <div class="media d-flex w-100"> <div class="media-body align-self-center pl-2"><br> <span class="mb-0 font-w-600"><i class="fa fa-shopping-bag"></i> Reference ID : <?php echo $invoice['reference'] ?></span><br> <p class="mb-0 font-w-500 tx-s-12"><i class="fa fa-user"></i> Customer: <?php echo $invoice['firstname'] . ' ' . $invoice['lastname'] ?></p> <p class="mb-0 font-w-500 tx-s-12"><i class="icon-calendar"></i> OrderDate : <?php echo $invoice['order_date'] ?></p> <p class="mb-0 font-w-500 tx-s-12"><i class="icon-wallet"></i> Payment Method : <?php echo $invoice['payment_method'] ?></p> <p class="mb-0 font-w-500 tx-s-12"><i class="fa fa-exchange-alt"></i> Order Type : <?php echo ucfirst($invoice['order_type']) ?></p> <p class="mb-0 font-w-500 tx-s-12"><i class="fa fa-exclamation"></i> Order Status : <?php if ($invoice['order_status'] == "0") { echo '<b class="badge outline-badge-warning"><i class="fa fa-hand-holding"></i> Pending</b>'; } elseif ($invoice['order_status'] == "1") { echo '<b class="badge outline-badge-success"><i class="fa fa-check"></i> Completed</b>'; } elseif ($invoice['order_status'] == "2") { echo '<b class="badge outline-badge-info"><i class="fa fa-exclamation"></i> Processing</b>'; } elseif ($invoice['order_status'] == "3") { echo '<b class="badge outline-badge-danger"><i class="fa fa-exclamation"></i> Cancelled</b>'; } else { echo '<b class=" badge outline-badge-danger"><i class="fa fa-times-circle"></i> Unknown</b>'; } ?> </p> <?php if ($invoice['payment_status'] != '2') { ?> <p class="flex-display"> <select data-ref="<?php echo $invoice['reference'] ?>" name="invoice_order_status" class="form-control avoid-this"> <option value="">Select Status</option> <option value="0">Pending</option> <option value="2">Processing</option> <option value="1">Completed</option> <option value="3">Cancelled</option> </select> </p> <?php } ?> </div> </div> </li> </ul> </div> </div> </div> </div> <div class="col-md-4 mt-3"></div> <div class="col-md-4 mt-3"> <div class=""> <div class="card-header d-flex justify-content-between align-items-center"> <h2 class="card-title">Shipping Info.</h2> </div> <div class="card-content"> <div class="card-body p-0"> <ul class="list-group list-unstyled"> <li class="p-2 border-bottom"> <div class="media d-flex w-100"> <div class="media-body align-self-center pl-2 text-right"> <p class="mb-0 font-w-500 tx-s-12">Company Name: <?php echo $invoice['company_name'] ?></p> <p class="mb-0 font-w-500 tx-s-12">Shipping Address: <?php echo $invoice['shipping_address'] ?></p> <p class="mb-0 font-w-500 tx-s-12">Country: <?php echo $invoice['country'] ?></p> <p class="mb-0 font-w-500 tx-s-12">State: <?php echo $invoice['state'] ?></p> <p class="mb-0 font-w-500 tx-s-12">Town: <?php echo $invoice['town'] ?></p> <p class="mb-0 font-w-500 tx-s-12">Postal Code: <?php echo $invoice['postal_code'] ?></p> <p class="mb-0 font-w-500 tx-s-12">Order Note: <?php echo $invoice['order_note'] ?></p> </div> </div> </li> </ul> </div> </div> </div> </div> <div class="col-12 col-md-12 col-lg-12 mt-3"> <div class=""> <div class="card-header justify-content-between align-items-center"> <h6 class="card-title">Order Items</h6> </div> <div class="card-body table-responsive p-0"> <table class="table mb-0"> <thead> <tr> <th>SN</th> <th>Barcode</th> <th>Photo</th> <th>Product Name</th> <th>Total</th> <th>Quantity</th> <th>Color's</th> <th>Size's</th> <th>Weight</th> </tr> </thead> <tbody> <?php $this->db->join('chb_orders', 'chb_orders.reference = chb_order_items.reference', 'left'); $this->db->where('chb_order_items.reference', $invoice['reference']); $this->db->order_by('chb_order_items.item_id', 'desc'); $items = $this->db->get('chb_order_items')->result_array(); $index = ''; foreach ($items as $item) { $index++; ?> <tr> <td><?php echo $index; ?></td> <td> <?php echo $item['product_id'] ?> </td> <td> <div class=""> <a href="<?php echo base_url() . 'product/' . $item['product_id'] ?>"><img src="<?php echo base_url() ?>assets/images/<?php echo $this->db->get_where('chb_products', array('productId' => $item['product_id']))->row_array()['main_photo'] ?>" alt="" class="max_h50"></a> </div> </td> <td> <?php echo $this->db->get_where('chb_products', array('productId' => $item['product_id']))->row_array()['product_name']; ?> </td> <td> ₦<?php echo number_format($item['amount']) ?>.00 </td> <td> <?php echo $item['quantity'] ?> </td> <td> <span class="wColorWrapper"> <?php $tags = explode(',', $item['color']); for ($i = 0; $i < count($tags); $i++) { ?> <span class="colorCircle" style="background-color: <?php echo str_replace(' ', '', $tags[$i]); ?>;"></span> <?php } ?> </span> </td> <td> <?php $tags = explode(',', $item['size']); for ($i = 0; $i < count($tags); $i++) { ?> <span><?php echo str_replace(' ', '', $tags[$i]); ?></span> <?php } ?> </td> <td> <?php echo $this->db->get_where('chb_products', array('productId' => $item['product_id']))->row_array()['weight'] ?>Kg. </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> <div class="col-12 col-md-6 col-lg-6 mt-3"> <div class="col-md-12 bottomLeft position_fixed"> <a href="javascript:void(0);" class="btn btn-primary print avoid-this"> <i class="fa fa-print"></i> Print Invoice</a><br> <?php if($invoice['payment_method'] === 'Card'){ ?> <a href="<?php echo base_url() ?>manager/verifyPayment/<?php echo $invoice['reference'] ?>" class="verifyPayment btn btn-warning avoid-this mt-2"> <i class="fa fa-check"></i> Verify Payment</a><br> <?php } if ($invoice['payment_status'] != '2') { if ($admin['position'] == 'Super-Admin' || $admin['position'] == 'Admin') { echo '<button data-target="#refundModal" data-toggle="modal" class="btn btn-danger mt-2 refundPayment avoid-this"><i class="fa fa-money-bill-wave-alt"></i> Make Refund</button>'; } } ?> </div> </div> <div class="col-md-6 mt-3"> <div class="card"> <div class="card-header d-flex justify-content-between align-items-center"> <h3 class="card-title">Order Overview</h3> </div> <div class="card-content"> <div class="card-body"> <ul class="list-group list-unstyled"> <li>Subtotal <span class="pull-right">₦<?php echo number_format($invoice['sub_total']); ?>.00</span> </li> <li>VAT- <span class="pull-right">₦<?php echo number_format($invoice['vat']) ?>.00 </span> </li> <li>Total Weight <span class="pull-right"><?php echo $invoice['weight'] ?>Kg.</span> </li> <li>Shipping <span class="pull-right">₦<?php echo number_format($invoice['shippingFee']) ?>.00</span> </li> <li>Coupon Applied <span class="pull-right"><?php echo $invoice['coupon'] ?>%</span> </li> </ul> </div> </div> <div class="card-footer d-flex justify-content-between align-items-center"> <h5 class="pull-right">Grand Total ₦<?php echo number_format($invoice['grandTotal']) ?>.00</h5> </div> </div> </div> </div> <!-- END: Card DATA--> </div> </main> <!-- END: Content--> <div class="modal fade" id="refundModal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog" role="document"> <form class="modal-content" name="refundForm" method="post" action="<?php echo base_url() ?>manager/refund"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Make Refund</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <input type="hidden" name="ref_id" value="<?php echo $invoice['reference'] ?>"> <div class="form-group mt-2"> <label class="text-danger">Enter the Barcode of each product to refund separated with comma(,)</label> <input type="text" autocomplete="off" required name="refunded_products" class="form-control" placeholder=""> </div> <div class="form-group mt-2"> <label class="text-danger">Enter the Quantity of each product to refund separated with comma(,)</label> <input type="text" autocomplete="off" required name="refunded_product_qty" class="form-control" placeholder=""> </div> <div class="form-group mt-2"> <label class="text-danger">Enter Amount Equivalent (This will be deducted from sum total of this order)</label> <input type="number" autocomplete="off" required name="refund_amount" class="form-control" placeholder=""> </div> <div class="form-group mt-2"> <label class="text-danger">Optional note</label> <textarea name="note" class="form-control" placeholder=""></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary submitRefund"><i class="fa fa-check"></i> Make Refund</button> </div> </form> </div> </div> <?php $this->load->view('manager/template/footer'); ?> <?php $this->load->view('manager/template/js_functions'); ?> <script src="<?php echo $user_url ?>js/jQuery.print.min.js"></script> <script> const prependThis = '<div class="text-center p10">CHBLUXURY<br/> <?php echo $admin['location'] ?> <br>+234 708 242 7348</div> <br><br> <h3><strong>SALES INVOICE</strong></h3> <br> <div class="text-uppercase p10">BRANCH: <span class="pull-right"><?php echo $admin['office_name'] ?></span></div>'; const appendThis = '<div class="text-uppercase p10"> <div class="text-center">...Thank you</div></div>'; $('.print').on('click', function() { $("#printable").print({ globalStyles: true, mediaPrint: true, stylesheet: "http://fonts.googleapis.com/css?family=Inconsolata", iframe: false, noPrintSelector: ".avoid-this", prepend: prependThis, append: appendThis, deferred: $.Deferred().done(function() { console.log('Printing done', arguments); }) }); }); $('.submitRefund').on('click', function() { var p = $('[name="refunded_products"]').val(); var r = $('[name="refunded_product_qty"]').val(); var a = $('[name="refund_amount"]').val(); if (!p) { toastr.error('This is a required field'); $('[name="refunded_products"]').focus(); return false; } if (!r) { toastr.error('This is a required field'); $('[name="refunded_product_qty"]').focus(); return false; } if (!a) { toastr.error('This is a required field'); $('[name="refund_amount"]').focus(); return false; } if (confirm("This cannot be undone. Do you want to continue?")) { $('[name="refundForm"]').submit(); } }); </script>
💾 Save Changes