CAMP part 1, registration, apply, new login screen, wide layout
This commit is contained in:
21
_include/include_accept_apply.php
Normal file
21
_include/include_accept_apply.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# JELENTEKEZÉS ELFOGADÁSA
|
||||
camp_apply::apply_response($this->get_id(), 3);
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($this->get_id());
|
||||
header('Location: /admin/camps/' . $new_apply->get_capp_camp_id()->get_camp_id());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
50
_include/include_apply.php
Normal file
50
_include/include_apply.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# TÁBORI JELENTKEZÉS
|
||||
|
||||
//jelentkező
|
||||
$apply = new camp_apply();
|
||||
$apply->set_capp_data_by_id($this->get_id());
|
||||
|
||||
//felelős kapcsolattartó
|
||||
$res_cc_id = $sql->single_variable("SELECT cac_camp_contact_cc_id FROM camp_apply_contact WHERE cac_is_responsible = 1 AND cac_camp_apply_capp_id = " . $this->get_id() );
|
||||
$res_cc = new camp_contact();
|
||||
$res_cc->set_cc_data_by_id($res_cc_id);
|
||||
|
||||
//további kapcst-ók
|
||||
|
||||
$cc_ids = $sql->assoc_array("SELECT cac_camp_contact_cc_id FROM camp_apply_contact WHERE cac_is_responsible = 0 AND cac_camp_apply_capp_id = " . $this->get_id() );
|
||||
|
||||
$contacts = array();
|
||||
foreach ($cc_ids as $cc) {
|
||||
$contact = new camp_contact();
|
||||
$contact->set_cc_data_by_id($cc['cac_camp_contact_cc_id']);
|
||||
$contacts[] = $contact;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$smarty->assign('apply',$apply);
|
||||
$smarty->assign('res_cc',$res_cc);
|
||||
$smarty->assign('contacts',$contacts);
|
||||
$smarty->display('apply.tpl');
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
57
_include/include_camp_applies.php
Normal file
57
_include/include_camp_applies.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR ÁTIRÁNYÍTÉS /1-re
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# JELENTKEZÉSEK: 2 táblázat
|
||||
// elbírált jelentkezések
|
||||
// elfogadásra váró jelentkezések
|
||||
|
||||
//lekérjük az elbírált jelentkezéseket
|
||||
$accepted_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE ck_owner_id = " . $user->get_cu_id() . " AND capp_status in (3,4);");
|
||||
$color = "";
|
||||
$apply_array = array();
|
||||
foreach ($accepted_applies as $apply) {
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($apply['capp_id']);
|
||||
//lekérjük a státuszt
|
||||
//TODO: objektummal
|
||||
$status = $sql->single_variable('SELECT cas_name FROM camp_apply_status WHERE cas_id = ' . $new_apply->get_capp_status());
|
||||
if ($new_apply->get_capp_status() == 3) {
|
||||
$color = "green";
|
||||
}
|
||||
else {
|
||||
$color = "red";
|
||||
}
|
||||
$new_apply->set_capp_status($status);
|
||||
$apply_array[] = $new_apply;
|
||||
}
|
||||
|
||||
|
||||
//lekérjük az elfogadásra váró jelentkezéseket
|
||||
$pending_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE ck_owner_id = " . $user->get_cu_id() . " AND capp_status = 2;");
|
||||
|
||||
$apply_array_2 = array();
|
||||
foreach ($pending_applies as $apply) {
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($apply['capp_id']);
|
||||
$apply_array_2[] = $new_apply;
|
||||
}
|
||||
|
||||
$smarty->assign('color', $color);
|
||||
$smarty->assign('apply_array', $apply_array);
|
||||
$smarty->assign('pending_apply_array', $apply_array_2);
|
||||
$smarty->display('applies.tpl');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
167
_include/include_camp_apply.php
Normal file
167
_include/include_camp_apply.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR ÁTIRÁNYÍTÉS /1-re
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# TÁBORI JELENTKEZÉS
|
||||
//var_dump($_COOKIE);
|
||||
|
||||
if ($this->get_id() == 1) {
|
||||
//1. LÉPÉS JELENTKEZŐ ADATAI
|
||||
//lekérjük a camp_user kid-jeit egy tömbbe
|
||||
$kid_assoc_array = $sql->assoc_array("SELECT * FROM camp_kid WHERE ck_owner_id = " . $user->get_cu_id() . " AND ck_original_id IS NULL");
|
||||
$kids = array();
|
||||
foreach ($kid_assoc_array as $kid_array) {
|
||||
$new_kid = new camp_kid();
|
||||
$new_kid->set_ck_data_by_id($kid_array['ck_id']);
|
||||
$kids[] = $new_kid;
|
||||
}
|
||||
|
||||
$shirt_assoc_array = $sql->assoc_array("SELECT * FROM camp_shirt WHERE cshirt_deleted = 0 ORDER BY cshirt_id ASC;");
|
||||
$shirts = array();
|
||||
foreach ($shirt_assoc_array as $shirt) {
|
||||
$new_shirt = new camp_shirt();
|
||||
$new_shirt->set_cshirt_data_by_id($shirt['cshirt_id']);
|
||||
$shirts[] = $new_shirt;
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('step',1);
|
||||
$smarty->assign('kids',$kids);
|
||||
$smarty->assign('shirts',$shirts);
|
||||
$smarty->display('camp_apply.tpl');
|
||||
|
||||
//var_dump($user);
|
||||
}
|
||||
|
||||
elseif ($this->get_id() == 2) {
|
||||
//2. LÉPÉS KAPCSOLATTARTÓ ADATAI
|
||||
//csak akkor érhető el, ha van cookie, egyébként visszadob az első lépésre
|
||||
if (!isset($_COOKIE['badminton_camp_session_id'])) {
|
||||
header('Location: /tabor/jelentkezes/1');
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
|
||||
//lekérjük a korábban megadott kapcsolattartókat
|
||||
$contact_assoc_array = $sql->assoc_array("SELECT * FROM camp_contact WHERE cc_owner_id = " . $user->get_cu_id() . " AND cc_original_id IS NULL");
|
||||
$contacts = array();
|
||||
foreach ($contact_assoc_array as $contact_array) {
|
||||
$new_cc = new camp_contact();
|
||||
$new_cc->set_cc_data_by_id($contact_array['cc_id']);
|
||||
$contacts[] = $new_cc;
|
||||
}
|
||||
|
||||
//lekérjük van-e felelős kapcsolattartó
|
||||
//ha van, akkor nem lehet bepipálni
|
||||
//ha nincs, akkor van pipa
|
||||
$has_responsible = camp_apply::has_responsible_contact($_COOKIE['badminton_camp_session_id']);
|
||||
|
||||
|
||||
//lekérjük a contact type-okat
|
||||
$cct_assoc_array = $sql->assoc_array("SELECT * FROM camp_contact_type WHERE cct_owner IS NULL OR cct_owner = " . $user->get_cu_id() . ";");
|
||||
$cct_array = array();
|
||||
foreach ($cct_assoc_array as $cct) {
|
||||
$new_cct = new camp_contact_type();
|
||||
$new_cct->set_cct_data_by_id($cct['cct_id']);
|
||||
$cct_array[] = $new_cct;
|
||||
}
|
||||
|
||||
$smarty->assign('cct_array', $cct_array);
|
||||
|
||||
|
||||
|
||||
//lekérjük a session_id alapján a camp_kid it-t, objektumot csinálunk belőle és úgy adjuk át
|
||||
$ck_id = $sql->single_variable("SELECT capp_camp_kid_ck_id FROM camp_apply WHERE capp_id = " . $_COOKIE['badminton_camp_session_id']);
|
||||
$new_camp_kid = new camp_kid();
|
||||
$new_camp_kid->set_ck_data_by_id($ck_id);
|
||||
|
||||
$smarty->assign('camp_kid', $new_camp_kid);
|
||||
$smarty->assign('contacts', $contacts);
|
||||
$smarty->assign('step',2);
|
||||
$smarty->assign('has_responsible',($has_responsible?true:false));
|
||||
$smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
|
||||
$smarty->display('camp_apply.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($this->get_id() == 3) {
|
||||
# amikor nem választott felelős kapcsolattartót
|
||||
|
||||
//megnézzük van-e sessionj-e
|
||||
if (!isset($_COOKIE['badminton_camp_session_id'])) {
|
||||
header('Location: /tabor/jelentkezes/1');
|
||||
}
|
||||
|
||||
//lekérjük a contact-okat
|
||||
$contact_assoc_array = $sql->assoc_array('SELECT * FROM camp_apply_contact WHERE cac_camp_apply_capp_id = ' . $_COOKIE['badminton_camp_session_id']);
|
||||
$contacts = array();
|
||||
foreach ($contact_assoc_array as $contact_array) {
|
||||
$new_contact = new camp_contact();
|
||||
$new_contact->set_cc_data_by_id($contact_array['cac_camp_contact_cc_id']);
|
||||
$contacts[] = $new_contact;
|
||||
}
|
||||
|
||||
$smarty->assign('contacts', $contacts);
|
||||
$smarty->assign('step',3);
|
||||
$smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
|
||||
$smarty->display('camp_apply.tpl');
|
||||
|
||||
}
|
||||
|
||||
elseif ($this->get_id() == 4) {
|
||||
# tábor adatok megadása
|
||||
|
||||
//megnézzük van-e sessionj-e
|
||||
if (!isset($_COOKIE['badminton_camp_session_id'])) {
|
||||
header('Location: /tabor/jelentkezes/1');
|
||||
}
|
||||
|
||||
//lekérjük azokat a táborokat, amikre lehet jelentkezni, és a kezdődátum a mainál később van (>), és nem törölt
|
||||
$camp_assoc_array = $sql->assoc_array("SELECT * FROM camp WHERE camp_deleted = 0 AND camp_is_open = 1 AND camp_from > NOW() ORDER BY camp_from ASC;");
|
||||
|
||||
$camp_array = array();
|
||||
foreach ($camp_assoc_array as $camp) {
|
||||
$new_camp = new camp();
|
||||
$new_camp->set_camp_data_by_id($camp['camp_id']);
|
||||
$camp_array[] = $new_camp;
|
||||
}
|
||||
|
||||
$smarty->assign('step',4);
|
||||
$smarty->assign('camp_array',$camp_array);
|
||||
$smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
|
||||
$smarty->display('camp_apply.tpl');
|
||||
|
||||
}
|
||||
|
||||
elseif ($this->get_id() == 5) {
|
||||
# visszaigazoló szöveg
|
||||
|
||||
//megnézzük van-e sessionj-e
|
||||
if (!isset($_COOKIE['badminton_camp_session_id']) || empty($_COOKIE['badminton_camp_session_id'])) {
|
||||
header('Location: /tabor/jelentkezes/1');
|
||||
}
|
||||
|
||||
setcookie('badminton_camp_session_id', null, time()-60*60, '/');
|
||||
$smarty->assign('step',5);
|
||||
$smarty->display('camp_apply.tpl');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# REDIRECT
|
||||
header("Location: /tabor/jelentkezes/1");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
18
_include/include_camp_information.php
Normal file
18
_include/include_camp_information.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
# TÁBOR INFORMÁCIÓK
|
||||
|
||||
$info_query = "SELECT set_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = 'Tábor - információk';";
|
||||
|
||||
$setv_id = $sql->single_variable($info_query);
|
||||
|
||||
$new_setval = new setting_value();
|
||||
$new_setval->set_setting_value_data_by_id($setv_id);
|
||||
|
||||
$smarty->assign('setting', $new_setval);
|
||||
|
||||
$smarty->display('information.tpl');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
28
_include/include_camp_shirt_types.php
Normal file
28
_include/include_camp_shirt_types.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR TÁBORI PÓLÓLISTA
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# TÁBORI PÓLÓ SZERKESZTÉSE
|
||||
$camp_shirt_query = "SELECT * FROM camp_shirt WHERE cshirt_id = " . $this->get_id();
|
||||
$camp_shirt_assoc_array = $sql->assoc_array($camp_shirt_query);
|
||||
$smarty->assign('camp_shirt_array',$camp_shirt_assoc_array[0]);
|
||||
$smarty->display('camp_shirt_data_edit.tpl');
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# TÁBORI PÓLÓ LISTA
|
||||
|
||||
$camp_shirt_query = "SELECT * FROM camp_shirt WHERE cshirt_deleted = 0 ORDER BY cshirt_name ASC";
|
||||
$shirt_assoc_array = $sql->assoc_array($camp_shirt_query);
|
||||
|
||||
$smarty->assign('shirt_assoc_array',$shirt_assoc_array);
|
||||
$smarty->display('camp_shirt_list.tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
37
_include/include_camp_types.php
Normal file
37
_include/include_camp_types.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR TÁBOR_TÍPUSLISTA
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# TÁBOR_TÍPUS SZERKESZTÉSE
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# TÁBOR_TÍPUS LISTA
|
||||
|
||||
$ct_query = "SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC";
|
||||
$ct_assoc_array = $sql->assoc_array($ct_query);
|
||||
|
||||
$ct_array = array();
|
||||
foreach ($ct_assoc_array as $value) {
|
||||
$new_ct = new camp_type();
|
||||
$new_ct->set_ct_data_by_id($value['ct_id']);
|
||||
$ct_array[] = $new_ct;
|
||||
}
|
||||
|
||||
$smarty->assign('ct_array',$ct_array);
|
||||
$smarty->display('camp_type_list.tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
134
_include/include_camps.php
Normal file
134
_include/include_camps.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
|
||||
# HA NINCS ID, AKKOR TÁBORLISTA
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# TÁBOR SZERKESZTÉSE
|
||||
|
||||
$camp = new camp();
|
||||
$camp->set_camp_data_by_id($this->get_id());
|
||||
|
||||
//labda típusok hozzáadása
|
||||
$shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle_type WHERE cst_deleted = 0 ORDER BY cst_id ASC");
|
||||
$shuttle_array = array();
|
||||
foreach ($shuttle_assoc_array as $shuttle_type) {
|
||||
$new_cst = new camp_shuttle_type();
|
||||
$new_cst->set_cst_data_by_id($shuttle_type['cst_id']);
|
||||
$shuttle_array[] = $new_cst;
|
||||
}
|
||||
$smarty->assign('shuttle_array', $shuttle_array);
|
||||
|
||||
|
||||
//ottalvós opciók hozzáadása
|
||||
$accomodation_assoc = $sql->assoc_array("SELECT * FROM camp_accomodation_type WHERE cat_deleted = 0 ORDER BY cat_id ASC");
|
||||
$accomodation_array = array();
|
||||
foreach ($accomodation_assoc as $accomodation_type) {
|
||||
$new_cat = new camp_accomodation_type();
|
||||
$new_cat->set_cat_data_by_id($accomodation_type['cat_id']);
|
||||
$accomodation_array[] = $new_cat;
|
||||
}
|
||||
$smarty->assign('accomodation_array', $accomodation_array);
|
||||
|
||||
|
||||
//tábor típusok
|
||||
$ct_assoc_array = $sql->assoc_array("SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC");
|
||||
$camp_type_array = array();
|
||||
foreach ($ct_assoc_array as $ct) {
|
||||
$new_ct = new camp_type();
|
||||
$new_ct->set_ct_data_by_id($ct['ct_id']);
|
||||
$camp_type_array[] = $new_ct;
|
||||
}
|
||||
$smarty->assign('camp_type_array', $camp_type_array);
|
||||
|
||||
|
||||
|
||||
//shuttles
|
||||
$shuttles_assoc_array = $sql->assoc_array('SELECT * FROM camp_shuttle WHERE cs_camp_id = ' . $this->get_id());
|
||||
$shuttles = array();
|
||||
foreach ($shuttles_assoc_array as $shuttle) {
|
||||
$new_sh = new camp_shuttle_type();
|
||||
$new_sh->set_cst_data_by_id($shuttle['cs_shuttle_id']);
|
||||
$shuttles[] = $new_sh->get_cst_id(); //csak az id-t rakjuk bele, hogy in_array-jel könnyebb legyen keresni
|
||||
}
|
||||
|
||||
//accomodations
|
||||
$accom_assoc_array = $sql->assoc_array('SELECT * FROM camp_accomodation WHERE ca_camp_id = ' . $this->get_id());
|
||||
$accoms = array();
|
||||
foreach ($accom_assoc_array as $accom) {
|
||||
$new_ac = new camp_accomodation_type();
|
||||
$new_ac->set_cat_data_by_id($accom['ca_accomodation_id']);
|
||||
$accoms[] = $new_ac->get_cat_id(); //csak az id-t rakjuk bele, hogy in_array-jel könnyebb legyen keresni
|
||||
}
|
||||
|
||||
//visszaigazolt jelentkezések
|
||||
$accepted_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE capp_camp_id = " . $this->get_id() . " AND capp_status in (3,4) ORDER BY ck_name ASC;");
|
||||
$color = "";
|
||||
$apply_array = array();
|
||||
foreach ($accepted_applies as $apply) {
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($apply['capp_id']);
|
||||
//lekérjük a státuszt
|
||||
//TODO: objektummal
|
||||
$status = $sql->single_variable('SELECT cas_name FROM camp_apply_status WHERE cas_id = ' . $new_apply->get_capp_status());
|
||||
if ($new_apply->get_capp_status() == 3) {
|
||||
$color = "green";
|
||||
}
|
||||
else {
|
||||
$color = "red";
|
||||
}
|
||||
$new_apply->set_capp_status($status);
|
||||
$apply_array[] = $new_apply;
|
||||
}
|
||||
|
||||
//lekérjük az elfogadásra váró jelentkezéseket
|
||||
$pending_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE capp_camp_id = " . $this->get_id() . " AND capp_status = 2 ORDER BY capp_date DESC;;");
|
||||
|
||||
$apply_array_2 = array();
|
||||
foreach ($pending_applies as $apply) {
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($apply['capp_id']);
|
||||
$apply_array_2[] = $new_apply;
|
||||
}
|
||||
|
||||
$smarty->assign('color', $color);
|
||||
$smarty->assign('apply_array', $apply_array);
|
||||
$smarty->assign('pending_apply_array', $apply_array_2);
|
||||
|
||||
$smarty->assign('camp', $camp);
|
||||
$smarty->assign('shuttles', $shuttles);
|
||||
$smarty->assign('accomodations', $accoms);
|
||||
|
||||
|
||||
$smarty->display('camp_data_update.tpl');
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
# TÁBOR LISTA
|
||||
|
||||
//tábor adatok
|
||||
$camp_query = "SELECT * FROM camp WHERE camp_deleted = 0 ORDER BY camp_from DESC";
|
||||
$camp_assoc_array = $sql->assoc_array($camp_query);
|
||||
|
||||
$camp_array = array();
|
||||
foreach ($camp_assoc_array as $camp_data) {
|
||||
$new_camp = new camp();
|
||||
$new_camp->set_camp_data_by_id($camp_data['camp_id']);
|
||||
$camp_array[] = $new_camp;
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('camp_array',$camp_array);
|
||||
$smarty->display('camp_list.tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -4,27 +4,45 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
training
|
||||
JOIN
|
||||
training_coach ON trc_training_tr_id = tr_id
|
||||
(SELECT
|
||||
tr_id AS obj_id,
|
||||
TIMESTAMP(tr_date) AS obj_date,
|
||||
'training' AS obj_type
|
||||
FROM
|
||||
training
|
||||
JOIN training_coach ON trc_training_tr_id = tr_id
|
||||
WHERE
|
||||
trc_coach_uc_id = " . $user->get_ua_id() . " AND tr_deleted = 0
|
||||
ORDER BY tr_date DESC) valami
|
||||
UNION (SELECT
|
||||
mox_id AS obj_id,
|
||||
TIMESTAMP(date_add(mox_date, INTERVAL '23:59' HOUR_MINUTE)) AS obj_date,
|
||||
'money_expense' AS obj_type
|
||||
FROM
|
||||
money_expense
|
||||
WHERE
|
||||
trc_coach_uc_id = " . $user->get_ua_id() . "
|
||||
ORDER BY tr_date DESC
|
||||
;
|
||||
mox_user_coach_ua_id = " . $user->get_ua_id() . " AND mox_deleted = 0) ORDER BY obj_date DESC , obj_type ASC;
|
||||
";
|
||||
|
||||
|
||||
$action_assoc_array = $sql->assoc_array($action_list_query);
|
||||
|
||||
$trainings = array();
|
||||
foreach ($action_assoc_array as $action) {
|
||||
$new_training = new training();
|
||||
$new_training->set_training_data_by_id($action['tr_id']);
|
||||
$trainings[] = $new_training;
|
||||
$actions = array();
|
||||
foreach ($action_assoc_array as $action_array) {
|
||||
if ('money_expense' == $action_array['obj_type']) {
|
||||
$action = new $action_array['obj_type']();
|
||||
$action->set_mox_data_by_id($action_array['obj_id']);
|
||||
}
|
||||
elseif ('training' == $action_array['obj_type']) {
|
||||
$action = new $action_array['obj_type']();
|
||||
$action->set_training_data_by_id($action_array['obj_id']);
|
||||
}
|
||||
$actions[] = $action;
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('trainings', $trainings);
|
||||
//var_dump($actions);
|
||||
|
||||
$smarty->assign('actions',$actions);
|
||||
$smarty->display('coach_diary.tpl');
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ switch ($this->get_id()) {
|
||||
$training_type_assoc_array = $sql->assoc_array($training_type_query);
|
||||
$smarty->assign("training_type_assoc_array", $training_type_assoc_array);
|
||||
//COACH ARRAY
|
||||
$coach_data_query = "SELECT * FROM user_coach;";
|
||||
$coach_data_query = "SELECT * FROM user_coach WHERE ua_deleted = 0;";
|
||||
$coach_data_assoc_array = $sql->assoc_array($coach_data_query);
|
||||
|
||||
|
||||
@@ -154,8 +154,52 @@ switch ($this->get_id()) {
|
||||
file_put_contents($path.$file_name, $dump_content);
|
||||
|
||||
header("Location: /admin/settings/3");
|
||||
break;
|
||||
case 'camp_type':
|
||||
# ÚJ TÁBOR TÍPUS
|
||||
$smarty->display('camp_type_create.tpl');
|
||||
break;
|
||||
case 'camp':
|
||||
# ÚJ TÁBOR
|
||||
|
||||
//tábor típusok
|
||||
$ct_assoc_array = $sql->assoc_array("SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC");
|
||||
$camp_type_array = array();
|
||||
foreach ($ct_assoc_array as $ct) {
|
||||
$new_ct = new camp_type();
|
||||
$new_ct->set_ct_data_by_id($ct['ct_id']);
|
||||
$camp_type_array[] = $new_ct;
|
||||
}
|
||||
$smarty->assign('camp_type_array', $camp_type_array);
|
||||
|
||||
|
||||
//labda típusok hozzáadása
|
||||
$shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle_type WHERE cst_deleted = 0 ORDER BY cst_id ASC");
|
||||
$shuttle_array = array();
|
||||
foreach ($shuttle_assoc_array as $shuttle_type) {
|
||||
$new_cst = new camp_shuttle_type();
|
||||
$new_cst->set_cst_data_by_id($shuttle_type['cst_id']);
|
||||
$shuttle_array[] = $new_cst;
|
||||
}
|
||||
$smarty->assign('shuttle_array', $shuttle_array);
|
||||
|
||||
|
||||
//ottalvós opciók hozzáadása
|
||||
$accomodation_assoc = $sql->assoc_array("SELECT * FROM camp_accomodation_type WHERE cat_deleted = 0 ORDER BY cat_id ASC");
|
||||
$accomodation_array = array();
|
||||
foreach ($accomodation_assoc as $accomodation_type) {
|
||||
$new_cat = new camp_accomodation_type();
|
||||
$new_cat->set_cat_data_by_id($accomodation_type['cat_id']);
|
||||
$accomodation_array[] = $new_cat;
|
||||
}
|
||||
$smarty->assign('accomodation_array', $accomodation_array);
|
||||
|
||||
|
||||
$smarty->display('camp_create.tpl');
|
||||
break;
|
||||
case 'camp_shirt':
|
||||
# CAMP SHIRT létrehozása
|
||||
$smarty->display('camp_shirt_create.tpl');
|
||||
break;
|
||||
default:
|
||||
# code...
|
||||
|
||||
14
_include/include_delete_camp.php
Normal file
14
_include/include_delete_camp.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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('camp', array('camp_deleted' => 1), array('camp_id' => $this->get_id()));
|
||||
$new_camp = new camp();
|
||||
$new_camp->set_camp_data_by_id($this->get_id());
|
||||
log::register('delete_camp', $new_camp->get_camp_from() . " (" . $new_camp->get_camp_city() . ")");
|
||||
header("Location: /admin/camps");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
19
_include/include_delete_camp_shirt.php
Normal file
19
_include/include_delete_camp_shirt.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
//akiknek ez a shirt_id van beállítva, azoknál null-ra állítjuk
|
||||
$shirt_query = "SELECT ck_id FROM camp_kid WHERE ck_shirt_size_id = " . $this->get_id();
|
||||
$shirt_assoc_array = $sql->assoc_array($shirt_query);
|
||||
foreach ($shirt_assoc_array as $uk_id) {
|
||||
$sql->update_table('camp_kid', array('ck_shirt_size_id' => 'null'), array('ck_id' => $uk_id['ck_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('camp_shirt', array('cshirt_deleted' => 1), array('cshirt_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_camp_shirt', $this->get_id());
|
||||
header("Location: /admin/camp_shirt_type");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
12
_include/include_delete_camp_type.php
Normal file
12
_include/include_delete_camp_type.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('camp_type', array('ct_deleted' => 1), array('ct_id' => $this->get_id()));
|
||||
log::register('delete_ct', $this->get_id());
|
||||
header("Location: /admin/camp_types");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
21
_include/include_deny_apply.php
Normal file
21
_include/include_deny_apply.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
# JELENTEKEZÉS ELFOGADÁSA
|
||||
camp_apply::apply_response($this->get_id(), 4);
|
||||
$new_apply = new camp_apply();
|
||||
$new_apply->set_capp_data_by_id($this->get_id());
|
||||
header('Location: /admin/camps/' . $new_apply->get_capp_camp_id()->get_camp_id());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -13,6 +13,11 @@ elseif ($from == 'coach') {
|
||||
$log_c = 'coach_logout';
|
||||
$cookie = 'coach';
|
||||
|
||||
}
|
||||
elseif ($from == 'tabor') {
|
||||
$log_c = 'camp_user_logout';
|
||||
$cookie = 'camp';
|
||||
|
||||
}
|
||||
log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
|
||||
setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
|
||||
|
||||
Reference in New Issue
Block a user