menu authorities
This commit is contained in:
1
template/templates/access_denied.tpl
Normal file
1
template/templates/access_denied.tpl
Normal file
@@ -0,0 +1 @@
|
||||
<h2>Nincs jogosultsága ehhez a menüponthoz!</h2>
|
||||
@@ -1,39 +1,66 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="coach_create">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_name">Név:</label>
|
||||
<div><input type="text" name="ua_name" id="ua_name" required></div>
|
||||
</div>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="coach_create">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_can_login">Be tud lépni:</label>
|
||||
<div><input type="checkbox" name="ua_can_login" id="ua_can_login"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_name">Név:</label>
|
||||
<div><input type="text" name="ua_name" id="ua_name" required></div>
|
||||
</div>
|
||||
|
||||
<div id="password">
|
||||
<label class="desc" id="title1" for="ua_password">Jelszó:</label>
|
||||
<div><input type="text" name="ua_password" id="ua_password"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_can_login">Be tud lépni:</label>
|
||||
<div><input type="checkbox" name="ua_can_login" id="ua_can_login"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Létrehozás">
|
||||
</div>
|
||||
</div>
|
||||
<div id="password" class="admin_area">
|
||||
<label class="desc" for="ua_password">Jelszó:</label>
|
||||
<div><input type="text" name="ua_password" id="ua_password"></div>
|
||||
</div>
|
||||
<div class="admin_area">
|
||||
<label>Jogosultságok:</label>
|
||||
<table id="authorities">
|
||||
{foreach $a_array as $a}
|
||||
<tr id="a_{$a->get_a_id()}">
|
||||
<td><label for="authority_{$a->get_a_id()}">{$a->get_a_title()}</label></td>
|
||||
<td><input class="authorities" value="{$a->get_a_id()}" type="checkbox" name="authorities[]" id="authority_{$a->get_a_id()}"></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Létrehozás">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
$("#password").hide();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$(".admin_area").hide();
|
||||
});
|
||||
|
||||
$('#ua_can_login').click(function() {
|
||||
$("#password").toggle(this.checked);
|
||||
});
|
||||
$('#ua_can_login').click(function() {
|
||||
$(".admin_area").toggle(this.checked);
|
||||
});
|
||||
|
||||
</script>
|
||||
$('.authorities').on('change', function () {
|
||||
if ($('#authority_1').is(':checked')) {
|
||||
$('.authorities').each(function (k,v) {
|
||||
if ($(v).val() > 1) {
|
||||
$(this).prop('checked', false);
|
||||
$(this).prop('disabled', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('.authorities').each(function (k,v) {
|
||||
if ($(v).val() > 1) {
|
||||
$(this).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,32 +1,68 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_coach/{$coach->get_ua_id()}" class="addbutton delete-big">Edző törlése</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="coach_data_edit">
|
||||
<input type="hidden" name="ua_id" value="{$coach->get_ua_id()}">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_name">Név:</label>
|
||||
<div><input type="text" name="ua_name" id="ua_name" value="{$coach->get_ua_name()}" required></div>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_coach/{$coach->get_ua_id()}" class="addbutton delete-big">Edző törlése</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="coach_data_edit">
|
||||
<input type="hidden" name="ua_id" value="{$coach->get_ua_id()}">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_name">Név:</label>
|
||||
<div><input type="text" name="ua_name" id="ua_name" value="{$coach->get_ua_name()}" required></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_can_login">Admin:</label>
|
||||
<div><input type="checkbox" name="ua_admin" id="ua_admin" {if $coach->get_ua_admin()}checked{/if}></div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ua_can_login">Be tud lépni:</label>
|
||||
<div><input type="checkbox" name="ua_admin" id="ua_admin" {if $coach->get_ua_admin()}checked{/if}></div>
|
||||
</div>
|
||||
|
||||
<div id="password">
|
||||
<label class="desc" id="title1" for="ua_password">Új jelszó:</label>
|
||||
<div><input type="text" name="ua_password" id="ua_password"></div>
|
||||
</div>
|
||||
<div id="password">
|
||||
<label class="desc" id="title1" for="ua_password">Új jelszó:</label>
|
||||
<div><input type="text" name="ua_password" id="ua_password"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_area">
|
||||
<label>Jogosultságok:</label>
|
||||
<table id="authorities">
|
||||
{foreach $a_array as $a}
|
||||
<tr id="a_{$a->get_a_id()}">
|
||||
<td><label for="authority_{$a->get_a_id()}">{$a->get_a_title()}</label></td>
|
||||
<td><input class="authorities" value="{$a->get_a_id()}" type="checkbox" name="authorities[]" id="authority_{$a->get_a_id()}" {if $coach->has_authority($a->get_a_id())}checked{/if}></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.authorities').on('change', function () {
|
||||
if ($('#authority_1').is(':checked')) {
|
||||
$('.authorities').each(function (k,v) {
|
||||
if ($(v).val() > 1) {
|
||||
$(this).prop('checked', false);
|
||||
$(this).prop('disabled', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('.authorities').each(function (k,v) {
|
||||
if ($(v).val() > 1) {
|
||||
$(this).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.authorities').trigger('change');
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,65 +1,95 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_training/{$training_data.tr_id}" class="addbutton delete-big">Törlés</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" id="action" value="training_data_edit">
|
||||
<input type="hidden" name="tr_id" id="tr_id" value="{$training_data.tr_id}">
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_training/{$training_data.tr_id}" class="addbutton delete-big">Törlés</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" id="action" value="training_data_edit">
|
||||
<input type="hidden" name="tr_id" id="tr_id" value="{$training_data.tr_id}">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tr_date">Dátum:</label>
|
||||
<div><input type="text" name="tr_date" id="tr_date" value="{$training_data.tr_date|substr:0:-3}" required></div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tr_date">Dátum:</label>
|
||||
<div><input type="text" name="tr_date" id="tr_date" value="{$training_data.tr_date|substr:0:-3}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title2" for="tr_training_type_trt_id">Típus:</label>
|
||||
<div>
|
||||
<select name="tr_training_type_trt_id" id="tr_training_type_trt_id">
|
||||
<option value="null"> - </option>
|
||||
{foreach $training_type_assoc_array as $training_type_array}
|
||||
<option value="{$training_type_array.trt_id}"{if $training_type_array.trt_id == $training_data.tr_training_type_trt_id} selected{/if}>
|
||||
{$training_type_array.trt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title2" for="tr_training_type_trt_id">Típus:</label>
|
||||
<div>
|
||||
<select name="tr_training_type_trt_id" id="tr_training_type_trt_id">
|
||||
<option value="null"> - </option>
|
||||
{foreach $training_type_assoc_array as $training_type_array}
|
||||
<option value="{$training_type_array.trt_id}"{if $training_type_array.trt_id == $training_data.tr_training_type_trt_id} selected{/if}>
|
||||
{$training_type_array.trt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tr_duration">Időtartam (perc):</label>
|
||||
<div><input type="text" name="tr_duration" id="tr_duration" value="{$training_data.tr_duration}" required></div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tr_duration">Időtartam (perc):</label>
|
||||
<div><input type="text" name="tr_duration" id="tr_duration" value="{$training_data.tr_duration}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="tr_note">Megjegyzés:</label>
|
||||
<div>
|
||||
<textarea rows="4" name="tr_note" id="tr_note">{$training_data.tr_note}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" for="tr_price">Ár:</label>
|
||||
<div><input type="text" name="tr_price" id="tr_price" value="{$training_data.tr_price}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="coaches">Edző(k):</label>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="bold">Név</td>
|
||||
<td class="bold center">E</td>
|
||||
<td class="bold center">SE</td>
|
||||
</tr>
|
||||
{foreach $coach_array as $coach}
|
||||
<tr>
|
||||
<td class="coach">{$coach->get_ua_name()}</td>
|
||||
<td><input type="checkbox" name="coaches[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_coach_at_training($tr_id)} checked{/if}></td>
|
||||
<td><input type="checkbox" name="helpers[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_helper_at_training($tr_id)} checked{/if}></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" for="tr_note">Megjegyzés:</label>
|
||||
<div>
|
||||
<textarea rows="4" name="tr_note" id="tr_note">{$training_data.tr_note}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="desc" id="title1" for="coaches">Edző(k):</label>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="bold">Név</td>
|
||||
<td class="bold center">E</td>
|
||||
<td class="bold center">SE</td>
|
||||
</tr>
|
||||
{foreach $coach_array as $coach}
|
||||
<tr>
|
||||
<td class="coach">{$coach->get_ua_name()}</td>
|
||||
<td><input type="checkbox" name="coaches[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_coach_at_training($tr_id)} checked{/if}></td>
|
||||
<td><input type="checkbox" name="helpers[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_helper_at_training($tr_id)} checked{/if}></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#tr_training_type_trt_id').on('change', function(e) {
|
||||
//get trt default price by ajax
|
||||
let selectedType = $('#tr_training_type_trt_id option:selected').val();
|
||||
$.ajax({
|
||||
url: '/_ajax/get_trt_default_price.php',
|
||||
//method: 'GET',
|
||||
data: {
|
||||
'trt_id' : selectedType
|
||||
},
|
||||
success: function(data, status, jqXHR) {
|
||||
let pdata = JSON.parse(data);
|
||||
console.log(pdata);
|
||||
if (null === pdata) {
|
||||
$('#tr_price').val('');
|
||||
return;
|
||||
}
|
||||
|
||||
$('#tr_price').val(pdata);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user