user_parent_list
This commit is contained in:
@@ -29,14 +29,13 @@ class page {
|
||||
public function get_page_content() {
|
||||
global $sql, $user, $smarty;
|
||||
//var_dump($user);
|
||||
ini_set('include_path', '/opt/lampp/htdocs/badminton_coach/_include');
|
||||
//ini_set('include_path', '/var/www/badminton_coach/_include');
|
||||
//ini_set('include_path', '/opt/lampp/htdocs/badminton_coach/_include');
|
||||
ini_set('include_path', '/var/www/badminton_coach/_include');
|
||||
if (!empty($user) && $user->is_logged_in()) {
|
||||
if ($this->is_page()) {
|
||||
//TODO: mi van ha nincs page? átirányítás v 404?
|
||||
//page alapján betölti a tpl-t
|
||||
//var_dump($_GET);
|
||||
//var_dump($_SERVER);
|
||||
|
||||
switch ($this->get_page()) {
|
||||
case 'admin':
|
||||
# ADMIN OLDALAK
|
||||
@@ -52,6 +51,10 @@ class page {
|
||||
$tpl = "edit";
|
||||
include('include_members.php');
|
||||
break;
|
||||
case 'parents':
|
||||
# SZÜLŐK SZERKESZTÉSE
|
||||
include('include_parents.php');
|
||||
break;
|
||||
case 'trainings':
|
||||
# EDZÉSEK
|
||||
# itt az edzések listája jelenik meg az aktuális hónapban
|
||||
|
||||
@@ -2,29 +2,89 @@
|
||||
|
||||
/*
|
||||
USER_PARENT osztály
|
||||
SZÜLŐK osztálya, a USER osztályból öröklődik
|
||||
SZÜLŐK osztálya
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class user_parent extends user {
|
||||
class user_parent {
|
||||
|
||||
private $up_id;
|
||||
private $up_name;
|
||||
private $up_password;
|
||||
private $up_last_login;
|
||||
private $up_email;
|
||||
private $up_phone;
|
||||
private $up_facebook;
|
||||
|
||||
|
||||
protected function set_user_phone($_phone) {
|
||||
$this->$user_phone = $_phone;
|
||||
public function set_up_id($_id) {
|
||||
$this->up_id = $_id;
|
||||
}
|
||||
|
||||
protected function set_user_facebook($_facebook) {
|
||||
$this->$user_facebook = $_facebook;
|
||||
public function set_up_name($_name) {
|
||||
$this->up_name = $_name;
|
||||
}
|
||||
|
||||
protected function get_user_phone() {
|
||||
return $this->user_phone;
|
||||
public function set_up_password($_password) {
|
||||
$this->up_password = $_password;
|
||||
}
|
||||
|
||||
protected function get_user_facebook() {
|
||||
return $this->user_facebook;
|
||||
public function set_up_last_login($_last_login) {
|
||||
$this->up_last_login = $_last_login;
|
||||
}
|
||||
|
||||
public function set_up_email($_email) {
|
||||
$this->up_email = $_email;
|
||||
}
|
||||
|
||||
public function set_up_phone($_phone) {
|
||||
$this->up_phone = $_phone;
|
||||
}
|
||||
|
||||
public function set_up_facebook($_facebook) {
|
||||
$this->up_facebook = $_facebook;
|
||||
}
|
||||
|
||||
public function get_up_id() {
|
||||
return $this->up_id;
|
||||
}
|
||||
|
||||
public function get_up_name() {
|
||||
return $this->up_name;
|
||||
}
|
||||
|
||||
public function get_up_password() {
|
||||
return $this->up_password;
|
||||
}
|
||||
|
||||
public function get_up_last_login() {
|
||||
return $this->up_last_login;
|
||||
}
|
||||
|
||||
public function get_up_email() {
|
||||
return $this->up_email;
|
||||
}
|
||||
|
||||
public function get_up_phone() {
|
||||
return $this->up_phone;
|
||||
}
|
||||
|
||||
public function get_up_facebook() {
|
||||
return $this->up_facebook;
|
||||
}
|
||||
|
||||
public function set_user_data_by_id($_uk_id) {
|
||||
global $sql, $user;
|
||||
$user_data_assoc_array = $sql->assoc_array("select * from user_parent where up_id = " . $_uk_id);
|
||||
$user_data_array = $user_data_assoc_array[0];
|
||||
foreach ($user_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value); //alapadatok beállítása
|
||||
//$this->set_ua_type(3); //parent típus beállítása
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
27
_include/include_parents.php
Normal file
27
_include/include_parents.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
# HA NINCS ID, AKKOR SZÜLŐLISTA
|
||||
# HA VAN ID, AKKOR SZÜLŐ ADATAINAK MEGJELENÍTÉSE/SZERKESZTÉSE
|
||||
|
||||
if ($this->is_id()) {
|
||||
# ADOTT TAG ADATAINAK MEGJELENÍTÉSE
|
||||
|
||||
}
|
||||
else {
|
||||
# SZÜLŐ LISTA
|
||||
|
||||
$parent_query = "SELECT * FROM user_parent ORDER BY up_name ASC;";
|
||||
$parent_assoc_array = $sql->assoc_array($parent_query);
|
||||
$parent_array = array();
|
||||
foreach ($parent_assoc_array as $parent) {
|
||||
$new_parent = new user_parent();
|
||||
$new_parent->set_user_data_by_id($parent['up_id']);
|
||||
$parent_array[] = $new_parent;
|
||||
}
|
||||
|
||||
$smarty->assign('parent_array', $parent_array);
|
||||
$smarty->display('parent_list.tpl');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
17
template/templates/parent_list.tpl
Normal file
17
template/templates/parent_list.tpl
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td class="create"><a href="/admin/create/parent">+ Új szülő hozzádása</a></td>
|
||||
</tr>
|
||||
|
||||
{foreach $parent_array as $parent}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/admin/{if !$edit}members{else}edit_member{/if}/{$user->get_uk_id()}">
|
||||
{$user->get_up_name()}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</table>
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="create"><a href="/admin/create/member">+ Új tag hozzáadása</a></td>
|
||||
<td class="create"><a href="/admin/create/member">+ Új tag hozzáadása</a></td>
|
||||
<td class="create"><a href="/admin/parents">+ Szülők kezelése</a></td>
|
||||
</tr>
|
||||
|
||||
{foreach $user_array as $user}
|
||||
|
||||
Reference in New Issue
Block a user