presence training data
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
ini_set('include_path', '/opt/lampp/htdocs/badminton_coach/_class');
|
ini_set('include_path', '../_class/');
|
||||||
include('class_sql.php');
|
include('class_sql.php');
|
||||||
$sql = new sql('localhost','root','','badminton_coach');
|
$sql = new sql('localhost','root','','badminton_coach');
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class page {
|
|||||||
public function get_page_content() {
|
public function get_page_content() {
|
||||||
global $sql, $user, $smarty;
|
global $sql, $user, $smarty;
|
||||||
//var_dump($user);
|
//var_dump($user);
|
||||||
ini_set('include_path', '/opt/lampp/htdocs/badminton_coach/_include');
|
ini_set('include_path', '_include/');
|
||||||
//ini_set('include_path', '/var/www/badminton_coach/_include');
|
//ini_set('include_path', '/var/www/badminton_coach/_include');
|
||||||
if (!empty($user) && $user->is_logged_in()) {
|
if (!empty($user) && $user->is_logged_in()) {
|
||||||
if ($this->is_page()) {
|
if ($this->is_page()) {
|
||||||
|
|||||||
@@ -20,8 +20,29 @@ if ($this->is_id()) {
|
|||||||
$users[] = $user;
|
$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);
|
//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('presence_assoc_array', $presence_assoc_array);
|
||||||
$smarty->assign('users', $users);
|
$smarty->assign('users', $users);
|
||||||
$smarty->assign('tr_id', $this->get_id());
|
$smarty->assign('tr_id', $this->get_id());
|
||||||
|
|||||||
@@ -1,3 +1,32 @@
|
|||||||
|
<h1>Jelenlét kezelése</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Edzés dátuma:</td>
|
||||||
|
<td>
|
||||||
|
{$training->get_tr_date()|substr:0:-3}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Típus: </td>
|
||||||
|
<td>{$training->get_tr_type_name_by_id()}</td>
|
||||||
|
<tr>
|
||||||
|
<td>Edző(k):</td>
|
||||||
|
<td>
|
||||||
|
{foreach $trc_coaches as $coach}
|
||||||
|
{$coach->get_ua_name()}<br>
|
||||||
|
{/foreach}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Létszám:</td>
|
||||||
|
<td>
|
||||||
|
<div id="headcount">
|
||||||
|
{$headcount}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<input type="hidden" id="tr_id" value="{$tr_id}">
|
<input type="hidden" id="tr_id" value="{$tr_id}">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user