Subversion Repositories SmartDukaan

Rev

Rev 16601 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
16591 anikendra 1
<div class="row-fluid">
2
	<?php if(!empty($appOffers)):?>
3
	<ul class="list list-unstyled">
4
	<?php foreach ($appOffers['AppOffers'] as $appOffer): ?>
5
	<li class="approw">
6
		<div class="row-fluid">			
7
			<div class="col-xs-12">
8
				<div class = "content_box" >
9
					<div class="row">
10
						<div class ="col-xs-4">
11
							<img src="<?php echo $base_url;?>timthumb.php/?src=<?php echo h($appOffer['image_url']); ?>&h=80"/>
12
							<br>
13
							<div class="text_arrange">	
14
								<b><?php echo h($appOffer['app_name']); ?></b>
15
							</div>	
16
							<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span><i><?php echo $appOffer['downloads'];?></i><br>
17
						 	<span class="stars"><?php echo $appOffer['ratings'];?></span>
18
							<div class="text_arrange">
19
							 	<?php echo $appOffer['offerCategory'];?>
20
							</div>
21
						</div>
22
						<div class ="col-xs-8">
23
							<h5 style= "padding:0;margin:0;">
24
								<?php echo h($appOffer['app_name']); ?>
25
							</h5>
26
							<div style= "padding:0;margin:0; font-size:12px;">
27
								<?php echo h($appOffer['shortDescription']); ?>
28
							</div>	
29
							<p class="text-info" style= "font-size:12px;">
30
								<?php echo strip_tags($appOffer['longDescription']); ?>
31
								<br/>
32
								<?php echo h($appOffer['customer_tagline']);?>
33
							</p>
34
 
35
							<button data-id="<?php echo $appOffer['id'];?>" data-me="<?php echo $me;?>"class="btn btn-primary getapp" type="button">Install</button>
36
						</div>
37
					</div>	
38
				</div>
39
			</div>
40
			<div class="col-xs-2">
41
				&nbsp;
42
			</div>
43
		</div>
44
	</li>
45
	<?php endforeach; ?>
46
	</ul>	
47
	<ul class="pager">
48
	<?php
49
		// if(PaginatorHelper::hasPrev()){
50
			echo $this->Paginator->prev('< ' . __('previous'), array('tag' => 'li'), '&nbsp;', array('class' => 'prev disabled'));
51
		// }
52
		// echo $this->Paginator->numbers(array('separator' => ''));
53
		// if(PaginatorHelper::hasNext()){
54
			echo $this->Paginator->next(__('next') . ' >', array('tag' => 'li','slug1'=>$slug,'slug2'=>$type), null, array('class' => 'next disabled'));
55
		// }
56
	?>
57
	</ul>
58
	<?php else:?>
59
	<div class="text-center text-danger">This url has expired. Please open Profitmandi app for new url</div>
60
	<?php endif;?>
61
</div>
62
<script>
63
$.fn.stars = function() {
64
    return $(this).each(function() {
65
        // Get the value
66
        var val = parseFloat($(this).html());
67
        // Make sure that the value is in 0 - 5 range, multiply to get width
68
        val = Math.round(val * 2) / 2;
69
        var size = Math.max(0, (Math.min(5, val))) * 16;
70
        // Create stars holder
71
        var $span = $('<span />').width(size);
72
        // Replace the numerical value with stars
73
        $(this).html($span);
74
    });
75
}
76
$(function() {
77
    $('span.stars').stars();
78
	$('.getapp').on('click',function(e){
79
		console.log(e);
80
		var that = $(this);
81
		var req = $.ajax({
82
			url: 'http://104.200.25.40:8057/appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),
83
			// Tell jQuery we're expecting JSONP
84
			dataType: "jsonp",
85
			// Tell YQL what we want and that we want JSON			
86
			method: 'get',
87
			// timeout: 30000,
88
			// Work with the response
89
			success: function( response ) {
90
				if(response.message=='Success'){
91
					document.location = response.url;
92
				}
93
			}
94
		},'json');
95
	});
96
});
97
</script>