add camp_money field

This commit is contained in:
2021-04-15 20:58:53 +02:00
parent a66774e19a
commit b25714ab6c
9 changed files with 363 additions and 299 deletions

View File

@@ -8,6 +8,7 @@ class camp_apply
private $capp_status = null; private $capp_status = null;
private $capp_accept_date = null; private $capp_accept_date = null;
private $capp_camp_id = null; private $capp_camp_id = null;
private $capp_money;
/** /**
* get_s the value of capp_id. * get_s the value of capp_id.
@@ -153,6 +154,30 @@ class camp_apply
return $this; return $this;
} }
/**
* get_s the value of capp_money.
*
* @return mixed
*/
public function get_capp_money()
{
return $this->capp_money;
}
/**
* Sets the value of capp_money.
*
* @param mixed $capp_money the capp money
*
* @return self
*/
private function set_capp_money($capp_money)
{
$this->capp_money = $capp_money;
return $this;
}
//STATIC! //STATIC!
public static function has_responsible_contact($_capp_id) public static function has_responsible_contact($_capp_id)
{ {
@@ -247,4 +272,13 @@ class camp_apply
'capp_camp_id' => $_camp, 'capp_camp_id' => $_camp,
], ['capp_id' => $_apply_id]); ], ['capp_id' => $_apply_id]);
} }
public static function set_money($_money, $_capp_id)
{
global $sql;
$sql->update_table('camp_apply', [
'capp_money' => $_money,
], ['capp_id' => $_capp_id]);
}
} }

View File

