[eluser]persian empire[/eluser]
hi I have a problem with implement pagination into my code . please help me ,
this is my code :
Code:
<?=partial('months')?>
<?=partial('search_filter_', array('county'=>$county,
'categories'=>$categories, 'municipalities'=>$municipalities, 'advert_types'=>$advert_types))?>
[removed]
$(document).ready(function()
{
$('#all').click(function()
{
$('#advert_target').val('<?=ADVERT_TARGET_ALL_SLUG?>');
$('#search_form').submit();
});
$('#private').click(function()
{
$('#advert_target').val('<?=ADVERT_TARGET_PRIVATE_SLUG?>');
$('#search_form').submit();
});
$('#company').click(function()
{
$('#advert_target').val('<?=ADVERT_TARGET_COMPANY_SLUG?>');
$('#search_form').submit();
});
$('#advert_sort_time').click(function(e)
{
$('#advert_sort').val('<?=ADVERT_SORT_TIME?>');
$('#search_form').submit();
e.preventDefault();
});
$('#advert_sort_price').click(function(e)
{
$('#advert_sort').val('<?=ADVERT_SORT_PRICE?>');
$('#search_form').submit();
e.preventDefault();
});
});
[removed]
<div id="result">
<div id="summary">
<div id="all" class="box <?=literal('advert_target') == ADVERT_TARGET_ALL_SLUG ? 'active':null?>"> all adverts (
<?=$count['all']?>
) </div>
<div id="private" class="box <?=literal('advert_target') == ADVERT_TARGET_PRIVATE_SLUG ? 'active':null?>"> private ads (
<?=$count['private']?>
) </div>
<div id="company" class="box <?=literal('advert_target') == ADVERT_TARGET_COMPANY_SLUG ? 'active':null?>"> commercial ads (
<?=$count['company']?>
) </div>
<div id="sort">
<?php if(strtolower(literal('advert_sort')) == ADVERT_SORT_PRICE):?>
<?=anchor('', lang('search_sort_time'), 'id="advert_sort_time"')?>
<?php else:?>
<?=anchor('', lang('search_sort_price'), 'id="advert_sort_price"')?>
<?php endif;?>
</div>
<div style="clear:both"> </div>
</div>
<div id="adverts">
<?php if($adverts):?>
<?php $i=1; foreach($adverts as $advert):?>
<div class="advert">
<div class="time">
<?php if(date('Y-m-d') == date('Y-m-d', strtotime($advert->advert_created))):?>
Today<br />
<?php elseif (date('Y-m-d', strtotime('-1 day')) == date('Y-m-d', strtotime($advert->advert_created))):?>
Tomorrow<br />
<?php else:?>
<?=date(' d M Y' ,strtotime($advert->advert_created))?>
<br />
<?php endif;?>
<? echo "Hour: ".date('H:i', strtotime($advert->advert_created))?> </div>
<?php if($advert->image):?>
<div class="image">advert_slug)?>';"> <a >advert_slug)?>"><img >image->advert_image_id)?>" /></a> </div>
<?php else:?>
<div class="blank"> </div>
<?php endif;?>
<div class="text"> <span class="title">
<?=anchor('advert/detail/'.$advert->advert_slug, $advert->advert_subject)?>
</span> <br />
<br />
<span class="price">
<?=$advert->advert_price ? number_format($advert->advert_price,0,'','.').CURR : null?>
</span> </div>
<div class="municipality">
<?=$advert->municipality_name?>
<br />
<br />
<?=$advert->target_name?>
<br />
<br />
<?=$advert->category_name?>
</div>
</div>
<div class="advert_divider"> </div>
<?php $i++; endforeach;?>
<?php else:?>
<div id="body_wrapper">
<h1>There is no advert</h1>
</div>
<?php endif;?>
</div>
</div>
<div style="clear:both"></div>
this is my view file and i was attached the controller . because it's too long
please help me