Exemple #1
0
 protected function On_Input()
 {
     parent::On_Input();
     $this->site_title .= " :: Заказы";
     $m_handbags = M_Handbags::Instance();
     $this->handbags = $m_handbags->All_Handbags();
 }
 protected function On_Input()
 {
     parent::On_Input();
     $this->site_title .= " :: Оформление заказа";
     $m_handbags = M_Handbags::Instance();
     $m_functions = M_Functions::Instance();
     $m_orders = M_Orders::Instance();
     $this->calendar = M_Calendar::Instance();
     $this->now_month = $m_functions->Date_In_Russian(date("n, Y"));
     $this->next_month = $m_functions->Date_In_Russian(date("n, Y", strtotime('now + 1 month')));
     $this->handbag = $m_handbags->Define_Handbag($_POST['id_handbag']);
     $this->free_dates = $m_handbags->Free_Dates_For_Rent;
     /* Если пришли после нажатия на кнопку wish_list */
     if (isset($_POST['wish_list'])) {
         $this->id_handbag = $_POST['id_handbag'];
     } elseif (isset($_POST['create_order'])) {
         /* Удаление лишнего */
         $this->name = $m_functions->Clear_Data($_POST['name']);
         $this->surname = $m_functions->Clear_Data($_POST['surname']);
         $this->telephone = $m_functions->Clear_Data($_POST['telephone']);
         $this->email = $m_functions->Clear_Data($_POST['email']);
         $this->id_handbag = $m_functions->Clear_Data($_POST['id_handbag']);
         $this->address = $m_functions->Clear_Data($_POST['address']);
         $this->comment = $m_functions->Clear_Data($_POST['comment']);
         $this->rent_time_begin = $m_functions->Clear_Data($_POST['rent_time_begin']);
         $this->rent_time_end = $m_functions->Clear_Data($_POST['rent_time_end']);
         /* Генерация ошибок */
         if ($this->name == '' or mb_strlen($this->name, 'UTF-8') < 3) {
             $this->errors['name'] = 'Не верно введено имя';
         }
         if ($this->surname == '' or mb_strlen($this->surname, 'UTF-8') < 3) {
             $this->errors['surname'] = 'Не верно введена фамилия';
         }
         if ($this->telephone == '' or mb_strlen($this->telephone, 'UTF-8') < 7) {
             $this->errors['telephone'] = 'Не верно введен телефон';
         }
         if ($this->email == '' or mb_strlen($this->email, 'UTF-8') < 6) {
             $this->errors['email'] = 'Не верно введен e-mail';
         }
         if ($this->address == '' or mb_strlen($this->address, 'UTF-8') < 10) {
             $this->errors['address'] = 'Не верно введен адрес';
         }
         if ($this->id_handbag == '') {
             $this->errors['id_handbag'] = 'Не выбрана сумка';
         }
         if (count($this->errors) > 0) {
         } else {
             $m_orders->Create_Order($this->id_handbag, $this->name, $this->surname, $this->telephone, $this->email, $this->address, $this->comment, $this->rent_time_begin, $this->rent_time_end);
         }
     } else {
     }
 }
Exemple #3
0
 protected function On_Input()
 {
     parent::On_Input();
     $this->site_title .= " :: Календарь";
     $m_handbags = M_Handbags::Instance();
     $m_functions = M_Functions::Instance();
     $this->calendar = M_Calendar::Instance();
     $this->handbags = $m_handbags->All_Handbags_For_Calendar();
     if (isset($_GET['id_borrow']) or isset($_POST['handbag'])) {
         if (isset($_GET['id_borrow'])) {
             $this->id_handbag = $_GET['id_borrow'];
         } elseif (isset($_POST['handbag'])) {
             $this->id_handbag = $_POST['handbag'];
         }
         $this->handbag = $m_handbags->Define_Handbag($this->id_handbag);
         //print_r($this->handbag['rent_time']);
     }
     $this->now_month = $m_functions->Date_In_Russian(date("n, Y"));
     $this->next_month = $m_functions->Date_In_Russian(date("n, Y", strtotime('now + 1 month')));
 }
 protected function On_Input()
 {
     parent::On_Input();
     $this->site_title .= " :: Подтверждение заказа";
     $m_handbags = M_Handbags::Instance();
     $this->handbag = $m_handbags->Define_Handbag($_POST['id_handbag']);
     /* Если пришли после нажатия на кнопку wish_list */
     if (isset($_POST['wish_list'])) {
         $this->id_handbag = $_POST['id_handbag'];
     } elseif (isset($_POST['create_order'])) {
         /* необходимо установить защиту */
         $this->name = $_POST['name'];
         $this->surname = $_POST['surname'];
         $this->telephone = $_POST['telephone'];
         $this->email = $_POST['email'];
         $this->id_handbag = $_POST['id_handbag'];
         $this->address = $_POST['address'];
         $this->comment = $_POST['comment'];
     } else {
     }
 }
Exemple #5
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();
             // количесво страниц
         }
     }
 }