@@ -7,25 +7,32 @@
*/ */
class page
class page { {
private $page = null; private $page = null;
private $subpage = null; private $subpage = null;
private $id = null; private $id = null;
function __construct() { public function __construct()
if (isset($_GET['page'])) $this->set_page($_GET['page']); {
if (isset($_GET['subpage'])) $this->set_subpage($_GET['subpage']); if (isset($_GET['page'])) {
if (isset($_GET['id'])) $this->set_id($_GET['id']); $this->set_page($_GET['page']);
}
if (isset($_GET['subpage'])) {
$this->set_subpage($_GET['subpage']);
}
if (isset($_GET['id'])) {
$this->set_id($_GET['id']);
}
} }
public function get_page_nav() { public function get_page_nav()
{
global $smarty, $sql, $user; global $smarty, $sql, $user;
//nem kell if, hanem page alapján beillesztük az id-t //nem kell if, hanem page alapján beillesztük az id-t
if ($this->get_page() == 'admin') { if ('admin' == $this->get_page()) {
if ($user) { if ($user) {
$menus_query = " $menus_query = '
SELECT SELECT
* *
FROM FROM
@@ -37,32 +44,27 @@ class page {
OR ua_authority_a_id = 1) OR ua_authority_a_id = 1)
WHERE WHERE
spage_page_id = 1 spage_page_id = 1
AND ua_user_kid_uk_id = " . $user->get_ua_id() ." ORDER BY spage_id ASC; AND ua_user_kid_uk_id = '.$user->get_ua_id().' ORDER BY spage_id ASC;
"; ';
} } else {
else { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 1;';
$menus_query = "SELECT * FROM subpage WHERE spage_page_id = 1;";
} }
$menu_assoc_array = $sql->assoc_array($menus_query); $menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array); $smarty->assign('menus', $menu_assoc_array);
} } elseif ('view' == $this->get_page() || 'preview' == $this->get_page()) {
elseif ($this->get_page() == 'view' || $this->get_page() == 'preview') { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 2;';
$menus_query = "SELECT * FROM subpage WHERE spage_page_id = 2;";
$menu_assoc_array = $sql->assoc_array($menus_query); $menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array); $smarty->assign('menus', $menu_assoc_array);
} } elseif ('coach' == $this->get_page() || 'coach_preview' == $this->get_page()) {
elseif ($this->get_page() == 'coach' || $this->get_page() == 'coach_preview') { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 3;';
$menus_query = "SELECT * FROM subpage WHERE spage_page_id = 3;";
$menu_assoc_array = $sql->assoc_array($menus_query); $menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array); $smarty->assign('menus', $menu_assoc_array);
} } elseif ('tabor' == $this->get_page()) {
elseif ($this->get_page() == 'tabor') { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 4;';
$menus_query = "SELECT * FROM subpage WHERE spage_page_id = 4;";
$menu_assoc_array = $sql->assoc_array($menus_query); $menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array); $smarty->assign('menus', $menu_assoc_array);
} } elseif ('taborvezeto' == $this->get_page()) {
elseif ($this->get_page() == 'taborvezeto') { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 5;';
$menus_query = "SELECT * FROM subpage WHERE spage_page_id = 5;";
$menu_assoc_array = $sql->assoc_array($menus_query); $menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array); $smarty->assign('menus', $menu_assoc_array);
} }
@@ -71,9 +73,8 @@ class page {
$smarty->display('nav.tpl'); $smarty->display('nav.tpl');
} }
public function findInStructure($id, &$array)
{
function findInStructure($id, &$array) {
if (array_key_exists($id, $array)) { if (array_key_exists($id, $array)) {
return $id; return $id;
} }
@@ -85,500 +86,504 @@ class page {
} }
} }
public function get_page_content() { public function get_page_content()
{
global $sql, $user, $smarty, $structure; global $sql, $user, $smarty, $structure;
//var_dump($user); //var_dump($user);
ini_set('include_path', '_include/'); ini_set('include_path', '_include/');
//ini_set('include_path', '/var/www/badminton_coach/_include'); //ini_set('include_path', '/var/www/badminton_coach/_include');
$exceptions = array("export_balance", "send_report", "money_update"); $exceptions = ['export_balance', 'send_report', 'money_update'];
if ((!empty($user) && $user->is_logged_in()) || in_array($this->get_subpage(), $exceptions)) { if ((!empty($user) && $user->is_logged_in()) || in_array($this->get_subpage(), $exceptions)) {
if ($this->is_page()) { if ($this->is_page()) {
//TODO: mi van ha nincs page? átirányítás v 404? //TODO: mi van ha nincs page? átirányítás v 404?
//page alapján betölti a tpl-t //page alapján betölti a tpl-t
if ($this->is_subpage() && $this->get_page() == 'admin') { if ($this->is_subpage() && 'admin' == $this->get_page()) {
if ('create' == $this->get_subpage()) { if ('create' == $this->get_subpage()) {
$toFind = $this->get_id(); $toFind = $this->get_id();
} elseif (strpos($this->get_subpage(), 'delete') !== false) { } elseif (false !== strpos($this->get_subpage(), 'delete')) {
//delete_ utáni rész //delete_ utáni rész
$toFind = substr($this->get_subpage(), 7); $toFind = substr($this->get_subpage(), 7);
} } else {
else {
$toFind = $this->get_subpage(); $toFind = $this->get_subpage();
} }
$subPage = $this->findInStructure($toFind, $structure); $subPage = $this->findInStructure($toFind, $structure);
if ((!empty($user) && $user->is_logged_in()) && 'exception' != $subPage && !$user->has_authority_by_name($subPage)) { if ((!empty($user) && $user->is_logged_in()) && 'exception' != $subPage && !$user->has_authority_by_name($subPage)) {
include('include_access_denied.php'); include 'include_access_denied.php';
return; return;
} }
} }
switch ($this->get_page()) { switch ($this->get_page()) {
case 'admin': case 'admin':
# ADMIN OLDALAK // ADMIN OLDALAK
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'members': case 'members':
# TAGOK KEZELÉSE // TAGOK KEZELÉSE
$tpl = "edit"; $tpl = 'edit';
include('include_members.php'); include 'include_members.php';
break; break;
case 'edit_member': case 'edit_member':
# TAG SZERKESZTÉSE // TAG SZERKESZTÉSE
$tpl = "edit"; $tpl = 'edit';
include('include_members.php'); include 'include_members.php';
break; break;
case 'delete_member': case 'delete_member':
# TAG TÖRLÉSE // TAG TÖRLÉSE
# TODO: error kezelés // TODO: error kezelés
include('include_delete_member.php'); include 'include_delete_member.php';
break; break;
case 'delete_parent': case 'delete_parent':
# SZÜLŐ TÖRLÉSE // SZÜLŐ TÖRLÉSE
# TODO: error kezelés // TODO: error kezelés
include('include_delete_parent.php'); include 'include_delete_parent.php';
break; break;
case 'parents': case 'parents':
# SZÜLŐK SZERKESZTÉSE // SZÜLŐK SZERKESZTÉSE
include('include_parents.php'); include 'include_parents.php';
break; break;
case 'coaches': case 'coaches':
# EDZŐK SZERKESZTÉSE // EDZŐK SZERKESZTÉSE
include('include_coaches.php'); include 'include_coaches.php';
break; break;
case 'trainings': case 'trainings':
# EDZÉSEK // EDZÉSEK
# itt az edzések listája jelenik meg az aktuális hónapban // itt az edzések listája jelenik meg az aktuális hónapban
$tpl = "edit"; $tpl = 'edit';
include('include_trainings.php'); include 'include_trainings.php';
break; break;
case 'training_templates': case 'training_templates':
# EDZÉS SABLONOK // EDZÉS SABLONOK
include('include_training_templates.php'); include 'include_training_templates.php';
break; break;
case 'delete_training_template': case 'delete_training_template':
# EDZÉS SABLON TÖRLÉS // EDZÉS SABLON TÖRLÉS
include('include_delete_training_template.php'); include 'include_delete_training_template.php';
break; break;
case 'shirts': case 'shirts':
# PÓLÓK // PÓLÓK
include('include_shirts.php'); include 'include_shirts.php';
break; break;
case 'cities': case 'cities':
# PÓLÓK // PÓLÓK
include('include_cities.php'); include 'include_cities.php';
break; break;
case 'edit_training': case 'edit_training':
# TAG SZERKESZTÉSE // TAG SZERKESZTÉSE
$tpl = "edit"; $tpl = 'edit';
include('include_trainings.php'); include 'include_trainings.php';
break; break;
case 'delete_training': case 'delete_training':
# EDZÉS TÖRLÉS // EDZÉS TÖRLÉS
include('include_delete_training.php'); include 'include_delete_training.php';
break; break;
case 'create': case 'create':
# LÉTREHOZÓS OLDALAK // LÉTREHOZÓS OLDALAK
include('include_create.php'); include 'include_create.php';
break; break;
case 'presence': case 'presence':
# JELENLÉT // JELENLÉT
$tpl = "presence"; $tpl = 'presence';
include('include_presence.php'); include 'include_presence.php';
break; break;
case 'schools': case 'schools':
# ISKOLÁK // ISKOLÁK
include('include_schools.php'); include 'include_schools.php';
break; break;
case 'training_types': case 'training_types':
# EDZÉS TÍPUSOK // EDZÉS TÍPUSOK
include('include_training_types.php'); include 'include_training_types.php';
break; break;
case 'regions': case 'regions':
# DIÁKOLIMPIA KÖRZETEK // DIÁKOLIMPIA KÖRZETEK
include('include_regions.php'); include 'include_regions.php';
break; break;
case 'log': case 'log':
# NAPLÓ // NAPLÓ
include('include_log.php'); include 'include_log.php';
break; break;
case 'money_deposit': case 'money_deposit':
# BEFIZETÉSEK // BEFIZETÉSEK
include('include_money_deposit.php'); include 'include_money_deposit.php';
break; break;
case 'lease': case 'lease':
# BÉRLETTÍPUSOK // BÉRLETTÍPUSOK
include('include_lease.php'); include 'include_lease.php';
break; break;
case 'lock_training': case 'lock_training':
# EDZÉS ZÁROLÁS, FELOLDÁS // EDZÉS ZÁROLÁS, FELOLDÁS
include('include_lock_training.php'); include 'include_lock_training.php';
break; break;
case 'view_deposit': case 'view_deposit':
# BEFIZETÉSEK / USER // BEFIZETÉSEK / USER
include('include_view_deposit.php'); include 'include_view_deposit.php';
break; break;
case 'money_expense': case 'money_expense':
# KIADÁSOK // KIADÁSOK
include('include_money_expense.php'); include 'include_money_expense.php';
break; break;
case 'money_expense_category': case 'money_expense_category':
# KIADÁS KATEGÓRIÁK // KIADÁS KATEGÓRIÁK
include('include_money_expense_category.php'); include 'include_money_expense_category.php';
break; break;
case 'money_income_category': case 'money_income_category':
# BEVÉTEL KATEGÓRIÁK // BEVÉTEL KATEGÓRIÁK
include('include_money_income_category.php'); include 'include_money_income_category.php';
break; break;
case 'money_income': case 'money_income':
# BEVÉTELEK // BEVÉTELEK
include('include_money_income.php'); include 'include_money_income.php';
break; break;
case 'money_update': case 'money_update':
# FRISSÍTÉS // FRISSÍTÉS
include('include_money_update.php'); include 'include_money_update.php';
// no break
case 'settings': case 'settings':
# BEÁLLÍTÁSOK // BEÁLLÍTÁSOK
include('include_settings.php'); include 'include_settings.php';
break; break;
case 'balance_list': case 'balance_list':
# BEÁLLÍTÁSOK // BEÁLLÍTÁSOK
include('include_balance_list.php'); include 'include_balance_list.php';
break; break;
case 'stats': case 'stats':
# STATISZTIKÁK // STATISZTIKÁK
include('include_stats.php'); include 'include_stats.php';
break; break;
case 'news': case 'news':
# INFORMÁCIÓS FAL // INFORMÁCIÓS FAL
include('include_information.php'); include 'include_information.php';
break; break;
case 'expire_check': case 'expire_check':
# CRON FUTTATÁSA // CRON FUTTATÁSA
include('include_expire_check.php'); include 'include_expire_check.php';
break; break;
case 'userlist': case 'userlist':
# GYEREK ADATLISTA // GYEREK ADATLISTA
include('include_userlist.php'); include 'include_userlist.php';
break; break;
case 'export_users': case 'export_users':
# GYEREKLISTA EXPORTÁLÁSA // GYEREKLISTA EXPORTÁLÁSA
include('include_export_users.php'); include 'include_export_users.php';
break; break;
case 'traininglist': case 'traininglist':
# EDZÉS ADATLISTA // EDZÉS ADATLISTA
include('include_traininglist.php'); include 'include_traininglist.php';
break; break;
case 'export_trainings': case 'export_trainings':
# EDZÉSLISTA EXPORTÁLÁSA // EDZÉSLISTA EXPORTÁLÁSA
include('include_export_trainings.php'); include 'include_export_trainings.php';
break; break;
case 'export_balance': case 'export_balance':
# EGYENLEG LISTA EXPORTÁLÁSA // EGYENLEG LISTA EXPORTÁLÁSA
include('include_export_balance.php'); include 'include_export_balance.php';
break; break;
case 'download_report': case 'download_report':
# EGYENLEG LISTA LETÖLTÉSE // EGYENLEG LISTA LETÖLTÉSE
include('include_download_report.php'); include 'include_download_report.php';
break; break;
case 'send_report': case 'send_report':
# EGYENLEG LISTA KÜLDÉSE // EGYENLEG LISTA KÜLDÉSE
include('include_send_report.php'); include 'include_send_report.php';
break; break;
case 'set_credit_to_zero': case 'set_credit_to_zero':
# HITELALKALOM NULLÁZÁS // HITELALKALOM NULLÁZÁS
include('include_set_credit_to_zero.php'); include 'include_set_credit_to_zero.php';
break; break;
case 'delete_training_type': case 'delete_training_type':
# EDZÉS TÍPUS TÖRLÉS // EDZÉS TÍPUS TÖRLÉS
include('include_delete_training_type.php'); include 'include_delete_training_type.php';
break; break;
case 'delete_coach': case 'delete_coach':
# EDZŐ TÖRLÉS // EDZŐ TÖRLÉS
include('include_delete_coach.php'); include 'include_delete_coach.php';
break; break;
case 'delete_shirt': case 'delete_shirt':
# PÓLÓ TÖRLÉS // PÓLÓ TÖRLÉS
include('include_delete_shirt.php'); include 'include_delete_shirt.php';
break; break;
case 'delete_city': case 'delete_city':
# VÁROS TÖRLÉS // VÁROS TÖRLÉS
include('include_delete_city.php'); include 'include_delete_city.php';
break; break;
case 'delete_region': case 'delete_region':
# KÖRZET TÖRLÉS // KÖRZET TÖRLÉS
include('include_delete_region.php'); include 'include_delete_region.php';
break; break;
case 'delete_school': case 'delete_school':
# ISKOLA TÖRLÉS // ISKOLA TÖRLÉS
include('include_delete_school.php'); include 'include_delete_school.php';
break; break;
case 'delete_money_deposit': case 'delete_money_deposit':
# BEFIZETÉS TÖRLÉS // BEFIZETÉS TÖRLÉS
include('include_delete_money_deposit.php'); include 'include_delete_money_deposit.php';
break; break;
case 'delete_money_expense_category': case 'delete_money_expense_category':
# BEFIZETÉS KATEGÓRIA TÖRLÉS // BEFIZETÉS KATEGÓRIA TÖRLÉS
include('include_delete_money_expense_category.php'); include 'include_delete_money_expense_category.php';
break; break;
case 'delete_money_expense': case 'delete_money_expense':
# BEFIZETÉS TÖRLÉS // BEFIZETÉS TÖRLÉS
include('include_delete_money_expense.php'); include 'include_delete_money_expense.php';
break; break;
case 'delete_money_income_category': case 'delete_money_income_category':
# BEVÉTEL KATEGÓRIA TÖRLÉS // BEVÉTEL KATEGÓRIA TÖRLÉS
include('include_delete_money_income_category.php'); include 'include_delete_money_income_category.php';
break; break;
case 'delete_money_income': case 'delete_money_income':
# BEVÉTEL TÖRLÉS // BEVÉTEL TÖRLÉS
include('include_delete_money_income.php'); include 'include_delete_money_income.php';
break; break;
case 'delete_news': case 'delete_news':
# HÍR TÖRLÉS // HÍR TÖRLÉS
include('include_delete_news.php'); include 'include_delete_news.php';
break; break;
case 'delete_lease': case 'delete_lease':
# BÉRLETTÍPUS TÖRLÉS // BÉRLETTÍPUS TÖRLÉS
include('include_delete_lease.php'); include 'include_delete_lease.php';
break; break;
case 'logout': case 'logout':
# kijelentkezés // kijelentkezés
$from = "admin"; $from = 'admin';
include('include_logout.php'); include 'include_logout.php';
break; break;
case 'camps': case 'camps':
# TÁBOROK // TÁBOROK
include('include_camps.php'); include 'include_camps.php';
break; break;
case 'camp_types': case 'camp_types':
# TÁBOR TÍPUSOK // TÁBOR TÍPUSOK
include('include_camp_types.php'); include 'include_camp_types.php';
break; break;
case 'camp_shirt_type': case 'camp_shirt_type':
# TÁBOR PÓLÓ TÍPUSOK // TÁBOR PÓLÓ TÍPUSOK
include('include_camp_shirt_types.php'); include 'include_camp_shirt_types.php';
break; break;
case 'accept_apply': case 'accept_apply':
# TÁBOR JELENTKEZÉS ELFOGADÁSA // TÁBOR JELENTKEZÉS ELFOGADÁSA
include('include_accept_apply.php'); include 'include_accept_apply.php';
break; break;
case 'deny_apply': case 'deny_apply':
# TÁBOR JELENTKEZÉS ELUTASÍTÁSA // TÁBOR JELENTKEZÉS ELUTASÍTÁSA
include('include_deny_apply.php'); include 'include_deny_apply.php';
break; break;
case 'remove_apply': case 'remove_apply':
# TÁBOR JELENTKEZÉS ELTÁVOLÍTÁSA A LISTÁBÓL // TÁBOR JELENTKEZÉS ELTÁVOLÍTÁSA A LISTÁBÓL
include('include_remove_apply.php'); include 'include_remove_apply.php';
break; break;
case 'apply': case 'apply':
# TÁBORI JELENTKEZŐ ADATAINAK MEGTEKINTÉSE // TÁBORI JELENTKEZŐ ADATAINAK MEGTEKINTÉSE
include('include_apply.php'); include 'include_apply.php';
break; break;
case 'camp_user': case 'camp_user':
# táborvezetők // táborvezetők
include('include_user_camp_leader.php'); include 'include_user_camp_leader.php';
break; break;
case 'camp_details': case 'camp_details':
# turnusok // turnusok
include('include_camp_details.php'); include 'include_camp_details.php';
break;
case 'camp_fee':
// tábordíj befizetés
include 'include_camp_fee.php';
break; break;
case 'delete_camp_type': case 'delete_camp_type':
# TÁBOR TÍPUS TÖRLÉS // TÁBOR TÍPUS TÖRLÉS
include('include_delete_camp_type.php'); include 'include_delete_camp_type.php';
break; break;
case 'delete_camp': case 'delete_camp':
# TÁBOR TÖRLÉS // TÁBOR TÖRLÉS
include('include_delete_camp.php'); include 'include_delete_camp.php';
break; break;
case 'delete_camp_shirt': case 'delete_camp_shirt':
# TÁBORI PÓLÓ TÖRLÉS // TÁBORI PÓLÓ TÖRLÉS
include('include_delete_camp_shirt.php'); include 'include_delete_camp_shirt.php';
break; break;
case 'delete_camp_leader': case 'delete_camp_leader':
# TÁBORVEZETŐ TÖRLÉS // TÁBORVEZETŐ TÖRLÉS
include('include_delete_camp_leader.php'); include 'include_delete_camp_leader.php';
break; break;
default: default:
# code... // code...
break; break;
} }
break; break;
case 'ajax': case 'ajax':
if ($this->is_subpage()) { if ($this->is_subpage()) {
include('ajax/'.$this->get_subpage()); include 'ajax/'.$this->get_subpage();
} }
break; break;
case 'view': case 'view':
# SZÜLŐ FELÜLET // SZÜLŐ FELÜLET
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'logout': case 'logout':
# kijelentkezés // kijelentkezés
$from = "view"; $from = 'view';
include('include_logout.php'); include 'include_logout.php';
break; break;
case 'overview': case 'overview':
# áttekintő oldal adatokkal // áttekintő oldal adatokkal
include('include_overview.php'); include 'include_overview.php';
break; break;
case 'diary': case 'diary':
# napló, edzéslista // napló, edzéslista
include('include_diary.php'); include 'include_diary.php';
break; break;
case 'information': case 'information':
# információk // információk
include('include_information_wall.php'); include 'include_information_wall.php';
break; break;
default: default:
include('include_diary.php'); include 'include_diary.php';
break; break;
} }
break; break;
case 'preview': case 'preview':
# SZÜLŐI OLDAL ELŐNÉZET // SZÜLŐI OLDAL ELŐNÉZET
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'overview': case 'overview':
# áttekintő oldal adatokkal // áttekintő oldal adatokkal
include('include_overview.php'); include 'include_overview.php';
break; break;
case 'diary': case 'diary':
# napló, edzéslista // napló, edzéslista
include('include_diary.php'); include 'include_diary.php';
break; break;
case 'information': case 'information':
# információk // információk
include('include_information_wall.php'); include 'include_information_wall.php';
break; break;
default: default:
include('include_diary.php'); include 'include_diary.php';
break; break;
} }
break; break;
case 'coach': case 'coach':
# EDZŐI NÉZET // EDZŐI NÉZET
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'diary': case 'diary':
# napló, edzéslista // napló, edzéslista
include('include_coach_diary.php'); include 'include_coach_diary.php';
break; break;
case 'logout': case 'logout':
# kijelentkezés // kijelentkezés
$from = "coach"; $from = 'coach';
include('include_logout.php'); include 'include_logout.php';
break; break;
default: default:
include('include_coach_diary.php'); include 'include_coach_diary.php';
break; break;
} }
break; break;
case 'coach_preview': case 'coach_preview':
# EDZŐI ELŐNÉZET // EDZŐI ELŐNÉZET
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'diary': case 'diary':
# napló, edzéslista // napló, edzéslista
include('include_coach_diary.php'); include 'include_coach_diary.php';
break; break;
default: default:
include('include_coach_diary.php'); include 'include_coach_diary.php';
break; break;
} }
break; break;
case 'tabor': case 'tabor':
# TÁBOR OLDALAK // TÁBOR OLDALAK
switch ($this->get_subpage()) { switch ($this->get_subpage()) {
case 'informaciok': case 'informaciok':
# tábori információk // tábori információk
include('include_camp_information.php'); include 'include_camp_information.php';
break; break;
case 'jelentkezes': case 'jelentkezes':
# jelentkezés // jelentkezés
include('include_camp_apply.php'); include 'include_camp_apply.php';
break; break;
case 'jelentkezesek': case 'jelentkezesek':
# jelentkezések // jelentkezések
include('include_camp_applies.php'); include 'include_camp_applies.php';
break; break;
case 'move_next': case 'move_next':
# továbblépés mentés nélkül // továbblépés mentés nélkül
include('include_move_next.php'); include 'include_move_next.php';
break; break;
case 'logout': case 'logout':
# kijelentkezés // kijelentkezés
$from = "tabor"; $from = 'tabor';
include('include_logout.php'); include 'include_logout.php';
break; break;
case 'delete_apply': case 'delete_apply':
# jelentkezés törlése // jelentkezés törlése
include('include_delete_apply.php'); include 'include_delete_apply.php';
break; break;
default: default:
include('include_camp_information.php'); include 'include_camp_information.php';
break; break;
} }
break; break;
} }
} }
} } else {
else {
//nincs bejelentkezve //nincs bejelentkezve
$smarty->assign("page", $this->get_page()); $smarty->assign('page', $this->get_page());
if ('tabor' == $this->get_page() && $this->is_subpage() && 'regisztracio' == $this->get_subpage()) { if ('tabor' == $this->get_page() && $this->is_subpage() && 'regisztracio' == $this->get_subpage()) {
if (isset($_COOKIE['bc_reg_error'])) { if (isset($_COOKIE['bc_reg_error'])) {
$smarty->assign('error_code', $_COOKIE['bc_reg_error']); $smarty->assign('error_code', $_COOKIE['bc_reg_error']);
setcookie('bc_reg_error', null, time()-60*60*3, '/'); setcookie('bc_reg_error', null, time() - 60 * 60 * 3, '/');
} }
$smarty->display("register.tpl"); $smarty->display('register.tpl');
} } else {
else {
if (isset($_COOKIE['bc_reg_error'])) { if (isset($_COOKIE['bc_reg_error'])) {
$smarty->assign('error_code', $_COOKIE['bc_reg_error']); $smarty->assign('error_code', $_COOKIE['bc_reg_error']);
setcookie('bc_reg_error', null, time()-60*60*2, '/'); setcookie('bc_reg_error', null, time() - 60 * 60 * 2, '/');
} }
$smarty->display("login.tpl"); $smarty->display('login.tpl');
} }
} }
} }
private function set_page($_page)
private function set_page($_page) { {
$this->page = $_page; $this->page = $_page;
} }
private function set_subpage($_subpage) { private function set_subpage($_subpage)
{
$this->subpage = $_subpage; $this->subpage = $_subpage;
} }
private function set_id($_id) { private function set_id($_id)
{
$this->id = $_id; $this->id = $_id;
} }
public function get_page() { public function get_page()
{
return $this->page; return $this->page;
} }
public function get_subpage() { public function get_subpage()
{
return $this->subpage; return $this->subpage;
} }
public function get_id() { public function get_id()
{
return $this->id; return $this->id;
} }
public function is_page() { public function is_page()
{
return !empty($this->page); return !empty($this->page);
} }
public function is_subpage() { public function is_subpage()
{
return !empty($this->subpage); return !empty($this->subpage);
} }
public function is_id() { public function is_id()
{
return !empty($this->id); return !empty($this->id);
} }
} }
?>

