https://t.me/RX1948
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/rabbithabit.com/public_html/application/views/admin/orders-old/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/rabbithabit.com/public_html/application/views/admin/orders-old/index.php
<link rel="stylesheet" href="<?= base_url('assets/admin/chosen_js/chosen.css'); ?>">
<style>
    .chosen-container, .chosen-container-single{
        width: 100% !important;
    }
</style>

<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> Back to Dashboard</a></p><br>
        <h2>Sales Orders</h2>
        <?= $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 -->

<h3 style="display: none;">Generate Multiple Invoices</h3>
<div class="row" style="display: none;">
    <?= form_open('admin/orders/generate_multiple_invoices'); ?>
    <div class="col-sm-2 col-xs-6">
        <input class="form-control datepicker" type="text" placeholder="Enter Start Date" name="start_date" required>
    </div><!-- end class="col-sm-8" -->
     <div class="col-sm-2 col-xs-6">
        <input class="form-control datepicker" type="text" placeholder="Enter End Date" name="end_date" required>
    </div><!-- end class="col-sm-8" -->
    <div class="col-sm-1 col-xs-6" style="text-align:right;">
        <label>Include<br>Unpaid Orders</label>
    </div><!-- end class="col-sm-8" -->

    <div class="col-sm-2 col-xs-6">
       <select class="form-control" name="include_unpaid_orders">
            <option value="no">No</option>
            <option value="yes">Yes</option>
       </select>
    </div><!-- end class="col-sm-8" -->

    <div class="col-sm-3 col-xs-6">
        <input class="btn btn-primary form-control" type="submit" name="generate_invoices" value="GENERATE INVOICES">
    </div><!-- end class="col-sm-6" -->
    <?= form_close(); ?>
</div> <!-- end row -->

<h3 style="display: none;">Generate Multiple Delivery Slips</h3>
<div class="row" style="display: none;">
    <?= form_open('admin/orders/generate_multiple_deliveryslips'); ?>
    <div class="col-sm-2 col-xs-6">
        <input class="datepicker form-control" type="text" placeholder="Enter Start Date" name="start_date" required>
    </div><!-- end class="col-sm-8" -->
     <div class="col-sm-2 col-xs-6">
        <input class="datepicker form-control" type="text" placeholder="Enter End Date" name="end_date" required>
    </div><!-- end class="col-sm-8" -->

    <div class="col-sm-1 col-xs-6" style="text-align:right;">
        <label>Include<br>Unpaid Orders</label>
    </div><!-- end class="col-sm-8" -->

    <div class="col-sm-2 col-xs-6">
       <select class="form-control" name="include_unpaid_orders">
            <option value="no">No</option>
            <option value="yes">Yes</option>
       </select>
    </div><!-- end class="col-sm-8" -->

    <div class="col-sm-3 col-xs-6">
        <input class="btn btn-primary form-control" type="submit" name="generate_deliveryslips" value="GENERATE DELIVERY SLIPS">
    </div><!-- end class="col-sm-6" -->
    <?= form_close(); ?>
</div> <!-- end row -->

<!-- <div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/order_excel_export'); ?>"><img src="<?= base_url('assets/admin/img/excel-icon.png'); ?>"> EXPORT TO MS EXCEL</a></p>
        <p>(Export this to excel file)</p>
    </div>
</div> -->

