forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_package.html
More file actions
419 lines (405 loc) · 23.5 KB
/
edit_package.html
File metadata and controls
419 lines (405 loc) · 23.5 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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
<div class="l-center edit">
<div class="l-sort clearfix">
<div class="l-sort-toolbar clearfix float-left">
<span class="title edit"><b><?=__('Editing Package')?></b></span>
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
}
}
?>
</div>
</div>
<? display_error_block() ?>
</div>
<div class="l-separator"></div>
<!-- /.l-separator -->
<div class="l-center">
<?php
$back = getenv("HTTP_REFERER");
if (empty($back)) {
$back = "location.href='/list/package/'";
} else {
$back = "location.href='".$back."'";
}
?>
<form id="vstobjects" name="v_edit_package" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<table class='data'>
<tr class="data-add">
<td class="data-dotted">
<table class="data-col1">
<tr>
<td>
<a class="data-date"><?=translate_date($v_date)?></a><br>
<a class="data-date"><?=$v_time?></a>
</td>
</tr>
<tr><td class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>
</table>
</td>
<td class="data-dotted">
<table class="data-col2">
<tr>
<td class="vst-text step-top">
<?php print __('Package Name');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_package" <?php if (!empty($v_package)) echo "value=".htmlentities($v_package); ?> disabled >
<input type="hidden" name="v_package" <?php if (!empty($v_package)) echo "value=".htmlentities($v_package); ?>>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Web Template') . " <span class='optional'> " .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_web_template">
<?php
foreach ($web_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
if ((!empty($v_web_template)) && ( $value == $v_web_template)){
echo ' selected' ;
}
if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
echo ' selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Backend Template') . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_backend_template">
<?php
foreach ($backend_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
echo ' selected' ;
}
if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Proxy Template') . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_proxy_template">
<?php
foreach ($proxy_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
echo ' selected' ;
}
if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
echo ' selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<tr>
<td class="vst-text input-label">
<?php print __('DNS Template') . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_dns_template">
<?php
foreach ($dns_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
echo ' selected' ;
}
if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
echo ' selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('SSH Access');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_shell">
<?php
foreach ($shells as $key => $value) {
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
if ((!empty($v_shell)) && ( $value == $v_shell)){
echo ' selected' ;
}
if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
echo ' selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Web Domains');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_web_domains" <?php if (isset($v_web_domains)) echo "value=".htmlentities($v_web_domains); ?>>
<img class="unlim-trigger" id="unlim-web-domains" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Web Aliases');?> <span class="optional">(<?=__('per domain')?>)</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_web_aliases" <?php if (isset($v_web_aliases)) echo "value=".htmlentities($v_web_aliases); ?>>
<img id="unlim-web-aliases" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('DNS domains');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_dns_domains" <?php if (isset($v_dns_domains)) echo "value=".htmlentities($v_dns_domains); ?>>
<img id="unlim-dns-domain" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('DNS records');?> <span class="optional">(<?=__('per domain')?>)</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_dns_records" <?php if (isset($v_dns_records)) echo "value=".htmlentities($v_dns_records); ?>>
<img id="unlim-dns-records" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Mail Domains');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_mail_domains" <?php if (isset($v_mail_domains)) echo "value=".htmlentities($v_mail_domains); ?>>
<img id="unlim-mail-domains" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Mail Accounts');?> <span class="optional">(<?=__('per domain')?>)</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_mail_accounts" <?php if (isset($v_mail_accounts)) echo "value=".htmlentities($v_mail_accounts); ?>>
<img id="unlim-mail-accounts" class="unlim-trigger" src="/images/unlim.png" />
<td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Databases');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_databases" <?php if (isset($v_databases)) echo "value=".htmlentities($v_databases); ?>>
<img id="unlim-databases" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Cron Jobs');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_cron_jobs" <?php if (isset($v_cron_jobs)) echo "value=".htmlentities($v_cron_jobs); ?>>
<img id="unlim-cron-jobs" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Backups');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_backups" <?php if (isset($v_backups)) echo "value=".htmlentities($v_backups); ?>>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Quota');?> <span class="optional">(<?=__('in megabytes')?>)</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_disk_quota" <?php if (isset($v_disk_quota)) echo "value=".htmlentities($v_disk_quota); ?>>
<img id="unlim-disk-quota" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Bandwidth');?> <span class="optional">(<?=__('in megabytes')?>)</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_bandwidth" <?php if (isset($v_bandwidth)) echo "value=".htmlentities($v_bandwidth); ?>>
<img name="unlim-bandwidth" class="unlim-trigger" src="/images/unlim.png" />
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Name Servers');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns1" <?php if (!empty($v_ns1)) echo "value=".htmlentities($v_ns1); ?>>
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns2" <?php if (!empty($v_ns2)) echo "value=".htmlentities($v_ns2); ?>>
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>
<? if($v_ns3)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns3" value="'.htmlentities($v_ns3).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
if($v_ns4)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns4" value="'.htmlentities($v_ns4).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
if($v_ns5)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns5" value="'.htmlentities($v_ns5).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
if($v_ns6)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns6" value="'.htmlentities($v_ns6).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
if($v_ns7)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns7" value="'.htmlentities($v_ns7).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
if($v_ns8)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns8" value="'.htmlentities($v_ns8).'">
<span class="remove-ns additional-control delete">delete</span>
</td>
</tr>';
?>
<tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
<td class="step-top-small">
<span class="add-ns-button additional-control add">Add one more Name Server</span>
</td>
</tr>
</table>
<table class="data-col2">
<tr>
<td class="step-top" width="116px">
<input type="submit" class="button" name="save" value="<?php print __('Save');?>">
</td>
<td class="step-top">
<input type="button" class="button cancel" value="<?php print __('Back');?>" onclick="<?php echo $back ?>">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<script type="text/javascript" src="/js/pages/edit.package.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>