templates
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="mod_sum">Összeg:</label>
|
||||
<div><input type="text" name="mod_sum" id="mod_sum" value="8000" required></div>
|
||||
<div><input type="text" name="mod_sum" id="mod_sum" required></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
<input type="hidden" name="action" id="action" value="training_data_create">
|
||||
<input type="hidden" name="jumpTo" id="jumpTo" value="0">
|
||||
|
||||
<div>
|
||||
<label class="desc" for="training_templates">Sablon:</label>
|
||||
<div>
|
||||
<select name="training_templates" id="training_templates">
|
||||
<option value="null"> - </option>
|
||||
{foreach $training_templates as $template}
|
||||
<option value="{$template.tt_id}">
|
||||
{$template.tt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tr_date">Dátum:</label>
|
||||
@@ -78,4 +93,45 @@
|
||||
$('.save').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
$('#training_templates').on('change', function(e) {
|
||||
let selectedTemplate = $('#training_templates option:selected').val();
|
||||
console.log(selectedTemplate);
|
||||
$.ajax({
|
||||
url: '/_ajax/get_training_template.php',
|
||||
//method: 'GET',
|
||||
data: {
|
||||
'template_id' : selectedTemplate
|
||||
},
|
||||
success: function(data, status, jqXHR) {
|
||||
var pdata = JSON.parse(data);
|
||||
|
||||
if (null == pdata) {
|
||||
|
||||
$('#tr_date').val('');
|
||||
$('#tr_training_type_trt_id').val('null');
|
||||
$('#tr_duration').val('');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(pdata);
|
||||
|
||||
var d = new Date();
|
||||
|
||||
var month = d.getMonth()+1;
|
||||
var day = d.getDate();
|
||||
|
||||
var output = d.getFullYear() + '-' +
|
||||
((''+month).length<2 ? '0' : '') + month + '-' +
|
||||
((''+day).length<2 ? '0' : '') + day;
|
||||
|
||||
|
||||
if (null != pdata['tt_time']) $('#tr_date').val(output + ' ' + pdata['tt_time']);
|
||||
if (null != pdata['tt_training_type']) $('#tr_training_type_trt_id').val(pdata['tt_training_type']);
|
||||
if (null != pdata['tt_duration']) $('#tr_duration').val(pdata['tt_duration']);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
<div class="buttons">
|
||||
<a href="/admin/create/training" class="addbutton add-big">Új edzés hozzáadása</a>
|
||||
<a href="/admin/training_types" class="addbutton add-big">Edzés típusok szerkesztése</a>
|
||||
<a href="/admin/training_templates" class="addbutton add-big">Edzés sablonok szerkesztése</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="list">
|
||||
{foreach $training_array as $training}
|
||||
{if
|
||||
{if
|
||||
$training@first ||
|
||||
(
|
||||
$training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2
|
||||
$training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
{if !$training@first &&
|
||||
{if !$training@first &&
|
||||
$training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2
|
||||
}
|
||||
</div>
|
||||
{/if}
|
||||
<span onclick="block_action('block_{$training->get_tr_date()|substr:0:4}{$training->get_tr_date()|substr:5:2}');" class="date_separator clickable">{$training_array[$training@index]->get_tr_date()|substr:0:4}.
|
||||
<span onclick="block_action('block_{$training->get_tr_date()|substr:0:4}{$training->get_tr_date()|substr:5:2}');" class="date_separator clickable">{$training_array[$training@index]->get_tr_date()|substr:0:4}.
|
||||
{$months[$training_array[$training@index]->get_tr_date()|substr:5:2]}
|
||||
<img src="/_image/open_folder.png">
|
||||
</span>
|
||||
@@ -26,11 +27,11 @@
|
||||
<a href="/admin/{if $edit=='edit'}edit_training{elseif $edit=='view'}trainings{else}presence{/if}/{$training->get_tr_id()}">
|
||||
<div class="list_item">
|
||||
<img src="/_image/training.png">
|
||||
{$training->get_tr_date()|substr:0:4}.
|
||||
{$months[$training_array[$training@index]->get_tr_date()|substr:5:2]}
|
||||
{$training->get_tr_date_day()}.
|
||||
{$days[$training->get_tr_date_day_of_week()]}
|
||||
{$training->get_tr_date_time()}
|
||||
{$training->get_tr_date()|substr:0:4}.
|
||||
{$months[$training_array[$training@index]->get_tr_date()|substr:5:2]}
|
||||
{$training->get_tr_date_day()}.
|
||||
{$days[$training->get_tr_date_day_of_week()]}
|
||||
{$training->get_tr_date_time()}
|
||||
{if $training->get_tr_training_type_trt_id()}({$training->get_tr_type_name_by_id()}){/if}
|
||||
</div>
|
||||
</a>
|
||||
@@ -67,8 +68,8 @@ $( document ).ready(function() {
|
||||
var div_list = $( ".list" ).find( divs );
|
||||
|
||||
open_block(div_list[0].id);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
42
template/templates/training_template_create.tpl
Normal file
42
template/templates/training_template_create.tpl
Normal file
@@ -0,0 +1,42 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="training_template_create">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_name">Új edzés sablon neve:</label>
|
||||
<div><input type="text" name="tt_name" id="tt_name" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_time">Edzés ideje:</label>
|
||||
<div><input type="text" name="tt_time" id="tt_time" placeholder="ÓÓ:PP"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title2" for="tt_training_type">Típus:</label>
|
||||
<div>
|
||||
<select name="tt_training_type" id="tt_training_type">
|
||||
<option value="null"> - </option>
|
||||
{foreach $training_type_assoc_array as $training_type_array}
|
||||
<option value="{$training_type_array.trt_id}">
|
||||
{$training_type_array.trt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_duration">Időtartam (perc):</label>
|
||||
<div><input type="text" name="tt_duration" id="tt_duration"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Létrehozás">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
46
template/templates/training_template_edit.tpl
Normal file
46
template/templates/training_template_edit.tpl
Normal file
@@ -0,0 +1,46 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_training_template/{$template_data.tt_id}" class="addbutton delete-big">Törlés</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="training_template_update">
|
||||
<input type="hidden" name="tt_id" value="{$template_data.tt_id}">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_name">Új edzés sablon neve:</label>
|
||||
<div><input type="text" name="tt_name" id="tt_name" value="{$template_data.tt_name}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_time">Edzés ideje:</label>
|
||||
<div><input type="text" name="tt_time" id="tt_time" placeholder="ÓÓ:PP" value="{$template_data.tt_time}"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title2" for="tt_training_type">Típus:</label>
|
||||
<div>
|
||||
<select name="tt_training_type" id="tt_training_type">
|
||||
<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 == $template_data.tt_training_type} selected{/if}>
|
||||
{$training_type_array.trt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="tt_duration">Időtartam (perc):</label>
|
||||
<div><input type="text" name="tt_duration" id="tt_duration" value="{$template_data.tt_duration}"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
18
template/templates/training_template_list.tpl
Normal file
18
template/templates/training_template_list.tpl
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="buttons">
|
||||
|
||||
<a href="/admin/create/training_template" class="addbutton add-big">Új edzés sablon</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="list">
|
||||
{foreach $tts as $template}
|
||||
<a href="/admin/training_templates/{$template->get_tt_id()}">
|
||||
<div class="list_item">
|
||||
<img src="/_image/template.png">
|
||||
{$template->get_tt_name()}
|
||||
</div>
|
||||
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
Reference in New Issue
Block a user