groups
63
_ajax/add_category_to_kid.php
Executable file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
//megnézzük, hogy a KID benne van-e olyan category-val, ami az adott grouphoz tartozik
|
||||
//ha igen, akkor, akkor updateljük a categoryját
|
||||
//ha nem, akkor beszúrjuk az új category ID-val
|
||||
if ($_POST['category_id'] == 'null') {
|
||||
//var_dump('null');
|
||||
|
||||
}
|
||||
|
||||
$ugk_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $_POST['uk_id'] . " AND ugk_category_ugc_id in (
|
||||
SELECT ugc_id FROM user_group_category WHERE ugc_user_group_ug_id = ".$_POST['group_id'].");";
|
||||
|
||||
if ($sql->num_of_rows($ugk_query)) {
|
||||
//update
|
||||
//ha null, akkor megnézzük, hogy null-e a csoportja is
|
||||
//ha igen, akkor töröljük
|
||||
//ha nem, akkor updateljük null-ra
|
||||
//egyébként update
|
||||
$ugk_id = $sql->single_variable($ugk_query);
|
||||
if ($_POST['category_id'] == 'null') {
|
||||
$group_check_query = "SELECT ugk_user_group_ug_id FROM user_group_kid WHERE ugk_id = " . $ugk_id;
|
||||
$group_id = $sql->single_variable($group_check_query);
|
||||
|
||||
if ($group_id) {
|
||||
$sql->update_table('user_group_kid', array('ugk_category_ugc_id' => $_POST['category_id']), array('ugk_id' => $ugk_id));
|
||||
}
|
||||
else {
|
||||
$sql->execute_query('DELETE FROM user_group_kid WHERE ugk_id = ' . $ugk_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql->update_table('user_group_kid', array('ugk_category_ugc_id' => $_POST['category_id']), array('ugk_id' => $ugk_id));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
//insert
|
||||
//megnézzük, hogy null-e a csoport
|
||||
//ha igen, insert
|
||||
//ha nem, akkor update
|
||||
$ugk_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $_POST['uk_id'] . " AND ugk_user_group_ug_id = " . $_POST['group_id'];
|
||||
$ugk_id = $sql->single_variable($ugk_query);
|
||||
|
||||
if ($ugk_id) {
|
||||
$sql->update_table('user_group_kid', array('ugk_category_ugc_id' => $_POST['category_id']), array('ugk_id' => $ugk_id));
|
||||
}
|
||||
else {
|
||||
$sql->insert_into('user_group_kid', array(
|
||||
'ugk_user_kid_uk_id' => $_POST['uk_id'],
|
||||
//'ugk_user_group_ug_id' => $_POST['group_id'],
|
||||
'ugk_category_ugc_id' => $_POST['category_id'],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
47
_ajax/apply_filters.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
include('class_user_parent.php');
|
||||
include('class_user_kid.php');
|
||||
include('class_user_group.php');
|
||||
include('class_user_group_filter.php');
|
||||
include('class_user_group_filter_value.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
$all_kid = array();
|
||||
|
||||
if (empty($_POST['filter_array'])) {
|
||||
echo json_encode(null);
|
||||
}
|
||||
else {
|
||||
//updatelni kell az user_group_filter_value, aztán apply-olni
|
||||
user_group::empty_group($_POST['user_group_id']);
|
||||
foreach ($_POST['filter_array'] as $key => $filter_value) {
|
||||
//[0] => filter_value_id, [1] => value, [2] => filter_id
|
||||
if ($filter_value[1] == 'null') {
|
||||
$sql->execute_query('DELETE FROM user_group_filter_value WHERE ugfv_id = ' . $filter_value[0]);
|
||||
}
|
||||
else {
|
||||
$sql->update_table('user_group_filter_value', array(
|
||||
'ugfv_filter_id' => $filter_value[2],
|
||||
'ugfv_group_id' => $_POST['user_group_id'],
|
||||
'ugfv_value' => $filter_value[1],
|
||||
), array(
|
||||
'ugfv_id' => $filter_value[0],
|
||||
));
|
||||
|
||||
|
||||
|
||||
$ugfv_obj = new user_group_filter_value();
|
||||
$ugfv_obj->set_ugfv_data_by_id($filter_value[0]);
|
||||
$ugfv_obj->apply($_POST['intersect']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
14
_ajax/create_category.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
echo json_encode($sql->insert_into('user_group_category', array(
|
||||
'ugc_name' => $_POST['category_name'],
|
||||
'ugc_user_group_ug_id' => $_POST['group_id']
|
||||
)));
|
||||
|
||||
?>
|
||||
11
_ajax/create_user_group_filter.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
echo json_encode($sql->insert_into('user_group_filter_value', array()));
|
||||
|
||||
?>
|
||||
77
_ajax/get_auto_group_members.php
Executable file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
//paraméterek: group_id, category_id
|
||||
//ha nincs category_id, akkor mindenki
|
||||
|
||||
function get_value_parts($str) {
|
||||
$parts = explode(',', $str);
|
||||
return $parts;
|
||||
}
|
||||
|
||||
$user_kid_query = "
|
||||
SELECT
|
||||
uk_id,
|
||||
uk_name,
|
||||
ugk_id,
|
||||
GROUP_CONCAT(distinct ugk_id) ugk_ids,
|
||||
GROUP_CONCAT(distinct ugc_id order by ugc_id) ugc_ids,
|
||||
GROUP_CONCAT(ugc_name) ugc_names,
|
||||
GROUP_CONCAT(distinct ugk_ugfv_id) ugfv_ids,
|
||||
GROUP_CONCAT(distinct if(ugf_table is null, 'null', ugf_table)) ugf_tables,
|
||||
GROUP_CONCAT(distinct if(ugf_value is null, 'null', ugf_value)) ugf_values,
|
||||
GROUP_CONCAT(distinct if(ugf_label is null, 'null', ugf_label)) ugf_labels
|
||||
|
||||
|
||||
FROM
|
||||
user_kid
|
||||
JOIN
|
||||
user_group_kid ON ugk_user_kid_uk_id = uk_id
|
||||
LEFT JOIN
|
||||
user_group_category ON ugc_id = ugk_category_ugc_id
|
||||
JOIN
|
||||
user_group_filter_value ON ugfv_id = ugk_ugfv_id
|
||||
JOIN
|
||||
user_group_filter ON ugf_id = ugfv_filter_id
|
||||
WHERE
|
||||
uk_deleted = 0 and uk_is_active = 1 and
|
||||
ugk_user_group_ug_id = ".$_POST['group_id'].""
|
||||
.($_POST['category_id']?" AND ugk_category_ugc_id = " . $_POST['category_id']:"").
|
||||
" GROUP BY uk_id
|
||||
ORDER BY uk_name ASC;
|
||||
";
|
||||
|
||||
$kid_array = $sql->assoc_array($user_kid_query);
|
||||
//var_dump($user_kid_query);
|
||||
|
||||
//szívás, ne módosítsuk
|
||||
foreach ($kid_array as $key => $kid_value) {
|
||||
$tables = get_value_parts($kid_value['ugf_tables']);
|
||||
$values_to_write = array();
|
||||
foreach ($tables as $index => $table_name) {
|
||||
if ('null' != $table_name && $kid_value['ugc_names']) {
|
||||
$values = get_value_parts($kid_value['ugf_values']);
|
||||
$value_field = $values[$index];
|
||||
$labels = get_value_parts($kid_value['ugf_labels']);
|
||||
$label_field = $labels[$index];
|
||||
$values_to_search = get_value_parts($kid_value['ugc_names']);
|
||||
//var_dump($values_to_search);
|
||||
$value_to_search = $values_to_search[$index];
|
||||
$values_to_write[] = $sql->single_variable('select '.$label_field.' from '.$table_name.' where '.$value_field.'='.$value_to_search);
|
||||
$query = 'select '.$label_field.' from '.$table_name.' where '.$value_field.'='.$value_to_search;
|
||||
}
|
||||
else {
|
||||
$names = get_value_parts($kid_value['ugc_names']);
|
||||
$values_to_write[] = $names[$index];
|
||||
}
|
||||
}
|
||||
$final_string = implode(',', $values_to_write);
|
||||
$kid_array[$key]['ugc_names'] = $final_string;
|
||||
}
|
||||
|
||||
echo json_encode($kid_array);
|
||||
|
||||
?>
|
||||
12
_ajax/get_category.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
$category_query = "SELECT * FROM user_group_category WHERE ugc_id = " . $_POST['category_id'];
|
||||
|
||||
echo json_encode($sql->assoc_array($category_query));
|
||||
|
||||
?>
|
||||
17
_ajax/get_category_list.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
$ugc_query = "SELECT * FROM user_group_category WHERE ugc_user_group_ug_id = " . $_POST['group_id'] . " ORDER BY ugc_name ASC";
|
||||
|
||||
$ugc_assoc_array = $sql->assoc_array($ugc_query);
|
||||
|
||||
echo json_encode($ugc_assoc_array);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
17
_ajax/get_filter_list.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
$ugc_query = "SELECT * FROM user_group_filter ORDER BY ugf_name ASC";
|
||||
|
||||
$ugc_assoc_array = $sql->assoc_array($ugc_query);
|
||||
|
||||
echo json_encode($ugc_assoc_array);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
17
_ajax/get_filter_value_list.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
$ugfv_query = "SELECT * FROM user_group_filter_value WHERE ugfv_group_id = " . $_POST['group_id'];
|
||||
|
||||
$ugfv_assoc_array = $sql->assoc_array($ugfv_query);
|
||||
|
||||
echo json_encode($ugfv_assoc_array);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
29
_ajax/get_filter_values.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
include('class_user_group_filter.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
if ($_POST['filter_id'] == 'null') {
|
||||
echo json_encode(null);
|
||||
}
|
||||
else {
|
||||
$ugf = new user_group_filter();
|
||||
$ugf->set_ugf_data_by_id($_POST['filter_id']);
|
||||
|
||||
//megvizsgáljuk, hogy külön táblából kell-e szedni az adatokat
|
||||
if ($ugf->get_ugf_table()) {
|
||||
$ugf_query = "SELECT DISTINCT ".$ugf->get_ugf_value()." AS ugf_id, ".$ugf->get_ugf_label()." AS ugf_name FROM " . $ugf->get_ugf_table() . " WHERE " . $ugf->get_ugf_condition();
|
||||
}
|
||||
else {
|
||||
$ugf_query = "SELECT DISTINCT uk_" . $ugf->get_ugf_field() . " AS ugf_id, uk_".$ugf->get_ugf_field()." as ugf_name FROM user_kid WHERE uk_".$ugf->get_ugf_field()." IS NOT NULL ORDER BY uk_" . $ugf->get_ugf_field() . " ASC;";
|
||||
}
|
||||
//var_dump($ugf_query);
|
||||
$ugf_assoc_array = $sql->assoc_array($ugf_query);
|
||||
|
||||
echo json_encode($ugf_assoc_array);
|
||||
}
|
||||
|
||||
?>
|
||||
93
_ajax/get_group_members.php
Executable file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
//ha members akkor minden AKTÍV, NEM TÖRÖLT kid-et lekéri, név szerint rendezve
|
||||
|
||||
$kid_query = "SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT
|
||||
uk_id,
|
||||
uk_name,
|
||||
ugk_id,
|
||||
uk_is_active,
|
||||
uk_deleted,
|
||||
ugk_user_group_ug_id,
|
||||
ugk_category_ugc_id
|
||||
FROM
|
||||
user_kid
|
||||
LEFT JOIN user_group_kid ON (ugk_user_kid_uk_id = uk_id
|
||||
AND ugk_id NOT IN (SELECT
|
||||
ugk_id
|
||||
FROM
|
||||
user_group_kid
|
||||
WHERE
|
||||
ugk_user_group_ug_id != ".$_POST['groupId']."))) subtbl
|
||||
WHERE
|
||||
(ugk_user_group_ug_id = ".$_POST['groupId']."
|
||||
OR ugk_user_group_ug_id IS NULL)
|
||||
AND uk_is_active = 1
|
||||
AND uk_deleted = 0
|
||||
AND (ugk_category_ugc_id NOT IN (SELECT
|
||||
ugc_id
|
||||
FROM
|
||||
user_group_category
|
||||
WHERE
|
||||
ugc_user_group_ug_id != ".$_POST['groupId'].")
|
||||
OR ugk_category_ugc_id IS NULL)";
|
||||
|
||||
|
||||
if (!empty($_POST['searchStr'])) {
|
||||
if ('members' == $_POST['searchStr']) {
|
||||
$kid_query = "select uk_id, uk_name, ugk_id, ugk_user_group_ug_id, ugk_category_ugc_id from user_kid
|
||||
left join user_group_kid on ugk_user_kid_uk_id = uk_id
|
||||
where ugk_user_group_ug_id = ".$_POST['groupId'];
|
||||
}
|
||||
elseif ('not_members' == $_POST['searchStr']) {
|
||||
$kid_query = " select uk_id, uk_name,
|
||||
(select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id) as thisGroup,
|
||||
if ((select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id), ugk_id, null) ugk_id,
|
||||
null ugk_user_group_ug_id,
|
||||
if ((select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id), ugk_category_ugc_id, null) ugk_category_ugc_id
|
||||
from user_kid main_uk
|
||||
left join user_group_kid main_ugk on ugk_user_kid_uk_id = uk_id
|
||||
where uk_id not in (
|
||||
select ugk_user_kid_uk_id from user_group_kid where ugk_user_group_ug_id = ".$_POST['groupId'].") AND uk_is_active = 1 AND uk_deleted = 0";
|
||||
}
|
||||
elseif ('members_without_category' == $_POST['searchStr']) {
|
||||
$kid_query = " SELECT
|
||||
*
|
||||
FROM
|
||||
user_kid
|
||||
JOIN
|
||||
user_group_kid ON ugk_user_kid_uk_id = uk_id
|
||||
WHERE
|
||||
ugk_user_group_ug_id = ".$_POST["groupId"]."
|
||||
AND ugk_category_ugc_id IS NULL";
|
||||
}
|
||||
elseif (is_numeric($_POST['searchStr'])) {
|
||||
# szűrés kategóriára
|
||||
$kid_query = "select uk_id, uk_name, ugk_id, ugk_user_group_ug_id, ugk_category_ugc_id from user_kid
|
||||
left join user_group_kid on ugk_user_kid_uk_id = uk_id
|
||||
where ugk_category_ugc_id = " . $_POST['searchStr'];
|
||||
}
|
||||
else {
|
||||
//keresés
|
||||
$kid_query .= " AND uk_name like '".$_POST['searchStr']."%'";
|
||||
}
|
||||
}
|
||||
|
||||
$kid_query .= " ORDER BY uk_name ASC;";
|
||||
|
||||
|
||||
$kid_assoc_array = $sql->assoc_array($kid_query);
|
||||
|
||||
|
||||
echo json_encode($kid_assoc_array);
|
||||
|
||||
?>
|
||||
0
_ajax/get_parent_data.php
Normal file → Executable file
0
_ajax/get_user_list.php
Normal file → Executable file
48
_ajax/update_membership.php
Executable file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
//tag listánál ez adja vissza a keresés eredményét
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
|
||||
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
|
||||
//ha benne van, akkor törölni kell, egyébként insertelni
|
||||
|
||||
$ugk_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_POST['group_id']. " AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
|
||||
|
||||
if ($sql->num_of_rows($ugk_query)) {
|
||||
//ha nincs category-ja, akkor töröljük, egyébként csak nullra rakjuk a group_id-t
|
||||
$ugk_id = $sql->single_variable($ugk_query);
|
||||
|
||||
$check_query = "SELECT ugk_category_ugc_id FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_POST['group_id']. " AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
|
||||
$category_id = $sql->single_variable($check_query);
|
||||
if ($category_id) {
|
||||
//update to null
|
||||
$sql->update_table('user_group_kid', array('ugk_user_group_ug_id' => 'null'), array('ugk_id' => $ugk_id));
|
||||
}
|
||||
else {
|
||||
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_id = " . $ugk_id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
//ha még nincs benne null-lal, akkor insert, egyébként update
|
||||
$check_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_group_ug_id IS NULL AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
|
||||
$ugk_id = $sql->single_variable($check_query);
|
||||
if ($ugk_id) {
|
||||
//update
|
||||
$sql->update_table('user_group_kid', array(
|
||||
'ugk_user_group_ug_id' => $_POST['group_id']
|
||||
), array('ugk_id' => $ugk_id));
|
||||
}
|
||||
else {
|
||||
$sql->insert_into('user_group_kid', array(
|
||||
'ugk_user_kid_uk_id' => $_POST['uk_id'],
|
||||
'ugk_user_group_ug_id' => $_POST['group_id']
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
0
_ajax/update_presence.php
Normal file → Executable file
@@ -119,7 +119,7 @@ class log {
|
||||
elseif (strstr($this->get_log_category()->get_logc_name(), 'delete')) return 'delete';
|
||||
elseif (strstr($this->get_log_category()->get_logc_name(), 'update')) return 'edit';
|
||||
elseif (in_array($this->get_log_category()->get_logc_name(), array('training_close', 'training_open'))) return 'lock';
|
||||
elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout', 'coach_login', 'coach_logout', 'camp_user_login', 'camp_user_logout'))) return 'login';
|
||||
elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout', 'coach_login', 'coach_logout', 'camp_user_login', 'camp_user_logout', 'camp_leader_login', 'camp_leader_logout'))) return 'login';
|
||||
}
|
||||
|
||||
public function set_log_data_by_id($_log_id) {
|
||||
@@ -141,6 +141,7 @@ class log {
|
||||
if ($this->get_log_category()->get_logc_type() == 1) $new_user = new user();
|
||||
elseif($this->get_log_category()->get_logc_type() == 2) $new_user = new user_kid();
|
||||
elseif($this->get_log_category()->get_logc_type() == 3) $new_user = new camp_user();
|
||||
elseif($this->get_log_category()->get_logc_type() == 4) $new_user = new user_camp_leader();
|
||||
$new_user->set_user_data_by_id($value);
|
||||
$this->set_log_user($new_user);
|
||||
}
|
||||
|
||||
@@ -219,6 +219,10 @@ class page {
|
||||
# turnusok
|
||||
include('include_camp_details.php');
|
||||
break;
|
||||
case 'user_groups':
|
||||
# csoportok
|
||||
include('include_user_groups.php');
|
||||
break;
|
||||
case 'delete_training_type':
|
||||
# EDZÉS TÍPUS TÖRLÉS
|
||||
include('include_delete_training_type.php');
|
||||
@@ -275,6 +279,10 @@ class page {
|
||||
# TÁBORVEZETŐ TÖRLÉS
|
||||
include('include_delete_camp_leader.php');
|
||||
break;
|
||||
case 'delete_user_group':
|
||||
# CSOPORT TÖRLÉS
|
||||
include('include_delete_user_group.php');
|
||||
break;
|
||||
case 'logout':
|
||||
# kijelentkezés
|
||||
$from = "admin";
|
||||
|
||||
194
_class/class_user_group.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
|
||||
class user_group {
|
||||
private $ug_id;
|
||||
private $ug_name;
|
||||
private $ug_description;
|
||||
private $ug_is_automatic;
|
||||
private $ug_deleted;
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_id()
|
||||
{
|
||||
return $this->ug_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_id($ug_id)
|
||||
{
|
||||
$this->ug_id = $ug_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_name()
|
||||
{
|
||||
return $this->ug_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_name
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_name($ug_name)
|
||||
{
|
||||
$this->ug_name = $ug_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_description()
|
||||
{
|
||||
return $this->ug_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_description
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_description($ug_description)
|
||||
{
|
||||
$this->ug_description = $ug_description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_is_automatic()
|
||||
{
|
||||
return $this->ug_is_automatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_is_automatic
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_is_automatic($ug_is_automatic)
|
||||
{
|
||||
$this->ug_is_automatic = $ug_is_automatic;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_deleted()
|
||||
{
|
||||
return $this->ug_deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_deleted
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_deleted($ug_deleted)
|
||||
{
|
||||
$this->ug_deleted = $ug_deleted;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ug_filter()
|
||||
{
|
||||
return $this->ug_filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ug_filter
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ug_filter($ug_filter)
|
||||
{
|
||||
$this->ug_filter = $ug_filter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function set_ug_data_by_id($_id) {
|
||||
global $sql;
|
||||
$set_data_assoc_array = $sql->assoc_array("select * from user_group where ug_id = " . $_id);
|
||||
$set_data_array = $set_data_assoc_array[0];
|
||||
foreach ($set_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value); //alapadatok beállítása
|
||||
}
|
||||
}
|
||||
|
||||
public static function create_user_group($_name, $_description, $_is_automatic = 0) {
|
||||
global $sql;
|
||||
|
||||
return $sql->insert_into('user_group', array(
|
||||
'ug_name' => $_name,
|
||||
'ug_description' => $_description,
|
||||
'ug_is_automatic' => $_is_automatic,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static function update_user_group($_name, $_description, $_id, $_is_automatic = 0) {
|
||||
global $sql;
|
||||
|
||||
$sql->update_table('user_group', array(
|
||||
'ug_name' => $_name,
|
||||
'ug_description' => $_description,
|
||||
'ug_is_automatic' => $_is_automatic,
|
||||
),
|
||||
array(
|
||||
'ug_id' => $_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static function empty_group($_group_id) {
|
||||
//kitörli a usereket a groupból; categoryra szűrhető
|
||||
global $sql;
|
||||
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_group_id);
|
||||
$sql->execute_query("DELETE FROM user_group_category WHERE ugc_user_group_ug_id = " . $_group_id);
|
||||
|
||||
}
|
||||
|
||||
public function get_user_group_filter_values() {
|
||||
global $sql;
|
||||
|
||||
$ugfv_array = array();
|
||||
|
||||
$ugfv_assoc_array = $sql->assoc_array("SELECT * FROM user_group_filter_value WHERE ugfv_group_id = " . $this->get_ug_id());
|
||||
|
||||
foreach ($ugfv_assoc_array as $u) {
|
||||
$ugfv = new user_group_filter_value();
|
||||
$ugfv->set_ugfv_data_by_id($u['ugfv_id']);
|
||||
$ugfv_array[] = $ugfv;
|
||||
}
|
||||
|
||||
return $ugfv_array;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
86
_class/class_user_group_category.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
class user_group_category {
|
||||
private $ugc_id;
|
||||
private $ugc_name;
|
||||
private $ugc_user_group_ug_id;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugc_id()
|
||||
{
|
||||
return $this->ugc_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugc_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugc_id($ugc_id)
|
||||
{
|
||||
$this->ugc_id = $ugc_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugc_name()
|
||||
{
|
||||
return $this->ugc_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugc_name
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugc_name($ugc_name)
|
||||
{
|
||||
$this->ugc_name = $ugc_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugc_user_group_ug_id()
|
||||
{
|
||||
return $this->ugc_user_group_ug_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugc_user_group_ug_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugc_user_group_ug_id($ugc_user_group_ug_id)
|
||||
{
|
||||
$this->ugc_user_group_ug_id = $ugc_user_group_ug_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function set_ugc_data_by_id($_id) {
|
||||
global $sql;
|
||||
$set_data_assoc_array = $sql->assoc_array("select * from user_group_category where ugc_id = " . $_id);
|
||||
$set_data_array = $set_data_assoc_array[0];
|
||||
foreach ($set_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value); //alapadatok beállítása
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function get_ugc_by_name($_name, $_group_id) {
|
||||
global $sql;
|
||||
return $sql->single_varible("select ugc_id from user_group_category where ugc_user_group_ug_id = " . $_group_id . " AND ugc_name = '".$_name."';");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
167
_class/class_user_group_filter.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
class user_group_filter {
|
||||
private $ugf_id;
|
||||
private $ugf_name;
|
||||
private $ugf_field;
|
||||
private $ugf_table;
|
||||
private $ugf_label;
|
||||
private $ugf_value;
|
||||
private $ugf_condition;
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_id()
|
||||
{
|
||||
return $this->ugf_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_id($ugf_id)
|
||||
{
|
||||
$this->ugf_id = $ugf_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_name()
|
||||
{
|
||||
return $this->ugf_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_name
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_name($ugf_name)
|
||||
{
|
||||
$this->ugf_name = $ugf_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_field()
|
||||
{
|
||||
return $this->ugf_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_field
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_field($ugf_field)
|
||||
{
|
||||
$this->ugf_field = $ugf_field;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_table()
|
||||
{
|
||||
return $this->ugf_table;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_table
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_table($ugf_table)
|
||||
{
|
||||
$this->ugf_table = $ugf_table;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_label()
|
||||
{
|
||||
return $this->ugf_label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_label
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_label($ugf_label)
|
||||
{
|
||||
$this->ugf_label = $ugf_label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_value()
|
||||
{
|
||||
return $this->ugf_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_value
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_value($ugf_value)
|
||||
{
|
||||
$this->ugf_value = $ugf_value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugf_condition()
|
||||
{
|
||||
return $this->ugf_condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugf_condition
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugf_condition($ugf_condition)
|
||||
{
|
||||
$this->ugf_condition = $ugf_condition;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function set_ugf_data_by_id($_ugf_id) {
|
||||
global $sql;
|
||||
$ugf_assoc_array = $sql->assoc_array("select * from user_group_filter where ugf_id = " . $_ugf_id);
|
||||
$ugf_array = $ugf_assoc_array[0];
|
||||
//alapadatok
|
||||
foreach ($ugf_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
232
_class/class_user_group_filter_value.php
Normal file
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
class user_group_filter_value {
|
||||
private $ugfv_id;
|
||||
private $ugfv_filter_id; //obj
|
||||
private $ugfv_group_id; //obj
|
||||
private $ugfv_value;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugfv_id()
|
||||
{
|
||||
return $this->ugfv_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugfv_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugfv_id($ugfv_id)
|
||||
{
|
||||
$this->ugfv_id = $ugfv_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugfv_filter_id()
|
||||
{
|
||||
return $this->ugfv_filter_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugfv_filter_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugfv_filter_id($ugfv_filter_id)
|
||||
{
|
||||
$this->ugfv_filter_id = $ugfv_filter_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugfv_group_id()
|
||||
{
|
||||
return $this->ugfv_group_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugfv_group_id
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugfv_group_id($ugfv_group_id)
|
||||
{
|
||||
$this->ugfv_group_id = $ugfv_group_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_ugfv_value()
|
||||
{
|
||||
return $this->ugfv_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ugfv_value
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function set_ugfv_value($ugfv_value)
|
||||
{
|
||||
$this->ugfv_value = $ugfv_value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function set_ugfv_data_by_id($_sc_id) {
|
||||
global $sql;
|
||||
$ugfv_data_assoc_array = $sql->assoc_array("select * from user_group_filter_value where ugfv_id = " . $_sc_id);
|
||||
$ugfv_data_array = $ugfv_data_assoc_array[0];
|
||||
foreach ($ugfv_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value); //alapadatok beállítása
|
||||
if ($field == 'ugfv_filter_id' && !empty($value)) {
|
||||
$filter = new user_group_filter();
|
||||
$filter->set_ugf_data_by_id($value);
|
||||
$this->set_ugfv_filter_id($filter);
|
||||
}
|
||||
if ($field == 'ugfv_group_id' && !empty($value)) {
|
||||
$group = new user_group();
|
||||
$group->set_ug_data_by_id($value);
|
||||
$this->set_ugfv_group_id($group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function apply($intersect = 0) {
|
||||
global $sql;
|
||||
//EZ CSAK BEILLESZT, A SZÜKSÉGES TÖRLÉSEKET ELŐTTE KELL MEGCSINÁLNI
|
||||
//$this->get_ugfv_group_id()->empty_group($ugc_id);
|
||||
//$this->get_ugfv_group_id()->empty_group($ugc_id);
|
||||
//lekéri az usereket a megadott értékek alapján, és ha még nincs ilyen user a csoportban ezzel a category-val, akkor beilleszti
|
||||
|
||||
if (!$intersect) {
|
||||
$ugc_id = $sql->insert_into('user_group_category', array(
|
||||
'ugc_name' => $this->get_ugfv_value(),
|
||||
'ugc_user_group_ug_id' => $this->get_ugfv_group_id()->get_ug_id(),
|
||||
'ugc_ugfv_id' => $this->get_ugfv_id()
|
||||
));
|
||||
}
|
||||
|
||||
if ($this->get_ugfv_filter_id()->get_ugf_table()) {
|
||||
//ha meg van adva table, akkor az alapján rakjuk össze a query-t
|
||||
$table = $this->get_ugfv_filter_id()->get_ugf_table();
|
||||
$uk_field = 'uk_'.$this->get_ugfv_filter_id()->get_ugf_field();
|
||||
$value = $this->get_ugfv_filter_id()->get_ugf_value();
|
||||
$condition = $this->get_ugfv_filter_id()->get_ugf_condition();
|
||||
|
||||
$filter_query = "
|
||||
SELECT
|
||||
uk_id
|
||||
FROM
|
||||
user_kid
|
||||
JOIN
|
||||
".$table." ON ".$value." = ".$uk_field."
|
||||
WHERE ".($table!='user_kid_is_active'?"uk_is_active = 1 ":"")." AND uk_deleted = 0 AND
|
||||
".$uk_field." = ".$this->get_ugfv_value() . ($condition?" AND " . $condition:"") .
|
||||
";";
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
$filter_query = "
|
||||
SELECT uk_id FROM user_kid
|
||||
WHERE uk_is_active = 1 AND uk_deleted = 0 AND uk_".$this->get_ugfv_filter_id()->get_ugf_field()." = '".$this->get_ugfv_value()."';
|
||||
";
|
||||
|
||||
}
|
||||
//var_dump($filter_query);
|
||||
|
||||
|
||||
$uk_assoc_array = $sql->assoc_array($filter_query);
|
||||
|
||||
$uk_ids = [];
|
||||
foreach ($uk_assoc_array as $uk_array) {
|
||||
$uk_ids[] = $uk_array['uk_id'];
|
||||
}
|
||||
|
||||
$ugfv_list = $sql->assoc_array('SELECT * FROM user_group_kid WHERE ugk_ugfv_id in (SELECT ugfv_id FROM user_group_filter_value WHERE ugfv_group_id = ' . $this->get_ugfv_group_id()->get_ug_id(). ');');
|
||||
if ($intersect && count($ugfv_list)) {
|
||||
//ha már van vmi a metszetben
|
||||
//végigmegyünk a metszeten, és ha az aktuális elem nincs benne az uk_assoc_arrayben, akkor kivesszük a metszetből
|
||||
foreach ($ugfv_list as $index => $ugfv_array) {
|
||||
if (!in_array($ugfv_array['ugk_user_kid_uk_id'], $uk_ids)) {
|
||||
$sql->execute_query('DELETE FROM user_group_kid WHERE ugk_id = ' . $ugfv_array['ugk_id']);
|
||||
unset($ugfv_list[$index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
foreach ($uk_assoc_array as $uk) {
|
||||
$sql->insert_into('user_group_kid', array(
|
||||
'ugk_user_kid_uk_id' => $uk['uk_id'],
|
||||
'ugk_user_group_ug_id' => $this->get_ugfv_group_id()->get_ug_id(),
|
||||
'ugk_category_ugc_id' => ($intersect?'null':$ugc_id),
|
||||
'ugk_ugfv_id' => $this->get_ugfv_id(),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function is_user_filterable($user) {
|
||||
global $sql;
|
||||
|
||||
if ($this->get_ugfv_filter_id()->get_ugf_table()) {
|
||||
//ha meg van adva table, akkor az alapján rakjuk össze a query-t
|
||||
$table = $this->get_ugfv_filter_id()->get_ugf_table();
|
||||
$uk_field = 'uk_'.$this->get_ugfv_filter_id()->get_ugf_field();
|
||||
$value = $this->get_ugfv_filter_id()->get_ugf_value();
|
||||
$condition = $this->get_ugfv_filter_id()->get_ugf_condition();
|
||||
|
||||
$filter_query = "
|
||||
SELECT
|
||||
uk_id
|
||||
FROM
|
||||
user_kid
|
||||
JOIN
|
||||
".$table." ON ".$value." = ".$uk_field."
|
||||
WHERE ".($table!='user_kid_is_active'?"uk_is_active = 1 ":"")." AND uk_id = ".$user->get_uk_id()." AND uk_deleted = 0 AND
|
||||
".$uk_field." = ".$this->get_ugfv_value() . ($condition?" AND " . $condition:"") .
|
||||
";";
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
$filter_query = "
|
||||
SELECT uk_id FROM user_kid
|
||||
WHERE uk_is_active = 1 AND uk_deleted = 0 AND uk_id = ".$user->get_uk_id()." AND uk_".$this->get_ugfv_filter_id()->get_ugf_field()." = '".$this->get_ugfv_value()."';
|
||||
";
|
||||
|
||||
}
|
||||
//var_dump($filter_query);
|
||||
return $sql->num_of_rows($filter_query);
|
||||
}
|
||||
|
||||
public function is_intersect() {
|
||||
global $sql;
|
||||
return empty($sql->single_variable('SELECT ugk_category_ugc_id FROM user_group_kid WHERE ugk_user_group_ug_id = ' . $this->get_ugfv_group_id()->get_ug_id(). ' AND ugk_ugfv_id = ' . $this->get_ugfv_id()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -21,6 +21,7 @@ class user_kid extends user_parent {
|
||||
private $user_first_training;
|
||||
private $user_beforehand;
|
||||
private $user_hand;
|
||||
private $user_level;
|
||||
private $user_last_modified;
|
||||
private $logged_in;
|
||||
private $user_type;
|
||||
@@ -33,7 +34,8 @@ class user_kid extends user_parent {
|
||||
private $user_phone;
|
||||
private $user_facebook;
|
||||
private $user_region;
|
||||
private $user_ago_category;
|
||||
private $user_age_category;
|
||||
private $user_official_age_category;
|
||||
private $user_contact;
|
||||
private $user_other;
|
||||
private $user_deleted;
|
||||
@@ -207,6 +209,12 @@ class user_kid extends user_parent {
|
||||
public function get_uk_hand() {
|
||||
return $this->user_hand;
|
||||
}
|
||||
public function set_uk_level($_level) {
|
||||
$this->user_level = $_level;
|
||||
}
|
||||
public function get_uk_level() {
|
||||
return $this->user_level;
|
||||
}
|
||||
public function set_uk_last_modified($_last_modified) {
|
||||
$this->user_last_modified = $_last_modified;
|
||||
}
|
||||
@@ -237,6 +245,12 @@ class user_kid extends user_parent {
|
||||
public function get_uk_age_category() {
|
||||
return $this->user_age_category;
|
||||
}
|
||||
public function set_uk_official_age_category($_age_category) {
|
||||
$this->user_official_age_category = $_age_category;
|
||||
}
|
||||
public function get_uk_official_age_category() {
|
||||
return $this->user_official_age_category;
|
||||
}
|
||||
public function set_uk_school($_school) {
|
||||
$this->user_school = $_school;
|
||||
}
|
||||
@@ -508,5 +522,103 @@ class user_kid extends user_parent {
|
||||
|
||||
return $_de_obj_array;
|
||||
}
|
||||
|
||||
public function get_groups() {
|
||||
global $sql;
|
||||
|
||||
$group_array = array();
|
||||
$g_assoc = $sql->assoc_array("select * from user_group_kid join user_group on ug_id = ugk_user_group_ug_id where ug_is_automatic = 1 and ugk_user_kid_uk_id = ".$this->get_uk_id().";");
|
||||
|
||||
foreach ($g_assoc as $g) {
|
||||
$group = new user_group();
|
||||
$group->set_ug_data_by_id($g['ugk_user_group_ug_id']);
|
||||
$group_array[] = $group;
|
||||
}
|
||||
|
||||
return $group_array;
|
||||
}
|
||||
|
||||
public function update_filters() {
|
||||
global $sql;
|
||||
|
||||
//azok a csoportokban, amikben az user benne van
|
||||
$user_groups = $this->get_groups();
|
||||
|
||||
//az user csoportjainak ugfv-i; tömb[tömb]
|
||||
$my_ugfv_array = array();
|
||||
foreach ($user_groups as $user_group) {
|
||||
$ugfv = $user_group->get_user_group_filter_values();
|
||||
$no_falses = 0;
|
||||
$index = 0;
|
||||
foreach ($ugfv as $ugfv_obj) {
|
||||
//var_dump($ugfv_obj->is_intersect());
|
||||
if(!$ugfv_obj->is_user_filterable($this) && $ugfv_obj->is_intersect()) {
|
||||
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id());
|
||||
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id());
|
||||
continue 2;
|
||||
}
|
||||
elseif (!$ugfv_obj->is_user_filterable($this) && !$ugfv_obj->is_intersect()) {
|
||||
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $ugfv_obj->get_ugfv_id());
|
||||
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $ugfv_obj->get_ugfv_id());
|
||||
$no_falses++;
|
||||
}
|
||||
$index ++;
|
||||
}
|
||||
if($no_falses == $index) {
|
||||
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $this->get_ugfv_id());
|
||||
}
|
||||
}
|
||||
|
||||
//lekérni minden csoport (ami nem az előzőek egyike) minden filtervalue-ját, és megnézni, hogy beszűrné-e
|
||||
|
||||
//minden csoport, ami nem az előzőek
|
||||
$user_groups_assoc = $sql->assoc_array("select * from user_group where ug_id not in (select distinct ugk_user_group_ug_id from user_group_kid where ugk_user_kid_uk_id = ".$this->get_uk_id().") and ug_is_automatic = 1 and ug_deleted = 0;");
|
||||
|
||||
$user_groups = array();
|
||||
foreach ($user_groups_assoc as $ug) {
|
||||
$new_ug = new user_group();
|
||||
$new_ug->set_ug_data_by_id($ug['ug_id']);
|
||||
$user_groups[] = $new_ug;
|
||||
}
|
||||
|
||||
foreach ($user_groups as $user_group) {
|
||||
$ugfv = $user_group->get_user_group_filter_values();
|
||||
$no_success = 0;
|
||||
$index = 0;
|
||||
foreach ($ugfv as $ugfv_obj) {
|
||||
if($ugfv_obj->is_user_filterable($this) && !$ugfv_obj->is_intersect()) {
|
||||
$category_id = $sql->single_variable("SELECT ugc_id FROM user_group_category WHERE ugc_ugfv_id =" . $ugfv_obj->get_ugfv_id());
|
||||
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id, ugk_category_ugc_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().", " . $category_id . ");");
|
||||
$sql->insert_into(
|
||||
'user_group_kid',
|
||||
array(
|
||||
'ugk_user_kid_uk_id' => $this->get_uk_id(),
|
||||
'ugk_user_group_ug_id' => $user_group->get_ug_id(),
|
||||
'ugk_category_ugc_id' => $category_id,
|
||||
'ugk_ugfv_id' => $ugfv_obj->get_ugfv_id()
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($ugfv_obj->is_user_filterable($this) && $ugfv_obj->is_intersect()) {
|
||||
$no_success++;
|
||||
|
||||
//continue 2;
|
||||
}
|
||||
$index ++;
|
||||
}
|
||||
if($no_success == $index) {
|
||||
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().");");
|
||||
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().");");
|
||||
$sql->insert_into(
|
||||
'user_group_kid',
|
||||
array(
|
||||
'ugk_user_kid_uk_id' => $this->get_uk_id(),
|
||||
'ugk_user_group_ug_id' => $user_group->get_ug_id(),
|
||||
'ugk_ugfv_id' => $ugfv_obj->get_ugfv_id()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
152
_css/default.css
@@ -568,9 +568,161 @@ h1.apply {
|
||||
margin: 30px auto 50px auto;
|
||||
}
|
||||
|
||||
#footer_control {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 50px;
|
||||
background: #3d3d3d;
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.list .member {
|
||||
background-color: #20b495;
|
||||
border-left: 3px solid black;
|
||||
}
|
||||
|
||||
.list .member:hover {
|
||||
background-color: #93e9ac;
|
||||
border-left: 3px solid black;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
width: 50px;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
right: -5px;
|
||||
top: -10px;
|
||||
background-color: #edfc5a;
|
||||
float: right;
|
||||
border-right: 3px solid;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.list .list_item .toggle img {
|
||||
position: relative;
|
||||
left: 12px;
|
||||
top: 45px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.nested {
|
||||
position: relative;
|
||||
right: 25px;
|
||||
height: 28px;
|
||||
border-radius: 0px 10px 7px 0px;
|
||||
top: 1px;
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
#footer_toggle {
|
||||
width: 60px;
|
||||
height: 50px;
|
||||
background: #e0e0e0;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#footer_toggle img {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.category_list {
|
||||
width: 70%;
|
||||
display: block;
|
||||
margin: 5px 2% 5px 8%;
|
||||
}
|
||||
|
||||
.add_category {
|
||||
width: 50%;
|
||||
margin: 5px 2% 0px 15%;
|
||||
}
|
||||
|
||||
.name_span {
|
||||
margin: 5px auto;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bigger_padding {
|
||||
padding: 20px 0px 50px 0px;
|
||||
}
|
||||
|
||||
form#auto_filters > div > label {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
.category_tab {
|
||||
padding: 3px;
|
||||
border: 1px solid;
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.categories {
|
||||
display: inline-block;
|
||||
padding: 10px 45px 10px 45px;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#categories {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
@media (min-width: 680px) {
|
||||
|
||||
.categories {
|
||||
width: unset;
|
||||
text-align: left;
|
||||
margin: 0px 0px 0px 45px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: relative;
|
||||
right: -5px;
|
||||
top: -10px;
|
||||
background-color: #edfc5a;
|
||||
float: right;
|
||||
border-right: 3px solid;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.list .list_item .toggle img {
|
||||
position: relative;
|
||||
left: 12px;
|
||||
top: 10px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.name_span {
|
||||
min-width: 200px;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.category_list {
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.add_category {
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
.list .date_separator {
|
||||
width: 100%;
|
||||
|
||||
BIN
_image/android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
_image/android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
_image/android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
_image/android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
_image/android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
_image/android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
_image/apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
_image/apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
_image/apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
_image/apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
_image/apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
_image/apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
_image/apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
_image/apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
_image/apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
_image/apple-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
_image/apple-icon.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
2
_image/browserconfig.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||
BIN
_image/collapse.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
_image/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
_image/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
_image/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
41
_image/manifest.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
_image/ms-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
_image/ms-icon-150x150.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
_image/ms-icon-310x310.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
_image/ms-icon-70x70.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
_image/switch.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@@ -205,6 +205,10 @@ switch ($this->get_id()) {
|
||||
# táborvezető létrehozása
|
||||
$smarty->display('user_camp_leader_create.tpl');
|
||||
break;
|
||||
case 'user_group':
|
||||
# táborvezető létrehozása
|
||||
$smarty->display('user_group_create.tpl');
|
||||
break;
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
|
||||
12
_include/include_delete_user_group.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
//$delete_query = "DELETE FROM user_kid WHERE uk_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
$sql->update_table('user_group', array('ug_deleted' => 1), array('ug_id' => $this->get_id()));
|
||||
log::register('delete_user_group', $this->get_id());
|
||||
header("Location: /admin/user_groups");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
34
_include/include_user_groups.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
# HA NINCS ID, AKKOR CSOPORTLISTA
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# CSOPORT SZERKESZTÉSE /TAGLISTA
|
||||
|
||||
$group = new user_group();
|
||||
$group->set_ug_data_by_id($this->get_id());
|
||||
|
||||
$smarty->assign('user_group', $group);
|
||||
$smarty->display('user_group_data_edit.tpl');
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# CSOPORT LISTA
|
||||
|
||||
$group_query = "SELECT * FROM user_group WHERE ug_deleted = 0 ORDER By ug_name ASC;";
|
||||
$group_assoc_array = $sql->assoc_array($group_query);
|
||||
|
||||
$group_array = array();
|
||||
foreach ($group_assoc_array as $group) {
|
||||
$new_ug = new user_group();
|
||||
$new_ug->set_ug_data_by_id($group['ug_id']);
|
||||
$group_array[] = $new_ug;
|
||||
}
|
||||
|
||||
$smarty->assign('user_group_array',$group_array);
|
||||
$smarty->display('user_group_list.tpl');
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -32,6 +32,7 @@ if (isset($_POST['action'])) {
|
||||
$user_kid_id = null;
|
||||
$user_coach_id = null;
|
||||
$user_camp_id = null;
|
||||
$user_camp_leader_id = null;
|
||||
|
||||
if ($_REQUEST['page'] == 'admin') $user_admin_id = $login->check_admin_login($_POST['user_name'], $_POST['user_password']);
|
||||
if ($_REQUEST['page'] == 'view') $user_kid_id = $login->check_kid_login($_POST['user_name'], $_POST['user_password']);
|
||||
@@ -92,8 +93,13 @@ if (isset($_POST['action'])) {
|
||||
$uid = $_POST['uk_id'];
|
||||
unset($_POST['uk_id']);
|
||||
user_kid::update_user($_POST, $uid);
|
||||
//filter_update
|
||||
$kid = new user_kid();
|
||||
$kid->set_user_data_by_id($uid);
|
||||
$kid->update_filters();
|
||||
//filter update end
|
||||
log::register('update_member', $uid);
|
||||
header("Location: " . $actual_link);
|
||||
//header("Location: " . $actual_link);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -507,6 +513,18 @@ if (isset($_POST['action'])) {
|
||||
log::register('update_camp_leader', $_POST['ucl_id']);
|
||||
header('Location: /admin/camp_user');
|
||||
break;
|
||||
case 'user_group_create':
|
||||
# új csoport
|
||||
$new_ug_id = user_group::create_user_group($_POST['ug_name'], $_POST['ug_description'], $_POST['ug_is_automatic']);
|
||||
log::register('new_user_group', $new_ug_id);
|
||||
header('Location: /admin/user_groups');
|
||||
break;
|
||||
case 'user_group_update':
|
||||
# csoport update
|
||||
user_group::update_user_group($_POST['ug_name'], $_POST['ug_description'], $_POST['ug_id'], $_POST['ug_is_automatic']);
|
||||
log::register('update_user_group', $_POST['ug_id']);
|
||||
header('Location: /admin/user_groups');
|
||||
break;
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
|
||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
18
index.php
@@ -15,7 +15,23 @@ setlocale(LC_ALL, 'hu_HU');
|
||||
</style>
|
||||
<script src="/jQuery/jquery-3.1.1.min.js"></script>
|
||||
<script src="/ckeditor/ckeditor.js"></script>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/_image/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/_image/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/_image/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/_image/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/_image/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/_image/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/_image/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/_image/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/_image/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/_image/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/_image/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/_image/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/_image/favicon-16x16.png">
|
||||
<link rel="manifest" href="/_image/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/_image/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
|
||||
@@ -81,6 +81,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_level">Szint:</label>
|
||||
<div><input type="text" name="uk_level" id="uk_level"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_email">E-mail cím:</label>
|
||||
@@ -152,6 +157,11 @@
|
||||
<div><input type="text" name="uk_age_category" id="uk_age_category"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_official_age_category">MTLSz korosztály:</label>
|
||||
<div><input type="text" name="uk_official_age_category" id="uk_official_age_category"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_shirt_size_ss_id">Pólóméret:</label>
|
||||
<div>
|
||||
|
||||
@@ -86,6 +86,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_level">Szint:</label>
|
||||
<div><input type="text" name="uk_level" id="uk_level" value="{$user_data.uk_level}"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_email">E-mail cím:</label>
|
||||
@@ -177,6 +182,11 @@
|
||||
<div><input type="text" name="uk_age_category" id="uk_age_category" value="{$user_data.uk_age_category}"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_official_age_category">MTLSz korosztály:</label>
|
||||
<div><input type="text" name="uk_official_age_category" id="uk_official_age_category" value="{$user_data.uk_official_age_category}"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_parent_1">Szülő:</label>
|
||||
<div>
|
||||
|
||||
27
template/templates/user_group_create.tpl
Normal file
@@ -0,0 +1,27 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="user_group_create">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_name">Név:</label>
|
||||
<div><input type="text" name="ug_name" id="ug_name" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_description">Leírás:</label>
|
||||
<div><textarea rows="5" name="ug_description" id="ug_description"></textarea></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_is_automatic">Automatikus csoport:</label>
|
||||
<div><input type="checkbox" name="ug_is_automatic" id="ug_is_automatic" value="1"></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Létrehozás">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
567
template/templates/user_group_data_edit.tpl
Normal file
@@ -0,0 +1,567 @@
|
||||
<div class="form_wrapper">
|
||||
<form method="post">
|
||||
<div class="buttons">
|
||||
<a href="/admin/delete_user_group/{$user_group->get_ug_id()}" class="addbutton delete-big">Csoport törlése</a>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="user_group_update">
|
||||
<input type="hidden" name="ug_id" id="ug_id" value="{$user_group->get_ug_id()}">
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_name">Név:</label>
|
||||
<div><input type="text" name="ug_name" id="ug_name" value="{$user_group->get_ug_name()}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_description">Leírás:</label>
|
||||
<div><textarea rows="5" name="ug_description" id="ug_description">{$user_group->get_ug_description()}</textarea></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="ug_is_automatic">Automatikus csoport:</label>
|
||||
<div><input type="checkbox" name="ug_is_automatic" id="ug_is_automatic" value="1" disabled="disabled" {if $user_group->get_ug_is_automatic()}checked{/if}></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input class="button black" type="submit" value="Mentés">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
{if $user_group->get_ug_is_automatic()}
|
||||
<br><br><br>
|
||||
<form method="post" id="auto_filters">
|
||||
</form>
|
||||
<input type="hidden" name="ug_id" id="ug_id" value="{$user_group->get_ug_id()}">
|
||||
<div class="user_filter">
|
||||
<button type="button" class="button black" onclick="add_filter()" style="height: 40px;">Szűrő Hozzáadás</button>
|
||||
</div>
|
||||
<br>
|
||||
<div class="user_filter">
|
||||
<button type="button" class="button black" onclick="apply_filters()" style="height: 40px;">Halmaz</button>
|
||||
<button type="button" class="button black" onclick="apply_filters(1)" style="height: 40px;">Metszet</button>
|
||||
</div>
|
||||
|
||||
<div class="list wide" id="user_list" style="padding: 20px 0px 50px 0px;"></div>
|
||||
|
||||
<div id="footer_control">
|
||||
<a onclick="update_user_list()" class="addbutton add" style="cursor: pointer;">Minden tag</a>
|
||||
<div id="categories">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="footer_toggle" onclick="footer_toggle();">
|
||||
<img src="/_image/collapse.png">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var footer_category_ids = [];
|
||||
var footer_values = [];
|
||||
|
||||
$( document ).ready(function() {
|
||||
update_user_list(null, true);
|
||||
update_footer();
|
||||
get_filters();
|
||||
});
|
||||
|
||||
|
||||
function get_filters() {
|
||||
$.post("/_ajax/get_filter_value_list.php",
|
||||
{
|
||||
group_id: $("#ug_id").val()
|
||||
},
|
||||
function(data, status) {
|
||||
//filter array
|
||||
var pdata = JSON.parse(data);
|
||||
|
||||
$.each(pdata, function(key, filter_value) {
|
||||
//végigmegyünk a filter_value-kon
|
||||
var filter_id = filter_value['ugfv_filter_id'];
|
||||
var filter_value_id = filter_value['ugfv_id'];
|
||||
var filter_html = '\
|
||||
<div class="filter_row"><label for="filter_'+filter_value_id+'""><select class="filter_select" onChange="update_value_list('+filter_value_id+', this)" id="filter_'+filter_value_id+'"><option value="null">- Válassz szűrőt -</option></select></label>\
|
||||
<div>\
|
||||
<select id="filter_value_'+filter_value_id+'"><option value="null">- Szűrő értéke -</option></select>\
|
||||
</div></div>\
|
||||
';
|
||||
$("#auto_filters").append(filter_html);
|
||||
load_filters(filter_value_id, filter_id, filter_value['ugfv_value']);
|
||||
//update_value_list(filter_value_id, $("#filter_"+filter_value_id), filter_value['ugfv_value']);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function load_filters(select_id, selected_filter_id = null, ugfv_value = null) {
|
||||
$.post("/_ajax/get_filter_list.php",
|
||||
function(data, status) {
|
||||
//filter array
|
||||
var pdata = JSON.parse(data);
|
||||
var selected;
|
||||
var option_string = '<option value="null">- Válassz szűrőt -</option>';
|
||||
$.each(pdata, function(key, value) {
|
||||
selected = '';
|
||||
if (selected_filter_id) {
|
||||
if (selected_filter_id == value["ugf_id"]) {
|
||||
selected = ' selected';
|
||||
}
|
||||
}
|
||||
option_string += "<option value='"+value["ugf_id"]+"'"+selected+">"+value["ugf_name"]+"</option>";
|
||||
});
|
||||
$("#filter_"+select_id).html(option_string);
|
||||
//$("#filter_"+select_id).trigger('change');
|
||||
if (ugfv_value) {
|
||||
update_value_list(select_id, $("#filter_"+select_id), ugfv_value);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function update_value_list(id, select_element, selected_id = null) {
|
||||
//itt kell megvizsgálni, hogy milyen fajta mező stb
|
||||
//mármint az ajaxezés közben
|
||||
$.post("/_ajax/get_filter_values.php",
|
||||
{
|
||||
filter_id: $("#filter_"+id).val(),
|
||||
},
|
||||
function(data, status) {
|
||||
//value array
|
||||
var pdata = JSON.parse(data);
|
||||
if (pdata != null) {
|
||||
var option_string = '';
|
||||
$.each(pdata, function(key, value) {
|
||||
option_string += "<option value='"+value["ugf_id"]+"'>"+value["ugf_name"]+"</option>";
|
||||
});
|
||||
$("#filter_value_"+id).html(option_string);
|
||||
if (selected_id) {
|
||||
$("#filter_value_"+id).val(selected_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#filter_value_"+id).html('<option value="null">- Szűrő értéke -</option>');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_footer() {
|
||||
$("#categories").html('');
|
||||
$.each(footer_category_ids, function(key, value) {
|
||||
$("#categories").append('<a onclick="update_user_list('+value+')" class="addbutton add" style="cursor: pointer;">'+footer_values[key]+'</a>');
|
||||
});
|
||||
}
|
||||
|
||||
function apply_filters(intersect = 0) {
|
||||
//ha üres a filter list, akkor nem csinál semmit
|
||||
var to_remove = [];
|
||||
if( ($('#auto_filters').children()).length ) {
|
||||
//todo: a kiválasztott mezőket is hozzá kell rakni
|
||||
|
||||
//bele kell rakni egy tömbbe a filterek id-ját
|
||||
var filter_array = [];
|
||||
$.each($(".filter_select"), function(key, value) {
|
||||
//le kell vágni a _ után a számot
|
||||
//tömb[tömb]
|
||||
//a belső tömbben egy filter ID, filter_value ID és egy value van
|
||||
var filter_select_value = $(this).val();
|
||||
|
||||
|
||||
if (filter_select_value == 'null') {
|
||||
to_remove.push($(this).parent().parent());
|
||||
}
|
||||
|
||||
var parts = $(value).attr('id').split('_');
|
||||
var filter_id = parts[1];
|
||||
var filter_value = [];
|
||||
filter_value.push(filter_id);
|
||||
filter_value.push($("#filter_value_"+filter_id).val());
|
||||
filter_value.push($("#filter_"+filter_id).val());
|
||||
|
||||
filter_array.push(filter_value);
|
||||
|
||||
|
||||
});
|
||||
//return;
|
||||
$.post("/_ajax/apply_filters.php",
|
||||
{
|
||||
filter_array: filter_array,
|
||||
user_group_id: $("#ug_id").val(),
|
||||
intersect: intersect,
|
||||
},
|
||||
function(data, status) {
|
||||
update_user_list(null, true);
|
||||
$.each(to_remove, function(key, value) {
|
||||
value.remove();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function update_user_list(category_id = 0, footer_update = false) {
|
||||
//lekéri a usereket a csoportból
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '/_ajax/get_auto_group_members.php',
|
||||
global: false,
|
||||
type: 'POST',
|
||||
data: {
|
||||
group_id: $("#ug_id").val(),
|
||||
category_id: category_id,
|
||||
},
|
||||
async: true, //blocks window close
|
||||
success: function(data, status) {
|
||||
var pdata = JSON.parse(data);
|
||||
console.log(pdata);
|
||||
var content = '';
|
||||
var ugc_name_parts;
|
||||
footer_category_ids = [];
|
||||
footer_values = [];
|
||||
content += '<div class="date_separator">'+pdata.length+' fő';
|
||||
if (category_id) {
|
||||
content += ' (szűkített nézet!)';
|
||||
}
|
||||
|
||||
content += '</div>';
|
||||
$.each(pdata, function(key, value) {
|
||||
ugc_name_parts = value['ugc_names'].split(",");
|
||||
//footer elements
|
||||
//darabokra szedjük + mégegy each
|
||||
if (value['ugc_ids']) {
|
||||
var ugc_ids = value['ugc_ids'].split(',');
|
||||
$.each(ugc_ids, function(k, v) {
|
||||
if (footer_category_ids.indexOf(v) == -1) {
|
||||
footer_category_ids.push(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
//fe. end
|
||||
|
||||
ugc_name_parts.sort();
|
||||
content +=
|
||||
'\
|
||||
<div class="list_item" id="kid_'+value['uk_id']+'">\
|
||||
<span class="name_span">'+value['uk_name']+'</span>';
|
||||
if (value['ugc_ids']) {
|
||||
content += '<div class="categories">';
|
||||
|
||||
$.each(ugc_name_parts, function(ugc_key, ugc_value) {
|
||||
content += '<span class="category_tab">'+ugc_value+'</span>';
|
||||
if (footer_values.indexOf(ugc_value) == -1) {
|
||||
footer_values.push(ugc_value);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
content += '\
|
||||
</div>';
|
||||
}
|
||||
content += '</div>';
|
||||
});
|
||||
if (footer_update) {
|
||||
update_footer();
|
||||
}
|
||||
document.getElementById('user_list').innerHTML = content;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function add_filter() {
|
||||
//hozzáad egy új szűrő a HTML-hez
|
||||
|
||||
$.post("/_ajax/create_user_group_filter.php",
|
||||
{
|
||||
create_new: true,
|
||||
},
|
||||
function(data, status) {
|
||||
//az új szűrő id-ját kapjuk vissza
|
||||
var pdata = JSON.parse(data);
|
||||
//illesszünk be rögtön egy új szűrőt, először csak null filter_id-val, és majd az Alkalmaz gombra kattintva tölti ki
|
||||
var filter_html = '\
|
||||
<div class="filter_row"><label for="filter_'+pdata+'""><select class="filter_select" onChange="update_value_list('+pdata+', this)" id="filter_'+pdata+'"><option value="null">- Válassz szűrőt -</option></select></label>\
|
||||
<div>\
|
||||
<select id="filter_value_'+pdata+'"><option value="null">- Szűrő értéke -</option></select>\
|
||||
</div></div>\
|
||||
';
|
||||
$("#auto_filters").append(filter_html);
|
||||
//legyen egy function, ami egy adott selectbe beletölti az összes filter típust
|
||||
load_filters(pdata);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
{else}
|
||||
|
||||
<div class="user_filter">
|
||||
<input name="uk_filter_name" id="uk_filter_name" placeholder="Keresés..." autofocus>
|
||||
<button type="button" class="button black" onclick="get_group_members({$user_group->get_ug_id()}, null)" style="height: 40px;">Összes tag</button>
|
||||
</div>
|
||||
<div class="user_filter">
|
||||
<input class="add_category" id="add_category" placeholder="Új kategória">
|
||||
<button type="button" class="button black" onclick="add_category()" style="height: 40px;">Hozzáadás</button>
|
||||
</div>
|
||||
|
||||
<div class="list wide" id="user_list" style="padding: 20px 0px 50px 0px;"></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer_control">
|
||||
<a href="#" id="members" onclick="get_group_members({$user_group->get_ug_id()},'members')" class="addbutton add">Tagok</a>
|
||||
<a href="#" id="not_members" onclick="get_group_members({$user_group->get_ug_id()},'not_members')" class="addbutton add">Nem tagok</a>
|
||||
<a href="#" id="members_without_category" onclick="get_group_members({$user_group->get_ug_id()},'members_without_category')" class="addbutton add">Kategória nélküli tagok</a>
|
||||
</div>
|
||||
<div id="footer_toggle" onclick="footer_toggle();">
|
||||
<img src="/_image/collapse.png">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var Timer;
|
||||
var options = '';
|
||||
|
||||
$( document ).ready(function() {
|
||||
//$("#uk_filter_name").focus();
|
||||
|
||||
//legeneráljuk az option-öket, és ezeket csak appendeljük, hogy ne kelljen minden lépésben lekérni
|
||||
generate_options($("#ug_id").val());
|
||||
|
||||
//betöltjük a footerbe a category-kat
|
||||
generate_footer_items($("#ug_id").val());
|
||||
|
||||
//mutassuk a tagokat
|
||||
get_group_members($('#ug_id').val(), 'members');
|
||||
|
||||
});
|
||||
|
||||
$("#uk_filter_name").keyup(function() {
|
||||
var text = $("#uk_filter_name").val();
|
||||
if (text.length >= 3) {
|
||||
document.getElementById('user_list').innerHTML = 'Betöltés...';
|
||||
clearTimeout(Timer);
|
||||
Timer = window.setTimeout(get_group_members($("#ug_id").val(),text), 1000);
|
||||
}
|
||||
});
|
||||
|
||||
function generate_options(ug_id) {
|
||||
$.post("/_ajax/get_category_list.php",
|
||||
{
|
||||
group_id: ug_id,
|
||||
},
|
||||
function(data, status) {
|
||||
var pdata = JSON.parse(data);
|
||||
var option_string = '';
|
||||
$.each(pdata, function(key, value) {
|
||||
option_string += "<option value='"+value["ugc_id"]+"'>"+value["ugc_name"]+"</option>";
|
||||
});
|
||||
options = option_string;
|
||||
update_select_lists();
|
||||
});
|
||||
}
|
||||
|
||||
function generate_footer_items(ug_id) {
|
||||
$.post("/_ajax/get_category_list.php",
|
||||
{
|
||||
group_id: ug_id,
|
||||
},
|
||||
function(data, status) {
|
||||
var pdata = JSON.parse(data);
|
||||
var option_string = '';
|
||||
$.each(pdata, function(key, value) {
|
||||
option_string += '<a href="#" id="members" onclick="get_group_members({$user_group->get_ug_id()},'+value['ugc_id']+')" class="addbutton add">'+value['ugc_name']+'</a>';
|
||||
});
|
||||
$("#footer_control").append(option_string);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function modify_membership(uk_id, group_id) {
|
||||
|
||||
//css átállítása
|
||||
if ($("#kid_"+uk_id).hasClass('member')) {
|
||||
$("#kid_"+uk_id).removeClass('member');
|
||||
$("#kid_"+uk_id).addClass('not_member');
|
||||
}
|
||||
else {
|
||||
$("#kid_"+uk_id).addClass('member');
|
||||
$("#kid_"+uk_id).removeClass('not_member');
|
||||
}
|
||||
|
||||
//adatbázis módosítás
|
||||
$.post("/_ajax/update_membership.php",
|
||||
{
|
||||
uk_id: uk_id,
|
||||
group_id: group_id
|
||||
});
|
||||
}
|
||||
|
||||
function create_category(group_id, category_name) {
|
||||
$.post("/_ajax/create_category.php",
|
||||
{
|
||||
group_id: group_id,
|
||||
category_name: category_name
|
||||
},
|
||||
function(data, status) {
|
||||
var pdata = JSON.parse(data);
|
||||
|
||||
generate_options(group_id);
|
||||
//add_category_to_kid(uk_id, pdata, group_id);
|
||||
//update_select_list(uk_id, group_id, pdata);
|
||||
add_category_to_footer(pdata);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function update_select_list(uk_id, group_id, category_id = null) {
|
||||
//az utolsó paraméter határozza meg, hogy selecteddé kell-e tenni valamit
|
||||
|
||||
//kitöröljük az összes optiont-t
|
||||
$('#cat_list_'+uk_id).html('');
|
||||
|
||||
//lekérjük a friss category listát ehhez a grouphoz
|
||||
$.post("/_ajax/get_category_list.php",
|
||||
{
|
||||
group_id: group_id,
|
||||
},
|
||||
function(data, status){
|
||||
var pdata = JSON.parse(data);
|
||||
var selected;
|
||||
//végigmegyünk rajta
|
||||
$.each(pdata, function(key, value) {
|
||||
selected = false;
|
||||
if (category_id) {
|
||||
if (value['ugc_id'] == category_id) {
|
||||
selected = 'selected';
|
||||
$('#select_value_'+uk_id).val(category_id);
|
||||
}
|
||||
}
|
||||
//a hidden mező értékét kéne csak beállítani
|
||||
$('#cat_list_'+uk_id).append($("<option></option>")
|
||||
.attr('value', value['ugc_id'])
|
||||
.prop('selected', selected)
|
||||
.text(value['ugc_name'])
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
update_select_lists();
|
||||
});
|
||||
}
|
||||
|
||||
function update_select_lists() {
|
||||
//updateli az összes selectet az oldalon
|
||||
//először elmenti h melyik id-jú a selected
|
||||
//betöltés után beállítja
|
||||
var selected;
|
||||
var select_id;
|
||||
var kid_id;
|
||||
var temp_array;
|
||||
$("select").each(function() {
|
||||
select_id = $(this).prop('id');
|
||||
temp_array = select_id.split('_');
|
||||
kid_id = temp_array[2];
|
||||
selected = $("#select_value_"+kid_id).val();
|
||||
$(this).html('<option value="null">- nincs kategória -</option>');
|
||||
$(this).append(options);
|
||||
$(this).val(selected);
|
||||
});
|
||||
}
|
||||
|
||||
function add_category_to_footer(category_id) {
|
||||
$.post("/_ajax/get_category.php",
|
||||
{
|
||||
category_id: category_id,
|
||||
},
|
||||
function(data, status){
|
||||
var pdata = JSON.parse(data);
|
||||
$("#footer_control").append('<a href="#" onclick="get_group_members('+$("#ug_id").val()+','+category_id+')" class="addbutton add">'+pdata[0]['ugc_name']+'</a>');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function add_category() {
|
||||
//létrehozzuk a category-t a group-hoz
|
||||
var cat_name = $("#add_category").val();
|
||||
create_category($("#ug_id").val(), cat_name);
|
||||
$("#add_category").val('');
|
||||
|
||||
//hozzáadjuk az új category-t a footerhez
|
||||
}
|
||||
|
||||
function add_category_to_kid(uk_id, category_id, group_id) {
|
||||
$.post("/_ajax/add_category_to_kid.php",
|
||||
{
|
||||
uk_id: uk_id,
|
||||
category_id: category_id,
|
||||
group_id: group_id
|
||||
});
|
||||
}
|
||||
|
||||
function update_category_to_user(uk_id, group_id, select_element) {
|
||||
$.post("/_ajax/add_category_to_kid.php",
|
||||
{
|
||||
uk_id: uk_id,
|
||||
category_id: select_element.value,
|
||||
group_id: group_id
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//searchStr lehetséges paraméterek: members, not_members, category_id
|
||||
function get_group_members(groupId, searchStr) {
|
||||
document.getElementById('user_list').innerHTML = 'Betöltés...';
|
||||
$.post("/_ajax/get_group_members.php",
|
||||
{
|
||||
searchStr: searchStr,
|
||||
groupId: groupId,
|
||||
|
||||
},
|
||||
function(data, status){
|
||||
var pdata = JSON.parse(data);
|
||||
var member;
|
||||
var content = '';
|
||||
for (var i=0; i<pdata.length; ++i) {
|
||||
|
||||
member = 'not_member';
|
||||
if (pdata[i]['ugk_user_group_ug_id'] == groupId) {
|
||||
member = 'member';
|
||||
}
|
||||
|
||||
content +=
|
||||
'\
|
||||
<div class="list_item '+member+'" id="kid_'+pdata[i]['uk_id']+'">\
|
||||
<span class="toggle" onclick="modify_membership('+pdata[i]['uk_id']+', '+groupId+')"><img src="/_image/switch.png"></span>\
|
||||
<span class="name_span">'+pdata[i]['uk_name']+'</span>\
|
||||
<select class="category_list" onChange="update_category_to_user('+pdata[i]['uk_id']+', '+groupId+', this)" id="cat_list_'+pdata[i]['uk_id']+'" name="cat_list_'+pdata[i]['uk_id']+'"><option value="null">- nincs kategória -</option></select>\
|
||||
<input type="hidden" id="select_value_'+pdata[i]['uk_id']+'" value="'+pdata[i]['ugk_category_ugc_id']+'">\
|
||||
</div>\
|
||||
';
|
||||
}
|
||||
document.getElementById('user_list').innerHTML = content;
|
||||
update_select_lists();
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">
|
||||
function footer_toggle() {
|
||||
$("#footer_control").fadeToggle( "fast", "linear" );
|
||||
}
|
||||
</script>
|
||||
15
template/templates/user_group_list.tpl
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="buttons">
|
||||
<a href="/admin/create/user_group" class="addbutton add-big">Új csoport hozzáadása</a>
|
||||
</div>
|
||||
|
||||
<div class="list">
|
||||
{foreach $user_group_array as $user_group}
|
||||
<a href="/admin/user_groups/{$user_group->get_ug_id()}">
|
||||
<div class="list_item clickable" id="coach_{$user_group->get_ug_id()}">
|
||||
<img src="/_image/coach.png">
|
||||
{$user_group->get_ug_name()}
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
|
||||
</div>
|
||||
@@ -5,6 +5,7 @@
|
||||
<a href="/admin/cities" class="addbutton add-big">Települések</a>
|
||||
<a href="/admin/schools" class="addbutton add-big">Iskolák</a>
|
||||
<a href="/admin/regions" class="addbutton add-big">Diákolimpia körzetek</a>
|
||||
<a href="/admin/user_groups" class="addbutton add-big">Csoportok</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||