| 13579 |
anikendra |
1 |
<div class="container">
|
|
|
2 |
<div class="row">
|
|
|
3 |
<div class="col-lg-3">
|
| 14098 |
anikendra |
4 |
<?php echo $this->Element('adminactions');?>
|
| 13579 |
anikendra |
5 |
</div>
|
|
|
6 |
<div class="col-lg-9">
|
|
|
7 |
<h2><?php echo __('Category Discounts'); ?></h2>
|
|
|
8 |
<table class="table table-striped">
|
|
|
9 |
<tr>
|
| 14098 |
anikendra |
10 |
<th><?php //echo $this->Paginator->sort('category_id'); ?>Category</th>
|
|
|
11 |
<th><?php //echo $this->Paginator->sort('brand'); ?>Brand</th>
|
|
|
12 |
<th><?php //echo $this->Paginator->sort('min_discount'); ?>Min Discount</th>
|
|
|
13 |
<th><?php //echo $this->Paginator->sort('max_discount'); ?>Max Discount</th>
|
|
|
14 |
<th><?php //echo $this->Paginator->sort('discountType'); ?>Discount Type</th>
|
|
|
15 |
<th class="actions"><?php //echo __('Actions'); ?></th>
|
| 13579 |
anikendra |
16 |
</tr>
|
|
|
17 |
<?php foreach ($categoryDiscounts as $categoryDiscount): ?>
|
| 13633 |
anikendra |
18 |
<?php $categoryDiscount = json_decode($categoryDiscount,1);?>
|
| 13579 |
anikendra |
19 |
<tr>
|
| 13633 |
anikendra |
20 |
<td><?php echo $categories[$categoryDiscount['category_id']];?>
|
| 13579 |
anikendra |
21 |
<?php //echo $this->Html->link($categoryDiscount['Category']['name'], array('controller' => 'categories', 'action' => 'view', $categoryDiscount['Category']['id'])); ?>
|
|
|
22 |
</td>
|
| 14098 |
anikendra |
23 |
<td><?php echo h($categoryDiscount['brand']); ?></td>
|
|
|
24 |
<td class="edit" id="min_discount" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['min_discount']); ?></td>
|
|
|
25 |
<td class="edit" id="max_discount" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['max_discount']); ?></td>
|
|
|
26 |
<td class="editable" id="discountType" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['discountType']); ?></td>
|
| 13579 |
anikendra |
27 |
<td class="actions">
|
| 14098 |
anikendra |
28 |
<?php //echo $this->Html->link(__('Edit'), array('action' => 'edit', $categoryDiscount['_id']['$oid'],$categoryDiscount['brand'],$categoryDiscount['category_id'])); ?>
|
|
|
29 |
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $categoryDiscount['_id']['$oid']), null, __('Are you sure you want to delete # %s?', $categoryDiscount['_id']['$oid'])); ?>
|
| 13579 |
anikendra |
30 |
</td>
|
|
|
31 |
</tr>
|
|
|
32 |
<?php endforeach; ?>
|
|
|
33 |
</table>
|
|
|
34 |
<p>
|
|
|
35 |
<?php
|
| 14098 |
anikendra |
36 |
/*echo $this->Paginator->counter(array(
|
| 13579 |
anikendra |
37 |
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
|
| 14098 |
anikendra |
38 |
));*/
|
| 13579 |
anikendra |
39 |
?> </p>
|
|
|
40 |
<div class="paging">
|
|
|
41 |
<?php
|
| 14098 |
anikendra |
42 |
// echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
|
|
|
43 |
// echo $this->Paginator->numbers(array('separator' => ''));
|
|
|
44 |
// echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
|
| 13579 |
anikendra |
45 |
?>
|
|
|
46 |
</div>
|
|
|
47 |
</div>
|
|
|
48 |
</div>
|
| 13633 |
anikendra |
49 |
</div>
|
| 14098 |
anikendra |
50 |
|
|
|
51 |
<script type="text/javascript">
|
|
|
52 |
$(document).ready(function() {
|
|
|
53 |
$('.editable').editable(base_url+'admin/'+controller+'/update', {
|
|
|
54 |
data : "{'DP':'DP','MRP':'MRP'}",
|
|
|
55 |
type : 'select',
|
|
|
56 |
submit : 'OK',
|
|
|
57 |
tooltip : 'Click to edit...',
|
|
|
58 |
submitdata : function(value, settings) {
|
|
|
59 |
return {oid: $(this).data('oid')};
|
|
|
60 |
}
|
|
|
61 |
});
|
|
|
62 |
});
|
|
|
63 |
</script>
|