<?= form_open('admin/orders/filter_order_by'); ?> 
    <div class="row">
        <div class="col-sm-6"> 
            <select class="form-control" name="filter_key" id="filter_key">
                <option value="order_id">Filter by Id Order</option>
                <option value="voucher">Filter by Voucher</option>
                <option value="payment_status">Filter by Payment Status</option>
                <option value="payment_type">Filter by Payment Type</option>
                <!-- <option value="flashsale">Filter by Flashsale</option> -->
                <option value="sale">Filter by Sale</option>
                <option value="date">Filter by Date</option>
                <option value="totalorder">Filter by Total Order</option>	
                <!-- <option value="marketplace">Filter by Marketplace</option> -->
                <option value="customer">Filter by Customer</option> 
            </select>
        </div><!-- end class="col-sm-8" -->   
    </div> <!-- end row --> 
    <div class="row">
        <div class="col-sm-6" id="order_id"> 
            <input class="form-control" type="text" placeholder="Enter " name="order_id">
        </div><!-- end class="col-sm-8" -->   
        <div class="col-sm-6" id="payment_status" style="display: none;"> 
            <select class="form-control" name="payment_status">
                <option value="0">Pending</option>
                <option value="1">Not Paid</option>
                <option value="2">Cancel</option>
                <option value="3">Paid</option>
                <option value="4">Process</option>
                <option value="5">Delivered</option>
            </select>
        </div><!-- end class="col-sm-8" --> 
        <div class="col-sm-6" id="payment_type" style="display: none;"> 
            <select class="form-control" name="payment_type">
                <option value="bank transfer BCA">BCA</option>
                <option value="bank transfer MANDIRI">MANDIRI</option>
                <option value="midtrans">MIDTRANS</option>
                <!-- <option value="top">TOP</option> -->
            </select>
        </div><!-- end class="col-sm-8" -->   
        <div class="col-sm-6" id="date" style="display: none;">
                From<input class="form-control datepicker" type="text" name="start_date">To
                <input class="form-control datepicker" type="text" name="end_date">
        </div><!-- end class="col-sm-8" -->
        <div class="col-sm-6" id="totalorder" style="display: none;">
                From<input class="form-control" type="number" name="start_amt">To
                <input class="form-control" type="number" name="end_amt">
        </div><!-- end class="col-sm-8" -->	
        <div class="col-sm-6" id="marketplace" style="display: none;">
            <select class="form-control" name="marketplace_name">
                <?php if($marketplaces != null): ?>
                    <?php foreach ($marketplaces as $marketplace):?>
                        <option value="<?= $marketplace->marketplace_name;?>"><?= ucfirst($marketplace->marketplace_name);?></option>
                    <?php endforeach; ?>
                <?php endif; ?>
            </select>
        </div><!-- end class="col-sm-8" -->
        <div class="col-sm-6" id="customer" style="display: none;">
            <select class="chosen-select" name="customer_id">
                <?php if($customers != null): ?>
                    <?php foreach ($customers as $customer):?>
                        <option value="<?= $customer->customer_id;?>">
                            <?php 
                                $customer_detail = $this->db->select('name,email')->from('customers')->where('id_customers',$customer->customer_id)->get()->row();
                                if(count($customer_detail) > 0){
                                    echo ucfirst($customer_detail->name)."(".$customer_detail->email.")";    
                                }
                            ?>
                        </option>
                    <?php endforeach; ?>
                <?php endif; ?>
            </select>
        </div><!-- end class="col-sm-8" -->	   
    </div> <!-- end row --> 
    <div class="row">
        <div class="col-sm-6">
            <input class="btn btn-primary form-control" type="submit" value="FILTER ORDER">
        </div><!-- end class="col-sm-6" -->    
        <div class="col-sm-6">
            <a href="<?= base_url('admin/orders');?>"><p style="margin-top: 6px;">Clear Filter</p></a>
        </div>
    </div>
<?= form_close(); ?> 

<div class="row">
    <div class="col-sm-12">
	
