forked from arifkhri/dingo_angularjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_second.html
192 lines (187 loc) · 7.98 KB
/
index_second.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
185
186
187
188
189
190
191
192
<html lang="en" >
<head>
<title>Angular Study</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- cdn bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- custom css -->
<style type="text/css">
</style>
<!-- end css -->
<script src="js/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-resource/1.5.8/angular-resource.js"></script> -->
</head>
<body ng-app="employees" ng-controller="employeesCtrl">
<div class="container">
<div class="row">
<h3>Input Employees</h3>
<div class="col-xs-5">
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Name" ng-model="employee.name">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Address" ng-model="employee.address">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Birthday" ng-model="employee.birthday">
</div>
<div class="form-group">
<div class="dropdown">
<a class="dropdown-toggle" id="dropdown2" role="button" data-toggle="dropdown" data-target="#" href="#">
<div class="input-group"><input type="text" class="form-control" data-ng-model="data.dateDropDownInput"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
</div>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<datetimepicker data-ng-model="data.dateDropDownInput" data-datetimepicker-config="{ dropdownSelector: '#dropdown2' }"/>
</ul>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Gender" ng-model="employee.gender">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Email" ng-model="employee.email">
</div>
<button ng-click="save(employee)" class="btn btn-primary">Create Employee </button>
<button ng-click="index()" class="btn btn-primary">List Employee</button>
</form>
<div>{{ employees.message }}</div>
</div>
<div class="col-xs-7">
<table class="table table-hover">
<thead>
<tr>
<th width="50px">ID</th>
<th width="150px">Name</th>
<th width="150px">Email</th>
<th width="150px">Action</th>
</tr>
</thead>
<tbody style="text-align: center;">
<tr ng-repeat="employee in employees">
<td>{{ employee.id }}</td>
<td>{{ employee.name }}</td>
<td>{{ employee.address }}</td>
<td>
<button ng-click="show(employee.id)" class="btn btn-info btn-s" data-toggle="modal" data-target="#myModal">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
</button>
<button ng-click="edit(employee.id)" class="btn btn-warning btn-s" data-toggle="modal" data-target="#myModal_edit">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
</button>
<button ng-click="delete(employee.id)" class="btn btn-danger btn-s">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Button trigger modal -->
<!-- <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button> -->
<!-- Modal -->
<!-- Modal Detail -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Detail Employee</h4>
</div>
<div class="modal-body">
<table class="table table-hover" border="0">
<tr><td>ID</td><td>{{ employees.employee.id }}</td></tr>
<tr><td>Name</td><td>{{ employees.employee.name }}</td></tr>
<tr><td>Birthday</td><td>{{ employees.employee.birthday }}</td></tr>
<tr><td>Gender</td><td>{{ employees.employee.gender }}</td></tr>
<tr><td>Email</td><td>{{ employees.employee.email }}</td></tr>
<tr><td>Address</td><td>{{ employees.employee.address }}</td></tr>
</table>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> -->
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
</div>
</div>
</div>
</div>
<!-- Modal Edit -->
<div class="modal fade" id="myModal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Detail Employee</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Name" ng-model="employees.employee.name">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Address" ng-model="employees.employee.address">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Birthday" ng-model="employees.employee.birthday">
</div>
<!-- <div class="form-group">
<div class="dropdown">
<a class="dropdown-toggle" id="dropdown2" role="button" data-toggle="dropdown" data-target="#" href="#">
<div class="input-group"><input type="text" class="form-control" data-ng-model="data.dateDropDownInput"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
</div>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<datetimepicker data-ng-model="data.dateDropDownInput" data-datetimepicker-config="{ dropdownSelector: '#dropdown2' }"/>
</ul>
</div>
</div> -->
<div class="form-group">
<input type="text" class="form-control" placeholder="Gender" ng-model="employees.employee.gender">
<!-- <div class="checkbox">
<label>
<input type="checkbox" name="male" ng-model="employees.employee.gender">Pria
<input type="checkbox" name="female" ng-model="employees.employee.gender"> Wanita
</label>
</div> -->
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Email" ng-model="employees.employee.email">
</div>
<button ng-click="update(employees.employee.id)" class="btn btn-primary">Update</button>
</form>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> -->
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
</div>
</div>
</div>
</div>
<!-- js http get url serve -->
<script src="js/module-http.js" type="text/javascript"></script>
<!-- end http -->
<!-- <script src="js/routes.js" type="text/javascript"></script> -->
<!-- Your application bootstrap -->
<script type="text/javascript">
// js call modal
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').focus()
})
// js dtpicker
// $( function() {
// $( "#datepicker" ).datepicker({
// changeMonth: true,
// changeYear: true,
// dateFormat: 'yy/mm/dd'
// });
// } );
</script>
</body>
</html>