-
Notifications
You must be signed in to change notification settings - Fork 0
/
advanced.php
executable file
·52 lines (43 loc) · 1.56 KB
/
advanced.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
$url = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) ? 'https://' : 'http://';
$url .= $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
if(!defined('BASE_PATH')) DEFINE('BASE_PATH', realpath('.')); // For use in PHP if needed
if(!defined('BASE_URL')) DEFINE('BASE_URL', $url); // For use in client output (css and js includes for example).
$search = '';
$text_source = '';
$file_source = '';
$cipher = '';
if(isset($_REQUEST["search_text"])) $search = $_REQUEST["search_text"];
if(isset($_REQUEST["file_source"])) $file_source = $_REQUEST["file_source"];
if(isset($_REQUEST["cipher"])) $cipher = $_REQUEST["cipher"];
require_once(BASE_PATH.'/config/config.php');
if(trim($file_source) == '') {
$file_source = '';
$source_name = 'Liber Al';
} else {
$source_name = $file_source;
}
$page->search = $search;
$page->title = 'Advanced Search';
$page->cipher = $cipher;
includeClass('class_form.php');
$form = new SearchForm($search);
$form->showFiles();
$form->showCipher();
$form->cipher = $cipher;
$form->file_source = $file_source;
$form->form_action = 'advanced.php';
$page->content[] = $form;
includeClass('class_matches.php');
$matches = new Matches($search);
$matches->file_source = $file_source;
$matches->source_name = $source_name;
$matches->cipher = $cipher;
$matches->getMatches();
includeClass('class_triangle.php');
$triangle = new Triangle($search);
$triangle->cipher = $cipher;
$triangle->first_match = $matches->getFirstMatch();
$page->content[] = $triangle;
$page->content[] = $matches;
$page->renderPage();