Esempio n. 1
0
 public static function Instance()
 {
     if (self::$instance == null) {
         self::$instance = new M_Filters();
     }
     return self::$instance;
 }
Esempio n. 2
0
 protected function On_Input()
 {
     parent::On_Input();
     $m_handbags = M_Handbags::Instance();
     $m_filters = M_Filters::Instance();
     $this->site_title .= " :: Прокат (аренда) сумок";
     $this->filter_colors = $m_filters->All_Colors();
     $this->filter_uses = $m_filters->All_Uses();
     $this->filter_designers = $m_filters->All_Designers();
     $this->colors = $m_filters->Generate_Array_From_Filter('colors');
     $this->designers = $m_filters->Generate_Array_From_Filter('designers');
     $this->uses = $m_filters->Generate_Array_From_Filter('uses');
     // Если выбрана сумка
     if (isset($_GET['id_borrow'])) {
         $this->handbag = $m_handbags->Define_Handbag($_GET['id_borrow']);
     } elseif (isset($_GET['designers'])) {
         $this->cost_from = $_POST['cost_from'];
         $this->cost_to = $_POST['cost_to'];
         $this->handbags = $m_handbags->Filter_Designers_Handbags($_GET['designers']);
     } else {
         if (isset($_POST['untouched'])) {
             $this->untouched = $_POST['untouched'];
         }
         if (isset($_POST['submit'])) {
             $this->cost_from = $_POST['cost_from'];
             $this->cost_to = $_POST['cost_to'];
             $this->handbags = $m_handbags->Filter_Handbags($_POST['colors'], $_POST['uses'], $_POST['designers'], $_POST['cost_from'], $_POST['cost_to'], $_POST['untouched']);
         } else {
             if (isset($_GET['page'])) {
                 $this->current_page = $_GET['page'];
                 $this->current_page = intval($this->current_page);
             } else {
                 $this->current_page = 1;
             }
             $this->handbags = $m_handbags->All_Handbags_On_Page($this->current_page);
             $this->navigation_page = $m_handbags->Navigator_Handbags();
             // количесво страниц
         }
     }
 }