FormClasses/info.php

41 lines
1.1 KiB
PHP
Raw Normal View History

2024-05-20 14:40:53 +03:00
<?php
2024-05-21 11:53:40 +03:00
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";
2024-05-20 15:11:17 +03:00
$surname = $_REQUEST["surname"];
$name = $_REQUEST["name"];
$patronymic = $_REQUEST["patronymic"];
2024-05-21 11:53:40 +03:00
$fullName = new FullName($surname, $name, $patronymic);
2024-05-20 15:11:17 +03:00
$fullName = $fullName->getFoolName();
$gender = $_REQUEST["gender"];
2024-05-21 11:53:40 +03:00
$dateOfBirth = $_REQUEST["dateOfBirth"];
2024-05-20 15:11:17 +03:00
2024-05-21 11:53:40 +03:00
$additionallyInfo = new AdditionallyInfo($dateOfBirth, $gender);
2024-05-20 15:11:17 +03:00
$additionallyInfo = $additionallyInfo->getAdditionallyInfo();
$countryCode = $_REQUEST["countryCode"];
$phoneNumber = $_REQUEST["phoneNumber"];
$email = $_REQUEST["email"];
2024-05-21 11:53:40 +03:00
$contacts = new Contacts($countryCode, $phoneNumber, $email);
2024-05-20 15:11:17 +03:00
$contacts = $contacts->getContacts();
2024-05-21 11:53:40 +03:00
$fullInformation = new Information($fullName, $additionallyInfo, $contacts);
$fullInformation = $fullInformation->getFullInformation();
2024-05-20 15:11:17 +03:00
2024-05-21 11:53:40 +03:00
$file = fopen("Information.txt", "a");
fwrite($file, $fullInformation);
fclose($file);
require "table.php";