Subversion Repositories SmartDukaan

Rev

Rev 16261 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16261 anikendra 1
<div class="container">
2
	<div class="row">
16363 anikendra 3
		<div class="col-lg-3">
4
			<?php echo $this->Element('adminactions');?>
5
		</div>
6
		<div class="col-lg-9">
7
			<h4>Generate url for sending push notifications for selected brands</h4>
8
			<div class="row">
9
				<?php if(!empty($categories)):?>
10
					<?php foreach ($categories as $key => $category):?>
11
						<div class="col-xs-6">
12
							<input class="category" type="radio" name="category_id" value="<?php echo $category['Category']['id'];?>"><?php echo $category['Category']['name'];?></input>
13
							<div class="clearfix"></div>
14
							<?php if(!empty($category['Brand'])):?>
15
							<select name="brands" multiple class="brands col-xs-12" data-categoryId="<?php echo $category['Category']['id'];?>">					
16
								<?php foreach ($category['Brand'] as $key => $brand):?>
17
								<option value="<?php echo $brand['id'];?>"><?php echo $brand['name'];?></option>	
18
								<?php endforeach;?>
19
							</select>
20
							<?php endif;?>
21
						</div>								
22
					<?php endforeach;?>
23
				<?php endif;?>
24
			</div>
25
			<div class="clearfix mt20"/>
26
			<div class="row text-center">		
27
				<div class="col-xs-12">
28
					URL : <textarea name="url" id="url" rows="2" ></textarea>
29
				</div>
30
			</div
31
		</div>
16261 anikendra 32
	</div>
33
</div>
34
<script type="text/javascript">
35
var baseurl = 'http://api.profittill.com/brands/filter/';
36
$(function(){
37
	$('.category').on('click',function(){
38
		$('#url').html('');
39
		$('.brands').each(function(){
40
			$(this).attr('checked',false);
41
		});
42
	});
43
	$('.brands').on('change',function(){
44
		url = baseurl+$(this).val().join(',')+'/'+$(this).data('categoryid');
45
		$('#url').html(url);
46
		console.log($(this).data('categoryid'));
47
	})
48
});
49
</script>
50
<style type="text/css">
51
.brands{height: 200px !important;}
52
</style>