Files
pomysloweprezenty.pl/admin/templates/update/main-view.php
Jacek Pyziak 3ecbe628dc Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created Articles.php for rendering article views including full articles, miniature lists, and news sections.
- Added Banners.php for handling banner displays.
- Introduced Languages.php for rendering language options.
- Implemented Menu.php for dynamic menu rendering.
- Developed Newsletter.php for newsletter view rendering.
- Created Scontainers.php for rendering specific containers.
- Added ShopCategory.php for category descriptions and product listings.
- Introduced ShopClient.php for managing client-related views such as address editing and order history.
- Implemented ShopPaymentMethod.php for displaying payment methods in the basket.
- Created ShopProduct.php for generating product URLs.
- Added ShopSearch.php for rendering a simple search form.
- Added .htaccess file to enhance security by restricting access to sensitive files and directories.
2026-02-21 23:00:15 +01:00

130 lines
4.3 KiB
PHP

<div class="panel">
<div class="panel-heading">
<span class="panel-title">Aktualizacja systemu</span>
</div>
<div class="panel-body">
<div class="form-group">
<label class="control-label col-lg-4">Twoja wersja systemu</label>
<div class="col-lg-8">
<p class="form-control-static"><?= $this->ver; ?></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Aktualna wersja systemu</label>
<div class="col-lg-8">
<p class="form-control-static"><?= $this->new_ver; ?></p>
</div>
</div>
<div class="progress-box hidden">
<div class="version">
<h3>Aktualizacja <span class="version_curent">0</span> / <span class="version_diff">0</span></h3>
</div>
<div class="progress">
<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar"
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
</div>
</div>
<? if ( $this->ver < $this->new_ver ): ?>
<div class="row mt15">
<div class="form-group col-lg-6 text-right">
<a href="#" class="btn btn-system btn-sm mb5" id="confirm">Aktualizuj do wyższej wersji</a>
</div>
<div class="form-group col-lg-6">
<a href="#" class="btn btn-system btn-sm mb5" id="confirmUpdateAll">Aktualizuj do najwyższej wersji</a>
</div>
</div>
<div class="text-danger text-center">* Przed aktualizacją systemu zalecane jest wykonanie pełnej kopii zapasowej.</div>
<? endif; ?>
</div>
</div>
<div class="panel">
<div class="panel-heading">
<span class="panel-title">Changelog</span>
</div>
<div class="panel-body">
<?= @file_get_contents( 'https://shoppro.project-dc.pl/updates/changelog.php' ); ?>
</div>
</div>
<script type="text/javascript">
$(function() {
var version_current = <?= $this->ver; ?>;
var version_new = <?= $this->new_ver; ?>;
var version_diff = Math.round( ( version_new - version_current ) * 1000 );
var width = 0;
var ac_lp = 0;
$( '#confirm' ).on( 'click', function( e ) {
e.preventDefault();
$.confirm({
title: 'Potwierdź',
content: 'Na pewno chcesz dokonać aktualizacji systemu?',
buttons: {
tak: function() {
document.location.href = '/admin/update/update/';
},
nie: function() {}
}
});
});
$( '#confirmUpdateAll' ).on( 'click', function( e ) {
e.preventDefault();
$.confirm({
title: 'Potwierdź',
content: 'Na pewno chcesz dokonać aktualizacji systemu do najwyższej wersji?',
buttons: {
tak: function() {
$( '.progress-box' ).removeClass( 'hidden' );
$( '#confirm' ).css( 'pointer-events', 'none' );
$( '#confirmUpdateAll' ).css( 'pointer-events', 'none' );
$( '.version_diff' ).html( version_diff );
updateAll( version_current, version_new, version_diff, width, ac_lp );
},
nie: function() {}
}
});
});
function updateAll( version_current, version_new, version_diff, width, ac_lp ) {
$.ajax({
url: '/admin/update/updateAll/',
type: 'POST',
data: { version_current: version_current },
success: function( data ) {
var response = jQuery.parseJSON( data );
if ( response.status == true ) {
ac_lp = ac_lp + 1;
$( '.version_curent' ).html( ac_lp );
width = width + ( ( 1 / version_diff ) * 100 );
$( '.progress-bar' ).css( 'width', width + '%' );
if ( response.version < version_new ) {
updateAll( response.version, version_new, version_diff, width, ac_lp );
} else {
$.alert({
title: 'Informacja',
content: 'Aktualizacja przebiegła pomyślnie.',
onClose: function() {
window.location.href = '/admin/update/main_view/';
}
});
}
} else {
$.alert({
title: 'Błąd',
content: 'W trakcie aktualizacji systemu wystąpił błąd. Proszę spróbować ponownie.',
onClose: function() {
window.location.href = '/admin/update/main_view/';
}
});
}
}
});
}
});
</script>