This commit is contained in:
2024-05-27 11:40:02 +03:00
parent 5b3ea91ac5
commit 5468b1d286
5 changed files with 61 additions and 10 deletions

View File

@ -5,7 +5,7 @@ namespace src;
use Information;
require_once "src/Information.php";
require_once "Search.php";
/*require_once "Search.php";*/
$fileName = "Information.txt";
$fileModeOpen = "a";
@ -21,15 +21,29 @@ $file = fopen($fileName, $fileModeOpen);
fwrite($file, $string);
fclose($file);
$file = fopen($fileName, "r");
$formSearch =
'<form action="search_result.php" target="_blank" method="post">
<input type="search" name="result_search"> <br> <br>
<input type="submit" value="Поиск">
</form>';
echo $formSearch;
/*$file = fopen($fileName, "r");
$arrKey = array('surname', 'name', 'patronymic', 'dateOfBirth', 'gender', 'countryCode', 'phoneNumber', 'email');
$parsingArray = array();
echo "<pre>";
print_r($_REQUEST);
$forSearch = $_REQUEST['result_search'];
while (!feof($file)) {
$str = fgets($file);
if(search($str, '/\b(иванов)\b/ui')){
//if(search($str, '/\b(иванов)\b/ui')){
if(search($str, $forSearch)){
$array = array_combine($arrKey, explode(";", $str));
$obj = new Information();
$obj->load($array);
@ -37,6 +51,6 @@ while (!feof($file)) {
}
}
echo "<pre>";
print_r($parsingArray);
print_r($parsingArray);*/
require "table.php";