From 8f07ea82bc7e64b3e8132579246025883628cc49 Mon Sep 17 00:00:00 2001 From: stas Date: Mon, 20 May 2024 15:11:17 +0300 Subject: [PATCH] third --- Information.txt | 13 +++++----- form.html | 2 +- functions.php | 4 +++ index.php | 46 +++++++++++++++++++++++++++------ info.php | 33 +++++++++++++++++++++++ src/Information.php | 20 +++++--------- src/additionallyInfo.php | 8 +++++- src/contacts.php | 9 ++++++- src/fullName.php | 5 +--- table.php | 56 +++++++++++++++++++++++++++++++++++++++- 10 files changed, 161 insertions(+), 35 deletions(-) diff --git a/Information.txt b/Information.txt index d8f5e84..b70cc05 100644 --- a/Information.txt +++ b/Information.txt @@ -1,6 +1,7 @@ -Билай Станислав Романович;Мужчина;2002-03-11;+79493761924;stasbilay02@yandex.ru; -Петров Петр Петрович;Мужчина;1234-12-12;+77777777777;jksghhsdkj@gmail.com; -Петров Петр Петрович;Мужчина;1234-02-23;+77777777777;jksghhsdkj@gmail.com; -Зайцева Анжела Игоревна;Мужчина;1999-05-05;+74444444444;aksjfhfka@mail.ru; -Билай Станислав Романович;Мужчина;1234-12-12;+79493761924;stasbilay02@yandex.ru; -Зайцева Анжела Игоревна;Мужчина;1234-12-12;+74444444444;aksjfhfka@mail.ru; +Билай Станислав Романович; 2002-03-11; Мужчина; +79493761924; stasbilay02@yandex.ru; +Иванов Иван Иванович; 2002-03-11; Мужчина; +71111111111; dsjgbdskgb@yandex.ru; +Иванова Мария Сергеевна; 2002-04-05; Женжина; +382222222222; sdguhnlnoih@gmail.com; +Плешкова Анастасия Денисовна; 2006-11-10; Женжина; +73333333333; ple.anastasiya@gmail.com; +Зайцева Анжела Игоревна; 1998-12-12; Женжина; +74444444444; aksjfhfka@mail.ru; +Петров Петр Петрович; 1987-03-02; Мужчина; +77777777777; jksghhsdkj@gmail.com; +Зайцев Федор Александрович; 2014-12-22; Мужчина; +76667774441; asert@mail.ru; diff --git a/form.html b/form.html index 2213a14..bfb6ae1 100644 --- a/form.html +++ b/form.html @@ -5,7 +5,7 @@ Form ФИО -
+ Фамилия:


