|
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/indolok.id/application/views/admin/customers/ |
Upload File : |
<?= $this->session->unset_userdata('location_add_customer'); ?>
<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>
<h2>Customers Administration</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 -->
<div class="row">
<div class="col-sm-12">
<p><a href="<?= base_url('admin/customer_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>
<div class="row" style="display: none;">
<div class="col-sm-12">
<p><a href="<?= base_url('admin/customer_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 class="col-sm-12">
<h3>Bulk Upload Customers</h3>
<p>UPLOAD CUSTOMERS DATA. ACCEPT ONLY CSV. PLEASE SAVE EXCEL AS CSV. CSV USE , AS SEPARATION.</p>
<!-- <p>PS: Products data with same SKU will be updated.</p> -->
<?php
$attributes = array(
'name' => 'uploadcsv',
'id' => 'uploadcsv'
);
?>
<?= form_open_multipart('admin/customers/upload_customers', $attributes); ?>
<table>
<tr>
<td> ULPLOAD CUSTOMERS DATA CSV: </td>
<td>
<div class="form-group">
<input style="float:left; width:60%;" type="file" class="form-control" name="userfile" id="userfile" align="center"/><input type="submit" name="upload_csv" class="btn btn-info" value="UPLOAD">
</div>
</td>
</tr>
</table>
<?= form_close();?>
<p>Note: During Upload, please wait until process finish. Do not close current window.</p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<?= form_open('admin/customers'); ?>
<div class="col-sm-5 col-xs-6">
<input class="form-control" type="text" placeholder="Enter Customer Name" name="customer"
<?php if (isset($keyword)) : ?>
value="<?= ucwords($keyword); ?>"
<?php endif; ?>>
</div><!-- end class="col-sm-8" -->
<div class="col-sm-3 col-xs-6">
<input class="btn btn-primary form-control" type="submit" name="search_customer" value="SEARCH CUSTOMER">
</div><!-- end class="col-sm-6" -->
<?= form_close(); ?>
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<?php if($allowed == true) : ?>
<p><?= anchor('admin/customers/add', '<i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW CUSTOMER'); ?></p>
<?php endif; ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<table class="table table-striped">
<thead>
<tr>
<th>Customer ID</th>
<th>Customer Name</th>
<th>HP/Phone</th>
<th>Email</th>
<th>Sales ID</th>
<th>Join Date</th>
<th>Total Purchases (Rp)</th>
<th>Customer Type</th>
<th>Status</th>
<th>View Info</th>
<?php if($allowed == true && $role != 'admin') : ?>
<th>Is Delete</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php if(count($customers)) : ?>
<?php foreach($customers as $customer): ?>
<tr>
<td><?= ucfirst($customer->id_customers); ?></td>
<td><?= ucfirst($customer->name); ?></td>
<td><?= ucfirst($customer->handphone); ?></td>
<td><a href="mailto:<?= $customer->email; ?>"><?= ucfirst($customer->email); ?></a></td>
<td><?= ucfirst($customer->sales_id); ?></td></td>
<td>
<?php
$join_date = date('d M Y', strtotime($customer->join_date));
echo $join_date;
?>
</td>
<td>
<?php
//get total purchase
$total_purchase = 0;
$this->db->select('*')->from('orders')->where('customer_id', $customer->id_customers)->group_start()->where('payment_status',3)->or_where('payment_status',4)->or_where('payment_status',5)->group_end();
$purchases = $this->db->get()->result();
foreach($purchases as $purchase) {
$grand_total = (($purchase->total_amount - $purchase->redeemed_voucher_amount - $purchase->minus_reward_amount)+($purchase->shipping_fee - $purchase->free_shipping_fee));
if($grand_total > 0){
$total_purchase = $total_purchase + $grand_total;
}
}
echo number_format($total_purchase);
?>
<a href="<?= base_url() . 'admin/orders/customer/' . $customer->id_customers; ?>" target="_blank"> <i class="fa fa-eye" aria-hidden="true"></i> view</a>
</td>
<td>
<?= ucwords($customer->type); ?>
</td>
<td>
<?php if($customer->status == 1) : ?>
Active
<?php else : ?>
Not Active
<?php endif; ?>
</td>
<td><?= bt_edit('admin/customers/edit/' . $customer->id_customers); ?></td>
<?php if($allowed == true && $role != 'admin') : ?>
<td><?= bt_delete('admin/customers/delete/' . $customer->id_customers); ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="3">We could not find any customer.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<?php if(isset($use_pagination)) : ?>
<?php
//create pagination...
echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>';
?>
<?php endif; ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->