|
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/products/ |
Upload File : |
<div class="row">
<div class="col-sm-12">
<p><a href="<?= base_url('admin/products'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Products Page</a></p>
<h2>Quick Edit Product Retail Price & Stock</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">
<table class="table table-striped">
<thead>
<tr>
<th>Product Name</th>
<th>SKU</th>
<th>Options</th>
<th>Current Stocks</th>
<th>Retail Price (Rp)</th>
<th>Discounted Price (Rp)</th>
</tr>
</thead>
<tbody>
<?php if(count($products)) : ?>
<?= form_open('admin/products/update_quick_edit'); ?>
<div style="text-align:right;">
<input type="submit" name="update_price" value="UPDATE PRICE & STOCK" class="btn btn-primary">
</div>
<?php foreach($products as $product): ?>
<tr>
<td>
<?php
//get product name
$this->db->select('title')->from('products')->where('id_products', $product->product_id);
$product_name = $this->db->get()->row()->title;
?>
<?= ucwords($product_name); ?>
</td>
<td><?= $product->sku; ?></td>
<td><?= $product->attributes; ?></td>
<td><input
<?php if($product->stock == 0) : ?>
style="background:yellow !important;"
<?php endif; ?>
class="form-control" value="<?= $product->stock; ?>" type="text" name="stock[<?= $product->id_product_details; ?>][]" required></td>
<td><input class="form-control" value="<?= $product->price; ?>" type="text" name="price[<?= $product->id_product_details; ?>][]" required></td>
<td><input class="form-control" value="<?= $product->discounted_price; ?>" type="text" name="discounted_price[<?= $product->id_product_details; ?>][]" required></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="3">We could not find any product.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<div style="text-align:right;">
<input type="submit" name="update_price" value="UPDATE PRICE & STOCK" class="btn btn-primary">
</div>
<?= form_close(); ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<?php if(isset($use_pagination)) : ?>
<div style="text-align:center;"><?= $this->pagination->create_links(); ?></div>
<?php endif; ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->