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 { } }
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'))); }