95 lines
3.1 KiB
PHP
95 lines
3.1 KiB
PHP
<?php
|
|
$lg = $_GET['lg'] ?? 'bg';
|
|
?>
|
|
<div class="flex top">
|
|
<div class="top-title">Въпроси и отговори</div>
|
|
<div class="breadcrumb p10">
|
|
<a href="/admin-global/index/dashboard">Начало</a>
|
|
<span>Въпроси и отговори</span>
|
|
</div>
|
|
</div>
|
|
<div class="inner-content p10">
|
|
<div class="action-buttons" style="border-bottom: 4px solid #f1f1f1; padding-bottom: 10px">
|
|
<a href="?lg=bg" class="btn-ib btn-default ct guide-link <?= $lg == 'bg' ? 'selected' : '' ?>"><i
|
|
class="lg lg-bg"></i> Български</a>
|
|
<a href="?lg=en" class="btn-ib btn-default ct guide-link <?= $lg == 'en' ? 'selected' : '' ?>"><i
|
|
class="lg lg-en"></i> Английски</a>
|
|
</div>
|
|
<div class="top10">
|
|
|
|
<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/_public/guides/cms-qa-' . $lg . '.pdf')): ?>
|
|
<iframe src="<?= Yii::$app->params['cms'] . '/_public/guides/cms-qa-' . $lg . '.pdf?time='. time() ?>"
|
|
style="height: calc(100vh - 200px); width: 100%; border: 0"></iframe>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<style>
|
|
.guide-link {
|
|
border: 1px solid #cccccc !important;
|
|
}
|
|
|
|
.guide-link.selected {
|
|
background: var(--base-background-ultra-bright-clear) !important;
|
|
}
|
|
|
|
.modalImg {
|
|
height: auto !important;
|
|
max-height: none !important;
|
|
}
|
|
|
|
.modalImg img {
|
|
height: auto !important;
|
|
width: 100% !important;
|
|
display: block;
|
|
}
|
|
</style>
|
|
<script>
|
|
window.onscroll = function () {
|
|
const ab = one('.action-buttons');
|
|
if (ab) {
|
|
if (window.pageYOffset > ab.offsetTop) {
|
|
ab.addClass('buttons-top')
|
|
} else {
|
|
ab.removeClass('buttons-top')
|
|
}
|
|
}
|
|
}
|
|
|
|
function openZoomImg(src) {
|
|
modal.modalPreview(src)
|
|
}
|
|
|
|
function uploadDocument(btn) {
|
|
const process = document.querySelector('#progress')
|
|
const fileInput = document.createElement('input')
|
|
fileInput.type = 'file';
|
|
fileInput.name = 'upload-cms-qa'
|
|
//fileInput.accept = '.pdf'
|
|
fileInput.addEventListener('change', () => {
|
|
btn.classList.add('disabled')
|
|
const file = fileInput.files[0];
|
|
const formData = new FormData();
|
|
formData.append('upload-cms-qa', file);
|
|
const xhr = new XMLHttpRequest()
|
|
xhr.upload.addEventListener('progress', (event) => {
|
|
const percentComplete = event.loaded / event.total * 100;
|
|
process.innerHTML = ` ${parseInt(percentComplete)}%`
|
|
if (percentComplete === 100) {
|
|
setTimeout(function () {
|
|
process.innerHTML = ''
|
|
btn.classList.add('disabled')
|
|
window.location.reload()
|
|
}, 2000)
|
|
}
|
|
});
|
|
|
|
|
|
xhr.open('POST', '?upload=true&lg=<?= $lg ?>');
|
|
xhr.send(formData);
|
|
})
|
|
fileInput.click()
|
|
|
|
}
|
|
|
|
</script>
|