-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
152 lines (138 loc) · 4.29 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "kas";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
};
if (session_status() == PHP_SESSION_NONE) {
session_start();
};
?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cantarell&display=swap" rel="stylesheet">
<style>
body {
font-family: "Cantarell";
}
.dropbtn {
border-radius: 10px;
background-color: #0dcaf0;
color: white;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 10px;
padding-right: 10px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropbtn:hover,
.dropbtn:focus {
background-color: #00bae0;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
border-radius: 10px;
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 120px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 9px 12px;
text-decoration: none;
display: block;
}
.dropdown a:hover {
background-color: #ddd;
}
.show {
display: block;
}
.center {
text-align: center;
}
.pagination {
display: inline-block;
}
.pagination a {
border-radius: 8px;
color: black;
float: left;
padding: 4px 12px;
text-decoration: none;
transition: background-color .3s;
border: 2px solid #ddd;
margin: 0 3px;
}
.pagination a.active {
background-color: #4CAF50;
color: white;
border: 2px solid #4CAF50;
}
.pagination a:hover:not(.active) {
background-color: #ddd;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<?php
date_default_timezone_set('Asia/Jakarta');
if (!isset($_SESSION['ID'])) {
if (isset($_GET['register'])) {
$title = "Register - Kas";
include "register.php";
} else {
$title = "Login - Kas";
include "login.php";
}
} else if (isset($_GET['logout'])) {
include "logout.php";
} else {
if (!isset($_GET['menu'])) {
$_GET['menu'] = null;
}
switch ($_GET['menu']) {
case "pinjam":
$title = "Pinjam Kas - Kas";
$_SESSION["Active"] = "pinjam";
include "pinjam.php";
break;
case "daftar":
$title = "Daftar Pinjaman - Absensi";
$_SESSION["Active"] = "daftar";
include "daftar.php";
break;
case "histori":
$title = "Histori - Absensi";
$_SESSION["Active"] = "histori";
include "histori.php";
break;
default:
$title = "Home - Kas";
$_SESSION["Active"] = "home";
include "home.php";
break;
}
}
?><title><?= $title ?></title>
</html>