diff --git a/_ajax/get_user_list.php b/_ajax/get_user_list.php new file mode 100644 index 0000000..d96f821 --- /dev/null +++ b/_ajax/get_user_list.php @@ -0,0 +1,28 @@ +assoc_array($kid_query); + + +echo json_encode($kid_assoc_array); + +?> \ No newline at end of file diff --git a/_class/class_login.php b/_class/class_login.php index e1e99d0..69c33fb 100755 --- a/_class/class_login.php +++ b/_class/class_login.php @@ -27,7 +27,7 @@ class login { " SELECT uk_id FROM user_kid WHERE (uk_name = '" . $_user_name . "' AND - uk_password = '" . md5($_user_password ) . "')"; + uk_password = '" . md5($_user_password ) . "') AND uk_deleted = 0 AND uk_is_active = 1"; if ($sql->num_of_rows($check_query)) return $sql->single_variable($check_query); @@ -74,7 +74,7 @@ class login { " SELECT uk_id FROM user_kid WHERE (uk_name = '" . $_user_name . "' AND - uk_password = '" . $_user_password . "')"; + uk_password = '" . $_user_password . "') AND uk_deleted = 0 AND uk_is_active = 1"; if ($sql->num_of_rows($check_query)) return $sql->single_variable($check_query); diff --git a/_class/class_user_kid.php b/_class/class_user_kid.php index 5f54183..d56f665 100644 --- a/_class/class_user_kid.php +++ b/_class/class_user_kid.php @@ -252,6 +252,21 @@ class user_kid extends user_parent { $this->logged_in = $_login; } + public function get_training_number_in_month($_year, $_month) { + //évet és hónapot kap paraméterül, az edzések számát adja vissza + global $sql; + //var_dump($_date); + return $sql->single_variable( + "SELECT count( DISTINCT pr_id ) + FROM `presence` + JOIN `training` ON `tr_id` = `pr_training_tr_id` + WHERE `pr_user_kid_uk_id` = ". $this->get_uk_id()." + AND `tr_date` LIKE '".$_year."-".$_month."%' + AND tr_deleted = 0 + ;" + ); + } + public function update_login_time($_uk_id = null) { global $sql; //az adott user_id-n updateli a login_time-ot diff --git a/_css/default.css b/_css/default.css index dcf9036..df94dba 100644 --- a/_css/default.css +++ b/_css/default.css @@ -12,6 +12,7 @@ body { margin: 0px; min-height: 100%; background-color: #aaaaaa; + word-wrap: break-word; } #pageContainer { @@ -40,6 +41,26 @@ main #main_content { } + +main #loading { + + width: 100%; + min-height: 100vh; + background-color: #fff; + padding: 30px 10px 10px 10px; + + webkit-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75); + -moz-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75); + box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75); + + + z-index: 100; + + background-image: url("/_image/spinner.gif"); + background-repeat: no-repeat; + background-position: center; +} + .italic { font-style: italic; } @@ -48,10 +69,51 @@ main #main_content { font-weight: bold; } +.danger { + background-color: #ffdddd; + border-left: 6px solid #002E4C; + padding: 6px 10px; + margin-top: 16px; + margin-bottom: 16px; + width: 100%; + font-weight: bold; +} + + ul.topnav span { color: #f2f2f2; } +.user_filter { + width: 100%; + clear: both; + margin: 15px 0px; +} + +.user_filter input { + +} + +.user_filter select, .user_filter input { + height: 40px; + width: 100%; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; + margin: 0px 0px 10px 0px; +} + +.user_filter select:focus, .user_filter input:focus { + outline: 0; + color: #333; + border-color: rgba(41, 92, 161, 0.4); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); + outline: 0 none; +} + .list .list_item .size20 { font-size: 20px; } @@ -151,7 +213,7 @@ td.create a { } .bigger_space { - margin: 10px 0px; + margin: 10px 0px !important; } .transp { @@ -212,15 +274,49 @@ table.log tr.delete:hover { background-color: #f02a2a; } +.date_separator img { + width: 20px; + float: right; + margin-top: 4px; + margin-right: 10px; + border: 0; + cursor: pointer; +} + + + +#main_content { + display: none; +} + @media (min-width: 680px) { -main #main_content { +main #main_content, main #loading { width: 80%; margin: 0px auto; } +.user_filter { + width: 90%; +} + +.user_filter select { + width: 40%; + max-width: 200px; +} + +.user_filter input { + width: 40%; + float: left; + margin: 0px 10px 0px 0px; +} + +.danger { + width: 90%; +} + .list { width: 40%; } diff --git a/_css/default_view.css b/_css/default_view.css index 1f1559c..3ef828a 100644 --- a/_css/default_view.css +++ b/_css/default_view.css @@ -6,6 +6,16 @@ main { background-color: #002E4C; } +.danger a:link { + color: #002E4C; + text-decoration: underline; +} + +.danger a:visited { + color: #002E4C; + text-decoration: underline; +} + ul.topnav { background-color: #FD9500; } diff --git a/_include/include_members.php b/_include/include_members.php index 0f29266..e5baecc 100755 --- a/_include/include_members.php +++ b/_include/include_members.php @@ -46,17 +46,7 @@ if ($this->is_id()) { else { # TAG LISTA - $user_list_query = "SELECT * FROM user_kid WHERE uk_deleted = 0 ORDER BY uk_name ASC;"; - $user_list_assoc_array = $sql->assoc_array($user_list_query); - //végigmegyünk a tömbbön, objektumot csinálunk belőlük, és átadjuk egy array-ben a template-nek - $user_array = array(); - foreach ($user_list_assoc_array as $user_list_array) { - $current_user = new user_kid(); - $current_user->set_user_data_by_id($user_list_array['uk_id']); - $user_array[] = $current_user; - } $smarty->assign('edit', $tpl == "edit"); - $smarty->assign('user_array', $user_array); $smarty->display('user_list.tpl'); //var_dump($user_array); } diff --git a/_include/include_presence.php b/_include/include_presence.php index 46782bf..eafda04 100755 --- a/_include/include_presence.php +++ b/_include/include_presence.php @@ -48,6 +48,7 @@ if ($this->is_id()) { IN ( " . implode(',', $tr_ids) . " ) AND `uk_deleted` = 0 AND `tr_deleted` = 0 + AND `uk_is_active` = 1 GROUP BY `pr_user_kid_uk_id` ORDER BY count( `pr_id` ) DESC, uk_name ASC; "; @@ -69,7 +70,7 @@ if ($this->is_id()) { $exeptions[] = $user->get_uk_id(); } - if (!empty($exeptions)) $rest_user_query = "SELECT * FROM user_kid WHERE uk_id NOT IN (" . implode(',', $exeptions) . ") AND uk_deleted = 0 ORDER BY uk_name ASC;"; //ha vannak kiemelt userek + if (!empty($exeptions)) $rest_user_query = "SELECT * FROM user_kid WHERE uk_id NOT IN (" . implode(',', $exeptions) . ") AND uk_deleted = 0 AND uk_is_active = 1 ORDER BY uk_name ASC;"; //ha vannak kiemelt userek else $rest_user_query = "SELECT * FROM user_kid WHERE uk_deleted = 0 ORDER BY uk_name;"; //ha nincsenek kiemelt userek $rest_user_assoc_array = $sql->assoc_array($rest_user_query); foreach ($rest_user_assoc_array as $rest_user) { diff --git a/index.php b/index.php index 0f903e1..975813a 100644 --- a/index.php +++ b/index.php @@ -15,11 +15,7 @@ setlocale(LC_ALL, 'hu_HU'); - + @@ -51,12 +47,36 @@ setlocale(LC_ALL, 'hu_HU'); get_page_nav();?>
+
get_page_content();?>
+ - \ No newline at end of file + + diff --git a/template/templates/presence_list.tpl b/template/templates/presence_list.tpl index 380b2cf..46abc3a 100644 --- a/template/templates/presence_list.tpl +++ b/template/templates/presence_list.tpl @@ -1,7 +1,6 @@
- {foreach $training_array as $training} {if $training@first || @@ -10,9 +9,16 @@ ) } - {$training_array[$training@index]->get_tr_date()|substr:0:4}. + {if !$training@first && + $training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2 + } +
+ {/if} + {$training_array[$training@index]->get_tr_date()|substr:0:4}. {$months[$training_array[$training@index]->get_tr_date()|substr:5:2]} + +
{/if}
@@ -25,6 +31,41 @@ {if $training->get_tr_training_type_trt_id()}({$training->get_tr_type_name_by_id()}){/if}
+ {if $training@last} +
+ {/if} {/foreach} - \ No newline at end of file + + + \ No newline at end of file diff --git a/template/templates/training_list.tpl b/template/templates/training_list.tpl index fb185ee..daf772f 100755 --- a/template/templates/training_list.tpl +++ b/template/templates/training_list.tpl @@ -12,9 +12,16 @@ ) } + {if !$training@first && + $training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2 + } + + {/if} {$training_array[$training@index]->get_tr_date()|substr:0:4}. {$months[$training_array[$training@index]->get_tr_date()|substr:5:2]} + +
{/if}
@@ -27,6 +34,41 @@ {if $training->get_tr_training_type_trt_id()}({$training->get_tr_type_name_by_id()}){/if}
+ {if $training@last} +
+ {/if} {/foreach} - \ No newline at end of file + + + \ No newline at end of file diff --git a/template/templates/user_diary.tpl b/template/templates/user_diary.tpl index 48cc0e8..542befc 100644 --- a/template/templates/user_diary.tpl +++ b/template/templates/user_diary.tpl @@ -1,6 +1,6 @@
{foreach $training_array as $training} -
+ {if $training@first || ( @@ -8,11 +8,19 @@ ) } + {if !$training@first && + $training_array[$training@index]->get_tr_date()|substr:5:2 != $training_array[$training@index-1]->get_tr_date()|substr:5:2 + } +
+ {/if} {$training_array[$training@index]->get_tr_date()|substr:0:4}. {$months[$training_array[$training@index]->get_tr_date()|substr:5:2]} + ({$user_login->get_training_number_in_month({$training->get_tr_date()|substr:0:4},{$training->get_tr_date()|substr:5:2})} edzés) + +
{/if} -
+
{$training->get_tr_date()|substr:0:4}. {$months[$training_array[$training@index]->get_tr_date()|substr:5:2]} @@ -29,6 +37,40 @@ {/foreach} {/if}
-
+ {if $training@last} +
+ {/if} {/foreach} -
\ No newline at end of file + + + \ No newline at end of file diff --git a/template/templates/user_list.tpl b/template/templates/user_list.tpl index f6bbcf2..8483fca 100755 --- a/template/templates/user_list.tpl +++ b/template/templates/user_list.tpl @@ -1,24 +1,72 @@
- Új tag hozzáadása Szülők Pólók Települések Iskolák Diákolimpia körzetek - +
+ + + +
+ + +
+ + +
+
-
- {foreach $user_array as $user} - -
- - {$user->get_uk_name()} -
-
- {/foreach} + \ No newline at end of file diff --git a/template/templates/user_overview.tpl b/template/templates/user_overview.tpl index 2ff3b8f..7b0345e 100644 --- a/template/templates/user_overview.tpl +++ b/template/templates/user_overview.tpl @@ -1,3 +1,8 @@ +
+ + Változás, téves vagy hiányzó adat esetén a helyes információt e-mail-ben kérjük megadni: szucs.zoltan@interware.hu + +