BIN
_image/dollar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,9 @@
<?php
if ($this->is_id()) {
$apply = new camp_apply();
$apply->set_capp_data_by_id($this->get_id());
$smarty->assign('apply', $apply);
$smarty->display('camp_fee.tpl');
}

View File

@@ -597,6 +597,12 @@ if (isset($_POST['action'])) {
log::register('update_lease', $l_id); log::register('update_lease', $l_id);
header('Location: /admin/lease/'.$l_id); header('Location: /admin/lease/'.$l_id);
break; break;
case 'camp_fee':
unset($_POST['action']);
camp_apply::set_money($_POST['capp_money'], $_POST['capp_id']);
header('Location: /admin/camp_fee/'.$_POST['capp_id']);
# code...
break;
default: default:
// code... // code...
break; break;

View File

@@ -14,3 +14,5 @@ ALTER TABLE `camp_apply` DROP INDEX `fk_camp_apply_3_idx`;
ALTER TABLE `camp_apply` ALTER TABLE `camp_apply`
DROP `capp_accomodation_type`, DROP `capp_accomodation_type`,
DROP `capp_shuttle_type`; DROP `capp_shuttle_type`;
ALTER TABLE `camp_apply` ADD `capp_money` INT NOT NULL DEFAULT '0' AFTER `capp_camp_id`;

View File

@@ -49,13 +49,6 @@
</label> </label>
<div style="clear: left;">{$apply->get_capp_camp_kid_ck_id()->get_ck_sport_history()}</div> <div style="clear: left;">{$apply->get_capp_camp_kid_ck_id()->get_ck_sport_history()}</div>
</div> </div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Pólóméret:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_shirt()->get_cshirt_name()}</div>
</div>
<div class="list_item"> <div class="list_item">
<label class="desc"> <label class="desc">
<img src="/_image/person.png"> <img src="/_image/person.png">
@@ -131,35 +124,6 @@
<div>{$apply->get_capp_camp_id()->get_camp_helpers()}</div> <div>{$apply->get_capp_camp_id()->get_camp_helpers()}</div>
</div> </div>
{/if} {/if}
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tábor típus:
</label>
<div>
{if $apply->get_capp_accomodation_type()}
{$apply->get_capp_accomodation_type()->get_cat_name()}
{else}
Nincs megadva
{/if}
</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Labda típus:
</label>
<div>
{if $apply->get_capp_shuttle_type()}
{$apply->get_capp_shuttle_type()->get_cst_name()}
{else}
Nincs megadva
{/if}
</div>
</div>
<h1>Felelős kapcsolattartó</h1> <h1>Felelős kapcsolattartó</h1>

