예제 #1
0
 public function adopted()
 {
     Phalanx::loadClasses('Cats');
     $this->views = new Views(new Template("admin"));
     $this->views->special = 1;
     $this->views->data = Cats::get_adopted(1, $this->session->user->id);
     $this->views->display('adopted_cat_list.phtml');
 }
예제 #2
0
    public function adopted()
    {
        $page = $this->get->page;
        Phalanx::loadClasses('Cats');
        $response = Cats::get_adopted($page);
        $result = array();
        echo '<section id="gatinhos-para-adocao">
            
        <ul class="mural">';
        foreach ($response as $item) {
            /* header */
            $html = '<div class="col s12 m6 box-gatos p-0"><li class="col s6 m6 l3 p-0 relative">';
            /* image */
            if ($item->special == 1) {
                $html .= "<span class=\"special_cat\"></span>";
            }
            /* image */
            $html .= '<a href="#" style="background-image: url(' . MEDIA_DIR . 'uploads/cats/' . $item->picture . ');">';
            if ($item->status == 1) {
                $html .= '<div class="reserved-cat hide-on-med-and-down"><i class="icon-white ic-locked"></i> Reservado</div>
                     <div class="reserved-cat hide-on-large-only"><i class="icon-white ic-locked"></i> Reservado</div>';
            }
            if ($item->status == 2) {
                $html .= '<div class="reserved-cat hide-on-med-and-down"><i class="icon-white ic-locked"></i> Adotado</div>
                     <div class="reserved-cat hide-on-large-only"><i class="icon-white ic-locked"></i> Adotado</div>';
            }
            $html .= '<h1 class="text_13 bold upper m-t-0" style="bottom: 0;
    position: absolute;
    color: white;
    left: 10px;">' . $item->name . '</h1>';
            $html .= '<div class="shadow">';
            /* description */
            if (strlen(strip_tags($item->description)) > 100) {
                $item->description = substr($item->description, 0, 100) . '...';
            }
            /* cod */
            if ($item->status != 2) {
                $html .= "<div class=\"cat_id\">" . $item->cod . "</div>";
            }
            $html .= '</div></a></div>';
            /* more */
            $html .= '</div>
               </li></div>';
            echo $html;
        }
        echo '</ul></section>';
        $counting = Cats::counting();
        echo '<span class="aug_blue_bg bold white-text bottom-msg" style="z-index:120">
    <small class="text_10">Já encaminhamos ' . $counting[0]->total . ' gatinhos para adoção!</small>
</span>';
    }