FormClasses/search.php
2024-06-26 11:34:47 +03:00

36 lines
1.1 KiB
PHP

<?php
use src\dto\InformationDTO;
use src\Processing;
require_once "vendor/autoload.php";
$rep = new \src\file_db_driver\FileDatabaseDriver();
$rep->connect(__DIR__ . "/Information.txt");
$columnKeys = $rep->getHeadKeys();
//$columnValues = $rep->getHeadValues();
$columnValues = ['id','Фамилия','Имя','Отчество','Дата рождения','Пол','Код страны','Номер телефона','Email','Статус'];
$columns = array_combine($columnKeys, $columnValues);
//$res = $rep->find([$_REQUEST['key'] => $_REQUEST['result_search']])->limit(7)->all();
//$res = $rep->find($_REQUEST)->limit(10)->all();
$res = $rep->find(['name' => ['Станислав', 'Анастасия', 'Анжела'], 'status' => ['0']])->limit(10)->all();
$rep->close();
$infArr = [];
foreach ($res as $key){
$inf = new InformationDTO();
$inf->load($key);
$infArr[] = $inf;
}
$json = new Processing();
$infArr = $json->createJsonArray($columns, $infArr, "form1");
$table = new \Itguild\Tables\ListJsonTable($infArr);
$table->create();
$table->render();