-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient_services_renew.pdt
65 lines (60 loc) · 2.57 KB
/
client_services_renew.pdt
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
<?php
$this->Form->create(null, ['id' => 'renew_service']);
?>
<div class="modal-header">
<h5 class="global_modal_title"><?php $this->_('ClientServices.renew.heading_renew');?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="renew_message alert alert-warning" style="display: none;"></div>
<?php
if ($client_can_change_term ?? false == 'true') {
?>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientServices.renew.field_pricing_id', true), 'pricing_id');
$this->Form->fieldSelect('pricing_id', ($terms ?? []), ($vars->term ?? $service->pricing_id), ['id' => 'pricing_id', 'class' => 'form-control']);
?>
</div>
<?php
} else {
$this->Form->fieldHidden('pricing_id', ($service->pricing_id ?? null));
}
?>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientServices.renew.field_password', true), 'password');
$this->Form->fieldPassword('password', ['id' => 'password', 'class' => 'form-control']);
?>
</div>
</div>
<div class="modal-footer">
<?php
$this->Form->fieldButton('cancel', $this->_('ClientServices.renew.field_renew_cancel', true), ['class' => 'btn btn-light', 'data-dismiss' => 'modal']);
$this->Form->fieldButton('submit', $this->_('ClientServices.renew.field_renew_submit', true), ['class' => 'btn btn-primary', 'type' => 'submit']);
?>
</div>
<?php
$this->Form->end();
?>
<script type="text/javascript">
$(document).ready(function() {
setRenewMessage();
$("#renew_service select[name='pricing_id']").change(function() {
setRenewMessage();
});
function setRenewMessage() {
var messages = <?php echo json_encode($renew_messages ?? []); ?>;
var pricing_id = $("#renew_service select[name='pricing_id']").val();
if (pricing_id == null || pricing_id == '') {
$("div.renew_message").hide();
return;
}
$("div.renew_message").hide();
$("div.renew_message").text(messages[pricing_id]);
$("div.renew_message").show();
}
});
</script>