- Created new directories and index files for controls, factory, and views. - Added .htaccess files for URL rewriting in layout and images directories. - Included a logo image in the layout/images directory. - Implemented load_prices.php to load ticket prices from the database into settings. - Developed admin panel settings page for enabling ticket sales. - Created tickets management page in the admin panel to display and edit ticket prices. - Added upgrade.php for database migrations, including creating the ticket_prices table and adding weekend price column.
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
$enable_sell = $this->enable_sell;
|
|
?>
|
|
<div id="admin-settings">
|
|
<div class="container">
|
|
<div class="tickets-orders">
|
|
<h1>Ustawienia</h1>
|
|
<div class="card p-4 mb-3">
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" id="enable_sell" <?= $enable_sell == '1' ? 'checked' : '' ?>>
|
|
<label class="form-check-label" for="enable_sell">Sprzedaz biletow wlaczona</label>
|
|
</div>
|
|
</div>
|
|
<button type="button" class="btn btn-t1" id="save-settings">Zapisz ustawienia</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('#save-settings').on('click', function() {
|
|
var postData = {};
|
|
if ($('#enable_sell').is(':checked')) {
|
|
postData['enable_sell'] = '1';
|
|
}
|
|
|
|
$.ajax({
|
|
url: '/apanel/settings_save/',
|
|
type: 'POST',
|
|
data: postData,
|
|
dataType: 'json',
|
|
success: function(res) {
|
|
if (res.status === 'ok') {
|
|
$.alert({
|
|
title: 'Sukces',
|
|
content: 'Ustawienia zapisano',
|
|
});
|
|
} else {
|
|
$.alert({
|
|
title: 'Blad',
|
|
content: res.message || 'Wystapil blad',
|
|
});
|
|
}
|
|
},
|
|
error: function() {
|
|
$.alert({
|
|
title: 'Blad',
|
|
content: 'Nie udalo sie zapisac ustawien',
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|