public function indexAction()
 {
     // action body
     $Oko3 = new Application_Model_DbTable_TrzecieOko();
     $select = $Oko3->select('id', 'tytul', 'abstrakt', 'tekst')->where('id = ?', intval($this->getRequest()->getParam("id")));
     $this->view->artykul = $Oko3->fetchAll($select);
     $Oko3 = new Application_Model_DbTable_TrzecieOko();
     $select = $Oko3->select('id', 'tytul', 'abstrakt', 'data_dodania')->where('id <> ?', intval($this->getRequest()->getParam("id")))->where('czy_wyswietlac = ?', 1)->order('data_dodania DESC');
     $paginator = Zend_Paginator::factory($Oko3->fetchAll($select));
     $paginator->setItemCountPerPage(10)->setCurrentPageNumber($this->_getParam('page', 1));
     $this->view->paginator = $paginator;
 }
Exemple #2
0
    public function pokaz()
    {
        $Oko3 = new Application_Model_DbTable_TrzecieOko();
        $select = $Oko3->select('id', 'tytul', 'abstrakt')->where('czy_wyswietlac = ?', 1)->where('czy_wazna = ?', 1)->order(new Zend_Db_Expr('RAND()'))->limit(1);
        $oko3_artykuly = $Oko3->fetchAll($select);
        $view = Zend_Layout::getMvcInstance()->getView();
        ?>
      <section class="c_l_modul">
        <div class="c_l_modul_s2">
          <div class="c_l_modul_t2">
            <h2 class="tytul_belki1">t r z e c i e &nbsp; o k o</h2>
            <h2 class="tytul_belki2"><a href="<?php 
        echo $view->url(array('page' => 1), 'felietony', true);
        ?>
">f e l i e t o n y</a></h2>
          </div>
          <div class="c_l_modul_c2">
            <?php 
        foreach ($oko3_artykuly as $i => $oko3) {
            ?>
            <article class="art_info">
              <!--<a href="<?php 
            //echo Zend_Registry::get('baseUrl');
            ?>
/oko_news.php?id=<?php 
            //echo $oko3->id;
            ?>
">-->
              <a href="<?php 
            echo $view->url(array('id' => $oko3->id, 'title' => TS_Url::getUrl($oko3->tytul)), 'trzecieoko', true);
            ?>
">
                <p class="tytul"><?php 
            echo $oko3->tytul;
            ?>
</p>
                <p class="abstrakt"><?php 
            echo $oko3->abstrakt;
            ?>
<img src="images/layout/standard/ico/wiecej.gif"/></p>
              </a>
            </article>
            <?php 
        }
        ?>
          </div>
        </div>
      </section>
      <?php 
        /**/
    }