Subversion Repositories SmartDukaan

Rev

Rev 13958 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13958 Rev 14098
Line 1... Line 1...
1
<div class="container">
1
<div class="container">
2
	<div class="row">
2
	<div class="row">
3
		<div class="col-lg-3">
3
		<div class="col-lg-3">
4
			<?php echo $this->Element('categorydiscountactions');?>
4
			<?php echo $this->Element('adminactions');?>
5
		</div>
5
		</div>
6
		<div class="col-lg-9">
6
		<div class="col-lg-9">
7
			<h2><?php echo __('Category Discounts'); ?></h2>
7
			<h2><?php echo __('Category Discounts'); ?></h2>
8
			<table class="table table-striped">
8
			<table class="table table-striped">
9
			<tr>
9
			<tr>
10
				<th><?php echo $this->Paginator->sort('category_id'); ?></th>
10
				<th><?php //echo $this->Paginator->sort('category_id'); ?>Category</th>
11
				<th><?php echo $this->Paginator->sort('brand'); ?></th>
11
				<th><?php //echo $this->Paginator->sort('brand'); ?>Brand</th>
12
				<th><?php echo $this->Paginator->sort('min_discount'); ?></th>
12
				<th><?php //echo $this->Paginator->sort('min_discount'); ?>Min Discount</th>
13
				<th><?php echo $this->Paginator->sort('max_discount'); ?></th>
13
				<th><?php //echo $this->Paginator->sort('max_discount'); ?>Max Discount</th>
14
				<th><?php echo $this->Paginator->sort('discountType'); ?></th>
14
				<th><?php //echo $this->Paginator->sort('discountType'); ?>Discount Type</th>
15
				<th class="actions"><?php echo __('Actions'); ?></th>
15
				<th class="actions"><?php //echo __('Actions'); ?></th>
16
			</tr>
16
			</tr>
17
			<?php foreach ($categoryDiscounts as $categoryDiscount): ?>
17
			<?php foreach ($categoryDiscounts as $categoryDiscount): ?>
18
				<?php $categoryDiscount = json_decode($categoryDiscount,1);?>
18
				<?php $categoryDiscount = json_decode($categoryDiscount,1);?>
19
			<tr>
19
			<tr>
20
				<td><?php echo $categories[$categoryDiscount['category_id']];?>
20
				<td><?php echo $categories[$categoryDiscount['category_id']];?>
21
					<?php //echo $this->Html->link($categoryDiscount['Category']['name'], array('controller' => 'categories', 'action' => 'view', $categoryDiscount['Category']['id'])); ?>
21
					<?php //echo $this->Html->link($categoryDiscount['Category']['name'], array('controller' => 'categories', 'action' => 'view', $categoryDiscount['Category']['id'])); ?>
22
				</td>
22
				</td>
23
				<td><?php echo h($categoryDiscount['brand']); ?>&nbsp;</td>
23
				<td><?php echo h($categoryDiscount['brand']); ?></td>
24
				<td><?php echo h($categoryDiscount['min_discount']); ?>&nbsp;</td>
24
				<td class="edit" id="min_discount" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['min_discount']); ?></td>
25
				<td><?php echo h($categoryDiscount['max_discount']); ?>&nbsp;</td>
25
				<td class="edit" id="max_discount" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['max_discount']); ?></td>
26
				<td><?php echo h($categoryDiscount['discountType']); ?>&nbsp;</td>
26
				<td class="editable" id="discountType" data-oid="<?php echo $categoryDiscount['_id']['$oid'];?>"><?php echo h($categoryDiscount['discountType']); ?></td>
27
				<td class="actions">
27
				<td class="actions">
28
					<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $categoryDiscount['_id']['$oid'])); ?>
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['CategoryDiscount']['_id']['$oid'])); ?>
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'])); ?>
30
				</td>
30
				</td>
31
			</tr>
31
			</tr>
32
		<?php endforeach; ?>
32
		<?php endforeach; ?>
33
			</table>
33
			</table>
34
			<p>
34
			<p>
35
			<?php
35
			<?php
36
			echo $this->Paginator->counter(array(
36
			/*echo $this->Paginator->counter(array(
37
			'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
37
			'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
38
			));
38
			));*/
39
			?>	</p>
39
			?>	</p>
40
			<div class="paging">
40
			<div class="paging">
41
			<?php
41
			<?php
42
				echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
42
				// echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
43
				echo $this->Paginator->numbers(array('separator' => ''));
43
				// echo $this->Paginator->numbers(array('separator' => ''));
44
				echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
44
				// echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
45
			?>
45
			?>
46
			</div>
46
			</div>
47
		</div>
47
		</div>
48
	</div>
48
	</div>
49
</div>
49
</div>
-
 
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>
50
64