-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
26 lines (26 loc) · 1001 Bytes
/
search.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
<?php
include('./classes/DB.php');
include('./classes/Login.php');
include('./classes/Navigation.php');
include('./classes/Content.php');
include('./classes/Page.php');
$idUser = Login::isLoggedIn();
if ($idUser != false){
$title = 'Cari soal - Tarung Soal';
$content = Content::CariSoal();
$notif = '';
if(isset($_POST['soal'])){
$content1 = Page::Title('Hasil Pencarian Soal "'.$_POST['soal'].'"',Content::HasilCariSoal($_POST['soal']));
$content = Page::BlockContent($content,$content1,'');
}elseif(isset($_POST['u'])){
$content1 = Page::Title('Hasil Pencarian Pengguna "'.$_POST['u'].'"',Content::HasilCariUser($_POST['u'],$idUser));
$content = Page::BlockContent($content,$content1,'');
}else{
$content1 = Page::Title('Soal Terbaru',Content::SoalTerbaru());
$content = Page::BlockContent($content,$content1,'');
}
echo Page::DefaultPage($title,$notif,$content);
}else{
Login::redirect('./login.php');
}
?>