FormClasses/index.php
2024-05-20 15:11:17 +03:00

44 lines
1.1 KiB
PHP

<?php
require_once "form.html";
require_once "src/Information.php";
require_once "src/fullName.php";
require_once "src/contacts.php";
require_once "src/additionallyInfo.php";
//require_once "info.php";
require_once "table.php";
require_once "functions.php";
$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