-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
216 lines (181 loc) · 7.51 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
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
<html>
<head><title>Feature Requests</title>
<!-- JQuery-->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- Bootstrap-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- Moment JS-->
<script type="application/javascript" src="bower_components/moment/moment.js"></script>
<!-- Datetimepicker-->
<script type="application/javascript" src="bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css">
<!-- KnockoutJS-->
<script type="application/javascript" src="js/knockout-3.3.0.debug.js"></script>
<script type="application/javascript" src="js/knockout.mapping-latest.debug.js"></script>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.8/css/jquery.dataTables.css">
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.8/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function () {
function Option(data) {
this.value = ko.observable(data.id);
this.text = ko.observable(data.name);
}
function viewModel() {
var self = this;
self.clients = ko.observableArray([]);
self.clientList = ko.observable();
self.priorities = ko.observableArray([]);
self.products = ko.observableArray([]);
$.getJSON("./api/requests.php/clients", function (data) {
var mappedTasks = $.map(data, function (item) {
return new Option(item)
});
self.clients(mappedTasks);
});
self.clientList.subscribe(function (selected) {
var apiUrl = "./api/requests.php/priorities/" + selected;
$.getJSON(apiUrl, function (data) {
var mappedTasks = $.map(data, function (item) {
return new Option(item)
});
self.priorities(mappedTasks);
});
}, self);
$.getJSON("./api/requests.php/products", function (data) {
// alert(data);
var mappedTasks = $.map(data, function (item) {
return new Option(item)
});
self.products(mappedTasks);
});
}
ko.applyBindings(new viewModel());
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#datepicker').datetimepicker({
format: 'YYYY-MM-DD'
});
oTable = $("#table").DataTable({
"processing": true,
"serverSide": false,
"ajax": "./api/requests.php/requests/datatable",
"columnDefs": [
{
"targets": [0],
"visible": false,
"searchable": false
},
{
"targets": [3],
"visible": false,
"searchable": false
},
{
"targets": [8],
"visible": false
}
]
});
});
</script>
</head>
<body>
<div class="container-fluid">
<div class="text-center col-md-4 col-md-offset-4">
<h1>Feature Request</h1>
<form action="controllers/featureController.php" method="post" role="form">
<input type="hidden" name="action" value="addNewFeatureRequest"/>
<div class="row">
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" class="form-control" required/>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="description">Description</label>
<textarea name="description" class="form-control" required></textarea>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="client">Client</label>
<select name="client"
data-bind="value: clientList, options: clients, optionsText:'text', optionsValue:'value'"
class="form-control">
</select>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="priority">Client Priority</label>
<select name="priority"
data-bind="options: priorities, optionsText:'text', optionsValue:'value'"
class="form-control"></select>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="date">Target Date:</label>
<div class='input-group date' id='datepicker'>
<input type='text' name="date" class="form-control" required/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="url">Ticket URL</label>
<input type="text" name="url" class="form-control"/>
</div>
</div>
<div class="row">
<div class="form-group">
<label for="nama">Product Area</label>
<select name="product"
data-bind="options: products, optionsText:'text', optionsValue:'value'"
class="form-control">
</div>
</div>
<div class="row">
<div class="form-group">
<div class="">
<input type="submit" class="form-login btn btn-md btn-primary btn-block"/>
</div>
</div>
</div>
</form>
</div>
<div class="text-center col-md-12">
<hr>
<h2>Requests Submitted</h2>
</div>
<div class="row col-md-12">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="table">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Desc</th>
<th>client_id</th>
<th>Client</th>
<th>Priority</th>
<th>Target Date</th>
<th>Ticket URL</th>
<th>product_id</th>
<th>Product</th>
</tr>
</thead>
</table>
</div>
</div>
</body>
</html>