View File

@@ -87,10 +87,12 @@
{foreach $pending_apply_array as $apply} {foreach $pending_apply_array as $apply}
<tr> <tr>
<td> <td>
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a> {$apply->get_capp_id()}
</td> </td>
<td> <td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()} <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</a>
</td> </td>
<td> <td>
{$apply->get_capp_date()|substr:0:16} {$apply->get_capp_date()|substr:0:16}
@@ -124,10 +126,12 @@
{foreach $deleted_apply_array as $apply} {foreach $deleted_apply_array as $apply}
<tr> <tr>
<td class="bold"> <td class="bold">
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a> {$apply->get_capp_id()}
</td> </td>
<td> <td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()} <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</a>
</td> </td>
<td> <td>
{$apply->get_capp_accept_date()|substr:0:16} {$apply->get_capp_accept_date()|substr:0:16}
@@ -151,6 +155,8 @@
<th>Státusz</th> <th>Státusz</th>
<th>Visszaigazolva</th> <th>Visszaigazolva</th>
<th>Módosítás</th> <th>Módosítás</th>
<th>Befizetés</th>
<th>Befizetett összeg</th>
</tr> </tr>
{if !count($apply_array)} {if !count($apply_array)}
<tr> <tr>
@@ -160,10 +166,12 @@
{foreach $apply_array as $apply} {foreach $apply_array as $apply}
<tr> <tr>
<td class="bold"> <td class="bold">
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a> {$apply->get_capp_id()}
</td> </td>
<td> <td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()} <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</a>
</td> </td>
<td> <td>
{$apply->get_capp_date()|substr:0:16} {$apply->get_capp_date()|substr:0:16}
@@ -181,6 +189,20 @@
<a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a> <a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
{/if} {/if}
</td> </td>
<td>
{if $camp->get_camp_price() == null or $apply->get_capp_money() == $camp->get_camp_price()}
<img src="/_image/tick.png">
{elseif $camp->get_camp_price() > 0 and $apply->get_capp_money() == 0}
<img src="/_image/delete.png">
{else}
<img src="/_image/dollar.png">
{/if}
</td>
<td>
<a href="/admin/camp_fee/{$apply->get_capp_id()}" class="bold">
{$apply->get_capp_money()} Ft
</a>
</td>
</tr> </tr>
{/foreach} {/foreach}
{/if} {/if}

View File

@@ -0,0 +1,22 @@
<div class="form_wrapper">
<form method="post">
<div class="buttons">
<a href="/admin/camps/{$apply->get_capp_camp_id()->get_camp_id()}" class="addbutton big">Vissza</a>
</div>
<input type="hidden" name="capp_id" value="{$apply->get_capp_id()}">
<input type="hidden" name="action" value="camp_fee">
<div>
<label class="desc" for="capp_money">Befizetett összeg {$apply->get_capp_camp_kid_ck_id()->get_ck_name()} részére:</label>
<div><input type="number" min="0" name="capp_money" id="capp_money" value="{$apply->get_capp_money()}" required></div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form>
</div>