Subversion Repositories SmartDukaan

Rev

Rev 16601 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<div class="row-fluid">
        <?php if(!empty($appOffers)):?>
        <ul class="list list-unstyled">
        <?php foreach ($appOffers['AppOffers'] as $appOffer): ?>
        <li class="approw">
                <div class="row-fluid">                 
                        <div class="col-xs-12">
                                <div class = "content_box" >
                                        <div class="row">
                                                <div class ="col-xs-4">
                                                        <img src="<?php echo $base_url;?>timthumb.php/?src=<?php echo h($appOffer['image_url']); ?>&h=80"/>
                                                        <br>
                                                        <div class="text_arrange">      
                                                                <b><?php echo h($appOffer['app_name']); ?></b>
                                                        </div>  
                                                        <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span><i><?php echo $appOffer['downloads'];?></i><br>
                                                        <span class="stars"><?php echo $appOffer['ratings'];?></span>
                                                        <div class="text_arrange">
                                                                <?php echo $appOffer['offerCategory'];?>
                                                        </div>
                                                </div>
                                                <div class ="col-xs-8">
                                                        <h5 style= "padding:0;margin:0;">
                                                                <?php echo h($appOffer['app_name']); ?>
                                                        </h5>
                                                        <div style= "padding:0;margin:0; font-size:12px;">
                                                                <?php echo h($appOffer['shortDescription']); ?>
                                                        </div>  
                                                        <p class="text-info" style= "font-size:12px;">
                                                                <?php echo strip_tags($appOffer['longDescription']); ?>
                                                                <br/>
                                                                <?php echo h($appOffer['customerOneLiner']);?>
                                                        </p>
                                                        
                                                        <button data-id="<?php echo $appOffer['id'];?>" data-me="<?php echo $me;?>"class="btn btn-primary getapp" type="button">Install</button>
                                                </div>
                                        </div>  
                                </div>
                        </div>
                        <div class="col-xs-2">
                                &nbsp;
                        </div>
                </div>
        </li>
        <?php endforeach; ?>
        </ul>   
        <ul class="pager">
        <?php
                /*if($this->Paginator->hasPrev()){
                        // echo $this->Paginator->prev('< ' . __('previous'), array('tag' => 'li'), '', array('class' => 'prev disabled'));
                        echo '<li><a href="'.$base_url.$slug.'/'.$type."?page=".($page-1).'">Prev</a>';
                }
                // echo $this->Paginator->numbers(array('separator' => ''));
                if($this->Paginator->hasNext()){
                        // echo $this->Paginator->next(__('next') . ' >', array('tag' => 'li','slug1'=>$slug,'slug2'=>$type), null, array('class' => 'next disabled'));
                        echo '<li><a href="'.$base_url.$slug.'/'.$type."?page=".($page+1).'">Next</a>';
                }*/
        ?>
        </ul>
        <?php else:?>
        <div class="text-center text-danger">This url has expired. Please open Profitmandi app for new url</div>
        <?php endif;?>
</div>
<script>
$.fn.stars = function() {
    return $(this).each(function() {
        // Get the value
        var val = parseFloat($(this).html());
        // Make sure that the value is in 0 - 5 range, multiply to get width
        val = Math.round(val * 2) / 2;
        var size = Math.max(0, (Math.min(5, val))) * 16;
        // Create stars holder
        var $span = $('<span />').width(size);
        // Replace the numerical value with stars
        $(this).html($span);
    });
}
$(function() {
    $('span.stars').stars();
        $('.getapp').on('click',function(e){
                console.log(e);
                var that = $(this);
                var req = $.ajax({
                        url: 'http://104.200.25.40:8057/appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),
                        // Tell jQuery we're expecting JSONP
                        dataType: "jsonp",
                        // Tell YQL what we want and that we want JSON                  
                        method: 'get',
                        // timeout: 30000,
                        // Work with the response
                        success: function( response ) {
                                if(response.message=='Success'){
                                        document.location = response.url;
                                }
                        }
                },'json');
        });
});
</script>