<script type="text/javascript" src="<?php echo BASE_URL?>project/js/jquery.rateit.js"> </script>    
<script type="text/javascript" src="<?php echo BASE_URL?>project/js/ratinglist.js"> </script> 
  <?php 
           // if (PageContext::$response->totalrecords > 0){
           // {assign var="i" value=PageContext::$response->slno}
            foreach(PageContext::$response->leads as $id=>$lead){?>
            <div class="col-sm-6 col-md-6 col-lg-6">
                <div class="mediapost">
                    <div class="picpost_left pull-left">
                        <span class="picpost_left_pic">

                            <a href="<?php echo PageContext::$response->baseUrl;?>group/<?php echo $lead->community_alias;?>"><img class="business_profile_desc_colside_pic" alt="<?php echo $lead->file_orig_name;?>" src="<?php echo PageContext::$response->userImagePath;?><?php if($lead->file_path != ''){?>medium/<?php echo $lead->file_path;}elseif($lead->file_path == ''){?>default/no_image_bbf.jpg<?php } ?>"> </a>
                        </span>
                    </div>

                    <div class="media-body">
                        <h4 class="media-heading"><span><a href="<?php echo PageContext::$response->baseUrl;?>group/<?php echo $lead->community_alias;?>"><?php echo $lead->community_name;?><?php if(PageContext::$response->org_grp == 1){ ?>(<?php echo $lead->business_name;?>)<?php } ?></a></span></h4>
                        <?php if($lead->community_status =='I'){?>   
                        <span class="status clserror" >Pending Approval</span> 
                        <div class="right">
                                        <?php if(PageContext::$response->sess_user_id == $lead->community_created_by){?>  
                                        <a href="<?php echo PageContext::$response->baseUrl;?>edit-group/<?php echo $lead->community_id;?>" class="edititem left marg5right"><i class="fa fa-pencil"></i></a>
                                        <a href="<?php echo PageContext::$response->baseUrl;?>index/delete_community/<?php echo $lead->community_id;?>"  onclick="return deleteConfirm();" class="deleteitem left"><i class="fa fa-trash"></i></a> 
                                        <?php } ?>
                                    </div>
                        <?php }else { ?>
                        <div class="display_table">
                            <div class="display_table_cell wid60per">
                                <input type="hidden" id="created_by" value="<?php echo $lead->community_created_by;?>">
                                <div id="starring">
                                    <div class="rateit" id="rateit_<?php echo $lead->ratetype_id;?>" data-rateit-value="<?php echo $lead->ratevalue;?>" data-rateit-ispreset="true" data-rateit-id="<?php echo $lead->rateuser_id;?>" data-rateit-type="<?php echo $lead->ratetype;?>" data-rateit-typeid="<?php echo $lead->ratetype_id;?>" data-rateit-flag="<?php echo $lead->rateflag;?>" data-rateit-step=1 data-rateit-resetable="false">
                                    </div>
                                    <div class="right">
                                        <?php if(PageContext::$response->sess_user_id == $lead->community_created_by){?>    
                                        <a href="<?php echo PageContext::$response->baseUrl;?>edit-group/<?php echo $lead->community_id;?>" class="edititem left marg5right"><i class="fa fa-pencil"></i></a>
                                        <a href="<?php echo PageContext::$response->baseUrl;?>index/delete_community/<?php echo $lead->community_id?>"  onclick="return deleteConfirm();" class="deleteitem left"><i class="fa fa-trash"></i></a> 
                                        <?php }
                                        else{?>
                                            <a href="#" style="color: #0000FF;" onclick="DisjoinCommunity(<?php echo $lead->community_id;?>,'decline')">
                        <input type="button" name="invite" value="Unsubscribe" class="btn yellow_btn fontupper btt_full_width" title="invite-block">
                    </a>
                                       <?php }?>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <?php } ?>
                        <p class="paragraph-height">
                            <?php echo substr($lead->community_description,0,200)."...";?>

                            <!--{$lead->community_description|substr:0:200}....-->
                        </p>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
<!--           // {assign var="i" value=$i+1}-->
            <?php } 
            
             ?>
<!--<script>
    $(document).ready(function(){
$('#starring .rateit').bind('rated', function (e) {
   // alert("hlll");
        var ri = $(this);
        var rateField = $(this).attr("id");
        var status = true;
        var ratetype = ri.rateit('type');
        var ratetypeid = ri.rateit('typeid');     
        var rateflag = ri.rateit('flag');
        //if the use pressed reset, it will get value: 0 (to be compatible with the HTML range control), we could check if e.type == 'reset', and then set the value to  null .
        var ratevalue = ri.rateit('value');
        // alert("hi "+ratevalue);
        var userid = ri.rateit('id'); // if the product id was in some hidden field: ri.closest('li').find('input[name="productid"]').val()
        if(rateflag == 1 && userid <= 0){ //alert("2");
            status = checkLogin2(ratetype,ratetypeid,'rate',rateField);	    	
        }	 
        if(status != false){
            // alert("here");
            checkRated1(rateField);	    
        }
	 
    });
    });
</script>-->
            