Esempio n. 1
0
 public function show()
 {
     $this->views = new Views(new Template("admin"));
     Phalanx::loadClasses('Cats');
     $this->views->data = Cats::get_specials($this->session->user->id, $this->post->search, $this->post->order);
     $this->views->search = $this->post->search;
     $this->views->special = true;
     $this->views->display('cats_list.phtml');
 }
Esempio n. 2
0
 public function special()
 {
     $page = $this->get->page;
     Phalanx::loadClasses('Cats');
     $response = Cats::get_specials($page);
     $result = array();
     echo '<section id="gatinhos-para-adocao">
         <ul class="mural">';
     foreach ($response as $item) {
         $gender = $item->gender;
         switch ($item->gender) {
             case 'M':
                 $gender = ' ic-male ';
                 break;
             case 'F':
                 $gender = ' ic-female ';
                 break;
             case 'B':
                 $gender = ' ic-male-female ';
                 break;
         }
         $html = '<div class="col s12 m6 box-gatos p-0">
             
                 <li class="col s6 m6 l3 p-0 relative"><!--<div class="cat_index"></div>-->
                 <a href="' . HOST . 'detalhes-gato/' . $item->id . '/' . strtolower(str_replace(' ', '-', htmlentities($item->name))) . '" style="background-image: url(' . MEDIA_DIR . 'uploads/cats/' . $item->picture . ');" class="cat-profile">
                 <div class="hide-on-large-only" style="    position: absolute;
 bottom: 10px;
 left: 10px;">
                            <i class="icon-white ' . $gender . '"></i>
                        </div>
                 
                  <div class="special-cat hide-on-med-and-down" style="right:0"><span class="upper bold" style="margin-right: 13px;">Especial</span><i class="icon-white ic-star"></i></div>
                  <div class="special-cat hide-on-large-only"><i class="icon-white ic-star"></i><span class="upper bold">Especial</span></div>';
         //reservado
         if ($item->status == 2) {
             $html .= '<div class="special-cat hide-on-med-and-down" style="left:0"><i class="icon-white c-locked"></i></div>
                  <div class="special-cat hide-on-large-only"><i class="icon-white c-locked"></i></div>';
         }
         $html .= ' <div class="texto hide-on-med-and-down">
                    <h1 class="text_13 bold upper m-t-0">' . $item->name . '</h1>
                    
                    <p class="desc text_10">';
         $desc = strip_tags($item->description);
         if (strlen($desc) > 100) {
             $html .= substr($desc, 0, 100) . '...';
         } else {
             $html .= htmlentities($desc);
         }
         $html .= '</p>
                     <div class="col s6 characteristics m-t-10">
                       <div class="happines">';
         for ($i = 0; $i < $item->playful; $i++) {
             $html .= '<i class="sociavel icon-white ic-happy"></i>';
         }
         $html .= '</div>
                       <div class="funny">';
         for ($i = 0; $i < $item->social; $i++) {
             $html .= '<i class="sociavel icon-white ic-hank"></i>';
         }
         $html .= '</div>
                       <div class="loving">';
         for ($i = 0; $i < $item->lovely; $i++) {
             $html .= '<i class="sociavel icon-white ic-heart"></i>';
         }
         $html .= '</div>
                     </div>
                     <div class="col s4 gender text-right" style="margin-top:80px;">
                            <i class="icon-white ' . $gender . '"></i>
                        </div>
                </div>
                 <div class="more upper bold text_15 hide-on-large-only aug_purple_bg white">+</div>
             </a>
            </li>
            <li class="col s6 m6 l3 hide-on-large-only text-small-complete p-0">
                 <div class="col s12 texto-mobile">
                     <h1 class="flow-text bold upper aug_purple m-t-10 m-b-10 truncate">' . $item->name . '</h1>
                         <div class="text_10">
                         <p>';
         $desc = strip_tags($item->description);
         if (strlen($desc) > 400) {
             $html .= substr($desc, 0, 400) . '...';
         } else {
             $html .= htmlentities($desc);
         }
         $html .= '</p>
                         <div class="row col s12 characteristics m-t-10 m-b-0">
                             <div align="center" class="col s4 happines">
                                 <i class="sociavel icon-purple ic-happy"></i>
                                 <p style="display: inline;"> x' . $item->playful . '</p>
                             </div>
                             <div align="center" class="col s4 funny">
                                 <i class="sociavel icon-purple ic-hank"></i>
                                 <p style="display: inline;"> x' . $item->social . '</p>
                             </div>
                             <div align="center" class="col s4 loving">
                                 <i class="sociavel icon-purple ic-heart"></i>
                                 <p style="display: inline;"> x' . $item->lovely . '</p>
                             </div>
                         </div>
                     </div>
                 </div>
             </li>
          </div>';
         echo $html;
     }
     echo '</ul></section>';
 }