    <?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">&times;</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>