Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/laciasmara.com/public_html/shop/application/views/admin/orders/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/dashboard'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Dashboard</a></p><br> <h3>Pembelian Pelanggan</h3> <h4><?= ucwords($customer->name); ?></h4> <p>Email: <?= ucwords($customer->email); ?> Phone: <?= ucwords($customer->phone); ?><br> <?= ucwords($customer->address); ?> <?= ucwords($customer->subdistrict); ?> <?= ucwords($customer->district); ?> <?= ucwords($customer->province); ?> </p> <?= $this->session->flashdata('success'); //to display success message ?> <?= $this->session->flashdata('result'); //to display result message ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h1>Filter tanggal data yang tampil</h1> <form action="<?= base_url('admin/orders/customer') . '/' . $customer->id_customers; ?>" method="get"> <label for="start_date">Tanggal Mulai:</label> <input type="date" name="start_date" id="start_date"> <label for="end_date">Tanggal Akhir:</label> <input type="date" name="end_date" id="end_date"> <button type="submit">Filter</button> </form> </div> </div> <div id='tabel2' class="row"> <div class="row"> </div> <?php $total_product_purchases = 0; ?> <div class="col-sm-12"> <div class="table-responsive"> <h1>Laporan Penjualan</h1> <table id="tabelpenjualanretailer" class="table table-striped"> <thead> <tr> <th>Order ID</th> <th>Nama Produk</th> <th>Total QTY</th> <th>Item Price</th> <th>Discount</th> <th>Jumlah (Rp)</th> <th>Status Pesanan</th> </tr> </thead> <tbody> <?php if (count($orders)) { foreach ($orders as $order) { foreach ($order->item_summary as $order_id => $item) { foreach ($item as $product) { $total_product_purchases += $product['total_quantity']; $real_price = $this->db->select('price')->from('product_details')->where('product_id', $product['product_id'])->get()->row()->price; if ($order->redeemed_voucher_type == 'amount') { echo "$order->redeemed_voucher_amount"; } else { $discount_amount = 0; $discount_amount = (($order->redeemed_voucher_value / 100) * $product['subtotal']); } $subtotal_price = ($product['total_quantity'] * $real_price) - $discount_amount; ?> <tr> <td><?= $order_id; ?></td> <td><?= $product['product_name']; ?> <?php if ($product['attributes'] != 1) { echo "- " . $product['attributes']; } ?></td> <td><?= $product['total_quantity']; ?></td> <td><?= $real_price; ?></td> <td><?= $discount_amount; ?></td> <td><?= $subtotal_price; ?></td> <td><?php switch ($order->payment_status) { case 3: echo '<span style="color:green; font-weight:bold;">Sudah dibayar</span>'; break; case 0: echo '<span style="color:brown; font-weight:bold;">Menuggu</span>'; break; case 1: echo '<span style="color:brown; font-weight:bold;">Tidak dibayarkan</span>'; break; case 2: echo '<span style="color:brown; font-weight:bold;">Batal</span>'; break; case 5: echo '<span style="color:green; font-weight:bold;">Terkirim</span>'; break; case 8: echo '<span style="color:green; font-weight:bold;">Selesai</span>'; break; case 4: echo '<span style="color:green; font-weight:bold;">Sedang diproses</span>'; break; } ?></td> </tr> <?php } } } } else { ?> <tr> <td colspan="4">Kami tidak dapat menemukan produk apa pun.</td> </tr> <?php } ?> </tbody> </table> <?php if (isset($total_product_purchases)) : ?> <h4>Total Barang Jumlah Barang Dibeli : <?= number_format($total_product_purchases); ?></h4> <?php endif; ?> </div> </div> </div> <div id='tabel3' class="row"> <div class="row"></div> <?php $total_product_purchases = 0; ?> <div class="col-sm-12"> <div class="table-responsive"> <h1>Laporan Penjualan Per Produk</h1> <table id="tabelpenjualanretailerperproduk" class="table table-striped"> <thead> <tr> <th>Product ID</th> <th>Nama Produk</th> <th>QTY</th> </tr> </thead> <tbody> <?php foreach ($product_qty as $product) : ?> <tr> <td><?= $product['product_id']; ?></td> <td><?= $product['product_name']; ?></td> <td><?= $product['total_qty']; ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> </div> <div id='tabel1' class="row"> <div class="col-sm-12"> <div class="table-responsive"> <h1>Laporan Keseluruhan</h1> <table id="tabelpenjualanretailerkeseluruhan" class="table table-striped"> <thead> <tr> <th>Pesanan ID</th> <th>Tanggal Pesanan</th> <th>Pembelian</th> <th>QTY</th> <th>subtotal</th> <th>Total QTY</th> <th>Discount</th> <th>Jumlah (Rp)</th> <th>Status Pesanan</th> <th>Lihat Detail</th> </tr> </thead> <tbody> <?php if (count($orders)) : ?> <?php $total_purchases = 0; ?> <?php foreach ($orders as $order) : ?> <?php $grand_total = (($order->total_amount - $order->redeemed_voucher_amount - $order->minus_reward_amount) + ($order->shipping_fee - $order->free_shipping_fee)); if ($grand_total > 0) { $total_purchases = $total_purchases + $grand_total; } ?> <?php $first_row = true; ?> <?php foreach ($order->order_details as $order_detail) : ?> <tr> <?php if ($first_row) : ?> <td><?= $order->id_orders; ?></td> <td><?= date('j M Y', strtotime($order->order_date)); ?></td> <?php else : ?> <td></td> <td></td> <?php endif; ?> <td><?= $order_detail->item_name; ?> <?php if ($order_detail->attributes != 1) { echo "- " . $order_detail->attributes; } ?></td> <td><?= $order_detail->quantity; ?></td> <td><?= $order_detail->subtotal; ?></td> <?php if ($first_row) : ?> <td> <!-- Display order information here --> <!-- Initialize a variable to store the total quantity --> <?php $totalQuantity = 0; ?> <!-- Loop through order details for this order --> <?php foreach ($order->order_details as $order_detail) : ?> <!-- Display the quantity for each order detail --> <!-- Add the quantity to the total quantity --> <?php $totalQuantity += $order_detail->quantity; ?> <?php endforeach; ?> <!-- Display the total quantity for this order --> <p><?php echo $totalQuantity; ?></p> </td> <td> <?= ($order->redeemed_voucher_amount) ?> </td> <td> <?php if ($grand_total > 0) { echo number_format($grand_total); } else { echo number_format(0); } ?> </td> <td> <?php switch ($order->payment_status) { case 3: echo '<span style="color:green; font-weight:bold;">Sudah dibayar</span>'; break; case 0: echo '<span style="color:brown; font-weight:bold;">Menunggu</span>'; break; case 1: echo '<span style="color:brown; font-weight:bold;">Tidak dibayarkan</span>'; break; case 2: echo '<span style="color:brown; font-weight:bold;">Batal</span>'; break; case 5: echo '<span style="color:green; font-weight:bold;">Terkirim</span>'; break; case 8: echo '<span style="color:green; font-weight:bold;">Selesai</span>'; break; case 4: echo '<span style="color:green; font-weight:bold;">Sedang diproses</span>'; break; } ?> </td> <td><a target="_blank" style="text-decoration: underline;" href="<?= base_url('admin/orders_retailer/view') . '/' . $order->id_orders; ?>">Lihat</a></td> <?php else : ?> <td></td> <td></td> <td></td> <td></td> <td></td> <?php endif; ?> </tr> <?php $first_row = false; ?> <?php endforeach; ?> <?php endforeach; ?> <?php else : ?> <tr> <td colspan="3">Kami tidak dapat menemukan pesanan apa pun.</td> </tr> <?php endif; ?> </tbody> </table> <?php if (isset($total_purchases)) : ?> <h4>Total Pembelian: Rp <?= number_format($total_purchases); ?></h4> <?php endif; ?> </div> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <?php //create pagination... echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>'; ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <script src="https://code.jquery.com/jquery-3.5.1.js"></script> <script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.flash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script> <script src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css"> <script> $('#tabelpenjualanretailerkeseluruhan').DataTable({ "ordering": false, dom: 'Bfrtip', buttons: [{ extend: 'excelHtml5', title: 'Penjualan Pelanggan <?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'pdfHtml5', title: 'Penjualan Pelanggan <?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'print', title: 'Penjualan Pelanggan <?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' } ] }); $('#tabelpenjualanretailer').DataTable({ "ordering": true, dom: 'Bfrtip', buttons: [{ extend: 'excelHtml5', title: 'Penjualan Pelanggan Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'pdfHtml5', title: 'Penjualan Pelanggan Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'print', title: 'Penjualan Pelanggan Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' } ] }); $('#tabelpenjualanretailerperproduk').DataTable({ "ordering": true, dom: 'Bfrtip', buttons: [{ extend: 'excelHtml5', title: 'Penjualan Per Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'pdfHtml5', title: 'Penjualan Per Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' }, { extend: 'print', title: 'Penjualan Per Produk<?php echo (isset($_SESSION['startProduk'])) ? $_SESSION['startProduk'] . " - " . $_SESSION['endProduk'] : "" ?>' } ] }); </script>