/
index.php
70 lines (54 loc) · 1.61 KB
/
index.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
require_once ('init.php');
$PhoneBook = new PhoneBook();
?>
<html>
<head>
<title>Home | Agenda Telefonica</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<center>
<div id="wrapper">
<div id="menu">
<div id="search">
<form id="tfnewsearch" method="post" action="./?page=search">
<input type="text" class="tftextinput" name="search" size="60" maxlength="120" placeholder="Find Contacts">
<input type="submit" value="Search" class="tfbutton">
</form>
</div>
<form id="thnewsearch" action="./?page=add" method= "post">
<input type="submit" value="Add contact" id="add">
</form>
</div>
<div id="content">
<?php
if(isset($_GET['page']) && !empty($_GET['page'])) {
switch ($_GET['page']) {
case "add":
include (build_path(DIR_PAGES, 'add.php'));
break;
case "delete":
include (build_path(DIR_PAGES, 'delete.php'));
break;
case "search":
include (build_path(DIR_PAGES, 'list.php'));
break;
case "edit":
include (build_path(DIR_PAGES, 'edit.php'));
break;
default:
include(build_path(DIR_PAGES, 'list.php'));
break;
}
}
else {
include (build_path(DIR_PAGES, 'list.php'));
}
?>
</div>
</div>
</center>
</body>
</html>