-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_services_changeterm.pdt
79 lines (73 loc) · 3.42 KB
/
client_services_changeterm.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<div class="col-md-3">
<?php echo $this->Html->ifSet($tabs);?>
</div>
<div class="col-md-9">
<?php echo $this->Html->ifSet($message);?>
<?php
if (!empty($unpaid_invoices) && is_array($unpaid_invoices)) {
$num_invoices = count($unpaid_invoices);
?>
<div class="alert alert-warning">
<p><?php $this->_('ClientServices.!warning.invoices_change_term');?></p>
<p><a id="upgrade_pay_invoices" class="btn btn-warning" href="<?php echo ($num_invoices == 1 ? $this->base_uri . 'pay/method/' . $this->Html->ifSet($unpaid_invoices[0]->id) : '#');?>"><i class="fas fa-exclamation-triangle fa-fw"></i> <?php $this->_('ClientServices.upgrade.btn_make_payment');?></a></p>
</div>
<?php
}
$this->WidgetClient->clear();
$this->WidgetClient->create($this->_('ClientServices.change_term.boxtitle', true, $this->Html->ifSet($package->name), $this->Html->ifSet($service->name)), ['id' => 'client_change_term'], $this->Html->ifSet($render_section, null));
$this->WidgetClient->startBody();
$this->Form->create(null, ['id' => 'change_service_term', 'class' => 'disable-on-submit']);
?>
<div class="form-group">
<?php $this->Form->label($this->_('ClientServices.change_term.field_current_term', true));?>
<p><?php $this->Html->_($current_term);?></p>
</div>
<div class="form-group">
<?php
$this->Form->label($this->_('ClientServices.change_term.field_pricing_id', true), 'pricing_id');
$this->Form->fieldSelect('pricing_id', $this->Html->ifSet($terms), '', ['id' => 'pricing_id', 'class' => 'form-control']);
?>
</div>
<div id="package_options" class="mb-2"></div>
<div class="float-right">
<a href="<?php echo $this->Html->safe($this->base_uri . 'services/manage/' . $this->Html->ifSet($service->id) . '/');?>" class="btn btn-danger">
<i class="fas fa-ban fa-fw"></i> <?php $this->_('ClientServices.change_term.cancel');?>
</a>
<?php
if (empty($unpaid_invoices)) {
?>
<button type="submit" class="btn btn-light"><i class="fas fa-arrow-circle-right"></i> <?php $this->_('ClientServices.change_term.review');?></button>
<?php
}
?>
</div>
<?php
$this->Form->end();
$this->WidgetClient->endBody();
$this->WidgetClient->end();
?>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#pricing_id').change(function() {
packageOptions();
});
function packageOptions() {
var pricing_id = $('#pricing_id').val();
if (pricing_id) {
var params = $('[name^="configoptions"]', $('#change_service_term')).serialize();
$(this).blestaRequest('GET', '<?php echo $this->Html->safe($this->base_uri . 'services/packageoptions/' . $this->Html->ifSet($service->id) . '/');?>' + pricing_id, params, function(data) {
if (data && data.hasOwnProperty('html')) {
$('#package_options').html(data.html);
}
$(this).blestaBindServiceOptionSlider();
},
null,
{dataType: 'json'});
}
else {
$('#package_options').html('');
}
}
});
</script>