Skip to content

About

Simple names, phones, addresses, and tags search, filter, and downloads prototype. Not intended for production use.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Directory Search UI Prototype

Simple names, phones, addresses, and tags search, filter, and downloads prototype. Not intended for production use.

Getting Started:

Serve this project directly using an HTTP server with a PHP interpreter (e.g., Apache, Nginx, or PHP's built-in development server). The main entry point is /index.php.

Quick Local Test (PHP Built-in Server):

Run the following command from the project root directory:

php -S localhost:8000 -t ./php-directory-search-ui-prototype-2020/

Then open http://localhost:8000 in your web browser.

Default ADMIN credentials:

User: admin

Password: adminpwd

Search & Filtering System:

The application supports both UI-assisted searching (via Radio Buttons) and Advanced Combined Queries directly in the input box:

1. UI Search (Radio Buttons):

Select a filter mode in the UI and type your term (the query prefix is applied automatically):

  • Dirección (Address - Default): Type any street or location (e.g., Manhattan).
  • Etiqueta (Tag/Note): Type any tag previously assigned to records.
  • Orden (Index / Range): Type a single record ID (e.g., 3) or range (e.g., 1-50).
  • Persona (Owner Name): Type a person's first or last name.
  • Teléfono (Phone): Type matching phone digits.
  • Seleccionado(s) Checkbox: Restricts results to previously selected/saved items.

2. Regex & Advanced Combined Syntax:

  • Regex Support: Enclose your regex pattern strictly between slashes /pattern/ (e.g., /Manhattan|Queens/).
    • Note: Trailing flags like /i are not supported. The pattern must strictly start and end with /.
    • UI Usage: Select a radio button (e.g., Address or Person) and type /PatternA|PatternB/.
  • Multiple Filters (AND condition): Combine fields using || in the search box (e.g., dir:/Manhattan|Queens/||nom:Jose).
  • Filter Selected Items Only: Append ||$ to any query (e.g., nom:Max||$).

Requirements:

  • PHP: 7.4 or 8.x
  • Required PHP Extensions: ext-zip (for CSV chunked exports), ext-iconv, ext-session.
  • File Permissions: Read & write permissions allowed for PHP / Web Server on /b/, /r/, and /d/ directories.

Directory Structure:

  • /b/ - Storage for serialized city database files (grouped by Area/City).
  • /d/ - Temporary storage for generated CSV/ZIP export files (auto-deleted upon download).
  • /r/ - User credentials store (u.txt).
  • /x/ - Core internal processing scripts (search engine, user management, note handlers).
  • /a/ - Static assets.

Users & Areas management UI:

  • URI: /admin.php (alias of /x/manage.php)
  • Default CFM: adminadmin

Default ADMIN access config.:

index.php

if(!isset($_SESSION['Q'])){
  # ...

  # Only ADMIN can enter to '/x/manage.php' (Management UI):
  $X['admin'] = ['A' => 'AREA/TEST', 'U' => 'adminname', 'P' => 'adminpwd'];
  
  # ...

/x/manage.php

  # ...
  
  # ADMIN must be signed in and enter the CFM string.
  $CFM = 'adminadmin';
  
  # ...

Default USERS creation example:

$users = [
  'user' => ['A' => 'AREA/TEST', 'U' => 'username', 'P' => 'userpwd']
];

file_put_contents('r/u.txt', serialize($users));

NOTE: Remember that the r/u.txt is public, so you need to hide this file from public access on server config. And DO NOT EDIT this file manually, it is serialized via serialize & unserialized via unserialize.

Default DB creation example:

session_start();

$_SESSION = ['DB' => [
  ['1234567890', 'Jose Juan Lee', 'New York Manhattan Queens', 'Prueba 1', 's'],
  ['0987654321', 'Marco Segundo Jhonson', 'San Francisco City', 'Grupo 2'],
  ['1231239876', 'Max Hesse Jr.', 'Houston Texas El Dorado', 'Prueba 3', 's'],
  ['6789321321', 'Jhon Juris Smith', 'Chicago Third Street', 'Grupo 4'],
  ['9812763454', 'Boris Salazar Durov', 'Los Angeles 8th Street', 'Prueba 5', 's'],
  ['1298347656', 'Max Power Gonzalez', 'San Diego Far Far Away Avenue', 'Grupo 6']
]];

file_put_contents('./b/AREA/TEST', session_encode());

NOTE: DO NOT EDIT these DB files manually, these files are serialized via session_encode & unserialized via session_decode.

Server Security Configuration Examples:

Apache (.htaccess inside /r/ and /b/ folders):

Require all denied

Nginx (nginx.conf block):

location ~ ^/(r|b)/ {
    deny all;
    return 404;
}

License

MIT License

Copyright (c) 2020-2026 OKZGN

About

Simple names, phones, addresses, and tags search, filter, and downloads prototype. Not intended for production use.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages