• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pagination Problem

#1
[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 &lt;?=literal('advert_target') == ADVERT_TARGET_ALL_SLUG ? 'active':null?&gt;"> all adverts  (
      &lt;?=$count['all']?&gt;
      ) </div>
    <div id="private" class="box &lt;?=literal('advert_target') == ADVERT_TARGET_PRIVATE_SLUG ? 'active':null?&gt;"> private ads (
      &lt;?=$count['private']?&gt;
      ) </div>
    <div id="company" class="box &lt;?=literal('advert_target') == ADVERT_TARGET_COMPANY_SLUG ? 'active':null?&gt;"> commercial ads (
      &lt;?=$count['company']?&gt;
      ) </div>
    <div id="sort">
      &lt;?php if(strtolower(literal('advert_sort')) == ADVERT_SORT_PRICE):?&gt;
      &lt;?=anchor('', lang('search_sort_time'), 'id="advert_sort_time"')?&gt;
      &lt;?php else:?&gt;
      &lt;?=anchor('', lang('search_sort_price'), 'id="advert_sort_price"')?&gt;
      &lt;?php endif;?&gt;
    </div>
    <div style="clear:both">&nbsp;</div>
  </div>
  <div id="adverts">
    &lt;?php if($adverts):?&gt;
    &lt;?php $i=1; foreach($adverts as $advert):?&gt;
    <div class="advert">
      <div class="time">
        &lt;?php if(date('Y-m-d') == date('Y-m-d', strtotime($advert->advert_created))):?&gt;
        Today<br />
        &lt;?php elseif (date('Y-m-d', strtotime('-1 day')) == date('Y-m-d', strtotime($advert->advert_created))):?&gt;
        Tomorrow<br />
        &lt;?php else:?&gt;
        &lt;?=date('  d M   Y' ,strtotime($advert->advert_created))?&gt;
        <br />
        &lt;?php endif;?&gt;
        &lt;? echo "Hour: ".date('H:i', strtotime($advert->advert_created))?&gt; </div>
      &lt;?php if($advert->image):?&gt;
      <div class="image">advert_slug)?&gt;';"> <a >advert_slug)?&gt;"><img >image->advert_image_id)?&gt;" /></a> </div>
      &lt;?php else:?&gt;
      <div class="blank"> &nbsp; </div>
      &lt;?php endif;?&gt;
      <div class="text"> <span class="title">
        &lt;?=anchor('advert/detail/'.$advert->advert_slug, $advert->advert_subject)?&gt;
        </span> <br />
        <br />
        <span class="price">
        &lt;?=$advert->advert_price ? number_format($advert->advert_price,0,'','.').CURR : null?&gt;
        </span> </div>
      <div class="municipality">
        &lt;?=$advert->municipality_name?&gt;
        <br />
        <br />
        &lt;?=$advert->target_name?&gt;
        <br />
        <br />
        &lt;?=$advert->category_name?&gt;
      </div>
    </div>
    <div class="advert_divider"> &nbsp; </div>
    &lt;?php $i++; endforeach;?&gt;
    &lt;?php else:?&gt;
    <div id="body_wrapper">
      <h1>There is no advert</h1>
    </div>
    &lt;?php endif;?&gt;
  </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

#2
[eluser]paulc010[/eluser]
Maybe a clue as to what the error/problem is would be a good idea?

Paul

#3
[eluser]persian empire[/eluser]
I have not implement this code


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.