Subversion Repositories SmartDukaan

Rev

Rev 16591 | Rev 16708 | Go to most recent revision | Details | Compare with Previous | 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
16601 anikendra 49
		/*if($this->Paginator->hasPrev()){
50
			// echo $this->Paginator->prev('< ' . __('previous'), array('tag' => 'li'), '', array('class' => 'prev disabled'));
51
			echo '<li><a href="'.$base_url.$slug.'/'.$type."?page=".($page-1).'">Prev</a>';
52
		}
16591 anikendra 53
		// echo $this->Paginator->numbers(array('separator' => ''));
16601 anikendra 54
		if($this->Paginator->hasNext()){
55
			// echo $this->Paginator->next(__('next') . ' >', array('tag' => 'li','slug1'=>$slug,'slug2'=>$type), null, array('class' => 'next disabled'));
56
			echo '<li><a href="'.$base_url.$slug.'/'.$type."?page=".($page+1).'">Next</a>';
57
		}*/
16591 anikendra 58
	?>
59
	</ul>
60
	<?php else:?>
61
	<div class="text-center text-danger">This url has expired. Please open Profitmandi app for new url</div>
62
	<?php endif;?>
63
</div>
64
<script>
65
$.fn.stars = function() {
66
    return $(this).each(function() {
67
        // Get the value
68
        var val = parseFloat($(this).html());
69
        // Make sure that the value is in 0 - 5 range, multiply to get width
70
        val = Math.round(val * 2) / 2;
71
        var size = Math.max(0, (Math.min(5, val))) * 16;
72
        // Create stars holder
73
        var $span = $('<span />').width(size);
74
        // Replace the numerical value with stars
75
        $(this).html($span);
76
    });
77
}
78
$(function() {
79
    $('span.stars').stars();
80
	$('.getapp').on('click',function(e){
81
		console.log(e);
82
		var that = $(this);
83
		var req = $.ajax({
84
			url: 'http://104.200.25.40:8057/appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),
85
			// Tell jQuery we're expecting JSONP
86
			dataType: "jsonp",
87
			// Tell YQL what we want and that we want JSON			
88
			method: 'get',
89
			// timeout: 30000,
90
			// Work with the response
91
			success: function( response ) {
92
				if(response.message=='Success'){
93
					document.location = response.url;
94
				}
95
			}
96
		},'json');
97
	});
98
});
99
</script>