<div class="row">
    <div class="col-sm-12">
        <h4>Total Order :  <?= number_format($total_sales_order); ?></h4> 
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->

        <div class="table-responsive">
        <table class="table table-striped">
    <thead>
        <tr>
            <th>Order ID</th>
            <th>Order Date</th>
            <th>Customer</th>
            <th>Amount (Rp)</th>
            <th>Payment type</th>
            <th>Order Status</th>
            <th>Additional Info</th>
            <th>Multiple Warehouses</th>
            <th>View Details</th>
        </tr>
    </thead>
    <tbody>
        <?php if(count($orders)) : ?>

            <?php foreach($orders as $order): ?>
                <tr>
                    <td><?= $order->id_orders; ?></td>
                    <td><?= date('j M Y H:i:s', strtotime($order->order_date)); ?></td>
                    <td><?= ucwords($order->recipient_name); ?></td>
                    <td>
                        <?php 
                            $final_grand_total = 0;
                            $finalshippingfee = 0;
                            $calculate_finalshippingfee = $order->shipping_fee - $order->free_shipping_fee;
                            if($calculate_finalshippingfee > 0){
                                $finalshippingfee = $calculate_finalshippingfee;
                            }
                            $grand_total =  ($order->total_amount - $order->redeemed_voucher_amount - $order->minus_reward_amount)+($finalshippingfee);
                            if($grand_total > 0){
                                $final_grand_total = $grand_total;
                            }
                            echo number_format($final_grand_total);
                        ?>
                    </td>
                    <td><?= ucwords($order->payment_type);?></td>
                    <td>
                    <?php
                        switch ($order->payment_status) {
                            case 0:
                                echo '<span style="color:black; font-weight:bold;">Pending</span>';
                                break;
                            case 1:
                                echo '<span style="color:brown; font-weight:bold;">Not Paid</span>';
                                break;
                            case 2:
                                echo '<span style="color:red; font-weight:bold;">Cancel</span>';
                                break;
                            case 3:
                                echo '<span style="color:green; font-weight:bold;">Paid</span>';
                                break;
                            case 4:
                                echo '<span style="color:blue; font-weight:bold;">Process</span>';
                                break;
                            case 5:
                                echo '<span style="color:blue; font-weight:bold;">Delivered</span>';
                                break;
                        }
                    ?>
                    </td>
                    <td>
                    <?php if($order->payment_type == 'bank transfer BCA') : ?>
                        <?php
                            if($order->payment_confirm == 1 ) {
                                echo 'cust pay confirm: Yes';
                            } else {
                                echo 'Cust pay confirm: Not Yet';
                            }
                        ?>
                    <?php elseif($order->payment_type == 'bank transfer MANDIRI') : ?>
                        <?php
                            if($order->payment_confirm == 1 ) {
                                echo 'cust pay confirm: Yes';
                            } else {
                                echo 'Cust pay confirm: Not Yet';
                            }
                        ?>
                    <?php elseif($order->payment_type == 'midtrans') : ?>
                        <?= $order->payment_status_message; ?>
                    <?php endif; ?>
                    </td>
                    <td>
                        <?php
                        //calculate if the current order has more than 1 warehouse
                        $this->db->select('warehouse_id')->from('orders_detail')->where('orders_id', $order->id_orders);
                        $warehouse_ids = $this->db->get()->result();

                        $warehouse_id_array = array();

                        foreach ($warehouse_ids as $warehouse_id) {
                            if(!in_array($warehouse_id->warehouse_id, $warehouse_id_array)) {
                                 $warehouse_id_array[] = $warehouse_id->warehouse_id;
                            }  
                        }
                        ?>
                        <?php if(count($warehouse_id_array) > 1) : ?>
                            Yes
                        <?php else : ?>
                            No 
                        <?php endif; ?>      
                    </td>   
                    
                    <td><a target="_blank" style="text-decoration: underline;" href="<?= base_url('admin/orders/view') . '/' . $order->id_orders ; ?>">View</a></td>
                </tr>
            <?php endforeach; ?>
        <?php else: ?>
            <tr>
            <td colspan="3">We could not find any order.</td>
            </tr>
        <?php endif; ?>

    </tbody>
    </table>
    </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>
    $(document).ready(function() {
        $('#filter_key').change(function() {
            var filter_key      = $(this).val();
            if(filter_key == 'order_id'){
                $('#order_id').show();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if((filter_key == 'voucher') || (filter_key == 'flashsale') || (filter_key == 'sale')){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if(filter_key == 'payment_status'){
                $('#order_id').hide();
                $('#payment_status').show();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if(filter_key == 'payment_type'){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').show();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if(filter_key == 'date'){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').show();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if(filter_key == 'totalorder'){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').show();
                $('#marketplace').hide();
                $('#customer').hide();
            }
            if(filter_key == 'marketplace'){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').show();
                $('#customer').hide();
            }
            if(filter_key == 'customer'){
                $('#order_id').hide();
                $('#payment_status').hide();
                $('#payment_type').hide();
                $('#date').hide();
                $('#totalorder').hide();
                $('#marketplace').hide();
                $('#customer').show();
            }
        });
    });
</script>

<script src="<?= base_url('assets/admin/chosen_js/chosen.jquery.js'); ?>" type="text/javascript"></script>
<script src="<?= base_url('assets/admin/chosen_js/prism.js'); ?>" type="text/javascript" charset="utf-8"></script>
<script src="<?= base_url('assets/admin/chosen_js/init.js'); ?>" type="text/javascript" charset="utf-8"></script>

https://t.me/RX1948 - 2025