20161215
This commit is contained in:
@@ -16,7 +16,11 @@ switch ($this->get_id()) {
|
||||
//SCHOOL CITY ARRAY
|
||||
$school_city_query = "SELECT * FROM school_city;";
|
||||
$school_city_assoc_array = $sql->assoc_array($school_city_query);
|
||||
//REGION ARRAY
|
||||
$region_query = "SELECT * FROM region;";
|
||||
$region_assoc_array = $sql->assoc_array($region_query);
|
||||
|
||||
$smarty->assign('region_assoc_array', $region_assoc_array);
|
||||
$smarty->assign('shirt_size_assoc_array', $shirt_size_assoc_array);
|
||||
$smarty->assign('school_assoc_array', $school_assoc_array);
|
||||
$smarty->assign('school_city_assoc_array', $school_city_assoc_array);
|
||||
@@ -67,6 +71,10 @@ switch ($this->get_id()) {
|
||||
# CITY létrehozása
|
||||
$smarty->display('city_create.tpl');
|
||||
break;
|
||||
case 'region':
|
||||
# CITY létrehozása
|
||||
$smarty->display('region_create.tpl');
|
||||
break;
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
|
||||
10
_include/include_delete_region.php
Normal file
10
_include/include_delete_region.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM region WHERE reg_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
header("Location: /admin/regions");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
32
_include/include_lock_training.php
Normal file
32
_include/include_lock_training.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
|
||||
# EDZÉS ZÁROLÁS
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# EDZÉS ZÁROLÁS/FELOLDÁS
|
||||
|
||||
$locked = $sql->single_variable('select tr_locked from training where tr_id =' . $this->get_id());
|
||||
$sql->update_table('training', array(
|
||||
'tr_locked' => ($locked?0:1)
|
||||
),
|
||||
array(
|
||||
'tr_id' => $this->get_id()
|
||||
)
|
||||
);
|
||||
header('Location: /admin/presence/' . $this->get_id());
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# NEM LEHET
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
setcookie('badminton_coach_user', 'null', time()-60*60*72, '/');
|
||||
unset($_COOKIE['badminton_coach_user']);
|
||||
setcookie('badminton_'.$from.'_user', 'null', time()-60*60*72, '/');
|
||||
unset($_COOKIE['badminton_'.$from.'_user']);
|
||||
header('Location: http://' . $_SERVER['HTTP_HOST']);
|
||||
|
||||
|
||||
|
||||
@@ -19,9 +19,13 @@ if ($this->is_id()) {
|
||||
//SCHOOL CITY ARRAY
|
||||
$school_city_query = "SELECT * FROM school_city;";
|
||||
$school_city_assoc_array = $sql->assoc_array($school_city_query);
|
||||
//REGION ARRAY
|
||||
$region_query = "SELECT * FROM region;";
|
||||
$region_assoc_array = $sql->assoc_array($region_query);
|
||||
//smarty thingz
|
||||
$smarty->assign('school_assoc_array', $school_assoc_array);
|
||||
$smarty->assign('school_city_assoc_array', $school_city_assoc_array);
|
||||
$smarty->assign('region_assoc_array', $region_assoc_array);
|
||||
$smarty->assign('user_data', $user_data_assoc_array[0]);
|
||||
$smarty->assign('shirt_size_assoc_array', $shirt_size_assoc_array);
|
||||
$smarty->assign('parent_assoc_array', $parent_assoc_array);
|
||||
|
||||
31
_include/include_overview.php
Normal file
31
_include/include_overview.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
if ($this->is_id()) {
|
||||
# EMPTY
|
||||
}
|
||||
else {
|
||||
# ADATOK + EDZÉS LISTA
|
||||
//user_loginból veszi az adatokat
|
||||
|
||||
//szülők átadása
|
||||
if ($user->get_uk_parent_1()) {
|
||||
$parent_1_query = "SELECT * FROM user_parent WHERE up_id = " . $user->get_uk_parent_1();
|
||||
$parent_1_assoc_array = $sql->assoc_array($parent_1_query);
|
||||
$smarty->assign('parent_1', $parent_1_assoc_array[0]);
|
||||
}
|
||||
|
||||
if ($user->get_uk_parent_2()) {
|
||||
$parent_2_query = "SELECT * FROM user_parent WHERE up_id = " . $user->get_uk_parent_2();
|
||||
$parent_2_assoc_array = $sql->assoc_array($parent_2_query);
|
||||
$smarty->assign('parent_2', $parent_2_assoc_array[0]);
|
||||
}
|
||||
|
||||
|
||||
//todo: object
|
||||
|
||||
$smarty->display('user_overview.tpl');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -42,12 +42,14 @@ if ($this->is_id()) {
|
||||
$presence_query = "
|
||||
SELECT `pr_user_kid_uk_id` , count( `pr_id` ) AS 'presence'
|
||||
FROM `presence`
|
||||
JOIN user_kid ON uk_id = pr_user_kid_uk_id
|
||||
WHERE `pr_training_tr_id`
|
||||
IN ( " . implode(',', $tr_ids) . " )
|
||||
GROUP BY `pr_user_kid_uk_id`
|
||||
ORDER BY count( `pr_id` ) DESC;
|
||||
ORDER BY count( `pr_id` ) DESC, uk_name ASC;
|
||||
";
|
||||
//echo $presence_query;
|
||||
//echo $presence_query;
|
||||
if (!empty($tr_ids)) {
|
||||
$presence_assoc_array = $sql->assoc_array($presence_query);
|
||||
foreach ($presence_assoc_array as $presence) {
|
||||
@@ -76,7 +78,7 @@ if ($this->is_id()) {
|
||||
|
||||
|
||||
//TRAINING-COACH ARRAY
|
||||
$trc_query = "SELECT * FROM training_coach WHERE trc_training_tr_id = " . $this->get_id();
|
||||
$trc_query = "SELECT * FROM training_coach WHERE trc_helper = 0 AND 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) {
|
||||
@@ -85,17 +87,50 @@ if ($this->is_id()) {
|
||||
$trc_coaches[] = $new_coach;
|
||||
}
|
||||
|
||||
//TRAINING-HELPER ARRAY
|
||||
$trc_query = "SELECT * FROM training_coach WHERE trc_helper = 1 AND trc_training_tr_id = " . $this->get_id();
|
||||
$trc_helpers = 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_helpers[] = $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);
|
||||
|
||||
|
||||
//csak lista
|
||||
$s_users = array();
|
||||
$presence_query = "
|
||||
SELECT `pr_user_kid_uk_id`
|
||||
FROM `presence`
|
||||
JOIN user_kid ON uk_id = pr_user_kid_uk_id
|
||||
WHERE `pr_training_tr_id` = ".$this->get_id()."
|
||||
ORDER BY uk_name ASC;
|
||||
";
|
||||
|
||||
$presence_assoc_array = $sql->assoc_array($presence_query);
|
||||
foreach ($presence_assoc_array as $presence) {
|
||||
$s_user = new user_kid();
|
||||
$s_user->set_user_data_by_id($presence['pr_user_kid_uk_id']);
|
||||
$s_users[] = $s_user;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$smarty->assign('training', $training);
|
||||
$smarty->assign('trainings', $tr_ids);
|
||||
$smarty->assign('headcount', $headcount);
|
||||
$smarty->assign("trc_coaches", $trc_coaches);
|
||||
$smarty->assign("trc_helpers", $trc_helpers);
|
||||
$smarty->assign('presence_assoc_array', $presence_assoc_array);
|
||||
$smarty->assign('users', $users);
|
||||
$smarty->assign('sorted_users', $s_users);
|
||||
$smarty->assign('rest_users', $rest_users);
|
||||
$smarty->assign('tr_id', $this->get_id());
|
||||
|
||||
|
||||
30
_include/include_regions.php
Normal file
30
_include/include_regions.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR RÉGIÓLISTA
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# RÉGIÓ SZERKESZTÉSE
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# RÉGIÓ LISTA
|
||||
|
||||
$reg_query = "SELECT * FROM region ORDER BY reg_name ASC";
|
||||
$reg_assoc_array = $sql->assoc_array($reg_query);
|
||||
|
||||
$smarty->assign('reg_assoc_array',$reg_assoc_array);
|
||||
$smarty->display('region_list.tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user