-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
184 lines (180 loc) · 6.33 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRUD Firebase</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="css/vendor/font-awesome.min.css">
<link rel="stylesheet" href="css/vendor/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container-fluid">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2>CRUD <b>Firebase</b></h2>
</div>
<div class="col-sm-6">
<a href="#addEmployeeModal" class="btn btn-success" data-toggle="modal"><i
class="material-icons"></i> <span>Add New Employee</span></a>
<a href="#deleteEmployeeModal" class="btn btn-danger" data-toggle="modal"><i
class="material-icons"></i> <span>Delete</span></a>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<!-- <input type="text" id="search-name" class="form-control" placeholder="Search by name"> -->
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table id="employee-table" class="table table-striped table-hover">
<thead>
<tr>
<th>
<span class="custom-checkbox">
<input type="checkbox" id="selectAll">
<label for="selectAll"></label>
</span>
</th>
<th>Name</th>
<th>Email</th>
<th>Address</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="clearfix">
<div class="hint-text">Total of <b class="count">0</b> entries</div>
<!-- <ul class="pagination">
<li class="page-item"><a href="#" id="js-previous" class="page-link">Previous</a></li>
<li class="page-item"><a href="#" id="js-next" class="page-link">Next</a></li>
</ul> -->
</div>
<!-- <div class="readmore">
<button type="button" class="btn btn-primary js-loadmore">Load more</button>
</div> -->
</div>
</div>
<!-- Edit Modal HTML -->
<div id="addEmployeeModal" class="modal fade" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<form id="add-employee-form">
<div class="modal-header">
<h4 class="modal-title">Add Employee</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<input type="text" id="employee-name" class="form-control" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" id="employee-email" class="form-control" required>
</div>
<div class="form-group">
<label>Address</label>
<textarea id="employee-address" class="form-control" required></textarea>
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" id="employee-phone" class="form-control" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" class="btn btn-success" value="Add">
</div>
</form>
</div>
</div>
</div>
<!-- Edit Modal HTML -->
<div id="editEmployeeModal" class="modal fade" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<form id="edit-employee-form">
<div class="modal-header">
<h4 class="modal-title">Edit Employee</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<input type="text" id="employee-name" class="form-control" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" id="employee-email" class="form-control" required>
</div>
<div class="form-group">
<label>Address</label>
<textarea id="employee-address" class="form-control" required></textarea>
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" id="employee-phone" class="form-control" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" class="btn btn-info" value="Save">
</div>
</form>
</div>
</div>
</div>
<!-- Delete Modal HTML -->
<div id="deleteEmployeeModal" class="modal fade" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<form id="delete-employee-form">
<div class="modal-header">
<h4 class="modal-title">Delete Employee</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Are you sure you want to delete ?</p>
<p class="text-warning"><small>This action cannot be undone.</small></p>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" class="btn btn-danger" value="Delete">
</div>
</form>
</div>
</div>
</div>
<script src="js/vendor/jquery.min.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.4.2/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.4.2/firebase-firestore.js"></script>
<script>
var firebaseConfig = {
apiKey: "AIzaSyB-DJQEQgBgK0z6VSQJkePHP6s-AdDT3qg",
authDomain: "fir-employees-a228d.firebaseapp.com",
databaseURL: "https://fir-employees-a228d.firebaseio.com",
projectId: "fir-employees-a228d",
storageBucket: "",
messagingSenderId: "594574432902",
appId: "1:594574432902:web:658956ad1b8968d8"
};
firebase.initializeApp(firebaseConfig);
const db = firebase.firestore();
</script>
<script src="js/script.js"></script>
</body>
</html>