-
Notifications
You must be signed in to change notification settings - Fork 0
/
sewa.sql
232 lines (188 loc) · 6.21 KB
/
sewa.sql
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 21 Des 2020 pada 10.25
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sewa`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `akun`
--
CREATE TABLE `akun` (
`id_user` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`akses` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `akun`
--
INSERT INTO `akun` (`id_user`, `email`, `password`, `akses`) VALUES
(3, 'coba@gmail.com', '202cb962ac59075b964b07152d234b70', 'user'),
(5, 'daffa@gmail.com', '202cb962ac59075b964b07152d234b70', 'user'),
(6, 'd@g', '202cb962ac59075b964b07152d234b70', 'user'),
(10, 'abc@g', '202cb962ac59075b964b07152d234b70', 'user'),
(11, 'r@g', '202cb962ac59075b964b07152d234b70', 'user');
-- --------------------------------------------------------
--
-- Struktur dari tabel `akun_admin`
--
CREATE TABLE `akun_admin` (
`id_admin` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`akses` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `akun_admin`
--
INSERT INTO `akun_admin` (`id_admin`, `email`, `password`, `akses`) VALUES
(1, 'admin@megas.studio', '202cb962ac59075b964b07152d234b70', 'admin');
-- --------------------------------------------------------
--
-- Struktur dari tabel `data_alatdj`
--
CREATE TABLE `data_alatdj` (
`id_alatdj` int(10) NOT NULL,
`nama_alatdj` text NOT NULL,
`merk` text NOT NULL,
`harga` int(11) NOT NULL,
`status` int(1) NOT NULL,
`spesifikasi` text NOT NULL,
`foto` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `data_alatdj`
--
INSERT INTO `data_alatdj` (`id_alatdj`, `nama_alatdj`, `merk`, `harga`, `status`, `spesifikasi`, `foto`) VALUES
(1, 'XDJ 1000 MK2', 'MK2', 50000, 0, 'Belum diisi', 'gambar/def.png'),
(3, 'DJM 750 MK2', 'MK2', 50000, 0, '<p>1. Speaker Mantep</p>\r\n<p>2. Boost</p>', 'gambar/virus.png'),
(6, 'test123', 'test123', 123456, 1, '<p>123test</p>', 'gambar/pamunqkas_94419650_166409528191424_5101485317151165621_n.jpg');
-- --------------------------------------------------------
--
-- Struktur dari tabel `data_user`
--
CREATE TABLE `data_user` (
`nama` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`id_user` int(11) NOT NULL,
`alamat` text NOT NULL,
`hp` text NOT NULL,
`foto` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `data_user`
--
INSERT INTO `data_user` (`nama`, `email`, `id_user`, `alamat`, `hp`, `foto`) VALUES
('Daffa', 'coba@gmail.com', 3, 'Solok', '0812345678910', 'gambar/pamunqkas_94419650_166409528191424_5101485317151165621_n.jpg'),
('Daffa Qil', 'daffa@gmail.com', 5, '', '0', 'gambar/default.png'),
('daf', 'd@g', 6, '', '0', 'gambar/default.png'),
('abc', 'abc@g', 10, 'abc', '123', 'gambar/default.png'),
('rubah', 'r@g', 11, 'abc', '123', 'gambar/plot graph.png');
-- --------------------------------------------------------
--
-- Struktur dari tabel `sewa`
--
CREATE TABLE `sewa` (
`id_sewa` int(11) NOT NULL,
`tgl_sewa` date NOT NULL,
`durasi_sewa` varchar(20) CHARACTER SET latin1 NOT NULL,
`tgl_kembali` date NOT NULL,
`tgl_dikembalikan` date NOT NULL,
`denda` int(11) NOT NULL,
`total_sewa` int(11) NOT NULL,
`lunas` int(1) NOT NULL,
`id_user` int(11) NOT NULL,
`id_alatdj` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `sewa`
--
INSERT INTO `sewa` (`id_sewa`, `tgl_sewa`, `durasi_sewa`, `tgl_kembali`, `tgl_dikembalikan`, `denda`, `total_sewa`, `lunas`, `id_user`, `id_alatdj`) VALUES
(1, '2020-12-14', '+2 day', '2020-12-16', '2020-12-13', 0, 100000, 1, 3, 1),
(2, '2020-12-15', '+1 day', '2020-12-16', '2020-12-17', 10000, 50000, 1, 3, 1),
(3, '2020-12-15', '+1 day', '2020-12-16', '2020-12-17', 10000, 50000, 1, 3, 3);
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `akun`
--
ALTER TABLE `akun`
ADD PRIMARY KEY (`id_user`);
--
-- Indeks untuk tabel `akun_admin`
--
ALTER TABLE `akun_admin`
ADD PRIMARY KEY (`id_admin`);
--
-- Indeks untuk tabel `data_alatdj`
--
ALTER TABLE `data_alatdj`
ADD PRIMARY KEY (`id_alatdj`);
--
-- Indeks untuk tabel `data_user`
--
ALTER TABLE `data_user`
ADD KEY `data_user_ibfk_1` (`id_user`);
--
-- Indeks untuk tabel `sewa`
--
ALTER TABLE `sewa`
ADD PRIMARY KEY (`id_sewa`),
ADD KEY `id_user` (`id_user`),
ADD KEY `id_alatdj` (`id_alatdj`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `akun`
--
ALTER TABLE `akun`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT untuk tabel `akun_admin`
--
ALTER TABLE `akun_admin`
MODIFY `id_admin` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `data_alatdj`
--
ALTER TABLE `data_alatdj`
MODIFY `id_alatdj` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT untuk tabel `sewa`
--
ALTER TABLE `sewa`
MODIFY `id_sewa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `data_user`
--
ALTER TABLE `data_user`
ADD CONSTRAINT `data_user_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `akun` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `sewa`
--
ALTER TABLE `sewa`
ADD CONSTRAINT `sewa_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `akun` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `sewa_ibfk_2` FOREIGN KEY (`id_alatdj`) REFERENCES `data_alatdj` (`id_alatdj`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;