ver.0.3
This commit is contained in:
41
search.php
Normal file
41
search.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use src\debug\Debug;
|
||||
use src\Information;
|
||||
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();
|
||||
|
||||
$columns = array_combine($columnKeys, $columnValues);
|
||||
|
||||
//$res = $rep->find([$_REQUEST['key'] => $_REQUEST['result_search']])->limit(7)->all();
|
||||
//$fooArr = [
|
||||
// 'surname' => 'Билай',
|
||||
// 'dateOfBirth' => '4444-04-04',
|
||||
// 'status' => '1',
|
||||
// 'gender' => 'Мужчина'
|
||||
//];
|
||||
//Debug::dd($_REQUEST);
|
||||
$res = $rep->find($_REQUEST)->limit(10)->all();
|
||||
|
||||
$rep->close();
|
||||
|
||||
$infArr = [];
|
||||
foreach ($res as $key){
|
||||
$inf = new Information();
|
||||
$inf->load($key);
|
||||
$infArr[] = $inf;
|
||||
}
|
||||
|
||||
$json = new Processing();
|
||||
$infArr = $json->createJsonArray($columns, $infArr, "form1");
|
||||
|
||||
$table = new \Itguild\Tables\ListJsonTable($infArr);
|
||||
$table->create();
|
||||
$table->render();
|
Reference in New Issue
Block a user