diff --git a/_class/class_page.php b/_class/class_page.php index bd974ad..73dddde 100755 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -28,7 +28,7 @@ class page { $menu_assoc_array = $sql->assoc_array($menus_query); $smarty->assign('menus', $menu_assoc_array); } - elseif ($this->get_page() == 'view') { + elseif ($this->get_page() == 'view' || $this->get_page() == 'preview') { $menus_query = "SELECT * FROM subpage WHERE spage_page_id = 2;"; $menu_assoc_array = $sql->assoc_array($menus_query); $smarty->assign('menus', $menu_assoc_array); @@ -240,6 +240,26 @@ class page { break; } break; + case 'preview': + # SZÜLŐI OLDAL ELŐNÉZET + switch ($this->get_subpage()) { + case 'overview': + # áttekintő oldal adatokkal + include('include_overview.php'); + break; + case 'diary': + # napló, edzéslista + include('include_diary.php'); + break; + case 'information': + # információk + include('include_information.php'); + break; + default: + include('include_diary.php'); + break; + } + break; default: # code... break; diff --git a/_css/default.css b/_css/default.css index d1128b7..0121514 100644 --- a/_css/default.css +++ b/_css/default.css @@ -239,15 +239,14 @@ td.create a { .list .add_deposit { position: relative; top: -30px; - right: 10px; + right: 3px; cursor: pointer; padding: 0px !important; margin: 0px !important; } .list .add_deposit img { - width: 20px; - height: 20px; + width: 22px; } diff --git a/_include/include_diary.php b/_include/include_diary.php index 49a6f34..66c9d23 100644 --- a/_include/include_diary.php +++ b/_include/include_diary.php @@ -1,11 +1,6 @@ is_id()) { - # EMPTY -} -else { - # EDZÉS LISTA $action_list_query = " SELECT @@ -140,6 +135,6 @@ order by object_date ASC; //$smarty->assign('balance', $balance); $smarty->display('user_diary.tpl'); -} + ?> \ No newline at end of file diff --git a/_include/include_information.php b/_include/include_information.php index 9b39acf..46a562f 100644 --- a/_include/include_information.php +++ b/_include/include_information.php @@ -1,13 +1,5 @@ is_id()) { - # EMPTY - - -} -else { # INFORMÁCIÓK $info_query = "SELECT setv_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = 'Információk'"; @@ -23,6 +15,4 @@ else { -} - ?> \ No newline at end of file diff --git a/_include/include_overview.php b/_include/include_overview.php index 33f64f6..63728a5 100644 --- a/_include/include_overview.php +++ b/_include/include_overview.php @@ -1,33 +1,23 @@ is_id()) { - # EMPTY +//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]); } -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]); +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'); - -} +$smarty->display('user_overview.tpl'); ?> \ No newline at end of file diff --git a/common.php b/common.php index 76289a7..9febdc4 100644 --- a/common.php +++ b/common.php @@ -100,6 +100,15 @@ elseif ($_GET['page'] == 'view') { //var_dump($user); } } +elseif ($_GET['page'] == 'preview' && (isset($_COOKIE['badminton_coach_user']))) { + if (isset($_GET['id'])) { + $user = new user_kid(); + $user->set_user_data_by_id($_GET['id']); + $logout = true; + $smarty->assign('user_login', $user); + //var_dump($user); + } +} $smarty->assign('can_logout', $logout); diff --git a/index.php b/index.php index f2415f1..6f22502 100644 --- a/index.php +++ b/index.php @@ -32,7 +32,7 @@ setlocale(LC_ALL, 'hu_HU'); is_page() && $page->get_page() == "view") { + if ($page->is_page() && in_array($page->get_page(), array('view', 'preview'))) { echo ''; } diff --git a/template/templates/nav.tpl b/template/templates/nav.tpl index 73c62ec..4c6b03b 100755 --- a/template/templates/nav.tpl +++ b/template/templates/nav.tpl @@ -13,7 +13,7 @@ {foreach $menus as $menu} -
  • +
  • {$menu.spage_title} @@ -37,7 +37,7 @@ {$user_login->get_uk_name()} {/if} - +
  • diff --git a/template/templates/user_list.tpl b/template/templates/user_list.tpl index 7d038ae..54bddde 100755 --- a/template/templates/user_list.tpl +++ b/template/templates/user_list.tpl @@ -73,6 +73,18 @@ function search() {
    \ \ \ +
    \ +
    \ + Befizetés\ + \ +
    \ + \ +
    \ + Szülői előnézet\ + \ +
    \ +
    \ +
    \ ' } document.getElementById('user_list').innerHTML = content;