From 9750d827ccb69c3ddb739b9caae16fde78ca15b8 Mon Sep 17 00:00:00 2001 From: Ricsi Date: Mon, 21 Nov 2016 10:03:48 +0000 Subject: [PATCH] presence training data --- _ajax/update_presence.php | 2 +- _class/class_page.php | 2 +- _include/include_presence.php | 21 +++++++++++++++++++++ template/templates/presence.tpl | 29 +++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/_ajax/update_presence.php b/_ajax/update_presence.php index f1da2f5..3536a4b 100755 --- a/_ajax/update_presence.php +++ b/_ajax/update_presence.php @@ -1,5 +1,5 @@ is_logged_in()) { if ($this->is_page()) { diff --git a/_include/include_presence.php b/_include/include_presence.php index a644d3c..0ae23c6 100755 --- a/_include/include_presence.php +++ b/_include/include_presence.php @@ -20,8 +20,29 @@ if ($this->is_id()) { $users[] = $user; } + //training data + $training = new training(); + $training->set_training_data_by_id($this->get_id()); + + //TRAINING-COACH ARRAY + $trc_query = "SELECT * FROM training_coach WHERE trc_training_tr_id = " . $this->get_id(); + $trc_coaches = array(); + $trc_assoc_array = $sql->assoc_array($trc_query); + foreach ($trc_assoc_array as $trc_data) { + $new_coach = new user(); + $new_coach->set_user_data_by_id($trc_data['trc_coach_uc_id']); + $trc_coaches[] = $new_coach; + } + //var_dump($users); + //headcount + $headcount_query = "SELECT * FROM presence WHERE pr_training_tr_id = " . $this->get_id() . ";"; + $headcount = $sql->num_of_rows($headcount_query); + + $smarty->assign('training', $training); + $smarty->assign('headcount', $headcount); + $smarty->assign("trc_coaches", $trc_coaches); $smarty->assign('presence_assoc_array', $presence_assoc_array); $smarty->assign('users', $users); $smarty->assign('tr_id', $this->get_id()); diff --git a/template/templates/presence.tpl b/template/templates/presence.tpl index 91ca020..edb66d8 100755 --- a/template/templates/presence.tpl +++ b/template/templates/presence.tpl @@ -1,3 +1,32 @@ +

Jelenlét kezelése

+ + + + + + + + + + + + + + + + + +
Edzés dátuma: + {$training->get_tr_date()|substr:0:-3} +
Típus: {$training->get_tr_type_name_by_id()}
Edző(k): + {foreach $trc_coaches as $coach} + {$coach->get_ua_name()}
+ {/foreach} +
Létszám: +
+ {$headcount} +
+