fourth
This commit is contained in:
parent
8f07ea82bc
commit
8254407aae
@ -5,3 +5,6 @@
|
|||||||
Зайцева Анжела Игоревна; 1998-12-12; Женжина; +74444444444; aksjfhfka@mail.ru;
|
Зайцева Анжела Игоревна; 1998-12-12; Женжина; +74444444444; aksjfhfka@mail.ru;
|
||||||
Петров Петр Петрович; 1987-03-02; Мужчина; +77777777777; jksghhsdkj@gmail.com;
|
Петров Петр Петрович; 1987-03-02; Мужчина; +77777777777; jksghhsdkj@gmail.com;
|
||||||
Зайцев Федор Александрович; 2014-12-22; Мужчина; +76667774441; asert@mail.ru;
|
Зайцев Федор Александрович; 2014-12-22; Мужчина; +76667774441; asert@mail.ru;
|
||||||
|
Билай Станислав Романович;1111-11-11;Мужчина;+79493761924;stasbilay02@yandex.ru;
|
||||||
|
Плешкова Анастасия Денисовна;1111-11-11;Мужчина;+73333333333;ple.anastasiya@gmail.com;
|
||||||
|
Зайцев Федор Александрович;1234-12-12;Мужчина;+76667774441;asert@mail.ru;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Form ФИО</title>
|
<title>Form ФИО</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="index.php" target="_blank" method="post">
|
<!--<form action="info.php" target="_blank" method="post">
|
||||||
Фамилия: <br>
|
Фамилия: <br>
|
||||||
<input type = "text" name = "surname" required size="50" autofocus placeholder="Фамилия"> <br> <br>
|
<input type = "text" name = "surname" required size="50" autofocus placeholder="Фамилия"> <br> <br>
|
||||||
Имя: <br>
|
Имя: <br>
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<input type = "text" name = "patronymic" size="50" placeholder="Отчество"> <br> <br>
|
<input type = "text" name = "patronymic" size="50" placeholder="Отчество"> <br> <br>
|
||||||
|
|
||||||
Дата Рождения: <br>
|
Дата Рождения: <br>
|
||||||
<input type="date" name="DateOfBirth" required> <br> <br>
|
<input type="date" name="dateOfBirth" required> <br> <br>
|
||||||
|
|
||||||
Ваш пол: <br>
|
Ваш пол: <br>
|
||||||
<input type="radio" name="gender" value="Мужчина" checked> Мужчина
|
<input type="radio" name="gender" value="Мужчина" checked> Мужчина
|
||||||
@ -32,6 +32,6 @@
|
|||||||
|
|
||||||
<input type = "submit" value="Подтвердить">
|
<input type = "submit" value="Подтвердить">
|
||||||
<input type="reset">
|
<input type="reset">
|
||||||
</form>
|
</form>-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
29
form.php
Normal file
29
form.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php $form = '<form action="info.php" target="_blank" method="post">
|
||||||
|
Фамилия: <br>
|
||||||
|
<input type = "text" name = "surname" required size="50" autofocus placeholder="Фамилия"> <br> <br>
|
||||||
|
Имя: <br>
|
||||||
|
<input type = "text" name = "name" required size="50" placeholder="Имя"> <br> <br>
|
||||||
|
Отчество (если есть): <br>
|
||||||
|
<input type = "text" name = "patronymic" size="50" placeholder="Отчество"> <br> <br>
|
||||||
|
|
||||||
|
Дата Рождения: <br>
|
||||||
|
<input type="date" name="dateOfBirth" required> <br> <br>
|
||||||
|
|
||||||
|
Ваш пол: <br>
|
||||||
|
<input type="radio" name="gender" value="Мужчина" checked> Мужчина
|
||||||
|
<input type="radio" name="gender" value="Женжина"> Женжина<br> <br>
|
||||||
|
|
||||||
|
Номер телефона (Например 1234567890): <br>
|
||||||
|
<select name="countryCode">
|
||||||
|
<option value="+7" >Russia +7</option>
|
||||||
|
<option value="+38">Ukraine +38</option>
|
||||||
|
</select>
|
||||||
|
<input type="tel" name="phoneNumber" pattern="[0-9]{10}" maxlength="10" required placeholder="1234567890"> <br> <br>
|
||||||
|
|
||||||
|
Email адрес: <br>
|
||||||
|
<input type="Email" name="email" required> <br><br>
|
||||||
|
|
||||||
|
<input type = "submit" value="Подтвердить">
|
||||||
|
<input type="reset">
|
||||||
|
</form>';
|
||||||
|
echo $form;
|
@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
function isFullInfo($fullName, $additionallyInfo, $contacts)
|
|
||||||
{
|
|
||||||
return strlen($fullName) > 1 && strlen($additionallyInfo) > 1 && strlen($contacts) > 1 ? true : false;
|
|
||||||
} // isFullInfo
|
|
29
index.php
29
index.php
@ -1,38 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once "form.html";
|
require_once "form.php";
|
||||||
require_once "src/Information.php";
|
//require_once "src/Information.php";
|
||||||
require_once "src/fullName.php";
|
//require_once "src/FullName.php";
|
||||||
require_once "src/contacts.php";
|
//require_once "src/Contacts.php";
|
||||||
require_once "src/additionallyInfo.php";
|
//require_once "src/AdditionallyInfo.php";
|
||||||
//require_once "info.php";
|
//require_once "info.php";
|
||||||
require_once "table.php";
|
//require_once "table.php";
|
||||||
require_once "functions.php";
|
|
||||||
|
|
||||||
$flag = false;
|
/*$flag = false;
|
||||||
|
|
||||||
$surname = $_REQUEST["surname"];
|
$surname = $_REQUEST["surname"];
|
||||||
$name = $_REQUEST["name"];
|
$name = $_REQUEST["name"];
|
||||||
$patronymic = $_REQUEST["patronymic"];
|
$patronymic = $_REQUEST["patronymic"];
|
||||||
|
|
||||||
$fullName = new fullName($surname, $name, $patronymic);
|
$fullName = new FullName($surname, $name, $patronymic);
|
||||||
$fullName = $fullName->getFoolName();
|
$fullName = $fullName->getFoolName();
|
||||||
|
|
||||||
$gender = $_REQUEST["gender"];
|
$gender = $_REQUEST["gender"];
|
||||||
$DateOfBirth = $_REQUEST["DateOfBirth"];
|
$dateOfBirth = $_REQUEST["dateOfBirth"];
|
||||||
|
|
||||||
$additionallyInfo = new additionallyInfo($DateOfBirth, $gender);
|
$additionallyInfo = new AdditionallyInfo($dateOfBirth, $gender);
|
||||||
$additionallyInfo = $additionallyInfo->getAdditionallyInfo();
|
$additionallyInfo = $additionallyInfo->getAdditionallyInfo();
|
||||||
|
|
||||||
$countryCode = $_REQUEST["countryCode"];
|
$countryCode = $_REQUEST["countryCode"];
|
||||||
$phoneNumber = $_REQUEST["phoneNumber"];
|
$phoneNumber = $_REQUEST["phoneNumber"];
|
||||||
$email = $_REQUEST["email"];
|
$email = $_REQUEST["email"];
|
||||||
|
|
||||||
$contacts = new contacts($countryCode, $phoneNumber, $email);
|
$contacts = new Contacts($countryCode, $phoneNumber, $email);
|
||||||
$contacts = $contacts->getContacts();
|
$contacts = $contacts->getContacts();
|
||||||
|
|
||||||
$p1 = new Information($fullName, $additionallyInfo, $contacts);
|
$fullInformation = new Information($fullName, $additionallyInfo, $contacts);
|
||||||
$fullInformation = $p1->getFullInformation();
|
$fullInformation = $fullInformation->getFullInformation();
|
||||||
|
|
||||||
$flag = isFullInfo($fullName, $additionallyInfo, $contacts);
|
$flag = isFullInfo($fullName, $additionallyInfo, $contacts);
|
||||||
|
|
||||||
@ -40,4 +39,4 @@ if($flag) {
|
|||||||
$file = fopen("Information.txt", "a");
|
$file = fopen("Information.txt", "a");
|
||||||
fwrite($file, $fullInformation);
|
fwrite($file, $fullInformation);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
} // if
|
} // if*/
|
||||||
|
31
info.php
31
info.php
@ -1,34 +1,41 @@
|
|||||||
<?php
|
<?php
|
||||||
/*$flag = false;
|
|
||||||
|
namespace src;
|
||||||
|
|
||||||
|
use AdditionallyInfo;
|
||||||
|
use Contacts;
|
||||||
|
use FullName;
|
||||||
|
use Information;
|
||||||
|
|
||||||
|
require_once "src/Information.php";
|
||||||
|
require_once "src/FullName.php";
|
||||||
|
require_once "src/Contacts.php";
|
||||||
|
require_once "src/AdditionallyInfo.php";
|
||||||
|
|
||||||
$surname = $_REQUEST["surname"];
|
$surname = $_REQUEST["surname"];
|
||||||
$name = $_REQUEST["name"];
|
$name = $_REQUEST["name"];
|
||||||
$patronymic = $_REQUEST["patronymic"];
|
$patronymic = $_REQUEST["patronymic"];
|
||||||
|
|
||||||
$fullName = new fullName($surname, $name, $patronymic);
|
$fullName = new FullName($surname, $name, $patronymic);
|
||||||
$fullName = $fullName->getFoolName();
|
$fullName = $fullName->getFoolName();
|
||||||
|
|
||||||
$gender = $_REQUEST["gender"];
|
$gender = $_REQUEST["gender"];
|
||||||
$DateOfBirth = $_REQUEST["DateOfBirth"];
|
$dateOfBirth = $_REQUEST["dateOfBirth"];
|
||||||
|
|
||||||
$additionallyInfo = new additionallyInfo($DateOfBirth, $gender);
|
$additionallyInfo = new AdditionallyInfo($dateOfBirth, $gender);
|
||||||
$additionallyInfo = $additionallyInfo->getAdditionallyInfo();
|
$additionallyInfo = $additionallyInfo->getAdditionallyInfo();
|
||||||
|
|
||||||
$countryCode = $_REQUEST["countryCode"];
|
$countryCode = $_REQUEST["countryCode"];
|
||||||
$phoneNumber = $_REQUEST["phoneNumber"];
|
$phoneNumber = $_REQUEST["phoneNumber"];
|
||||||
$email = $_REQUEST["email"];
|
$email = $_REQUEST["email"];
|
||||||
|
|
||||||
$contacts = new contacts($countryCode, $phoneNumber, $email);
|
$contacts = new Contacts($countryCode, $phoneNumber, $email);
|
||||||
$contacts = $contacts->getContacts();
|
$contacts = $contacts->getContacts();
|
||||||
|
|
||||||
$p1 = new Information($fullName, $additionallyInfo, $contacts);
|
$fullInformation = new Information($fullName, $additionallyInfo, $contacts);
|
||||||
$fullInformation = $p1->getFullInformation();
|
$fullInformation = $fullInformation->getFullInformation();
|
||||||
|
|
||||||
$flag = isFullInfo($fullName, $additionallyInfo, $contacts);
|
|
||||||
|
|
||||||
if($flag) {
|
|
||||||
$file = fopen("Information.txt", "a");
|
$file = fopen("Information.txt", "a");
|
||||||
fwrite($file, $fullInformation);
|
fwrite($file, $fullInformation);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
} // if
|
require "table.php";
|
||||||
*/
|
|
14
src/AdditionallyInfo.php
Normal file
14
src/AdditionallyInfo.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class AdditionallyInfo
|
||||||
|
{
|
||||||
|
public $bDay;
|
||||||
|
public $gender;
|
||||||
|
public function __construct($bDay, $gender) {
|
||||||
|
$this->bDay = $bDay;
|
||||||
|
$this->gender = $gender;
|
||||||
|
}
|
||||||
|
public function getAdditionallyInfo() {
|
||||||
|
return $this->bDay . ";" . $this->gender;
|
||||||
|
}
|
||||||
|
}
|
17
src/Contacts.php
Normal file
17
src/Contacts.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Contacts
|
||||||
|
{
|
||||||
|
public $countryCode;
|
||||||
|
public $phoneNumber;
|
||||||
|
public $email;
|
||||||
|
public function __construct($countryCode, $phoneNumber, $email){
|
||||||
|
$this->countryCode = $countryCode;
|
||||||
|
$this->phoneNumber = $phoneNumber;
|
||||||
|
$this->email = $email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getContacts(){
|
||||||
|
return $this->countryCode . $this->phoneNumber . ";" . $this->email;
|
||||||
|
}
|
||||||
|
}
|
19
src/FullName.php
Normal file
19
src/FullName.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class FullName
|
||||||
|
{
|
||||||
|
public $surname;
|
||||||
|
public $name;
|
||||||
|
public $patronymic;
|
||||||
|
|
||||||
|
public function __construct($surname, $name, $patronymic)
|
||||||
|
{
|
||||||
|
$this->surname = $surname;
|
||||||
|
$this->name = $name;
|
||||||
|
$this->patronymic = $patronymic;
|
||||||
|
}
|
||||||
|
public function getFoolName()
|
||||||
|
{
|
||||||
|
return $this->surname . ' ' . $this->name . ' ' . $this->patronymic;
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class additionallyInfo
|
|
||||||
{
|
|
||||||
public $additionallyInfo;
|
|
||||||
public function __construct($b_day, $gender) {
|
|
||||||
$this->additionallyInfo = $b_day . ";" . $gender;
|
|
||||||
}
|
|
||||||
public function getAdditionallyInfo() {
|
|
||||||
return $this->additionallyInfo;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class contacts
|
|
||||||
{
|
|
||||||
public $contacts;
|
|
||||||
public function __construct($countryCode, $phoneNumber, $email){
|
|
||||||
$this->contacts = $countryCode . $phoneNumber . ";" . $email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getContacts(){
|
|
||||||
return $this->contacts;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class fullName
|
|
||||||
{
|
|
||||||
public $name;
|
|
||||||
|
|
||||||
public function __construct($surname, $name, $patronymic)
|
|
||||||
{
|
|
||||||
$this->name = $surname . " " . $name . " " . $patronymic;
|
|
||||||
}
|
|
||||||
public function getFoolName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user