pay_request.pt
15.2 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<html metal:use-macro="load: base.pt">
<div metal:fill-slot="content">
<style>
button {
margin:0px 3px;
}
#main{min-height: 1px;
padding-bottom: 1px;}
</style>
<form method="post" accept-charset="utf-8" id="deform" class="form-horizontal"
enctype="multipart/form-data"
style="background-color:white;"
autocomplete="off">
<div class="panel-body col-md-6">
<div class="col-md-12" style="padding-left: 0px; padding-right: 0px; margin-bottom: 5px;">
<button id="btn_submit" class="btn btn-primary" type="submit" name="lanjut" value="Lanjut">Lanjutkan Pembayaran ></button>
</div>
<div class="col-md-12 col-xs-12 well">
<!-- Proses Template Form -->
<input type="hidden" name="_charset_">
<input type="hidden" value="deform" name="__formid__">
<!-- Tampilan untuk general error -->
<div tal:define="field formParams" class="alert alert-danger" tal:condition="field.error">
<div class="errorMsgLbl" i18n:translate="">
Terdapat kesalahan pengisian
</div>
<p class="errorMsg">${field.errormsg}</p>
</div>
<!-- END Tampilan untuk general error -->
<div class="col-md-12">
<!-- Looping Semua Field-->
<div tal:repeat="f formParams">
<div tal:condition="f.widget.hidden">
<!-- Proses Saat Field hidden-->
${structure:f.serialize()}
</div>
<div tal:condition="not f.widget.hidden and not f.children"
class="form-group" >
<!-- Proses Saat Field Normal dan bukan Children-->
<!-- Field Reqired menggunakan class required -->
<label for="${f.oid}"
class="control-label col-md-4 ${f.required and 'required' or ''}"
id="req-${f.oid}">
${f.title}</label>
<div class="col-md-8">
${structure:f.serialize()}
<p tal:condition="f.error" id="error-${f.oid}" class="help-block"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 panel panel-default" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title">Biller</h3>
</div>
<div class="panel-body">
<input type="hidden" name="_charset_">
<input type="hidden" value="deform" name="__formid__">
<!-- Tampilan untuk general error -->
<div tal:define="field formBiller" class="alert alert-danger" tal:condition="field.error">
<div class="errorMsgLbl" i18n:translate="">
Terdapat kesalahan pengisian
</div>
<p class="errorMsg">${field.errormsg}</p>
</div>
<!-- END Tampilan untuk general error -->
<div class="col-md-12">
<!-- Looping Semua Field-->
<div tal:repeat="f formBiller">
<div tal:condition="f.widget.hidden">
<!-- Proses Saat Field hidden-->
${structure:f.serialize()}
</div>
<div tal:condition="not f.widget.hidden and not f.children"
class="form-group" >
<!-- Proses Saat Field Normal dan bukan Children-->
<!-- Field Reqired menggunakan class required -->
<label for="${f.oid}"
class="control-label col-md-4 ${f.required and 'required' or ''}"
id="req-${f.oid}">
${f.title}</label>
<div class="col-md-8">
${structure:f.serialize()}
<p tal:condition="f.error" id="error-${f.oid}" class="help-block"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 panel panel-default" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title">Deliver To</h3>
</div>
<div class="panel-body">
<input type="hidden" name="_charset_">
<input type="hidden" value="deform" name="__formid__">
<!-- Tampilan untuk general error -->
<div tal:define="field formDeliver" class="alert alert-danger" tal:condition="field.error">
<div class="errorMsgLbl" i18n:translate="">
Terdapat kesalahan pengisian
</div>
<p class="errorMsg">${field.errormsg}</p>
</div>
<!-- END Tampilan untuk general error -->
<div class="col-md-12">
<!-- Looping Semua Field-->
<div tal:repeat="f formDeliver">
<div tal:condition="f.widget.hidden">
<!-- Proses Saat Field hidden-->
${structure:f.serialize()}
</div>
<div tal:condition="not f.widget.hidden and not f.children"
class="form-group" >
<!-- Proses Saat Field Normal dan bukan Children-->
<!-- Field Reqired menggunakan class required -->
<label for="${f.oid}"
class="control-label col-md-4 ${f.required and 'required' or ''}"
id="req-${f.oid}">
${f.title}</label>
<div class="col-md-8">
${structure:f.serialize()}
<p tal:condition="f.error" id="error-${f.oid}" class="help-block"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 panel panel-default" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title">Server</h3>
</div>
<div class="panel-body">
<input type="hidden" name="_charset_">
<input type="hidden" value="deform" name="__formid__">
<!-- Tampilan untuk general error -->
<div tal:define="field formDeliver" class="alert alert-danger" tal:condition="field.error">
<div class="errorMsgLbl" i18n:translate="">
Terdapat kesalahan pengisian
</div>
<p class="errorMsg">${field.errormsg}</p>
</div>
<!-- END Tampilan untuk general error -->
<div class="col-md-12">
<!-- Looping Semua Field-->
<div tal:repeat="f formServer">
<div tal:condition="f.widget.hidden">
<!-- Proses Saat Field hidden-->
${structure:f.serialize()}
</div>
<div tal:condition="not f.widget.hidden and not f.children"
class="form-group" >
<!-- Proses Saat Field Normal dan bukan Children-->
<!-- Field Reqired menggunakan class required -->
<label for="${f.oid}"
class="control-label col-md-4 ${f.required and 'required' or ''}"
id="req-${f.oid}">
${f.title}</label>
<div class="col-md-8">
${structure:f.serialize()}
<p tal:condition="f.error" id="error-${f.oid}" class="help-block"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-12 panel panel-default" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title">Customer</h3>
</div>
<div class="panel-body">
<input type="hidden" name="_charset_">
<input type="hidden" value="deform" name="__formid__">
<!-- Tampilan untuk general error -->
<div tal:define="field formCustomer" class="alert alert-danger" tal:condition="field.error">
<div class="errorMsgLbl" i18n:translate="">
Terdapat kesalahan pengisian
</div>
<p class="errorMsg">${field.errormsg}</p>
</div>
<!-- END Tampilan untuk general error -->
<div class="col-md-12">
<!-- Looping Semua Field-->
<div tal:repeat="f formCustomer">
<div tal:condition="f.widget.hidden">
<!-- Proses Saat Field hidden-->
${structure:f.serialize()}
</div>
<div tal:condition="not f.widget.hidden and not f.children"
class="form-group" >
<!-- Proses Saat Field Normal dan bukan Children-->
<!-- Field Reqired menggunakan class required -->
<label for="${f.oid}"
class="control-label col-md-4 ${f.required and 'required' or ''}"
id="req-${f.oid}">
${f.title}</label>
<div class="col-md-8">
${structure:f.serialize()}
<p tal:condition="f.error" id="error-${f.oid}" class="help-block"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="padding-left: 0px; padding-right: 0px;" class="col-md-12 panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Produk</h3>
</div>
<div class="panel-body">
<div tal:define="fieldItem formCart['count']" id="item-${fieldItem.oid}">
<label for="${fieldItem.oid}" class="control-label col-md-3 required" id="req-${fieldItem.oid}">
${fieldItem.title}</label>
<div class="col-md-5">
${structure:fieldItem.serialize()}
<p id="error-${fieldItem.oid}" class="help-block" tal:condition="fieldItem.error" tal:repeat="error fieldItem.error.messages()">${error}</p>
</div>
<button tal:repeat="fb formCart.buttons" type="${fb.type}"
class="btn ${fb.css_class} "
name="${fb.name}" id="${fb.name}">${fb.title}</button>
</div>
<div class="col-md-12" id="itemsnya">
</div>
</div>
</div>
</div>
</form>
</div>
<div metal:fill-slot="scripts">
<script>
var detdet = ${itemDet};
$(document).ready(function () {
$("[name=count]").prop("readonly", true);
// $("[name=count]").prop("style", "width: 100px;");
$("#deform").each(function(){
$(this).find(':input').attr("required", "required"); //<-- Should return all input elements in that specific form.
});
$("[name=description]").removeAttr("required", "");
$("[name=address_biller]").removeAttr("required", "");
$("[name=email_deliver]").removeAttr("required", "");
$("[name=address_deliver]").removeAttr("required", "");
$("[name=domain_server]").removeAttr("required", "");
$("[name=ip_server]").removeAttr("required", "");
$("[name=address_cust]").removeAttr("required", "");
// $("[name=req_dt]").prop("style", "width: 150px;");
// $("[name=req_dt]").datepicker({
// format: 'dd-mm-yyyy',
// autoclose: true
// });
// $("[name=req_tm]").prop("style", "width: 100px;");
// $("[name=req_tm]").clockpicker();
})
function a(){
}
function getItemsCount(){
return $("#itemsnya #judul")['length'];
}
function removeItem(idnya){
$("#" + idnya).remove();
$("[name=count]").val(getItemsCount());
}
function doAdditem(cnt = 0, jml = 0){
$("#itemsnya").append(
`<div class="col-md-12" id="pack-`+cnt+`">`+
`<legend id="judul"></legend>`+
`<button type="button" onclick="removeItem('pack-`+cnt+`')">Hapus</button> `+
`<div tal:define="fieldItem formItemCart['img_url']" id="item-${fieldItem.oid}">`+
`<div class="col-md-8">`+
`<input type="text" name="${fieldItem.name}-`+cnt+`" value="" id="${fieldItem.name}-`+cnt+`">`+
`</div>`+
`</div>`+
`<br></br>`+
`<div tal:define="fieldItem formItemCart['goods_name']" id="item-${fieldItem.oid}">`+
`<label for="${fieldItem.oid}" class="control-label col-md-4 required" id="req-${fieldItem.oid}">`+
`${fieldItem.title}</label>`+
`<div class="col-md-8">`+
`<select class="form-control" name="${fieldItem.name}-`+cnt+`" id="${fieldItem.name}-`+cnt+`" required="required">`+
`<option disabled selected value> -- pilih produk -- </option>`+
`<option tal:repeat="item produks" value="${item[1]}">${item[1]}</option>`+
`</select>`+
`<p id="error-${fieldItem.oid}" class="help-block" tal:condition="fieldItem.error" tal:repeat="error fieldItem.error.messages()">${error}</p>`+
`</div>`+
`</div>`+
`<br></br>`+
`<div tal:define="fieldItem formItemCart['goods_detail']" id="item-${fieldItem.oid}">`+
`<label for="${fieldItem.oid}" class="control-label col-md-4" id="req-${fieldItem.oid}">`+
`${fieldItem.title}</label>`+
`<div class="col-md-8">`+
`<input type="text" class="form-control" id="${fieldItem.name}-`+cnt+`" name="${fieldItem.name}-`+cnt+`" value="" readonly="">`+
`<p id="error-${fieldItem.oid}" class="help-block" tal:condition="fieldItem.error" tal:repeat="error fieldItem.error.messages()">${error}</p>`+
`</div>`+
`</div>`+
`<br></br>`+
`<div tal:define="fieldItem formItemCart['goods_amt']" id="item-${fieldItem.oid}">`+
`<label for="${fieldItem.oid}" class="control-label col-md-4" id="req-${fieldItem.oid}">`+
`${fieldItem.title}</label>`+
`<div class="col-md-8" style="width: 150px;">`+
`<input type="text" class="form-control" id="${fieldItem.name}-`+cnt+`" name="${fieldItem.name}-`+cnt+`" value="" readonly="">`+
`<p id="error-${fieldItem.oid}" class="help-block" tal:condition="fieldItem.error" tal:repeat="error fieldItem.error.messages()">${error}</p>`+
`</div>`+
`</div>`+
`</div>`
);
var itemControl = $("#${formItemCart['goods_name'].name}-" + cnt);
var detailControl = $("#${formItemCart['goods_detail'].name}-" + cnt);
var hargaControl = $("#${formItemCart['goods_amt'].name}-" + cnt);
$(itemControl).change(function () {
var selectedIndex = itemControl.find(":selected").index();
detailControl.val(${itemDet}[selectedIndex][1]);
hargaControl.val(${itemDet}[selectedIndex][2]);
});
}
$("#add_item").click(function (){
doAdditem(Math.random().toString(36).substr(2, 5), getItemsCount() + 1);
$("[name=count]").val(getItemsCount());
})
</script>
</div>
</html>