|
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/angkasapuraretail.com/public_html/application/views/admin/vouchers/ |
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> Back to Dashboard</a></p><br>
<?= $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 -->
<?php if ($allowed == true) : ?>
<h3>Birthday Promo</h3>
<p>Bila customer dengan bulan lahir yang sama dengan bulan sekarang, maka customer tersebut mendapatkan promo dengan % sesuai umurnya.<br>Customer perlu mengisi KTP terlebih dahulu.</p>
<?php
$attributes = array(
'name' => 'updatebirthdaypromo',
'id' => 'updatebirthdaypromo'
);
?>
<?= form_open_multipart('admin/vouchers/update_birthday_promo', $attributes); ?>
<div class="row" style="margin-bottom:0">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-5">
<p>Promo Active?</p>
</div>
<div class="col-sm-7">
<select required name="birthdaypromo_active" class="form-control">
<option value="yes"
<?php if( $birthdaypromo->birthdaypromo_active == 'yes') : ?>
selected
<?php endif; ?>
>
Yes
</option>
<option value="no"
<?php if( $birthdaypromo->birthdaypromo_active == 'no') : ?>
selected
<?php endif; ?>
>
No
</option>
</select>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="row">
<div class="col-sm-5">
<p>Included Product Ids<br>(separated by comma)<br>
<a href="<?= base_url('admin/products'); ?>">Click here to get product Ids</a></p>
</div>
<div class="col-sm-7">
<p><?php
$data = array(
'name' => 'productids',
'value' => $birthdaypromo->birthdaypromo_productids,
'class' => 'form-control',
'required' => 'required'
);
echo form_input($data); ?>
<?= form_error('productids'); ?></p>
</div>
</div>
</div>
</div>
<input type="submit" name="update_birthdaypromo" class="btn btn-info" value="UPDATE BIRTHDAY PROMO">
</form>
<br><br>
<h3>Vouchers</h3>
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Bulk Upload Vouchers</h3>
<p>UPLOAD PRODUCTS DATA. ACCEPT ONLY .XLS. DOWNLOAD EXCEL SAMPLE <a style="color:blue;" href="<?= base_url('uploads/vouchers.xls'); ?>">HERE</a>.</p>
<!-- <p>PS: Products data with same SKU will be updated.</p> -->
<?php
$attributes = array(
'name' => 'uploadexcel',
'id' => 'uploadexcel'
);
?>
<?= form_open_multipart('admin/vouchers/upload_vouchers_xls', $attributes); ?>
<table>
<tr>
<td> ULPLOAD VOUCHERS 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_excel" class="btn btn-info" value="UPLOAD">
</div>
</td>
</tr>
</table>
</form>
<p>Note: During Upload, please wait until process finish. Do not close current window.</p>
</div><!-- end class="col-sm-12" -->
<?= form_close(); ?>
</div> <!-- end row; -->
<?php endif; ?>
<div class="row">
<?= form_open('admin/vouchers'); ?>
<div class="col-sm-5 col-xs-6">
<input class="form-control" type="text" placeholder="Enter Voucher Name or Voucher Code" name="voucher" <?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_voucher" value="SEARCH VOUCHER">
</div><!-- end class="col-sm-6" -->
<?= form_close(); ?>
</div> <!-- end row -->
<div class="row">
<?= form_open('admin/vouchers/delete_voucher_by_name'); ?>
<div class="col-sm-5 col-xs-6">
<input class="form-control" type="text" placeholder="Enter Voucher Name" name="voucher_name" <?php if (isset($name)) : ?> value="<?= ucwords($name); ?>" <?php endif; ?>>
</div>
<div class="col-sm-3 col-xs-6">
<input class="btn btn-primary form-control" type="submit" name="delete_voucher" value="DELETE VOUCHER" onclick="return confirm('You are about to delete a record. This cannot be undone. Are you sure ?')">
</div><!-- end class="col-sm-6" -->
<?= form_close(); ?>
</div>
<div class="row">
<div class="col-sm-12">
<?php if ($allowed == true) : ?>
<p><?= anchor('admin/vouchers/add', '<i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW VOUCHER'); ?></p>
<?php endif; ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Voucher Name</th>
<th>Voucher Code</th>
<th>Promo Type</th>
<th>Discount Amount</th>
<th>Created Date</th>
<th>Expired Date</th>
<th>Edit</th>
<?php if ($allowed == true && $role != 'admin') : ?>
<th>Delete</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php if (count($vouchers)) : ?>
<?php foreach ($vouchers as $voucher) : ?>
<tr>
<td><?= ucfirst($voucher->voucher_name); ?></td>
<td><?= ucfirst($voucher->voucher_code); ?></td>
<td><?= ucwords($voucher->voucher_type); ?></td>
<td>
<?php
$discount_type = $voucher->discount_type;
if ($discount_type == 'amount') {
echo 'IDR ' . number_format($voucher->discount_value);
} else {
echo number_format($voucher->discount_value) . ' %';
}
?>
</td>
<td><?= ucfirst($voucher->created_date); ?></td>
<td>
<?php
if ($voucher->expired_date == NULL) {
echo 'unlimited';
} else {
echo ucfirst($voucher->expired_date);
}
?>
</td>
<td><?= bt_edit('admin/vouchers/edit/' . $voucher->id_vouchers); ?></td>
<?php if ($allowed == true && $role != 'admin') : ?>
<td><?= bt_delete('admin/vouchers/delete/' . $voucher->id_vouchers); ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="3">We could not find any voucher.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<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 -->