<div id="modalConfirmYesNo" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="labelTitleConfirmDialog" class="modal-title"></h4>
            </div>
            <div class="modal-body">
                <p id="labelMsgConfirmDialog"></p>
            </div>
            <div class="modal-footer">
                <button id="btnYesConfirmDialog"
                        type="button"
                        class="btn btn-primary"
                ><?= lang('Basic.global.yes') ?></button>
                <button id="btnNoConfirmDialog"
                        type="button"
                        class="btn btn-default"
                ><?= lang('Basic.global.Cancel') ?></button>
            </div>
        </div>
    </div>
</div>


<?= $this->section('additionalInlineJs') ?>


function asyncConfirmDialog(title, msg, yesCallbackFn, noCallbackFn) {
    var $confirmDialog = $("#modalConfirmYesNo");
    $confirmDialog.modal('show');
    $("#labelTitleConfirmDialog").html(title);
    $("#labelMsgConfirmDialog").html(msg);
    $("#btnYesConfirmDialog").off('click').click(function () {
        yesCallbackFn();
        $confirmDialog.modal("hide");
    });
    $("#btnNoConfirmDialog").off('click').click(function () {
        noCallbackFn();
        $confirmDialog.modal("hide");
    });
}

function asyncConfirmDialogWithParams(title, msg, yesCallbackFn, noCallbackFn, params) {
    var $confirmDialog = $("#modalConfirmYesNo");
    $confirmDialog.modal('show');
    $("#labelTitleConfirmDialog").html(title);
    $("#labelMsgConfirmDialog").html(msg);
    $("#btnYesConfirmDialog").off('click').click(function () {
        yesCallbackFn(params);
        $confirmDialog.modal("hide");
    });
    $("#btnNoConfirmDialog").off('click').click(function () {
        noCallbackFn(params);
        $confirmDialog.modal("hide");
    });
}
<?= $this->endSection() ?>