Имя:
diff --git a/functions.php b/functions.php index b3d9bbc..6f5591b 100644 --- a/functions.php +++ b/functions.php @@ -1 +1,5 @@ 1 && strlen($additionallyInfo) > 1 && strlen($contacts) > 1 ? true : false; +} // isFullInfo diff --git a/index.php b/index.php index 63b23b3..b16d405 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,43 @@ foolName(); -$p1 = new Information($fn, 'hfd', '11', '+7', '11111111', 'ashg@ajhi'); -$p1->writeInformation(); \ No newline at end of file +$flag = false; + +$surname = $_REQUEST["surname"]; +$name = $_REQUEST["name"]; +$patronymic = $_REQUEST["patronymic"]; + +$fullName = new fullName($surname, $name, $patronymic); +$fullName = $fullName->getFoolName(); + +$gender = $_REQUEST["gender"]; +$DateOfBirth = $_REQUEST["DateOfBirth"]; + +$additionallyInfo = new additionallyInfo($DateOfBirth, $gender); +$additionallyInfo = $additionallyInfo->getAdditionallyInfo(); + +$countryCode = $_REQUEST["countryCode"]; +$phoneNumber = $_REQUEST["phoneNumber"]; +$email = $_REQUEST["email"]; + +$contacts = new contacts($countryCode, $phoneNumber, $email); +$contacts = $contacts->getContacts(); + +$p1 = new Information($fullName, $additionallyInfo, $contacts); +$fullInformation = $p1->getFullInformation(); + +$flag = isFullInfo($fullName, $additionallyInfo, $contacts); + +if($flag) { + $file = fopen("Information.txt", "a"); + fwrite($file, $fullInformation); + fclose($file); +} // if diff --git a/info.php b/info.php index b3d9bbc..a9e1e0e 100644 --- a/info.php +++ b/info.php @@ -1 +1,34 @@ getFoolName(); + +$gender = $_REQUEST["gender"]; +$DateOfBirth = $_REQUEST["DateOfBirth"]; + +$additionallyInfo = new additionallyInfo($DateOfBirth, $gender); +$additionallyInfo = $additionallyInfo->getAdditionallyInfo(); + +$countryCode = $_REQUEST["countryCode"]; +$phoneNumber = $_REQUEST["phoneNumber"]; +$email = $_REQUEST["email"]; + +$contacts = new contacts($countryCode, $phoneNumber, $email); +$contacts = $contacts->getContacts(); + +$p1 = new Information($fullName, $additionallyInfo, $contacts); +$fullInformation = $p1->getFullInformation(); + +$flag = isFullInfo($fullName, $additionallyInfo, $contacts); + +if($flag) { + $file = fopen("Information.txt", "a"); + fwrite($file, $fullInformation); + fclose($file); +} // if +*/ \ No newline at end of file diff --git a/src/Information.php b/src/Information.php index 0b00ae9..6085535 100644 --- a/src/Information.php +++ b/src/Information.php @@ -4,25 +4,19 @@ class Information { public $foolName; - public $gender; - public $DateOfBirthday; - public $countryCode; - public $phoneNumber; - public $email; + public $additionallyInfo; + public $contacts; - public function __construct($foolName, $gender, $DateOfBirthday, $countryCode, $phoneNumber, $email) + public function __construct($foolName, $additionallyInfo, $contacts) { $this->foolName = $foolName; - $this->gender = $gender; - $this->DateOfBirthday = $DateOfBirthday; - $this->countryCode = $countryCode; - $this->phoneNumber = $phoneNumber; - $this->email = $email; + $this->additionallyInfo = $additionallyInfo; + $this->contacts = $contacts; } - public function fullInformation() + public function getFullInformation() { - return $this->foolName . ";" . $this->gender . ";" . $this->DateOfBirthday . ";" . $this->countryCode . $this->phoneNumber . ";" . $this->email . ";"; + return $this->foolName . ";" . $this->additionallyInfo . ";" . $this->contacts . ";\n"; } } diff --git a/src/additionallyInfo.php b/src/additionallyInfo.php index 604dd25..850a9f4 100644 --- a/src/additionallyInfo.php +++ b/src/additionallyInfo.php @@ -2,5 +2,11 @@ class additionallyInfo { - + public $additionallyInfo; + public function __construct($b_day, $gender) { + $this->additionallyInfo = $b_day . ";" . $gender; + } + public function getAdditionallyInfo() { + return $this->additionallyInfo; + } } \ No newline at end of file diff --git a/src/contacts.php b/src/contacts.php index e506714..a5254d2 100644 --- a/src/contacts.php +++ b/src/contacts.php @@ -1,6 +1,13 @@ contacts = $countryCode . $phoneNumber . ";" . $email; + } + public function getContacts(){ + return $this->contacts; + } } \ No newline at end of file diff --git a/src/fullName.php b/src/fullName.php index 4a26b89..bc3517a 100644 --- a/src/fullName.php +++ b/src/fullName.php @@ -1,17 +1,14 @@ name = $surname . " " . $name . " " . $patronymic; } - public function foolName() + public function getFoolName() { return $this->name; } diff --git a/table.php b/table.php index b3d9bbc..dd8a215 100644 --- a/table.php +++ b/table.php @@ -1 +1,55 @@ - + + + + Information table + + + + + + + + + + + Инфрмацмонная таблица + + + + + + + + + +
ФИОДата рожденияПолНомер ТелефонаEmail
+ + + \ No newline at end of file