1
- <!DOCTYPE html >
2
- < html >
3
- < body >
4
- < head >
5
- < link rel =" stylesheet " type =" text/css " href =" css/style.css " >
6
- < script src ="https ://unpkg .com/axios/ dist/axios .min.js "> </ script >
7
- < script src ="js/app.js "> </ script >
8
- </ head >
9
- < h1 > Workshop Fundamentos </ h1 >
10
-
11
- < div ng-app =" bankApp ">
12
- < div align =" center " ng-controller =" bankCtrl ">
13
- < table border =" 1 ">
14
- < tr ng-repeat =" user in users | orderBy: balance " >
15
- < td class ="name " > < label > </ label > </ td >
16
- < td class ="balance " > < label > </ label > </ td >
17
- < td > < a href =" # " ng-click =" remove(user) " > Delete </ a > </ td >
18
- < td > < a href =" # " ng-click =" edit(user) " > Edit </ a > </ td >
19
- </ tr >
20
- </ table >
21
- < hr >
22
- < ul >
23
- < li >
24
- Name: < input type =" text " id ="name " ng-model =" current.name " value ="" />
25
- < br >
26
- Balance: < input type =" text " id =" balance " ng-model =" current.balance " value ="" />
27
- < br >
28
- </ li >
29
- < li >
30
- < button ng-click =" save(current) " > Save </ button >
31
- < button ng-click =" addNew(current) " > Add New User </ button >
32
- </ li >
33
- </ ul >
1
+ < script src =" http://code.jquery.com/jquery-1.11.1.min.js " > </ script >
2
+ < script src =" http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js " > </ script >
3
+ < link href =" http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css " rel =" stylesheet " id =" bootstrap-css " >
4
+ < script src =" http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js " > </ script >
5
+ < script src =" https://unpkg.com/[email protected] /dist/axios.min.js " > </ script >
6
+ < script src ="http ://getbootstrap .com/dist/js/bootstrap .min.js "> </ script >
7
+ < script src ="./ js/app.js "> </ script >
8
+
9
+
10
+ <!------ Table list ---------->
11
+ < div class =" container ">
12
+ < div class =" row ">
13
+ < div class =" col-md-12 ">
14
+ < h4 > Item list </ h4 >
15
+ < div class ="table-responsive " >
16
+ < table id =" mytable " class ="table table-bordred table-striped " >
17
+ < thead >
18
+ < th > Item </ th >
19
+ < th > Quantity </ th >
20
+ < th > Price </ th >
21
+ < th > Edit </ th >
22
+ < th > Delete </ th >
23
+ </ thead >
24
+ < tbody id ="tableBody " >
25
+ < tr > < td >
26
+ < p data-placement =" top " data-toggle =" tooltip " title =" Add " > < button class =" btn btn-secondary btn-xs " data-title =" Add "
27
+ data-toggle =" modal " data-target =" #add " > < span class =" glyphicon glyphicon-plus " > </ span > </ button > </ p >
28
+ </ td >
29
+ </ tr >
30
+ </ tbody >
31
+ </ table >
32
+ < div class =" clearfix " > </ div >
33
+ </ div >
34
34
</ div >
35
35
</ div >
36
+ </ div >
37
+
38
+ <!------ Total ---------->
39
+ < div class ="container ">
40
+ < div class ="row ">
41
+ < p id ="total "> Total:0</ p >
42
+ </ div >
43
+ </ div >
44
+
45
+
46
+ <!------ Modal add ---------->
47
+ < div class ="modal fade " id ="add " tabindex ="-1 " role ="dialog " aria-labelledby ="edit " aria-hidden ="true ">
48
+ < div class ="modal-dialog ">
49
+ < div class ="modal-content ">
50
+ < div class ="modal-header ">
51
+ < button type ="button " class ="close " data-dismiss ="modal " aria-hidden ="true "> < span class ="glyphicon glyphicon-remove "
52
+ aria-hidden ="true "> </ span > </ button >
53
+ < h4 class ="modal-title custom_align " id ="Heading "> Add Item</ h4 >
54
+ </ div >
55
+ < div class ="modal-body ">
56
+ < div class ="form-group ">
57
+ < input id ="addName " class ="form-control " type ="text " placeholder ="item ">
58
+ </ div >
59
+ < div class ="form-group ">
60
+
61
+ < input id ="addQuantity " class ="form-control " type ="text " placeholder ="quantity ">
62
+ </ div >
63
+ < div class ="form-group ">
64
+ < input id ="addPrice " class ="form-control " type ="text " placeholder ="price ">
65
+ </ div >
66
+ </ div >
67
+ < div class ="modal-footer ">
68
+ < button type ="button " onclick ="add(document.getElementById('addName').value,document.getElementById('addQuantity').value,document.getElementById('addPrice').value) " class ="btn btn-warning btn-lg " style ="width: 100%; "> < span class ="glyphicon glyphicon-ok-sign "> </ span > Create</ button >
69
+ </ div >
70
+ </ div >
71
+ <!-- /.modal-content -->
72
+ </ div >
73
+ <!-- /.modal-dialog -->
74
+ </ div >
75
+
36
76
37
- </ body >
38
- </ html >
77
+
78
+ <!------ Modal edit ---------->
79
+ < div class ="modal fade " id ="edit " tabindex ="-1 " role ="dialog " aria-labelledby ="edit " aria-hidden ="true ">
80
+ < div class ="modal-dialog ">
81
+ < div class ="modal-content ">
82
+ < div class ="modal-header ">
83
+ < button type ="button " class ="close " data-dismiss ="modal " aria-hidden ="true "> < span class ="glyphicon glyphicon-remove "
84
+ aria-hidden ="true "> </ span > </ button >
85
+ < h4 class ="modal-title custom_align " id ="Heading "> Edit Item</ h4 >
86
+ </ div >
87
+ < div class ="modal-body ">
88
+ < div class ="form-group ">
89
+ < input id ="editName " class ="form-control " type ="text " placeholder ="item ">
90
+ </ div >
91
+ < div class ="form-group ">
92
+
93
+ < input id ="editQuantity " class ="form-control " type ="text " placeholder ="quantity ">
94
+ </ div >
95
+ < div class ="form-group ">
96
+ < input id ="editPrice " class ="form-control " placeholder ="price ">
97
+ </ div >
98
+ </ div >
99
+ < div class ="modal-footer ">
100
+ < button type ="button " onclick ="edit(document.getElementById('editName').value,document.getElementById('editQuantity').value,document.getElementById('editPrice').value) " class ="btn btn-warning btn-lg " style ="width: 100%; "> < span class ="glyphicon glyphicon-ok-sign "> </ span > Update</ button >
101
+ </ div >
102
+ </ div >
103
+ <!-- /.modal-content -->
104
+ </ div >
105
+ <!-- /.modal-dialog -->
106
+ </ div >
107
+
108
+
109
+ <!------ Modal delete ---------->
110
+ < div class ="modal fade " id ="delete " tabindex ="-1 " role ="dialog " aria-labelledby ="edit " aria-hidden ="true ">
111
+ < div class ="modal-dialog ">
112
+ < div class ="modal-content ">
113
+ < div class ="modal-header ">
114
+ < button type ="button " class ="close " data-dismiss ="modal " aria-hidden ="true "> < span class ="glyphicon glyphicon-remove "
115
+ aria-hidden ="true "> </ span > </ button >
116
+ < h4 class ="modal-title custom_align " id ="Heading "> Delete this entry</ h4 >
117
+ </ div >
118
+ < div class ="modal-body ">
119
+ < div class ="alert alert-danger "> < span class ="glyphicon glyphicon-warning-sign "> </ span > Are you sure you want to delete
120
+ this Record?</ div >
121
+ </ div >
122
+ < div class ="modal-footer ">
123
+ < button type ="button " onclick ="deleteItem() " class ="btn btn-success "> < span class ="glyphicon glyphicon-ok-sign "> </ span > Yes</ button >
124
+ < button type ="button " class ="btn btn-default " data-dismiss ="modal "> < span class ="glyphicon glyphicon-remove "> </ span > No</ button >
125
+ </ div >
126
+ </ div >
127
+ <!-- /.modal-content -->
128
+ </ div >
129
+ <!-- /.modal-dialog -->
130
+ </ div >
0 commit comments