            <?php if(PageContext::$response->totalrecords > 0){
           // {assign var="i" value=PageContext::$response->slno}
            foreach(PageContext::$response->leads as $id=>$lead){?>
            <div class="item">
                <div class="mediapost well">
                    <div class="wid100per">
                        <span class="mediapost_pic">
            <a href="<?php echo PageContext::$response->baseUrl;?>community/<?php echo $lead->community_alias;?>">
                 <div class="mediapostpicblk" style="background-image: url('<?php echo PageContext::$response->userImagePath;if($lead->file_path != ''){?>medium/<?php echo $lead->file_path.'"';}elseif($lead->file_path == ''){?>default/no_preview_med.jpg');">
                                </div>
                        <?php } ?> </a>
                        </span>
                    </div>

                    <div class="wid100per pad5p media-body">
                        <h4 class="media-heading"><span><a href="<?php echo PageContext::$response->baseUrl;?>community/<?php echo $lead->community_alias;?>"><?php echo $lead->community_name?>(<?php echo$lead->business_name;?>)</a></span></h4>
                        <?php if($lead->community_status =='I'){?>  
                        <span class="status clserror" >Pending Approval</span> 
                        <?php } else{?>
                        <div class="display_table">
                            <div class="display_table_cell wid60per">
                                <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-community/<?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;?>" class="deleteitem left"><i class="fa fa-trash"></i></a> 
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <?php } ?>
                        <p>
                            <?php echo substr($lead->community_description,0,200)."...";?>
                            <!--{$lead->community_description|substr:0:200}....-->
                        </p>
                            <div class="referral_blk">
                                <div id="jRefDiv_<?php echo $lead->community_id;?>" class="fleft">
                                    <a href="#" class="jShowReferralOptions referral_btn" bid="<?php echo $lead->community_id;?>">Referral offer</a>
                                    <div class="clear"></div>
                                </div>
                                <div class="jReferralOptionsClass referraltype_blk" id="jDivdisplayReferralOptions_<?php echo $lead->community_id;?>" style="display:none;">
                                    <h4>Please choose the referral type</h4>
                                    <ul>
                                        <li><input type="radio" name="RefferalType_<?php echo $lead->community_id;?>" value="1" > Goodwill</li>
                                        <li><input type="radio" name="RefferalType_<?php echo $lead->community_id;?>" value="2" > Financial Incentive Based Referral</li>
                                        <li><input type="radio" name="RefferalType_<?php echo $lead->community_id;?>"  value="3"> Charitable Donation Based Referral</li>
                                        <li><input type="radio" name="RefferalType_<?php echo $lead->community_id;?>" value="4" > Voucher or Product Based Referral</li>
                                        <textarea name="personal_message_<?php echo $lead->community_id;?>" placeholder="Personal Message"></textarea>
                                        <li><input type="button" class="jClickReferralOffer sendref_offr_btn"  bid="<?php echo $lead->community_id;?>" uid="<?php echo $lead->community_created_by;?>" value="Send Referral Offer"></li>
                                    </ul>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
<!--            {assign var="i" value=$i+1}
            {/foreach}  
            {else}-->
            <!--<div class="business_profilelist_detailsarea">{if PageContext::$response->searchtype eq ''}No communities added/joined yet.{else}No matches found.{/if} Click to <a href="{php} echo PageContext::$response->baseUrl;{/php}add-community">create a community</a>.</div>-->
            <!--{/if}-->
            <?php }}?>