model
This commit is contained in:
21
search.php
21
search.php
@ -5,31 +5,20 @@ use src\Processing;
|
||||
|
||||
require_once "vendor/autoload.php";
|
||||
|
||||
$rep = new \src\file_db_driver\FileDatabaseDriver();
|
||||
$rep->connect(__DIR__ . "/Information.txt");
|
||||
ini_set("display_errors", true);
|
||||
error_reporting(-1);
|
||||
|
||||
$columnKeys = $rep->getHeadKeys();
|
||||
//$columnValues = $rep->getHeadValues();
|
||||
$columnValues = ['id','Фамилия','Имя','Отчество','Дата рождения','Пол','Код страны','Номер телефона','Email','Статус'];
|
||||
$user = new \src\models\UserModel();
|
||||
|
||||
$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();
|
||||
$res = $user->find(['name' => ['Анжела']])->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");
|
||||
$infArr = $json->createJsonArray($user->labels(), $res, "form1");
|
||||
|
||||
$table = new \Itguild\Tables\ListJsonTable($infArr);
|
||||
$table->create();
|
||||
|
Reference in New Issue
Block a user