deletes and fixes

This commit is contained in:
Ricsi
2019-03-27 22:59:40 +00:00
parent 4ddc2ec2e9
commit 999ace3149
122 changed files with 522 additions and 16020 deletions

View File

@@ -2,10 +2,10 @@
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//megnézzük, hogy a KID benne van-e olyan category-val, ami az adott grouphoz tartozik
//megnézzük, hogy a KID benne van-e olyan category-val, ami az adott grouphoz tartozik
//ha igen, akkor, akkor updateljük a categoryját
//ha nem, akkor beszúrjuk az új category ID-val
if ($_POST['category_id'] == 'null') {
@@ -36,7 +36,7 @@ if ($sql->num_of_rows($ugk_query)) {
}
else {
$sql->update_table('user_group_kid', array('ugk_category_ugc_id' => $_POST['category_id']), array('ugk_id' => $ugk_id));
}
}
@@ -60,4 +60,4 @@ else {
}
}
?>
?>

View File

@@ -1,47 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
include('class_user_parent.php');
include('class_user_kid.php');
include('class_user_group.php');
include('class_user_group_filter.php');
include('class_user_group_filter_value.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$all_kid = array();
if (empty($_POST['filter_array'])) {
echo json_encode(null);
}
else {
//updatelni kell az user_group_filter_value, aztán apply-olni
user_group::empty_group($_POST['user_group_id']);
foreach ($_POST['filter_array'] as $key => $filter_value) {
//[0] => filter_value_id, [1] => value, [2] => filter_id
if ($filter_value[1] == 'null') {
$sql->execute_query('DELETE FROM user_group_filter_value WHERE ugfv_id = ' . $filter_value[0]);
}
else {
$sql->update_table('user_group_filter_value', array(
'ugfv_filter_id' => $filter_value[2],
'ugfv_group_id' => $_POST['user_group_id'],
'ugfv_value' => $filter_value[1],
), array(
'ugfv_id' => $filter_value[0],
));
$ugfv_obj = new user_group_filter_value();
$ugfv_obj->set_ugfv_data_by_id($filter_value[0]);
$ugfv_obj->apply($_POST['intersect']);
}
}
}
?>

View File

@@ -1,14 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
echo json_encode($sql->insert_into('user_group_category', array(
'ugc_name' => $_POST['category_name'],
'ugc_user_group_ug_id' => $_POST['group_id']
)));
?>

View File

@@ -1,11 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
echo json_encode($sql->insert_into('user_group_filter_value', array()));
?>

View File

@@ -1,77 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//paraméterek: group_id, category_id
//ha nincs category_id, akkor mindenki
function get_value_parts($str) {
$parts = explode(',', $str);
return $parts;
}
$user_kid_query = "
SELECT
uk_id,
uk_name,
ugk_id,
GROUP_CONCAT(distinct ugk_id) ugk_ids,
GROUP_CONCAT(distinct ugc_id order by ugc_id) ugc_ids,
GROUP_CONCAT(ugc_name) ugc_names,
GROUP_CONCAT(distinct ugk_ugfv_id) ugfv_ids,
GROUP_CONCAT(distinct if(ugf_table is null, 'null', ugf_table)) ugf_tables,
GROUP_CONCAT(distinct if(ugf_value is null, 'null', ugf_value)) ugf_values,
GROUP_CONCAT(distinct if(ugf_label is null, 'null', ugf_label)) ugf_labels
FROM
user_kid
JOIN
user_group_kid ON ugk_user_kid_uk_id = uk_id
LEFT JOIN
user_group_category ON ugc_id = ugk_category_ugc_id
JOIN
user_group_filter_value ON ugfv_id = ugk_ugfv_id
JOIN
user_group_filter ON ugf_id = ugfv_filter_id
WHERE
uk_deleted = 0 and uk_is_active = 1 and
ugk_user_group_ug_id = ".$_POST['group_id'].""
.($_POST['category_id']?" AND ugk_category_ugc_id = " . $_POST['category_id']:"").
" GROUP BY uk_id
ORDER BY uk_name ASC;
";
$kid_array = $sql->assoc_array($user_kid_query);
//var_dump($user_kid_query);
//szívás, ne módosítsuk
foreach ($kid_array as $key => $kid_value) {
$tables = get_value_parts($kid_value['ugf_tables']);
$values_to_write = array();
foreach ($tables as $index => $table_name) {
if ('null' != $table_name && $kid_value['ugc_names']) {
$values = get_value_parts($kid_value['ugf_values']);
$value_field = $values[$index];
$labels = get_value_parts($kid_value['ugf_labels']);
$label_field = $labels[$index];
$values_to_search = get_value_parts($kid_value['ugc_names']);
//var_dump($values_to_search);
$value_to_search = $values_to_search[$index];
$values_to_write[] = $sql->single_variable('select '.$label_field.' from '.$table_name.' where '.$value_field.'='.$value_to_search);
$query = 'select '.$label_field.' from '.$table_name.' where '.$value_field.'='.$value_to_search;
}
else {
$names = get_value_parts($kid_value['ugc_names']);
$values_to_write[] = $names[$index];
}
}
$final_string = implode(',', $values_to_write);
$kid_array[$key]['ugc_names'] = $final_string;
}
echo json_encode($kid_array);
?>

View File

@@ -1,13 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//lekérjük a labda típusokat
$accom_assoc_array = $sql->assoc_array("SELECT * FROM camp_accomodation JOIN camp_accomodation_type on cat_id = ca_accomodation_id WHERE ca_camp_id = " . $_POST['camp_id']);
echo json_encode($accom_assoc_array);
?>

View File

@@ -1,13 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//lekérjük a labda típusokat
$cc_assoc_array = $sql->assoc_array("SELECT * FROM camp_contact WHERE cc_id = " . $_POST['camp_contact_id']);
echo json_encode($cc_assoc_array);
?>

View File

@@ -1,13 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//lekérjük a labda típusokat
$ck_assoc_array = $sql->assoc_array("SELECT * FROM camp_kid WHERE ck_id = " . $_POST['camp_kid_id']);
echo json_encode($ck_assoc_array);
?>

View File

@@ -1,18 +0,0 @@
<?php
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//lekérjük a labda típusokat
$shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle JOIN camp_shuttle_type on cst_id = cs_shuttle_id WHERE cs_camp_id = " . $_POST['camp_id']);
$shuttle_array = array();
foreach ($shuttle_assoc_array as $shuttle) {
$shuttle_array[$shuttle['cst_id']] = $shuttle['cst_name'];
}
echo json_encode($shuttle_assoc_array);
?>

View File

@@ -1,12 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$category_query = "SELECT * FROM user_group_category WHERE ugc_id = " . $_POST['category_id'];
echo json_encode($sql->assoc_array($category_query));
?>

View File

@@ -1,17 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$ugc_query = "SELECT * FROM user_group_category WHERE ugc_user_group_ug_id = " . $_POST['group_id'] . " ORDER BY ugc_name ASC";
$ugc_assoc_array = $sql->assoc_array($ugc_query);
echo json_encode($ugc_assoc_array);
?>

View File

@@ -1,17 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$ugc_query = "SELECT * FROM user_group_filter ORDER BY ugf_name ASC";
$ugc_assoc_array = $sql->assoc_array($ugc_query);
echo json_encode($ugc_assoc_array);
?>

View File

@@ -1,17 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$ugfv_query = "SELECT * FROM user_group_filter_value WHERE ugfv_group_id = " . $_POST['group_id'];
$ugfv_assoc_array = $sql->assoc_array($ugfv_query);
echo json_encode($ugfv_assoc_array);
?>

View File

@@ -1,29 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
include('class_user_group_filter.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
if ($_POST['filter_id'] == 'null') {
echo json_encode(null);
}
else {
$ugf = new user_group_filter();
$ugf->set_ugf_data_by_id($_POST['filter_id']);
//megvizsgáljuk, hogy külön táblából kell-e szedni az adatokat
if ($ugf->get_ugf_table()) {
$ugf_query = "SELECT DISTINCT ".$ugf->get_ugf_value()." AS ugf_id, ".$ugf->get_ugf_label()." AS ugf_name FROM " . $ugf->get_ugf_table() . " WHERE " . $ugf->get_ugf_condition();
}
else {
$ugf_query = "SELECT DISTINCT uk_" . $ugf->get_ugf_field() . " AS ugf_id, uk_".$ugf->get_ugf_field()." as ugf_name FROM user_kid WHERE uk_".$ugf->get_ugf_field()." IS NOT NULL ORDER BY uk_" . $ugf->get_ugf_field() . " ASC;";
}
//var_dump($ugf_query);
$ugf_assoc_array = $sql->assoc_array($ugf_query);
echo json_encode($ugf_assoc_array);
}
?>

View File

@@ -1,93 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//ha members akkor minden AKTÍV, NEM TÖRÖLT kid-et lekéri, név szerint rendezve
$kid_query = "SELECT
*
FROM
(SELECT
uk_id,
uk_name,
ugk_id,
uk_is_active,
uk_deleted,
ugk_user_group_ug_id,
ugk_category_ugc_id
FROM
user_kid
LEFT JOIN user_group_kid ON (ugk_user_kid_uk_id = uk_id
AND ugk_id NOT IN (SELECT
ugk_id
FROM
user_group_kid
WHERE
ugk_user_group_ug_id != ".$_POST['groupId']."))) subtbl
WHERE
(ugk_user_group_ug_id = ".$_POST['groupId']."
OR ugk_user_group_ug_id IS NULL)
AND uk_is_active = 1
AND uk_deleted = 0
AND (ugk_category_ugc_id NOT IN (SELECT
ugc_id
FROM
user_group_category
WHERE
ugc_user_group_ug_id != ".$_POST['groupId'].")
OR ugk_category_ugc_id IS NULL)";
if (!empty($_POST['searchStr'])) {
if ('members' == $_POST['searchStr']) {
$kid_query = "select uk_id, uk_name, ugk_id, ugk_user_group_ug_id, ugk_category_ugc_id from user_kid
left join user_group_kid on ugk_user_kid_uk_id = uk_id
where ugk_user_group_ug_id = ".$_POST['groupId'];
}
elseif ('not_members' == $_POST['searchStr']) {
$kid_query = " select uk_id, uk_name,
(select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id) as thisGroup,
if ((select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id), ugk_id, null) ugk_id,
null ugk_user_group_ug_id,
if ((select count(*) from user_group_category where ugc_user_group_ug_id = ".$_POST['groupId']." and ugc_id = ugk_category_ugc_id), ugk_category_ugc_id, null) ugk_category_ugc_id
from user_kid main_uk
left join user_group_kid main_ugk on ugk_user_kid_uk_id = uk_id
where uk_id not in (
select ugk_user_kid_uk_id from user_group_kid where ugk_user_group_ug_id = ".$_POST['groupId'].") AND uk_is_active = 1 AND uk_deleted = 0";
}
elseif ('members_without_category' == $_POST['searchStr']) {
$kid_query = " SELECT
*
FROM
user_kid
JOIN
user_group_kid ON ugk_user_kid_uk_id = uk_id
WHERE
ugk_user_group_ug_id = ".$_POST["groupId"]."
AND ugk_category_ugc_id IS NULL";
}
elseif (is_numeric($_POST['searchStr'])) {
# szűrés kategóriára
$kid_query = "select uk_id, uk_name, ugk_id, ugk_user_group_ug_id, ugk_category_ugc_id from user_kid
left join user_group_kid on ugk_user_kid_uk_id = uk_id
where ugk_category_ugc_id = " . $_POST['searchStr'];
}
else {
//keresés
$kid_query .= " AND uk_name like '".$_POST['searchStr']."%'";
}
}
$kid_query .= " ORDER BY uk_name ASC;";
$kid_assoc_array = $sql->assoc_array($kid_query);
echo json_encode($kid_assoc_array);
?>

View File

@@ -2,7 +2,7 @@
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
if ($_POST['parent_id'] == 'null') {

View File

@@ -2,7 +2,7 @@
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
if (empty($_GET['template_id'])) {

View File

@@ -2,7 +2,7 @@
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$filter1 = "";
@@ -25,4 +25,4 @@ $kid_assoc_array = $sql->assoc_array($kid_query);
echo json_encode($kid_assoc_array);
?>
?>

View File

@@ -1,118 +0,0 @@
<?php
//ini_set('include_path', '../_class/');
include '../_class/class_user_parent.php';
foreach (glob("../_class/*.php") as $filename)
{
//echo $filename;
$skip = array(
'../_class/class_user_parent.php',
'../_class/class_Exception.php',
);
if (in_array($filename, $skip)) continue;
include $filename;
}
/*
foreach ($_POST as $key => $value) {
trigger_error($_SERVER['HTTP_HOST'], E_USER_NOTICE);
}
*/
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
if (empty($_POST['uk_id'])) {
echo json_encode(null);
}
else {
$toNotify = new user_kid();
$toNotify->set_user_data_by_id($_POST['uk_id']);
if (null === $toNotify->get_uk_notify_email() || null === $toNotify->get_uk_notify_name()) {
echo json_encode('missing-data');
}
else {
$email_template_id = $sql->single_variable('select et_id from email_template where et_name = \'below_zero\'');
if (null !== $email_template_id) {
$emailTemplate = new email_template();
$emailTemplate->set_et_data_by_id($email_template_id);
$raw_subject = $emailTemplate->get_et_subject();
$raw_message = $emailTemplate->get_et_message();
//var_dump($toNotify_array);
//foreach ($toNotify_array as $toNotify) {
$personalizedSubject = $emailTemplate->personalize($raw_subject, array(
'uk_name' => $toNotify->get_uk_name(),
));
$personalizedMessage = $emailTemplate->personalize($raw_message, array(
'notify_name' => $toNotify->get_uk_notify_name(),
'uk_name' => $toNotify->get_uk_name(),
'uk_balance' => $toNotify->get_uk_balance(),
'uk_password' => $toNotify->get_uk_password(),
));
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->CharSet = PHPMailer::CHARSET_UTF8; // UTF-8
$mail->Host = 'mail.gginternet.com '; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'hirlevel@tollaslabda.info'; // SMTP username
$mail->Password = 'tollas12'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
//Recipients
$mail->setFrom($emailTemplate->get_et_from_email(), $emailTemplate->get_et_from_name());
$mail->addAddress($toNotify->get_uk_notify_email(), $toNotify->get_uk_notify_name());
//$mail->addAddress('tricsusz@gmail.com', 'Tóth Richárd'); // TEST
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $personalizedSubject;
$mail->Body = $personalizedMessage;
$mail->AltBody = 'Az Ön levelezője nem támogatja a HTML tartalom megjelenítését!';
//send mail
$mail->send();
//LOG SUCCESS
email_log::create_email_log(
$personalizedMessage,
$personalizedSubject,
$toNotify->get_uk_notify_name(),
$toNotify->get_uk_notify_email(),
$emailTemplate->get_et_id()
);
//Update kids last noti date
$sql->update_table('user_kid', array('uk_last_notification' => date('Y-m-d H:i:s')), array('uk_id' => $toNotify->get_uk_id()));
echo json_encode('success');
} catch (Exception $e) {
//LOG ERROR
email_log::create_email_log(
$personalizedMessage,
$personalizedSubject,
$toNotify->get_uk_notify_name(),
$toNotify->get_uk_notify_email(),
$emailTemplate->get_et_id(),
mysql_escape_string($e)
);
echo json_encode(null);
}
//}
}
}
}
?>

View File

@@ -1,48 +0,0 @@
<?php
//tag listánál ez adja vissza a keresés eredményét
ini_set('include_path', '../_class/');
include('class_sql.php');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
//ha benne van, akkor törölni kell, egyébként insertelni
$ugk_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_POST['group_id']. " AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
if ($sql->num_of_rows($ugk_query)) {
//ha nincs category-ja, akkor töröljük, egyébként csak nullra rakjuk a group_id-t
$ugk_id = $sql->single_variable($ugk_query);
$check_query = "SELECT ugk_category_ugc_id FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_POST['group_id']. " AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
$category_id = $sql->single_variable($check_query);
if ($category_id) {
//update to null
$sql->update_table('user_group_kid', array('ugk_user_group_ug_id' => 'null'), array('ugk_id' => $ugk_id));
}
else {
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_id = " . $ugk_id);
}
}
else {
//ha még nincs benne null-lal, akkor insert, egyébként update
$check_query = "SELECT ugk_id FROM user_group_kid WHERE ugk_user_group_ug_id IS NULL AND ugk_user_kid_uk_id = " . $_POST['uk_id'] . ";";
$ugk_id = $sql->single_variable($check_query);
if ($ugk_id) {
//update
$sql->update_table('user_group_kid', array(
'ugk_user_group_ug_id' => $_POST['group_id']
), array('ugk_id' => $ugk_id));
}
else {
$sql->insert_into('user_group_kid', array(
'ugk_user_kid_uk_id' => $_POST['uk_id'],
'ugk_user_group_ug_id' => $_POST['group_id']
));
}
}
?>

View File

@@ -7,7 +7,7 @@ foreach ($_POST as $key => $value) {
trigger_error($_SERVER['HTTP_HOST'], E_USER_NOTICE);
}
*/
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$check_query = "SELECT * FROM presence WHERE pr_training_tr_id = " . $_POST['tr_id'] . " AND pr_user_kid_uk_id = " . $_POST['user_id'] . ";";

View File

@@ -1,39 +0,0 @@
<?php
/**
* PHPMailer Exception class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
//namespace PHPMailer\PHPMailer;
/**
* PHPMailer exception handler.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class Exception extends \Exception
{
/**
* Prettify error message output.
*
* @return string
*/
public function errorMessage()
{
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
}
}

View File

@@ -1,138 +0,0 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2015 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
//namespace PHPMailer\PHPMailer;
use League\OAuth2\Client\Grant\RefreshToken;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
/**
* OAuth - OAuth2 authentication wrapper class.
* Uses the oauth2-client package from the League of Extraordinary Packages.
*
* @see http://oauth2-client.thephpleague.com
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
class OAuth
{
/**
* An instance of the League OAuth Client Provider.
*
* @var AbstractProvider
*/
protected $provider;
/**
* The current OAuth access token.
*
* @var AccessToken
*/
protected $oauthToken;
/**
* The user's email address, usually used as the login ID
* and also the from address when sending email.
*
* @var string
*/
protected $oauthUserEmail = '';
/**
* The client secret, generated in the app definition of the service you're connecting to.
*
* @var string
*/
protected $oauthClientSecret = '';
/**
* The client ID, generated in the app definition of the service you're connecting to.
*
* @var string
*/
protected $oauthClientId = '';
/**
* The refresh token, used to obtain new AccessTokens.
*
* @var string
*/
protected $oauthRefreshToken = '';
/**
* OAuth constructor.
*
* @param array $options Associative array containing
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
*/
public function __construct($options)
{
$this->provider = $options['provider'];
$this->oauthUserEmail = $options['userName'];
$this->oauthClientSecret = $options['clientSecret'];
$this->oauthClientId = $options['clientId'];
$this->oauthRefreshToken = $options['refreshToken'];
}
/**
* Get a new RefreshToken.
*
* @return RefreshToken
*/
protected function getGrant()
{
return new RefreshToken();
}
/**
* Get a new AccessToken.
*
* @return AccessToken
*/
protected function getToken()
{
return $this->provider->getAccessToken(
$this->getGrant(),
['refresh_token' => $this->oauthRefreshToken]
);
}
/**
* Generate a base64-encoded OAuth token.
*
* @return string
*/
public function getOauth64()
{
// Get a new token if it's not available or has expired
if (null === $this->oauthToken or $this->oauthToken->hasExpired()) {
$this->oauthToken = $this->getToken();
}
return base64_encode(
'user=' .
$this->oauthUserEmail .
"\001auth=Bearer " .
$this->oauthToken .
"\001\001"
);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,419 +0,0 @@
<?php
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
//namespace PHPMailer\PHPMailer;
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
* 1) This class does not support APOP authentication.
* 2) Opening and closing lots of POP3 connections can be quite slow. If you need
* to send a batch of emails then just perform the authentication once at the start,
* and then loop through your mail sending script. Providing this process doesn't
* take longer than the verification period lasts on your POP3 server, you should be fine.
* 3) This is really ancient technology; you should only need to use it to talk to very old systems.
* 4) This POP3 class is deliberately lightweight and incomplete, and implements just
* enough to do authentication.
* If you want a more complete class there are other POP3 classes for PHP available.
*
* @author Richard Davey (original author) <rich@corephp.co.uk>
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
*/
class POP3
{
/**
* The POP3 PHPMailer Version number.
*
* @var string
*/
const VERSION = '6.0.5';
/**
* Default POP3 port number.
*
* @var int
*/
const DEFAULT_PORT = 110;
/**
* Default timeout in seconds.
*
* @var int
*/
const DEFAULT_TIMEOUT = 30;
/**
* Debug display level.
* Options: 0 = no, 1+ = yes.
*
* @var int
*/
public $do_debug = 0;
/**
* POP3 mail server hostname.
*
* @var string
*/
public $host;
/**
* POP3 port number.
*
* @var int
*/
public $port;
/**
* POP3 Timeout Value in seconds.
*
* @var int
*/
public $tval;
/**
* POP3 username.
*
* @var string
*/
public $username;
/**
* POP3 password.
*
* @var string
*/
public $password;
/**
* Resource handle for the POP3 connection socket.
*
* @var resource
*/
protected $pop_conn;
/**
* Are we connected?
*
* @var bool
*/
protected $connected = false;
/**
* Error container.
*
* @var array
*/
protected $errors = [];
/**
* Line break constant.
*/
const LE = "\r\n";
/**
* Simple static wrapper for all-in-one POP before SMTP.
*
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return bool
*/
public static function popBeforeSmtp(
$host,
$port = false,
$timeout = false,
$username = '',
$password = '',
$debug_level = 0
) {
$pop = new self();
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
}
/**
* Authenticate with a POP3 server.
* A connect, login, disconnect sequence
* appropriate for POP-before SMTP authorisation.
*
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return bool
*/
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
{
$this->host = $host;
// If no port value provided, use default
if (false === $port) {
$this->port = static::DEFAULT_PORT;
} else {
$this->port = (int) $port;
}
// If no timeout value provided, use default
if (false === $timeout) {
$this->tval = static::DEFAULT_TIMEOUT;
} else {
$this->tval = (int) $timeout;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
// Reset the error log
$this->errors = [];
// connect
$result = $this->connect($this->host, $this->port, $this->tval);
if ($result) {
$login_result = $this->login($this->username, $this->password);
if ($login_result) {
$this->disconnect();
return true;
}
}
// We need to disconnect regardless of whether the login succeeded
$this->disconnect();
return false;
}
/**
* Connect to a POP3 server.
*
* @param string $host
* @param int|bool $port
* @param int $tval
*
* @return bool
*/
public function connect($host, $port = false, $tval = 30)
{
// Are we already connected?
if ($this->connected) {
return true;
}
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
//Rather than suppress it with @fsockopen, capture it cleanly instead
set_error_handler([$this, 'catchWarning']);
if (false === $port) {
$port = static::DEFAULT_PORT;
}
// connect to the POP3 server
$this->pop_conn = fsockopen(
$host, // POP3 Host
$port, // Port #
$errno, // Error Number
$errstr, // Error Message
$tval
); // Timeout (seconds)
// Restore the error handler
restore_error_handler();
// Did we connect?
if (false === $this->pop_conn) {
// It would appear not...
$this->setError(
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
);
return false;
}
// Increase the stream time-out
stream_set_timeout($this->pop_conn, $tval, 0);
// Get the POP3 server response
$pop3_response = $this->getResponse();
// Check for the +OK
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
return false;
}
/**
* Log in to the POP3 server.
* Does not support APOP (RFC 2828, 4949).
*
* @param string $username
* @param string $password
*
* @return bool
*/
public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
// Send the Username
$this->sendString("USER $username" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
// Send the Password
$this->sendString("PASS $password" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
}
}
return false;
}
/**
* Disconnect from the POP3 server.
*/
public function disconnect()
{
$this->sendString('QUIT');
//The QUIT command may cause the daemon to exit, which will kill our connection
//So ignore errors here
try {
@fclose($this->pop_conn);
} catch (Exception $e) {
//Do nothing
}
}
/**
* Get a response from the POP3 server.
*
* @param int $size The maximum number of bytes to retrieve
*
* @return string
*/
protected function getResponse($size = 128)
{
$response = fgets($this->pop_conn, $size);
if ($this->do_debug >= 1) {
echo 'Server -> Client: ', $response;
}
return $response;
}
/**
* Send raw data to the POP3 server.
*
* @param string $string
*
* @return int
*/
protected function sendString($string)
{
if ($this->pop_conn) {
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
echo 'Client -> Server: ', $string;
}
return fwrite($this->pop_conn, $string, strlen($string));
}
return 0;
}
/**
* Checks the POP3 server response.
* Looks for for +OK or -ERR.
*
* @param string $string
*
* @return bool
*/
protected function checkResponse($string)
{
if (substr($string, 0, 3) !== '+OK') {
$this->setError("Server reported an error: $string");
return false;
}
return true;
}
/**
* Add an error to the internal error store.
* Also display debug output if it's enabled.
*
* @param string $error
*/
protected function setError($error)
{
$this->errors[] = $error;
if ($this->do_debug >= 1) {
echo '<pre>';
foreach ($this->errors as $e) {
print_r($e);
}
echo '</pre>';
}
}
/**
* Get an array of error messages, if any.
*
* @return array
*/
public function getErrors()
{
return $this->errors;
}
/**
* POP3 connection error handler.
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*/
protected function catchWarning($errno, $errstr, $errfile, $errline)
{
$this->setError(
'Connecting to the POP3 server raised a PHP warning:' .
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,58 +0,0 @@
<?php
class backup {
private $bu_id;
private $bu_name;
private $bu_date;
private $bu_deleted;
public function set_bu_id($_item) {
$this->bu_id = $_item;
}
public function set_bu_name($_item) {
$this->bu_name = $_item;
}
public function set_bu_date($_item) {
$this->bu_date = $_item;
}
public function set_bu_deleted($_item) {
$this->bu_deleted = $_item;
}
public function get_bu_id() {
return $this->bu_id;
}
public function get_bu_name() {
return $this->bu_name;
}
public function get_bu_date() {
return $this->bu_date;
}
public function get_bu_deleted() {
return $this->bu_deleted;
}
public function set_backup_data_by_id($_id) {
//SETTING ID ALAPJÁN KÉRI LE;
//HA KELL, LEHET KÜLÖN FUNCTION-T ÍRNI HOGY ID ALAPJÁN KÉRJE
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from backup where bu_id = " . $_id);
$set_data_array = $set_data_assoc_array[0];
foreach ($set_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
}
}
}
?>

View File

@@ -1,336 +0,0 @@
<?php
/**
* tábor osztály
*/
class camp
{
private $camp_id;
private $camp_city;
private $camp_from;
private $camp_to;
private $camp_leader;
private $camp_helpers;
private $camp_camp_type_ct_id; //ID
private $camp_type; //OBJ
private $camp_shuttle = array(); //array
private $camp_sleep;
private $camp_deleted;
private $camp_is_open;
/**
* Gets the value of camp_id.
*
* @return mixed
*/
public function get_camp_id()
{
return $this->camp_id;
}
/**
* Sets the value of camp_id.
*
* @param mixed $camp_id the camp id
*
* @return self
*/
private function set_camp_id($camp_id)
{
$this->camp_id = $camp_id;
return $this;
}
/**
* Gets the value of camp_city.
*
* @return mixed
*/
public function get_camp_city()
{
return $this->camp_city;
}
/**
* Sets the value of camp_city.
*
* @param mixed $camp_city the camp city
*
* @return self
*/
private function set_camp_city($camp_city)
{
$this->camp_city = $camp_city;
return $this;
}
/**
* Gets the value of camp_from.
*
* @return mixed
*/
public function get_camp_from()
{
return $this->camp_from;
}
public function get_camp_from_day() {
$day = date("d", strtotime($this->camp_from));
if (substr($day, 0, 1) == '0') return substr($day, 1, 1);
return date("d", strtotime($this->camp_from));
}
public function get_camp_to_day() {
$day = date("d", strtotime($this->camp_to));
if (substr($day, 0, 1) == '0') return substr($day, 1, 1);
return date("d", strtotime($this->camp_to));
}
/**
* Sets the value of camp_from.
*
* @param mixed $camp_from the camp from
*
* @return self
*/
private function set_camp_from($camp_from)
{
$this->camp_from = $camp_from;
return $this;
}
/**
* Gets the value of camp_to.
*
* @return mixed
*/
public function get_camp_to()
{
return $this->camp_to;
}
/**
* Sets the value of camp_to.
*
* @param mixed $camp_to the camp to
*
* @return self
*/
private function set_camp_to($camp_to)
{
$this->camp_to = $camp_to;
return $this;
}
/**
* Gets the value of camp_camp_type_ct_id.
*
* @return mixed
*/
public function get_camp_camp_type_ct_id()
{
return $this->camp_camp_type_ct_id;
}
/**
* Sets the value of camp_camp_type_ct_id.
*
* @param mixed $camp_camp_type_ct_id the camp camp type ct id
*
* @return self
*/
private function set_camp_camp_type_ct_id($camp_camp_type_ct_id)
{
$this->camp_camp_type_ct_id = $camp_camp_type_ct_id;
return $this;
}
/**
* Gets the value of camp_type.
*
* @return mixed
*/
public function get_camp_type()
{
return $this->camp_type;
}
/**
* Sets the value of camp_type.
*
* @param mixed $camp_type the camp type
*
* @return self
*/
private function set_camp_type($camp_type)
{
$this->camp_type = $camp_type;
return $this;
}
public function get_camp_deleted() {
return $this->camp_deleted;
}
private function set_camp_deleted($_item) {
$this->camp_deleted = $_item;
return $this;
}
public function get_camp_is_open() {
return $this->camp_is_open;
}
private function set_camp_is_open($_item) {
$this->camp_is_open = $_item;
return $this;
}
public function get_camp_leader() {
return $this->camp_leader;
}
private function set_camp_leader($_item) {
$this->camp_leader = $_item;
return $this;
}
public function get_camp_helpers() {
return $this->camp_helpers;
}
private function set_camp_helpers($_item) {
$this->camp_helpers = $_item;
return $this;
}
public function has_pending_apply() {
global $sql;
return $sql->num_of_rows("select * from camp join camp_apply on capp_camp_id = camp_id where capp_status = 2 AND camp_id = " . $this->get_camp_id());
}
public function has_deleted_apply() {
global $sql;
return $sql->num_of_rows("select * from camp join camp_apply on capp_camp_id = camp_id where capp_status = 5 AND camp_id = " . $this->get_camp_id());
}
public function get_camp_applies() {
//visszaadja az elfogadott jelentkezéseket ABC sorrendben
global $sql;
$apply_assoc_array = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid ON ck_id = capp_camp_kid_ck_id WHERE capp_status = 3 AND capp_camp_id = " . $this->get_camp_id() . " ORDER BY ck_name ASC;");
$apply_array = array();
foreach ($apply_assoc_array as $apply) {
$new_apply = new camp_apply();
$new_apply->set_capp_data_by_id($apply['capp_id']);
$apply_array[] = $new_apply;
}
return $apply_array;
}
public function set_camp_data_by_id($_camp_id) {
global $sql;
$camp_data_assoc_array = $sql->assoc_array("select * from camp where camp_id = " . $_camp_id);
$camp_data_array = $camp_data_assoc_array[0];
//alapadatok
foreach ($camp_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ('camp_camp_type_ct_id' == $field) {
$new_ct = new camp_type();
$new_ct->set_ct_data_by_id($value);
$this->set_camp_type($new_ct);
}
}
//labdatípusok hozzáadása tömbbe
$shuttle_assoc_array = $sql->assoc_array("SELECT cs_shuttle_id FROM camp_shuttle WHERE cs_camp_id = " . $_camp_id . ";");
if (!empty($shuttle_assoc_array)) {
foreach ($shuttle_assoc_array as $shuttle_array) {
$this->camp_shuttle[] = $shuttle_array['cs_shuttle_id'];
}
}
}
public static function create_camp($_city, $_from, $_to, $_leader, $_helpers, $_is_open, $_ct_id, $_shuttles, $_accoms) {
global $sql;
$new_camp_id = $sql->insert_into('camp',array(
'camp_city' => $_city,
'camp_from' => $_from,
'camp_to' => $_to,
'camp_leader' => $_leader,
'camp_helpers' => $_helpers,
'camp_is_open' => $_is_open,
'camp_camp_type_ct_id' => $_ct_id
));
if (!empty($_shuttles)) {
foreach ($_shuttles as $_shuttle_id) {
$sql->insert_into('camp_shuttle', array('cs_camp_id' => $new_camp_id, 'cs_shuttle_id' => $_shuttle_id));
}
}
if (!empty($_accoms)) {
foreach ($_accoms as $_accom_id) {
$sql->insert_into('camp_accomodation', array('ca_camp_id' => $new_camp_id, 'ca_accomodation_id' => $_accom_id));
}
}
}
public static function update_camp($_city, $_from, $_to, $_leader, $_helpers, $_is_open, $_ct_id, $_shuttles, $_accoms, $_camp_id) {
global $sql;
$new_camp_id = $sql->update_table('camp',array(
'camp_city' => $_city,
'camp_from' => $_from,
'camp_to' => $_to,
'camp_leader' => $_leader,
'camp_helpers' => $_helpers,
'camp_is_open' => $_is_open,
'camp_camp_type_ct_id' => $_ct_id
),
array(
'camp_id' => $_camp_id
)
);
//kitöröljük a korábbi shuttle és accom sorokat
$sql->execute_query('DELETE FROM camp_shuttle WHERE cs_camp_id = ' . $_camp_id);
$sql->execute_query('DELETE FROM camp_accomodation WHERE ca_camp_id = ' . $_camp_id);
if (!empty($_shuttles)) {
foreach ($_shuttles as $_shuttle_id) {
$sql->insert_into('camp_shuttle', array('cs_camp_id' => $_camp_id, 'cs_shuttle_id' => $_shuttle_id));
}
}
if (!empty($_accoms)) {
foreach ($_accoms as $_accom_id) {
$sql->insert_into('camp_accomodation', array('ca_camp_id' => $_camp_id, 'ca_accomodation_id' => $_accom_id));
}
}
}
}
?>

View File

@@ -1,82 +0,0 @@
<?php
/**
* SHUTTLE
*/
class camp_accomodation_type
{
private $cat_id;
private $cat_name;
private $cat_deleted;
/**
* Gets the value of cat_id.
*
* @return mixed
*/
public function get_cat_id()
{
return $this->cat_id;
}
/**
* Sets the value of cat_id.
*
* @param mixed $cat_id the cat id
*
* @return self
*/
private function set_cat_id($cat_id)
{
$this->cat_id = $cat_id;
return $this;
}
/**
* Gets the value of cat_name.
*
* @return mixed
*/
public function get_cat_name()
{
return $this->cat_name;
}
/**
* Sets the value of cat_name.
*
* @param mixed $cat_name the cat name
*
* @return self
*/
private function set_cat_name($cat_name)
{
$this->cat_name = $cat_name;
return $this;
}
private function set_cat_deleted($_item) {
$this->cat_deleted = $_item;
}
public function get_cat_deleted($_item) {
return $this->cat_deleted;
}
public function set_cat_data_by_id($_cat_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from camp_accomodation_type where cat_id = " . $_cat_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
}
?>

View File

@@ -1,307 +0,0 @@
<?php
class camp_apply {
private $capp_id;
private $capp_camp_kid_ck_id;
private $capp_accomodation_type = null;
private $capp_shuttle_type = null;
private $capp_date = null;
private $capp_status = null;
private $capp_accept_date = null;
private $capp_camp_id = null;
/**
* get_s the value of capp_id.
*
* @return mixed
*/
public function get_capp_id()
{
return $this->capp_id;
}
/**
* Sets the value of capp_id.
*
* @param mixed $capp_id the capp id
*
* @return self
*/
private function set_capp_id($capp_id)
{
$this->capp_id = $capp_id;
return $this;
}
/**
* get_s the value of capp_camp_kid_ck_id.
*
* @return mixed
*/
public function get_capp_camp_kid_ck_id()
{
return $this->capp_camp_kid_ck_id;
}
/**
* Sets the value of capp_camp_kid_ck_id.
*
* @param mixed $capp_camp_kid_ck_id the capp camp user ck id
*
* @return self
*/
private function set_capp_camp_kid_ck_id($capp_camp_kid_ck_id)
{
$this->capp_camp_kid_ck_id = $capp_camp_kid_ck_id;
return $this;
}
/**
* get_s the value of capp_accomodation_type.
*
* @return mixed
*/
public function get_capp_accomodation_type()
{
return $this->capp_accomodation_type;
}
/**
* Sets the value of capp_accomodation_type.
*
* @param mixed $capp_accomodation_type the capp accomodation type
*
* @return self
*/
private function set_capp_accomodation_type($capp_accomodation_type)
{
$this->capp_accomodation_type = $capp_accomodation_type;
return $this;
}
/**
* get_s the value of capp_shuttle_type.
*
* @return mixed
*/
public function get_capp_shuttle_type()
{
return $this->capp_shuttle_type;
}
/**
* Sets the value of capp_shuttle_type.
*
* @param mixed $capp_shuttle_type the capp shuttle type
*
* @return self
*/
private function set_capp_shuttle_type($capp_shuttle_type)
{
$this->capp_shuttle_type = $capp_shuttle_type;
return $this;
}
/**
* get_s the value of capp_date.
*
* @return mixed
*/
public function get_capp_date()
{
return $this->capp_date;
}
/**
* Sets the value of capp_date.
*
* @param mixed $capp_date the capp date
*
* @return self
*/
private function set_capp_date($capp_date)
{
$this->capp_date = $capp_date;
return $this;
}
/**
* get_s the value of capp_status.
*
* @return mixed
*/
public function get_capp_status()
{
return $this->capp_status;
}
/**
* Sets the value of capp_status.
*
* @param mixed $capp_status the capp status
*
* @return self
*/
public function set_capp_status($capp_status)
{
$this->capp_status = $capp_status;
return $this;
}
/**
* get_s the value of capp_accept_date.
*
* @return mixed
*/
public function get_capp_accept_date()
{
return $this->capp_accept_date;
}
/**
* Sets the value of capp_accept_date.
*
* @param mixed $capp_accept_date the capp accept date
*
* @return self
*/
private function set_capp_accept_date($capp_accept_date)
{
$this->capp_accept_date = $capp_accept_date;
return $this;
}
/**
* get_s the value of capp_camp_id.
*
* @return mixed
*/
public function get_capp_camp_id()
{
return $this->capp_camp_id;
}
/**
* Sets the value of capp_camp_id.
*
* @param mixed $capp_camp_id the capp camp id
*
* @return self
*/
private function set_capp_camp_id($capp_camp_id)
{
$this->capp_camp_id = $capp_camp_id;
return $this;
}
//STATIC!
public static function has_responsible_contact($_capp_id) {
global $sql;
return $sql->num_of_rows('SELECT * FROM camp_apply_contact WHERE cac_camp_apply_capp_id = ' . $_capp_id . ' AND cac_is_responsible = 1;');
}
public static function apply_response($_apply_id, $_status_id) {
global $sql;
$sql->update_table('camp_apply', array('capp_status' => $_status_id, 'capp_accept_date' => date("Y-m-d H:i:s")), array('capp_id' => $_apply_id));
}
public static function has_contact($_capp_id) {
global $sql;
return $sql->num_of_rows('SELECT * FROM camp_apply_contact WHERE cac_camp_apply_capp_id = ' . $_capp_id . ';');
}
public function set_capp_data_by_id($_id) {
global $sql;
$capp_data_assoc_array = $sql->assoc_array("select * from camp_apply where capp_id = " . $_id);
$capp_array = $capp_data_assoc_array[0];
foreach ($capp_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ($field == 'capp_camp_kid_ck_id') {
$new_kid = new camp_kid();
$new_kid->set_ck_data_by_id($value);
$this->$function_name($new_kid);
}
if ($field == 'capp_accomodation_type') {
$new_cat = new camp_accomodation_type();
$new_cat->set_cat_data_by_id($value);
$this->$function_name($new_cat);
}
if ($field == 'capp_shuttle_type') {
$new_cst = new camp_shuttle_type();
$new_cst->set_cst_data_by_id($value);
$this->$function_name($new_cst);
}
if ($field == 'capp_camp_id') {
$new_camp = new camp();
$new_camp->set_camp_data_by_id($value);
$this->$function_name($new_camp);
}
}
}
public function get_responsible_contact() {
global $sql;
$cc_id = $sql->single_variable("SELECT cac_camp_contact_cc_id FROM camp_apply_contact WHERE cac_camp_apply_capp_id = " . $this->get_capp_id() . " AND cac_is_responsible = 1;");
$cc = new camp_contact();
$cc->set_cc_data_by_id($cc_id);
return $cc;
}
//egy létező jelentkezésnél felelős kapcsolattartóra állít valakit
public static function make_contact_responsible($_apply_id, $_cc_id, $_is_responsible = false) {
global $sql;
//TODO: itt majd cac objektumot adjunk át, és akkor nem így kell updatelni hanem primary key alapján
$sql->update_table('camp_apply_contact',
array(
'cac_is_responsible' => $_is_responsible
),
array(
'cac_camp_apply_capp_id' => $_apply_id,
'cac_camp_contact_cc_id' => $_cc_id
)
);
}
public static function create_camp_apply($_camp_kid, $_status = 1, $_camp_accom = 'null', $_camp_shuttle = 'null', $_camp_date = 'null', $_camp_accept_date = 'null', $_camp = 'null') {
global $sql;
return $sql->insert_into('camp_apply', array(
'capp_camp_kid_ck_id' => $_camp_kid,
'capp_accomodation_type' => $_camp_accom,
'capp_shuttle_type' => $_camp_shuttle,
'capp_date' => $_camp_date,
'capp_accept_date' => $_camp_accept_date,
'capp_status' => $_status,
'capp_camp_id' => $_camp,
)
);
}
//ezzel nem lehet kid-et updatelni, arra külön function kell
public static function update_camp_apply($_apply_id, $_status = 1, $_camp_accom = 'null', $_camp_shuttle = 'null', $_camp_date = 'null', $_camp_accept_date = 'null', $_camp = 'null') {
global $sql;
$sql->update_table('camp_apply', array(
'capp_accomodation_type' => $_camp_accom,
'capp_shuttle_type' => $_camp_shuttle,
'capp_date' => $_camp_date,
'capp_accept_date' => $_camp_accept_date,
'capp_status' => $_status,
'capp_camp_id' => $_camp,
), array('capp_id' => $_apply_id));
}
}
?>

View File

@@ -1,327 +0,0 @@
<?php
class camp_contact {
private $cc_id;
private $cc_name;
private $cc_mobile;
private $cc_email;
private $cc_facebook;
private $cc_camp_contact_type_cct_id;
private $cc_camp_contact_type;
private $cc_owner_id;
private $cc_owner;
private $cc_original_id;
private $cc_original;
/**
* Gets the value of cc_id.
*
* @return mixed
*/
public function get_cc_id()
{
return $this->cc_id;
}
/**
* Sets the value of cc_id.
*
* @param mixed $cc_id the cc id
*
* @return self
*/
private function set_cc_id($cc_id)
{
$this->cc_id = $cc_id;
return $this;
}
/**
* Gets the value of cc_name.
*
* @return mixed
*/
public function get_cc_name()
{
return $this->cc_name;
}
/**
* Sets the value of cc_name.
*
* @param mixed $cc_name the cc name
*
* @return self
*/
private function set_cc_name($cc_name)
{
$this->cc_name = $cc_name;
return $this;
}
/**
* Gets the value of cc_mobile.
*
* @return mixed
*/
public function get_cc_mobile()
{
return $this->cc_mobile;
}
/**
* Sets the value of cc_mobile.
*
* @param mixed $cc_mobile the cc mobile
*
* @return self
*/
private function set_cc_mobile($cc_mobile)
{
$this->cc_mobile = $cc_mobile;
return $this;
}
/**
* Gets the value of cc_email.
*
* @return mixed
*/
public function get_cc_email()
{
return $this->cc_email;
}
/**
* Sets the value of cc_email.
*
* @param mixed $cc_email the cc email
*
* @return self
*/
private function set_cc_email($cc_email)
{
$this->cc_email = $cc_email;
return $this;
}
/**
* Gets the value of cc_facebook.
*
* @return mixed
*/
public function get_cc_facebook()
{
return $this->cc_facebook;
}
/**
* Sets the value of cc_facebook.
*
* @param mixed $cc_facebook the cc facebook
*
* @return self
*/
private function set_cc_facebook($cc_facebook)
{
$this->cc_facebook = $cc_facebook;
return $this;
}
/**
* Gets the value of cc_camp_contact_type_cct_id.
*
* @return mixed
*/
public function get_cc_camp_contact_type_cct_id()
{
return $this->cc_camp_contact_type_cct_id;
}
/**
* Sets the value of cc_camp_contact_type_cct_id.
*
* @param mixed $cc_camp_contact_type_cct_id the cc camp contact type cct id
*
* @return self
*/
private function set_cc_camp_contact_type_cct_id($cc_camp_contact_type_cct_id)
{
$this->cc_camp_contact_type_cct_id = $cc_camp_contact_type_cct_id;
return $this;
}
/**
* Gets the value of cc_camp_contact_type.
*
* @return mixed
*/
public function get_cc_camp_contact_type()
{
return $this->cc_camp_contact_type;
}
/**
* Sets the value of cc_camp_contact_type.
*
* @param mixed $cc_camp_contact_type the cc camp contact type
*
* @return self
*/
private function set_cc_camp_contact_type($cc_camp_contact_type)
{
$this->cc_camp_contact_type = $cc_camp_contact_type;
return $this;
}
/**
* Gets the value of cc_owner_id.
*
* @return mixed
*/
public function get_cc_owner_id()
{
return $this->cc_owner_id;
}
/**
* Sets the value of cc_owner_id.
*
* @param mixed $cc_owner_id the cc owner id
*
* @return self
*/
private function set_cc_owner_id($cc_owner_id)
{
$this->cc_owner_id = $cc_owner_id;
return $this;
}
/**
* Gets the value of cc_owner.
*
* @return mixed
*/
public function get_cc_owner()
{
return $this->cc_owner;
}
/**
* Sets the value of cc_owner.
*
* @param mixed $cc_owner the cc owner
*
* @return self
*/
private function set_cc_owner($cc_owner)
{
$this->cc_owner = $cc_owner;
return $this;
}
/**
* Gets the value of cc_original_id.
*
* @return mixed
*/
public function get_cc_original_id()
{
return $this->cc_original_id;
}
/**
* Sets the value of cc_original_id.
*
* @param mixed $cc_original_id the cc original id
*
* @return self
*/
private function set_cc_original_id($cc_original_id)
{
$this->cc_original_id = $cc_original_id;
return $this;
}
/**
* Gets the value of cc_original.
*
* @return mixed
*/
public function get_cc_original()
{
return $this->cc_original;
}
/**
* Sets the value of cc_original.
*
* @param mixed $cc_original the cc original
*
* @return self
*/
private function set_cc_original($cc_original)
{
$this->cc_original = $cc_original;
return $this;
}
public function set_cc_data_by_id($_id) {
global $sql;
$cc_data_assoc_array = $sql->assoc_array("select * from camp_contact where cc_id = " . $_id);
$cc_array = $cc_data_assoc_array[0];
foreach ($cc_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ($field == 'cc_camp_contact_type_cct_id') {
$new_cct = new camp_contact_type();
$new_cct->set_cct_data_by_id($value);
$this->set_cc_camp_contact_type($new_cct);
}
if ($field == 'cc_owner_id') {
$new_cu = new camp_user();
$new_cu->set_user_data_by_id($value);
$this->set_cc_owner($new_cu);
}
if ($field == 'cc_original_id' && !empty($value)) {
$new_cc = new camp_contact();
$new_cc->set_cc_data_by_id($value);
$this->set_cc_original($new_cc);
}
}
}
private static function empty_to_null($str) {
return ($str == ""?"null":$str);
}
public static function create_camp_contact($_name, $_mobile, $_email, $_facebook, $_cct_id, $_owner_id, $_original_id) {
global $sql;
return $sql->insert_into('camp_contact', array(
'cc_name' => $_name,
'cc_mobile' => $_mobile,
'cc_email' => $_email,
'cc_facebook' => self::empty_to_null($_facebook),
'cc_camp_contact_type_cct_id' => $_cct_id,
'cc_owner_id' => $_owner_id,
'cc_original_id' => $_original_id,
)
);
}
}
?>

View File

@@ -1,53 +0,0 @@
<?php
class camp_contact_type {
private $cct_id;
private $cct_name;
private $cct_owner;
private $cct_deleted;
public function set_cct_id($_item) {
$this->cct_id = $_item;
}
public function set_cct_name($_item) {
$this->cct_name = $_item;
}
public function set_cct_owner($_item) {
$this->cct_owner = $_item;
}
public function set_cct_deleted($_item) {
$this->cct_deleted = $_item;
}
public function get_cct_id() {
return $this->cct_id;
}
public function get_cct_name() {
return $this->cct_name;
}
public function get_cct_owner() {
return $this->cct_owner;
}
public function get_cct_deleted() {
return $this->cct_deleted;
}
public function set_cct_data_by_id($_id) {
global $sql;
$ck_data_assoc_array = $sql->assoc_array("select * from camp_contact_type where cct_id = " . $_id);
$ck_data_array = $ck_data_assoc_array[0];
foreach ($ck_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
}
?>

View File

@@ -1,516 +0,0 @@
<?php
/**
* TÁBORBA JELENTKEZŐ GYEREK OSZTÁLY
*/
class camp_kid
{
private $ck_id;
private $ck_owner_id; //camp_user_id
private $ck_owner; //camp_user ojektum
private $ck_original_id; //camp_kid ojektum
private $ck_original; //camp_kid ojektum
private $ck_name;
private $ck_birth_year;
private $ck_ss_number;
private $ck_email;
private $ck_mobile;
private $ck_badminton_history;
private $ck_sport_history;
private $ck_shirt_size_id;
private $ck_shirt;
private $ck_food_info;
private $ck_hygiene_info;
private $ck_health_info;
private $ck_pharma_info;
private $ck_other_info;
private $ck_deleted;
/**
* Gets the value of ck_id.
*
* @return mixed
*/
public function get_ck_id()
{
return $this->ck_id;
}
/**
* Sets the value of ck_id.
*
* @param mixed $ck_id the ck id
*
* @return self
*/
private function set_ck_id($ck_id)
{
$this->ck_id = $ck_id;
return $this;
}
/**
* Gets the value of ck_name.
*
* @return mixed
*/
public function get_ck_name()
{
return $this->ck_name;
}
/**
* Sets the value of ck_name.
*
* @param mixed $ck_name the ck name
*
* @return self
*/
private function set_ck_name($ck_name)
{
$this->ck_name = $ck_name;
return $this;
}
/**
* Gets the value of ck_birth_year.
*
* @return mixed
*/
public function get_ck_birth_year()
{
return $this->ck_birth_year;
}
/**
* Sets the value of ck_birth_year.
*
* @param mixed $ck_birth_year the ck birth year
*
* @return self
*/
private function set_ck_birth_year($ck_birth_year)
{
$this->ck_birth_year = $ck_birth_year;
return $this;
}
/**
* Gets the value of ck_ss_number.
*
* @return mixed
*/
public function get_ck_ss_number()
{
return $this->ck_ss_number;
}
/**
* Sets the value of ck_ss_number.
*
* @param mixed $ck_ss_number the ck ss number
*
* @return self
*/
private function set_ck_ss_number($ck_ss_number)
{
$this->ck_ss_number = $ck_ss_number;
return $this;
}
/**
* Gets the value of ck_email.
*
* @return mixed
*/
public function get_ck_email()
{
return $this->ck_email;
}
/**
* Sets the value of ck_email.
*
* @param mixed $ck_email the ck email
*
* @return self
*/
private function set_ck_email($ck_email)
{
$this->ck_email = $ck_email;
return $this;
}
/**
* Gets the value of ck_mobile.
*
* @return mixed
*/
public function get_ck_mobile()
{
return $this->ck_mobile;
}
/**
* Sets the value of ck_mobile.
*
* @param mixed $ck_mobile the ck mobile
*
* @return self
*/
private function set_ck_mobile($ck_mobile)
{
$this->ck_mobile = $ck_mobile;
return $this;
}
/**
* Gets the value of ck_badminton_history.
*
* @return mixed
*/
public function get_ck_badminton_history()
{
return $this->ck_badminton_history;
}
/**
* Sets the value of ck_badminton_history.
*
* @param mixed $ck_badminton_history the ck badminton history
*
* @return self
*/
private function set_ck_badminton_history($ck_badminton_history)
{
$this->ck_badminton_history = $ck_badminton_history;
return $this;
}
/**
* Gets the value of ck_sport_history.
*
* @return mixed
*/
public function get_ck_sport_history()
{
return $this->ck_sport_history;
}
/**
* Sets the value of ck_sport_history.
*
* @param mixed $ck_sport_history the ck sport history
*
* @return self
*/
private function set_ck_sport_history($ck_sport_history)
{
$this->ck_sport_history = $ck_sport_history;
return $this;
}
/**
* Gets the value of ck_shirt_size_id.
*
* @return mixed
*/
public function get_ck_shirt_size_id()
{
return $this->ck_shirt_size_id;
}
/**
* Sets the value of ck_shirt_size_id.
*
* @param mixed $ck_shirt_size_id the ck shirt size id
*
* @return self
*/
private function set_ck_shirt_size_id($ck_shirt_size_id)
{
$this->ck_shirt_size_id = $ck_shirt_size_id;
return $this;
}
/**
* Gets the value of ck_shirt.
*
* @return mixed
*/
public function get_ck_shirt()
{
return $this->ck_shirt;
}
/**
* Sets the value of ck_shirt.
*
* @param mixed $ck_shirt the ck shirt
*
* @return self
*/
private function set_ck_shirt($ck_shirt)
{
$this->ck_shirt = $ck_shirt;
return $this;
}
/**
* Gets the value of ck_food_info.
*
* @return mixed
*/
public function get_ck_food_info()
{
return $this->ck_food_info;
}
/**
* Sets the value of ck_food_info.
*
* @param mixed $ck_food_info the ck food _info
*
* @return self
*/
private function set_ck_food_info($ck_food_info)
{
$this->ck_food_info = $ck_food_info;
return $this;
}
/**
* Gets the value of ck_hygiene_info.
*
* @return mixed
*/
public function get_ck_hygiene_info()
{
return $this->ck_hygiene_info;
}
/**
* Sets the value of ck_hygiene_info.
*
* @param mixed $ck_hygiene_info the ck hygiene _info
*
* @return self
*/
private function set_ck_hygiene_info($ck_hygiene_info)
{
$this->ck_hygiene_info = $ck_hygiene_info;
return $this;
}
/**
* Gets the value of ck_health_info.
*
* @return mixed
*/
public function get_ck_health_info()
{
return $this->ck_health_info;
}
/**
* Sets the value of ck_health_info.
*
* @param mixed $ck_health_info the ck health _info
*
* @return self
*/
private function set_ck_health_info($ck_health_info)
{
$this->ck_health_info = $ck_health_info;
return $this;
}
/**
* Gets the value of ck_pharma_info.
*
* @return mixed
*/
public function get_ck_pharma_info()
{
return $this->ck_pharma_info;
}
/**
* Sets the value of ck_pharma_info.
*
* @param mixed $ck_pharma_info the ck pharma _info
*
* @return self
*/
private function set_ck_pharma_info($ck_pharma_info)
{
$this->ck_pharma_info = $ck_pharma_info;
return $this;
}
/**
* Gets the value of ck_other_info.
*
* @return mixed
*/
public function get_ck_other_info()
{
return $this->ck_other_info;
}
/**
* Sets the value of ck_other_info.
*
* @param mixed $ck_other_info the ck other _info
*
* @return self
*/
private function set_ck_other_info($ck_other_info)
{
$this->ck_other_info = $ck_other_info;
return $this;
}
/**
* Gets the value of ck_deleted.
*
* @return mixed
*/
public function get_ck_deleted()
{
return $this->ck_deleted;
}
/**
* Sets the value of ck_deleted.
*
* @param mixed $ck_deleted the ck deleted
*
* @return self
*/
private function set_ck_deleted($ck_deleted)
{
$this->ck_deleted = $ck_deleted;
return $this;
}
public function get_ck_owner_id()
{
return $this->ck_id;
}
private function set_ck_owner_id($ck_id)
{
$this->ck_owner_id = $ck_id;
return $this;
}
public function get_ck_owner()
{
return $this->ck_id;
}
private function set_ck_owner($ck_id)
{
$this->ck_owner = $ck_id;
return $this;
}
public function get_ck_original()
{
return $this->ck_id;
}
private function set_ck_original($ck_id)
{
$this->ck_original = $ck_id;
return $this;
}
public function get_ck_original_id()
{
return $this->ck_id;
}
private function set_ck_original_id($ck_id)
{
$this->ck_original = $ck_id;
return $this;
}
public function set_ck_data_by_id($_id) {
global $sql;
$ck_data_assoc_array = $sql->assoc_array("select * from camp_kid where ck_id = " . $_id);
$ck_data_array = $ck_data_assoc_array[0];
foreach ($ck_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ($field == 'ck_shirt_size_id') {
$new_shirt = new camp_shirt();
$new_shirt->set_cshirt_data_by_id($value);
$this->set_ck_shirt($new_shirt);
}
if ($field == 'ck_owner_id') {
$new_camp_user = new camp_user();
$new_camp_user->set_user_data_by_id($value);
$this->set_ck_owner($new_camp_user);
}
if ($field == 'ck_original_id' && !empty($value)) {
$new_camp_kid = new camp_kid();
$new_camp_kid->set_ck_data_by_id($value);
$this->set_ck_original($new_camp_kid);
}
}
}
private static function empty_to_null($str) {
return ($str == ""?"null":$str);
}
public static function create_camp_kid($_name, $_birth_year, $_ss_number, $_email, $_mobile, $_shirt_id, $_info, $_original_id, $_owner_id) {
global $sql;
return $sql->insert_into('camp_kid', array(
'ck_name' => $_name,
'ck_birth_year' => $_birth_year,
'ck_ss_number' => $_ss_number,
'ck_email' => $_email,
'ck_mobile' => $_mobile,
'ck_shirt_size_id' => $_shirt_id,
'ck_original_id' => $_original_id,
'ck_owner_id' => $_owner_id,
'ck_sport_history' => self::empty_to_null($_info['ck_sport_history']),
'ck_badminton_history' => self::empty_to_null($_info['ck_badminton_history']),
'ck_food_info' => self::empty_to_null($_info['ck_food_info']),
'ck_hygiene_info' => self::empty_to_null($_info['ck_hygiene_info']),
'ck_health_info' => self::empty_to_null($_info['ck_health_info']),
'ck_pharma_info' => self::empty_to_null($_info['ck_pharma_info']),
'ck_other_info' => self::empty_to_null($_info['ck_other_info']),
));
}
}
?>

View File

@@ -1,45 +0,0 @@
<?php
class camp_shirt {
private $cshirt_id;
private $cshirt_name;
private $cshirt_deleted;
public function set_cshirt_id($_item) {
$this->cshirt_id = $_item;
}
public function set_cshirt_name($_item) {
$this->cshirt_name = $_item;
}
public function set_cshirt_deleted($_item) {
$this->cshirt_deleted = $_item;
}
public function get_cshirt_id() {
return $this->cshirt_id;
}
public function get_cshirt_name() {
return $this->cshirt_name;
}
public function get_cshirt_deleted() {
return $this->cshirt_deleted;
}
public function set_cshirt_data_by_id($_id) {
global $sql;
$ck_data_assoc_array = $sql->assoc_array("select * from camp_shirt where cshirt_id = " . $_id);
$ck_data_array = $ck_data_assoc_array[0];
foreach ($ck_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
}
?>

View File

@@ -1,82 +0,0 @@
<?php
/**
* SHUTTLE
*/
class camp_shuttle_type
{
private $cst_id;
private $cst_name;
private $cst_deleted;
/**
* Gets the value of cst_id.
*
* @return mixed
*/
public function get_cst_id()
{
return $this->cst_id;
}
/**
* Sets the value of cst_id.
*
* @param mixed $cst_id the cst id
*
* @return self
*/
private function set_cst_id($cst_id)
{
$this->cst_id = $cst_id;
return $this;
}
/**
* Gets the value of cst_name.
*
* @return mixed
*/
public function get_cst_name()
{
return $this->cst_name;
}
/**
* Sets the value of cst_name.
*
* @param mixed $cst_name the cst name
*
* @return self
*/
private function set_cst_name($cst_name)
{
$this->cst_name = $cst_name;
return $this;
}
private function set_cst_deleted($_item) {
$this->cst_deleted = $_item;
}
public function get_cst_deleted($_item) {
return $this->cst_deleted;
}
public function set_cst_data_by_id($_cst_id) {
global $sql;
$cst_assoc_array = $sql->assoc_array("select * from camp_shuttle_type where cst_id = " . $_cst_id);
$cst_array = $cst_assoc_array[0];
//alapadatok
foreach ($cst_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
}
?>

View File

@@ -1,98 +0,0 @@
<?php
/**
* Tábor típus osztály
*/
class camp_type
{
private $ct_id;
private $ct_name;
private $ct_deleted;
/**
* Gets the value of ct_id.
*
* @return mixed
*/
public function get_ct_id()
{
return $this->ct_id;
}
/**
* Sets the value of ct_id.
*
* @param mixed $ct_id the ct id
*
* @return self
*/
private function set_ct_id($ct_id)
{
$this->ct_id = $ct_id;
return $this;
}
/**
* Gets the value of ct_name.
*
* @return mixed
*/
public function get_ct_name()
{
return $this->ct_name;
}
/**
* Sets the value of ct_name.
*
* @param mixed $ct_name the ct name
*
* @return self
*/
private function set_ct_name($ct_name)
{
$this->ct_name = $ct_name;
return $this;
}
public function get_ct_deleted() {
return $this->ct_deleted;
}
private function set_ct_deleted($_item) {
$this->ct_deleted = $_item;
return $this;
}
public function set_ct_data_by_id($_ct_id) {
global $sql;
$ct_data_assoc_array = $sql->assoc_array("select * from camp_type where ct_id = " . $_ct_id);
$ct_data_array = $ct_data_assoc_array[0];
foreach ($ct_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_camp_type($_name) {
global $sql;
return $sql->insert_into('camp_type', array('ct_name' => $_name));
}
public static function update_camp_type($_id, $_name) {
global $sql;
$sql->update_table('camp_type', array('ct_name' => $_name), array('ct_id' => $_id));
}
}
?>

View File

@@ -1,197 +0,0 @@
<?php
class camp_user {
private $cu_id;
private $cu_email;
private $cu_password;
private $cu_reg_date;
private $cu_last_login = null;
private $cu_deleted;
private $logged_in;
/**
* Gets the value of cu_id.
*
* @return mixed
*/
public function get_cu_id()
{
return $this->cu_id;
}
/**
* Sets the value of cu_id.
*
* @param mixed $cu_id the cu id
*
* @return self
*/
private function set_cu_id($cu_id)
{
$this->cu_id = $cu_id;
return $this;
}
/**
* Gets the value of cu_email.
*
* @return mixed
*/
public function get_cu_email()
{
return $this->cu_email;
}
/**
* Sets the value of cu_email.
*
* @param mixed $cu_email the cu email
*
* @return self
*/
private function set_cu_email($cu_email)
{
$this->cu_email = $cu_email;
return $this;
}
/**
* Gets the value of cu_password.
*
* @return mixed
*/
public function get_cu_password()
{
return $this->cu_password;
}
/**
* Sets the value of cu_password.
*
* @param mixed $cu_password the cu password
*
* @return self
*/
private function set_cu_password($cu_password)
{
$this->cu_password = $cu_password;
return $this;
}
/**
* Gets the value of cu_reg_date.
*
* @return mixed
*/
public function get_cu_reg_date()
{
return $this->cu_reg_date;
}
/**
* Sets the value of cu_reg_date.
*
* @param mixed $cu_reg_date the cu reg date
*
* @return self
*/
private function set_cu_reg_date($cu_reg_date)
{
$this->cu_reg_date = $cu_reg_date;
return $this;
}
/**
* Gets the value of cu_last_login.
*
* @return mixed
*/
public function get_cu_last_login()
{
return $this->cu_last_login;
}
/**
* Sets the value of cu_last_login.
*
* @param mixed $cu_last_login the cu last login
*
* @return self
*/
private function set_cu_last_login($cu_last_login)
{
$this->cu_last_login = $cu_last_login;
return $this;
}
/**
* Gets the value of cu_deleted.
*
* @return mixed
*/
public function get_cu_deleted()
{
return $this->cu_deleted;
}
/**
* Sets the value of cu_deleted.
*
* @param mixed $cu_deleted the cu deleted
*
* @return self
*/
private function set_cu_deleted($cu_deleted)
{
$this->cu_deleted = $cu_deleted;
return $this;
}
public function update_login_time($_cu_id = null) {
global $sql;
//az adott user_id-n updateli a login_time-ot
$sql->update_table('camp_user', array('cu_last_login' => date('Y-m-d H:i:s')), array('cu_id' => (empty($_cu_id)?$this->get_cu_id():$_cu_id)));
}
public function set_user_data_by_id($_id) {
global $sql;
$cu_data_assoc_array = $sql->assoc_array("select * from camp_user where cu_id = " . $_id);
$cu_data_array = $cu_data_assoc_array[0];
foreach ($cu_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
$this->set_login(true);
}
}
public function is_logged_in() {
//leellenőrzi cookie alapján h be vagyunk-e jelentkezve
//JAVÍTVA: adja vissza az adattag igazságértékét
return $this->logged_in;
}
public function set_login($_login) {
//bool-t kap paraméterül
$this->logged_in = $_login;
}
public static function create_camp_user($_email, $_password, $_reg_date) {
global $sql;
return $sql->insert_into('camp_user', array(
'cu_email' => $_email,
'cu_password' => md5($_password),
'cu_reg_date' => $_reg_date,
));
}
}
?>

View File

@@ -1,138 +1,138 @@
<?php
/**
*
*
*/
class diary_entry {
private $de_presence_id;
private $de_date;
private $de_type; //money deposit or training
private $de_training_per_month; //hányadik edzés a hónapban
private $de_training_per_day; //hányadik edzés a napon
private $de_first_two; //boolean; első két edzés egyike-e
private $de_training = null;
private $de_money_deposit = null;
private $de_transaction = 0; //ez adja meg, hogy mennyivel csökken, vagy nő az egyenleg
private $de_balance = 0; //a felhasználóhoz tartozó aktuális egyenleg
private $de_has_discount = false; //van-e kedvzemény
private $de_discount_id; //kedvezmény ID
private $de_presence_id;
private $de_date;
private $de_type; //money deposit or training
private $de_training_per_month; //hányadik edzés a hónapban
private $de_training_per_day; //hányadik edzés a napon
private $de_first_two; //boolean; első két edzés egyike-e
private $de_training = null;
private $de_money_deposit = null;
private $de_transaction = 0; //ez adja meg, hogy mennyivel csökken, vagy nő az egyenleg
private $de_balance = 0; //a felhasználóhoz tartozó aktuális egyenleg
private $de_has_discount = false; //van-e kedvzemény
private $de_discount_id; //kedvezmény ID
function __construct($_pr_id, $_date, $_type, $_tpm, $_tpd, $_ft, $_tr = null, $_mod = null) {
$this->set_de_presence_id($_pr_id);
$this->set_de_date($_date);
$this->set_de_type($_type);
$this->set_de_training_per_month($_tpm);
$this->set_de_training_per_day($_tpd);
$this->set_de_first_two($_ft);
$this->set_de_training($_tr);
$this->set_de_money_deposit($_mod);
function __construct($_pr_id, $_date, $_type, $_tpm, $_tpd, $_ft, $_tr = null, $_mod = null) {
$this->set_de_presence_id($_pr_id);
$this->set_de_date($_date);
$this->set_de_type($_type);
$this->set_de_training_per_month($_tpm);
$this->set_de_training_per_day($_tpd);
$this->set_de_first_two($_ft);
$this->set_de_training($_tr);
$this->set_de_money_deposit($_mod);
}
}
public function set_de_presence_id($_item) {
$this->de_presence_id = $_item;
}
public function set_de_presence_id($_item) {
$this->de_presence_id = $_item;
}
/* ez majd akkor jöhet, ha lesz presence class
public function set_de_presence($_item) {
$this->de_presence = $_item;
}
*/
/* ez majd akkor jöhet, ha lesz presence class
public function set_de_presence($_item) {
$this->de_presence = $_item;
}
*/
public function set_de_date($_item) {
$this->de_date = $_item;
}
public function set_de_date($_item) {
$this->de_date = $_item;
}
public function set_de_type($_item) {
$this->de_type = $_item;
}
public function set_de_type($_item) {
$this->de_type = $_item;
}
public function set_de_training_per_month($_item) {
$this->de_training_per_month = $_item;
}
public function set_de_training_per_month($_item) {
$this->de_training_per_month = $_item;
}
public function set_de_training_per_day($_item) {
$this->de_training_per_day = $_item;
}
public function set_de_training_per_day($_item) {
$this->de_training_per_day = $_item;
}
public function set_de_first_two($_item) {
$this->de_first_two = $_item;
}
public function set_de_first_two($_item) {
$this->de_first_two = $_item;
}
public function set_de_training($_item) {
$this->de_training = $_item;
}
public function set_de_training($_item) {
$this->de_training = $_item;
}
public function set_de_money_deposit($_item) {
$this->de_money_deposit = $_item;
}
public function set_de_money_deposit($_item) {
$this->de_money_deposit = $_item;
}
public function set_de_transaction($_item) {
$this->de_transaction = $_item;
}
public function set_de_transaction($_item) {
$this->de_transaction = $_item;
}
public function set_de_balance($_item) {
$this->de_balance = $_item;
}
public function set_de_balance($_item) {
$this->de_balance = $_item;
}
public function set_de_has_discount($_item) {
$this->de_has_discount = $_item;
}
public function set_de_has_discount($_item) {
$this->de_has_discount = $_item;
}
public function set_de_discount_id($_item) {
$this->de_discount_id = $_item;
}
public function set_de_discount_id($_item) {
$this->de_discount_id = $_item;
}
public function get_de_presence_id() {
return $this->de_presence_id;
}
public function get_de_presence_id() {
return $this->de_presence_id;
}
public function get_de_date() {
return $this->de_date;
}
public function get_de_date() {
return $this->de_date;
}
public function get_de_type() {
return $this->de_type;
}
public function get_de_type() {
return $this->de_type;
}
public function get_de_training_per_month() {
return $this->de_training_per_month;
}
public function get_de_training_per_month() {
return $this->de_training_per_month;
}
public function get_de_training_per_day() {
return $this->de_training_per_day;
}
public function get_de_training_per_day() {
return $this->de_training_per_day;
}
public function get_de_first_two() {
return $this->de_first_two;
}
public function get_de_first_two() {
return $this->de_first_two;
}
public function get_de_training() {
return $this->de_training;
}
public function get_de_training() {
return $this->de_training;
}
public function get_de_money_deposit() {
return $this->de_money_deposit;
}
public function get_de_money_deposit() {
return $this->de_money_deposit;
}
public function get_de_transaction() {
return $this->de_transaction;
}
public function get_de_transaction() {
return $this->de_transaction;
}
public function get_de_balance() {
return $this->de_balance;
}
public function get_de_balance() {
return $this->de_balance;
}
public function get_de_has_discount() {
return $this->de_has_discount;
}
public function get_de_has_discount() {
return $this->de_has_discount;
}
public function get_de_discount_id() {
return $this->de_discount_id;
}
public function get_de_discount_id() {
return $this->de_discount_id;
}
}
?>
?>

View File

@@ -1,209 +0,0 @@
<?php
class email_log {
private $el_id;
private $el_message;
private $el_subject;
private $el_to_name;
private $el_to_email;
private $el_sent_date;
private $el_exception;
private $el_email_template_et_id;
public function set_el_data_by_id($_id) {
global $sql;
$el_data_assoc_array = $sql->assoc_array("select * from email_log where el_id = " . $_id);
$el_data_array = $el_data_assoc_array[0];
foreach ($el_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ('el_email_template_et_id' == $field) {
$new_et = new email_template();
$new_et->set_et_data_by_id($value);
$this->set_el_email_template_et_id($new_et);
}
}
}
public static function create_email_log($_message, $_subject, $_name, $_email, $_et, $_exc = 'null', $_date = null)
{
global $sql;
if (null === $_date) {
$_date = date('Y-m-d H:i:s');
}
return $sql->insert_into('email_log', array(
'el_message' => $_message,
'el_subject' => $_subject,
'el_to_name' => $_name,
'el_to_email' => $_email,
'el_email_template_et_id' => $_et,
'el_exception' => $_exc,
'el_sent_date' => $_date
));
}
/**
* @return mixed
*/
public function get_el_id()
{
return $this->el_id;
}
/**
* @param mixed $el_id
*
* @return self
*/
public function set_el_id($el_id)
{
$this->el_id = $el_id;
return $this;
}
/**
* @return mixed
*/
public function get_el_message()
{
return $this->el_message;
}
/**
* @param mixed $el_message
*
* @return self
*/
public function set_el_message($el_message)
{
$this->el_message = $el_message;
return $this;
}
/**
* @return mixed
*/
public function get_el_subject()
{
return $this->el_subject;
}
/**
* @param mixed $el_subject
*
* @return self
*/
public function set_el_subject($el_subject)
{
$this->el_subject = $el_subject;
return $this;
}
/**
* @return mixed
*/
public function get_el_to_name()
{
return $this->el_to_name;
}
/**
* @param mixed $el_to_name
*
* @return self
*/
public function set_el_to_name($el_to_name)
{
$this->el_to_name = $el_to_name;
return $this;
}
/**
* @return mixed
*/
public function get_el_to_email()
{
return $this->el_to_email;
}
/**
* @param mixed $el_to_email
*
* @return self
*/
public function set_el_to_email($el_to_email)
{
$this->el_to_email = $el_to_email;
return $this;
}
/**
* @return mixed
*/
public function get_el_sent_date()
{
return $this->el_sent_date;
}
/**
* @param mixed $el_sent_date
*
* @return self
*/
public function set_el_sent_date($el_sent_date)
{
$this->el_sent_date = $el_sent_date;
return $this;
}
/**
* @return mixed
*/
public function get_el_exception()
{
return $this->el_exception;
}
/**
* @param mixed $el_exception
*
* @return self
*/
public function set_el_exception($el_exception)
{
$this->el_exception = $el_exception;
return $this;
}
/**
* @return mixed
*/
public function get_el_email_template_et_id()
{
return $this->el_email_template_et_id;
}
/**
* @param mixed $el_email_template_et_id
*
* @return self
*/
public function set_el_email_template_et_id($el_email_template_et_id)
{
$this->el_email_template_et_id = $el_email_template_et_id;
return $this;
}
}
?>

View File

@@ -1,200 +0,0 @@
<?php
class email_template {
private $et_id;
private $et_name;
private $et_title;
private $et_deleted;
private $et_message;
private $et_subject;
private $et_from_name;
private $et_from_email;
public function set_et_data_by_id($_id) {
global $sql;
$et_data_assoc_array = $sql->assoc_array("select * from email_template where et_id = " . $_id);
$et_data_array = $et_data_assoc_array[0];
foreach ($et_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
/**
* @return mixed
*/
public function get_et_id()
{
return $this->et_id;
}
/**
* @param mixed $et_id
*
* @return self
*/
public function set_et_id($et_id)
{
$this->et_id = $et_id;
return $this;
}
/**
* @return mixed
*/
public function get_et_name()
{
return $this->et_name;
}
/**
* @param mixed $et_name
*
* @return self
*/
public function set_et_name($et_name)
{
$this->et_name = $et_name;
return $this;
}
/**
* @return mixed
*/
public function get_et_title()
{
return $this->et_title;
}
/**
* @param mixed $et_title
*
* @return self
*/
public function set_et_title($et_title)
{
$this->et_title = $et_title;
return $this;
}
/**
* @return mixed
*/
public function get_et_deleted()
{
return $this->et_deleted;
}
/**
* @param mixed $et_deleted
*
* @return self
*/
public function set_et_deleted($et_deleted)
{
$this->et_deleted = $et_deleted;
return $this;
}
/**
* @return mixed
*/
public function get_et_message()
{
return $this->et_message;
}
/**
* @param mixed $et_message
*
* @return self
*/
public function set_et_message($et_message)
{
$this->et_message = $et_message;
return $this;
}
/**
* @return mixed
*/
public function get_et_subject()
{
return $this->et_subject;
}
/**
* @param mixed $et_subject
*
* @return self
*/
public function set_et_subject($et_subject)
{
$this->et_subject = $et_subject;
return $this;
}
/**
* @return mixed
*/
public function get_et_from_name()
{
return $this->et_from_name;
}
/**
* @param mixed $et_from_name
*
* @return self
*/
public function set_et_from_name($et_from_name)
{
$this->et_from_name = $et_from_name;
return $this;
}
/**
* @return mixed
*/
public function get_et_from_email()
{
return $this->et_from_email;
}
/**
* @param mixed $et_from_email
*
* @return self
*/
public function set_et_from_email($et_from_email)
{
$this->et_from_email = $et_from_email;
return $this;
}
public function personalize($_raw, $_variable_array)
{
$matches = null;
preg_match_all('/{\$([a-z0-9\_]+)}/', $_raw, $matches);
//print_r($matches);
//[0] {$variable}
//[1] variable
foreach ($matches[0] as $key => $match) {
$_raw = str_replace($match, $_variable_array[$matches[1][$key]], $_raw);
}
return $_raw;
}
}
?>

View File

@@ -1,540 +0,0 @@
<?php
/**
* MILESTONE
*/
class milestone
{
private $ms_id;
private $ms_type_mt_id;
private $ms_training_mst_id = null;
private $ms_competition_msc_id = null;
private $ms_camp_msca_id = null;
private $ms_ranking_msr_id = null;
private $ms_user_kid_uk_id;
private $ms_sums; //text
private $season;
public function set_ms_data_by_id($_ms_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from milestone where ms_id = " . $_ms_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ($field == 'ms_type_mt_id' && $value != null) {
$new_mt = new milestone_type();
$new_mt->set_mt_data_by_id($value);
$this->set_ms_type_mt_id($new_mt);
}
if ($field == 'ms_training_mst_id' && $value != null) {
$new_mst = new milestone_training();
$new_mst->set_mst_data_by_id($value);
$this->set_ms_training_mst_id($new_mst);
}
if ($field == 'ms_competition_msc_id' && $value != null) {
$new_msc = new milestone_competition();
$new_msc->set_msc_data_by_id($value);
$this->set_ms_competition_msc_id($new_msc);
}
if ($field == 'ms_camp_msca_id' && $value != null) {
$new_msca = new milestone_camp();
$new_msca->set_msca_data_by_id($value);
$this->set_ms_camp_msca_id($new_msca);
}
if ($field == 'ms_ranking_msr_id' && $value != null) {
$new_msr = new milestone_ranking();
$new_msr->set_msr_data_by_id($value);
$this->set_ms_ranking_msr_id($new_msr);
}
if ($field == 'ms_season' && $value != null) {
$new_mss = new milestone_season();
$new_mss->set_mss_data_by_id($value);
$this->set_ms_season($new_mss);
}
}
}
public static function create_ms($_mt, $_season, $_uk, $_mst = null, $_msc = null, $_msca = null, $_msr = null, $_sums = null)
{
global $sql;
return $sql->insert_into('milestone', array(
'ms_type_mt_id' => $_mt,
'ms_season' => $_season,
'ms_user_kid_uk_id' => $_uk,
'ms_training_mst_id' => $_mst,
'ms_competition_msc_id' => $_msc,
'ms_ranking_msr_id' => $_msr,
'ms_camp_msca_id' => $_msca,
'ms_sums' => $_sums,
), false);
}
public function get_ms_month() {
if (null !== $this->ms_competition_msc_id) {
return $this->ms_competition_msc_id->get_msc_month();
}
elseif (null !== $this->ms_training_mst_id) {
return $this->ms_training_mst_id->get_mst_month();
}
elseif (null !== $this->ms_camp_msca_id) {
return $this->ms_camp_msca_id->get_msca_month();
}
}
/**
* @return mixed
*/
public function get_ms_id()
{
return $this->ms_id;
}
/**
* @param mixed $ms_id
*
* @return self
*/
public function set_ms_id($ms_id)
{
$this->ms_id = $ms_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_season()
{
return $this->ms_season;
}
/**
* @param mixed $ms_season
*
* @return self
*/
public function set_ms_season($ms_season)
{
$this->ms_season = $ms_season;
return $this;
}
/**
* @return mixed
*/
public function get_ms_type_mt_id()
{
return $this->ms_type_mt_id;
}
/**
* @param mixed $ms_type_mt_id
*
* @return self
*/
public function set_ms_type_mt_id($ms_type_mt_id)
{
$this->ms_type_mt_id = $ms_type_mt_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_training_mst_id()
{
return $this->ms_training_mst_id;
}
/**
* @param mixed $ms_training_mst_id
*
* @return self
*/
public function set_ms_training_mst_id($ms_training_mst_id)
{
$this->ms_training_mst_id = $ms_training_mst_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_competition_msc_id()
{
return $this->ms_competition_msc_id;
}
/**
* @param mixed $ms_competition_msc_id
*
* @return self
*/
public function set_ms_competition_msc_id($ms_competition_msc_id)
{
$this->ms_competition_msc_id = $ms_competition_msc_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_camp_msca_id()
{
return $this->ms_camp_msca_id;
}
/**
* @param mixed $ms_camp_msca_id
*
* @return self
*/
public function set_ms_camp_msca_id($ms_camp_msca_id)
{
$this->ms_camp_msca_id = $ms_camp_msca_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_ranking_msr_id()
{
return $this->ms_ranking_msr_id;
}
/**
* @param mixed $ms_ranking_msr_id
*
* @return self
*/
public function set_ms_ranking_msr_id($ms_ranking_msr_id)
{
$this->ms_ranking_msr_id = $ms_ranking_msr_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_user_kid_uk_id()
{
return $this->ms_user_kid_uk_id;
}
/**
* @param mixed $ms_user_kid_uk_id
*
* @return self
*/
public function set_ms_user_kid_uk_id($ms_user_kid_uk_id)
{
$this->ms_user_kid_uk_id = $ms_user_kid_uk_id;
return $this;
}
/**
* @return mixed
*/
public function get_ms_sums()
{
return $this->ms_sums;
}
/**
* @param mixed $ms_sums
*
* @return self
*/
public function set_ms_sums($ms_sums)
{
$this->ms_sums = $ms_sums;
return $this;
}
private static function is_valid($str) {
return !preg_match('/([A-ZÁÉÚŐÓÜŰÖÍa-z0-9áéúőóüűöí\_\-\ \,\.\:\?\;])/', $str);
}
public static function upload_file($file)
{
global $sql;
$nameToSearch = trim(substr($_FILES['fileToUpload']['name'],0,-4));
$kid = $sql->single_variable('SELECT uk_id FROM user_kid WHERE uk_name = "' . $nameToSearch . '";');
if (!$kid) {
return 1; //nem talalhato gyerek
}
$sql->execute_query('DELETE milestone_training FROM milestone_training JOIN milestone ON ms_training_mst_id = mst_id WHERE ms_user_kid_uk_id = ' . $kid);
$sql->execute_query('DELETE milestone_competition FROM milestone_competition JOIN milestone ON ms_competition_msc_id = msc_id WHERE ms_user_kid_uk_id = ' . $kid);
$sql->execute_query('DELETE milestone_camp FROM milestone_camp JOIN milestone ON ms_camp_msca_id= msca_id WHERE ms_user_kid_uk_id = ' . $kid);
$sql->execute_query('DELETE milestone_ranking FROM milestone_ranking JOIN milestone ON ms_ranking_msr_id= msr_id WHERE ms_user_kid_uk_id = ' . $kid);
$sql->execute_query('DELETE milestone_season FROM milestone_season JOIN milestone ON ms_season = mss_id WHERE ms_user_kid_uk_id = ' . $kid);
$content = file($_FILES['fileToUpload']['tmp_name']); //makes array
$newcontent = [];
foreach ($content as $lineNo => $line) {
//$line = utf8_decode($line);
//$line = iconv("UTF-8", "UTF-8//IGNORE", $line);
$valid = self::is_valid($line);
if (!$valid) {
$correctedStr = preg_replace('/[^A-ZÁÉÚŐÓÜŰÖÍa-z0-9áéúőóüűöí\_\-\ \,\.\:\?\;]/', '', $line);
$newcontent[$lineNo] = $correctedStr;
}
else {
$newcontent[$lineNo] = $line;
}
//$line = mb_convert_encoding($line, 'UTF-8', 'UTF-8');
}
//x
//var_dump($newcontent);
//die();
//die();
/*
Szerkezet:
s 2018-2019 --> szezon: ez megy a fejlécbe, ami lenyílik
x edzés *
y verseny *
e 2018 10 --> edzés éééé-hh
dátum F
2 edzés F
1 csoportos *
1 külön *
v --> verseny
Dátum F
Diákolimpia F
Kiskunfélegyháza F
Korcsoport F
Helyezés F
Mérkőzések: *
Egyéni 1. hely *
Páros 2. hely *
t 2016-07 ---> tábor
2018. július 17-24.
Budapest, Hodos
r 2018-09 ---> ranglista
2018. szeptember - 39. hét
felnőtt női egyéni: 28. hely
felnőtt női páros: 24. hely
felnőtt női vegyes páros: 23. hely
U19 lány egyéni: 32. hely
U19 lány páros: 20. hely
U19 lány vegyes páros: 23. hely
U17 lány egyéni: 18. hely
U17 lány páros: 17. hely
U17 lány vegyes páros: 12. hely
A fájlt kötelező szezonnal kezdeni!
*/
$milestoneId = null;
//var_dump($newcontent);
for ($lineNo = 0; $lineNo < count($newcontent); ++$lineNo) {
//var_dump($lineNo);
$line = $newcontent[$lineNo];
//var_dump($line);
//var_dump(0 === $lineNo, substr($line, 0, 1));
//1. sor lekezelése: ha nem szezon, akkor hiba!
if (0 === $lineNo && 's' != substr($line, 0, 1)) {
return 3;
}
//ha nincs beállítva ms id, akkor új egység következik és beállítjuk
if (null === $milestoneId) {
$milestoneId = substr($line, 0, 1);
//var_dump($line);
//var_dump($milestoneId);
//$ms = new milestone();
//$mss_id = null;
$mst_id = 'null';
$msc_id = 'null';
$msca_id = 'null';
$msr_id = 'null';
$sums = 'null';
$type = 'null';
}
//var_dump($milestoneId);
switch ($milestoneId) {
case 's':
# SZEZON
$mss_text = "";
$j = $lineNo;
while(isset($newcontent[$j]) && !empty(trim($newcontent[$j]))) {
//ha még csak a szezon első sorát olvassuk, akkor csak az "s" után rész kell
if ($j == $lineNo) {
//$newcontent[$j] = substr($newcontent[$j], 2);
$j++;
continue;
}
$mss_text .= trim($newcontent[$j]) . '\n';
//++$lineNo;
$j++;
}
$lineNo = $j;
//var_dump($lineNo);
$mss_id = milestone_season::create_mss($mss_text);
break;
case 'e':
# EDZÉS
$type = 1;
$mst = new milestone_training;
++$lineNo;
$mst_date = trim($newcontent[$lineNo]);
//var_dump('date: ' . $mst_date);
++$lineNo;
$mst_count = trim($newcontent[$lineNo]);
$j = $lineNo + 1;
$mst_trainings = "";
while(isset($newcontent[$j]) && !empty(trim($newcontent[$j]))) {
$mst_trainings .= trim($newcontent[$j]) . '\n';
++$j;
}
$lineNo = $j;
//var_dump($mst_date, $mst_count, $mst_trainings);
$mst_id = milestone_training::create_mst($mst_date, $mst_count, $mst_trainings);
break;
case 't':
# TÁBOR
$type = 3;
++$lineNo;
$msca_date = trim($newcontent[$lineNo]);
++$lineNo;
$msca_place = trim($newcontent[$lineNo]);
$msca_id = milestone_camp::create_msca($msca_date, $msca_place);
break;
case 'v':
# VERSENY
$type = 2;
++$lineNo;
$msc_date = trim($newcontent[$lineNo]);
++$lineNo;
$msc_name = trim($newcontent[$lineNo]);
++$lineNo;
$msc_location = trim($newcontent[$lineNo]);
++$lineNo;
$msc_category = trim($newcontent[$lineNo]);
++$lineNo;
$msc_place = trim($newcontent[$lineNo]);
++$lineNo;
if (isset($newcontent[$lineNo]) && !empty(trim($newcontent[$lineNo]))) {
++$lineNo; //mérkőzések szöveg
$matches = '';
do {
$matches .= trim($newcontent[$lineNo]) . '\n';
++$lineNo;
} while (isset($newcontent[$lineNo]) && !empty(trim($newcontent[$lineNo])));
}
else {
$matches = 'null';
}
$msc_id = milestone_competition::create_msc($msc_date, $msc_name, $msc_category, $msc_location, $msc_place, $matches);
break;
case 'r':
# RANGLISTA
$type = 4;
//get season after 'r'
$msr_season = trim(substr($newcontent[$lineNo], 2));
++$lineNo;
$msr_date = trim($newcontent[$lineNo]);
++$lineNo;
$rankings = '';
do {
$rankings .= trim($newcontent[$lineNo]) . '\n';
++$lineNo;
} while (isset($newcontent[$lineNo]) && !empty(trim($newcontent[$lineNo])));
$msr_id = milestone_ranking::create_msr($msr_date, $rankings, $msr_season);
break;
default:
# code...
break;
}
//todo: ezeket a változókat mindenképp be kell állítani h ne legyenek undefined-ok
if ('null' != $type) {
self::create_ms($type, $mss_id, $kid, $mst_id, $msc_id, $msca_id, $msr_id, $sums);
}
$milestoneId = null;
//$lineNo++;
//ha üres sor, akkor:
//eddig adatok rögzítése az adatbázisban
//ID nullozása
} //endfor
return 0;
}
}
?>

View File

@@ -1,94 +0,0 @@
<?php
/**
* MILESTONE COMPETITION
*/
class milestone_camp
{
private $msca_id;
private $msca_date;
private $msca_place;
public function set_msca_data_by_id($_msca_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from milestone_camp where msca_id = " . $_msca_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_msca($_date, $_place)
{
global $sql;
return $sql->insert_into('milestone_camp', array(
'msca_date' => $_date,
'msca_place' => $_place,
));
}
/**
* @return mixed
*/
public function get_msca_id()
{
return $this->msca_id;
}
/**
* @param mixed $msca_id
*
* @return self
*/
public function set_msca_id($msca_id)
{
$this->msca_id = $msca_id;
return $this;
}
/**
* @return mixed
*/
public function get_msca_date()
{
return $this->msca_date;
}
/**
* @param mixed $msca_date
*
* @return self
*/
public function set_msca_date($msca_date)
{
$this->msca_date = $msca_date;
return $this;
}
/**
* @return mixed
*/
public function get_msca_place()
{
return $this->msca_place;
}
/**
* @param mixed $msca_place
*
* @return self
*/
public function set_msca_place($msca_place)
{
$this->msca_place = $msca_place;
return $this;
}
}
?>

View File

@@ -1,205 +0,0 @@
<?php
/**
* MILESTONE COMPETITION
*/
class milestone_competition
{
private $msc_id;
private $msc_date;
private $msc_name;
private $msc_category;
private $msc_place;
private $msc_location;
private $msc_month;
private $msc_matches = null;
public function set_msc_data_by_id($_msc_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from milestone_competition where msc_id = " . $_msc_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_msc($_date, $_name, $_category, $_location, $_place, $_matches = NULL)
{
global $sql;
return $sql->insert_into('milestone_competition', array(
'msc_date' => $_date,
'msc_name' => $_name,
'msc_category' => $_category,
'msc_location' => $_location,
'msc_place' => $_place,
'msc_matches' => $_matches,
));
}
/**
* @return mixed
*/
public function get_msc_id()
{
return $this->msc_id;
}
/**
* @param mixed $msc_id
*
* @return self
*/
public function set_msc_id($msc_id)
{
$this->msc_id = $msc_id;
return $this;
}
/**
* @return mixed
*/
public function get_msc_date()
{
return $this->msc_date;
}
/**
* @param mixed $msc_date
*
* @return self
*/
public function set_msc_date($msc_date)
{
$this->msc_date = $msc_date;
return $this;
}
/**
* @return mixed
*/
public function get_msc_name()
{
return $this->msc_name;
}
/**
* @param mixed $msc_name
*
* @return self
*/
public function set_msc_name($msc_name)
{
$this->msc_name = $msc_name;
return $this;
}
/**
* @return mixed
*/
public function get_msc_category()
{
return $this->msc_category;
}
/**
* @param mixed $msc_category
*
* @return self
*/
public function set_msc_category($msc_category)
{
$this->msc_category = $msc_category;
return $this;
}
/**
* @return mixed
*/
public function get_msc_place()
{
return $this->msc_place;
}
/**
* @param mixed $msc_place
*
* @return self
*/
public function set_msc_place($msc_place)
{
$this->msc_place = $msc_place;
return $this;
}
/**
* @return mixed
*/
public function get_msc_matches()
{
return $this->msc_matches;
}
/**
* @param mixed $msc_matches
*
* @return self
*/
public function set_msc_matches($msc_matches)
{
$this->msc_matches = $msc_matches;
return $this;
}
/**
* @return mixed
*/
public function get_msc_month()
{
return $this->msc_month;
}
/**
* @param mixed $msc_month
*
* @return self
*/
public function set_msc_month($msc_month)
{
$this->msc_month = $msc_month;
return $this;
}
/**
* @return mixed
*/
public function get_msc_location()
{
return $this->msc_location;
}
/**
* @param mixed $msc_location
*
* @return self
*/
public function set_msc_location($msc_location)
{
$this->msc_location = $msc_location;
return $this;
}
}
?>

View File

@@ -1,117 +0,0 @@
<?php
/**
* MILESTONE RANKING
*/
class milestone_ranking
{
private $msr_id;
private $msr_season;
private $msr_date;
private $msr_rankings;
public function set_msr_data_by_id($_msr_id) {
global $sql;
$msr_assoc_array = $sql->assoc_array("select * from milestone_ranking where msr_id = " . $_msr_id);
$msr_array = $msr_assoc_array[0];
//alapadatok
foreach ($msr_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_msr($_date, $_rankings, $_season = 'null')
{
global $sql;
return $sql->insert_into('milestone_ranking', array(
'msr_date' => $_date,
'msr_rankings' => $_rankings,
'msr_season' => $_season,
));
}
/**
* @return mixed
*/
public function get_msr_id()
{
return $this->msr_id;
}
/**
* @param mixed $msr_id
*
* @return self
*/
public function set_msr_id($msr_id)
{
$this->msr_id = $msr_id;
return $this;
}
/**
* @return mixed
*/
public function get_msr_season()
{
return $this->msr_season;
}
/**
* @param mixed $msr_season
*
* @return self
*/
public function set_msr_season($msr_season)
{
$this->msr_season = $msr_season;
return $this;
}
/**
* @return mixed
*/
public function get_msr_date()
{
return $this->msr_date;
}
/**
* @param mixed $msr_date
*
* @return self
*/
public function set_msr_date($msr_date)
{
$this->msr_date = $msr_date;
return $this;
}
/**
* @return mixed
*/
public function get_msr_rankings()
{
return $this->msr_rankings;
}
/**
* @param mixed $msr_rankings
*
* @return self
*/
public function set_msr_rankings($msr_rankings)
{
$this->msr_rankings = $msr_rankings;
return $this;
}
}
?>

View File

@@ -1,72 +0,0 @@
<?php
/**
* MILESTONE SEASON
*/
class milestone_season
{
private $mss_id;
private $mss_text;
public function set_mss_data_by_id($_mss_id) {
global $sql;
$mss_assoc_array = $sql->assoc_array("select * from milestone_season where mss_id = " . $_mss_id);
$mss_array = $mss_assoc_array[0];
//alapadatok
foreach ($mss_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_mss($_text)
{
global $sql;
return $sql->insert_into('milestone_season', array(
'mss_text' => $_text,
));
}
/**
* @return mixed
*/
public function get_mss_id()
{
return $this->mss_id;
}
/**
* @param mixed $mss_id
*
* @return self
*/
public function set_mss_id($mss_id)
{
$this->mss_id = $mss_id;
return $this;
}
/**
* @return mixed
*/
public function get_mss_text()
{
return $this->mss_text;
}
/**
* @param mixed $mss_text
*
* @return self
*/
public function set_mss_text($mss_text)
{
$this->mss_text = $mss_text;
return $this;
}
}
?>

View File

@@ -1,139 +0,0 @@
<?php
/**
* MILESTONE TRAINING
*/
class milestone_training
{
private $mst_id;
private $mst_date;
private $mst_count;
private $mst_month;
private $mst_trainings = null;
public function set_mst_data_by_id($_mst_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from milestone_training where mst_id = " . $_mst_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
public static function create_mst($_date, $_count, $_trainings = NULL)
{
global $sql;
return $sql->insert_into('milestone_training', array(
'mst_date' => $_date,
'mst_count' => $_count,
'mst_trainings' => $_trainings,
));
}
/**
* @return mixed
*/
public function get_mst_id()
{
return $this->mst_id;
}
/**
* @param mixed $mst_id
*
* @return self
*/
public function set_mst_id($mst_id)
{
$this->mst_id = $mst_id;
return $this;
}
/**
* @return mixed
*/
public function get_mst_date()
{
return $this->mst_date;
}
/**
* @param mixed $mst_date
*
* @return self
*/
public function set_mst_date($mst_date)
{
$this->mst_date = $mst_date;
return $this;
}
/**
* @return mixed
*/
public function get_mst_count()
{
return $this->mst_count;
}
/**
* @param mixed $mst_count
*
* @return self
*/
public function set_mst_count($mst_count)
{
$this->mst_count = $mst_count;
return $this;
}
/**
* @return mixed
*/
public function get_mst_trainings()
{
return $this->mst_trainings;
}
/**
* @param mixed $mst_trainings
*
* @return self
*/
public function set_mst_trainings($mst_trainings)
{
$this->mst_trainings = $mst_trainings;
return $this;
}
/**
* @return mixed
*/
public function get_mst_month()
{
return $this->mst_month;
}
/**
* @param mixed $mst_month
*
* @return self
*/
public function set_mst_month($mst_month)
{
$this->mst_month = $mst_month;
return $this;
}
}
?>

View File

@@ -1,86 +0,0 @@
<?php
/**
* MILESTONE TYPE
*/
class milestone_type
{
private $mt_id;
private $mt_name;
private $mt_short_name;
public function set_mt_data_by_id($_mt_id) {
global $sql;
$cat_assoc_array = $sql->assoc_array("select * from milestone_type where mt_id = " . $_mt_id);
$cat_array = $cat_assoc_array[0];
//alapadatok
foreach ($cat_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
/**
* @return mixed
*/
public function get_mt_id()
{
return $this->mt_id;
}
/**
* @param mixed $mt_id
*
* @return self
*/
public function set_mt_id($mt_id)
{
$this->mt_id = $mt_id;
return $this;
}
/**
* @return mixed
*/
public function get_mt_name()
{
return $this->mt_name;
}
/**
* @param mixed $mt_name
*
* @return self
*/
public function set_mt_name($mt_name)
{
$this->mt_name = $mt_name;
return $this;
}
/**
* @return mixed
*/
public function get_mt_short_name()
{
return $this->mt_short_name;
}
/**
* @param mixed $mt_short_name
*
* @return self
*/
public function set_mt_short_name($mt_short_name)
{
$this->mt_short_name = $mt_short_name;
return $this;
}
}
?>

View File

@@ -1,122 +1,122 @@
<?php
/*
MONEY_DEPOSIT CLASS
MONEY_DEPOSIT CLASS
*/
class money_deposit {
private $mod_id;
private $mod_user_kid_uk_id; //ID
private $mod_user_kid; //OBJECT
private $mod_money_income_mi_id; //ID
private $mod_money_income; //OBJECT
private $mod_deleted;
private $mod_id;
private $mod_user_kid_uk_id; //ID
private $mod_user_kid; //OBJECT
private $mod_money_income_mi_id; //ID
private $mod_money_income; //OBJECT
private $mod_deleted;
public function set_mod_id($_id) {
$this->mod_id = $_id;
}
public function set_mod_id($_id) {
$this->mod_id = $_id;
}
public function set_mod_user_kid_uk_id($_user_kid_uk_id) {
$this->mod_user_kid_uk_id = $_user_kid_uk_id;
}
public function set_mod_user_kid_uk_id($_user_kid_uk_id) {
$this->mod_user_kid_uk_id = $_user_kid_uk_id;
}
public function set_mod_user_kid($_user_kid) {
$this->mod_user_kid = $_user_kid;
}
public function set_mod_user_kid($_user_kid) {
$this->mod_user_kid = $_user_kid;
}
public function set_mod_money_income_mi_id($_money_income_mi_id) {
$this->mod_money_income_mi_id = $_money_income_mi_id;
}
public function set_mod_money_income_mi_id($_money_income_mi_id) {
$this->mod_money_income_mi_id = $_money_income_mi_id;
}
public function set_mod_money_income($_money_income) {
$this->mod_money_income = $_money_income;
}
public function set_mod_money_income($_money_income) {
$this->mod_money_income = $_money_income;
}
public function set_mod_deleted($_deleted) {
$this->mod_deleted = $_deleted;
}
public function set_mod_deleted($_deleted) {
$this->mod_deleted = $_deleted;
}
public function get_mod_id() {
return $this->mod_id;
}
public function get_mod_id() {
return $this->mod_id;
}
public function get_mod_user_kid_uk_id() {
return $this->mod_user_kid_uk_id;
}
public function get_mod_user_kid_uk_id() {
return $this->mod_user_kid_uk_id;
}
public function get_mod_user_kid() {
return $this->mod_user_kid;
}
public function get_mod_user_kid() {
return $this->mod_user_kid;
}
public function get_mod_money_income_mi_id() {
return $this->mod_money_income_mi_id;
}
public function get_mod_money_income_mi_id() {
return $this->mod_money_income_mi_id;
}
public function get_mod_money_income() {
return $this->mod_money_income;
}
public function get_mod_money_income() {
return $this->mod_money_income;
}
public function get_mod_deleted() {
return $this->mod_deleted;
}
public function get_mod_deleted() {
return $this->mod_deleted;
}
public function set_mod_data_by_id($_id) {
global $sql;
$mod_query = "SELECT * FROM money_deposit WHERE mod_id = " . $_id . ";";
$mod_assoc_array = $sql->assoc_array($mod_query);
//var_dump($mod_assoc_array);
foreach ($mod_assoc_array[0] as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
if ($field == "mod_user_kid_uk_id") {
$new_user = new user_kid();
$new_user->set_user_data_by_id($value);
$this->set_mod_user_kid($new_user);
}
if ($field == "mod_money_income_mi_id") {
$new_mi = new money_income();
$new_mi->set_mi_data_by_id($value);
$this->set_mod_money_income($new_mi);
}
}
}
public function set_mod_data_by_id($_id) {
global $sql;
$mod_query = "SELECT * FROM money_deposit WHERE mod_id = " . $_id . ";";
$mod_assoc_array = $sql->assoc_array($mod_query);
//var_dump($mod_assoc_array);
foreach ($mod_assoc_array[0] as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
if ($field == "mod_user_kid_uk_id") {
$new_user = new user_kid();
$new_user->set_user_data_by_id($value);
$this->set_mod_user_kid($new_user);
}
if ($field == "mod_money_income_mi_id") {
$new_mi = new money_income();
$new_mi->set_mi_data_by_id($value);
$this->set_mod_money_income($new_mi);
}
}
}
public static function create_money_deposit($_user_id, $_date, $_sum, $_pt) {
global $sql;
public static function create_money_deposit($_user_id, $_date, $_sum, $_pt) {
global $sql;
$income_id = $sql->insert_into('money_income', array(
'mi_date' => $_date,
'mi_payment_type_pt_id' => $_pt,
'mi_sum' => $_sum,
'mi_item' => 'Edzésdíj',
'mi_money_income_category_mic_id' => 4,
)
);
$income_id = $sql->insert_into('money_income', array(
'mi_date' => $_date,
'mi_payment_type_pt_id' => $_pt,
'mi_sum' => $_sum,
'mi_item' => 'Edzésdíj',
'mi_money_income_category_mic_id' => 4,
)
);
return $sql->insert_into('money_deposit', array(
'mod_user_kid_uk_id' => $_user_id,
'mod_money_income_mi_id' => $income_id,
));
}
return $sql->insert_into('money_deposit', array(
'mod_user_kid_uk_id' => $_user_id,
'mod_money_income_mi_id' => $income_id,
));
}
public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id, $_pt, $_mi_id) {
global $sql;
$sql->update_table('money_income', array(
//'mod_user_kid_uk_id' => $_user_id,
'mi_date' => $_date,
'mi_payment_type_pt_id' => $_pt,
'mi_sum' => $_sum
), array(
'mi_id' => $_mi_id
));
public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id, $_pt, $_mi_id) {
global $sql;
$sql->update_table('money_income', array(
//'mod_user_kid_uk_id' => $_user_id,
'mi_date' => $_date,
'mi_payment_type_pt_id' => $_pt,
'mi_sum' => $_sum
), array(
'mi_id' => $_mi_id
));
$sql->update_table('money_deposit', array(
'mod_user_kid_uk_id' => $_user_id,
), array(
'mod_id' => $_mod_id
));
$sql->update_table('money_deposit', array(
'mod_user_kid_uk_id' => $_user_id,
), array(
'mod_id' => $_mod_id
));
}
}
}

View File

@@ -3,7 +3,7 @@
/*
PAGE CLASS
url alapjan lekeri a template-et
http://badmintoncoach.hu/PAGE/SUBPAGE/ID
http://badmintoncoach-demo.hu/PAGE/SUBPAGE/ID
*/
@@ -195,74 +195,6 @@ class page {
# STATISZTIKÁK
include('include_stats.php');
break;
case 'download_backup':
# BIZTONSÁGI MENTÉS LETÖLTÉS
include('include_download_backup.php');
break;
case 'camps':
# TÁBOROK
include('include_camps.php');
break;
case 'camp_types':
# TÁBOR TÍPUSOK
include('include_camp_types.php');
break;
case 'camp_shirt_type':
# TÁBOR PÓLÓ TÍPUSOK
include('include_camp_shirt_types.php');
break;
case 'accept_apply':
# TÁBOR JELENTKEZÉS ELFOGADÁSA
include('include_accept_apply.php');
break;
case 'deny_apply':
# TÁBOR JELENTKEZÉS ELUTASÍTÁSA
include('include_deny_apply.php');
break;
case 'remove_apply':
# TÁBOR JELENTKEZÉS ELTÁVOLÍTÁSA A LISTÁBÓL
include('include_remove_apply.php');
break;
case 'apply':
# TÁBORI JELENTKEZŐ ADATAINAK MEGTEKINTÉSE
include('include_apply.php');
break;
case 'camp_user':
# táborvezetők
include('include_user_camp_leader.php');
break;
case 'camp_details':
# turnusok
include('include_camp_details.php');
break;
case 'user_groups':
# csoportok
include('include_user_groups.php');
break;
case 'milestones':
# csoportok
include('include_milestones.php');
break;
case 'smtp_teszt':
# smtp teszt
include('include_smtp_test.php');
break;
case 'emails':
# email log
include('include_emails.php');
break;
case 'email':
# email log details
include('include_email.php');
break;
case 'notifications':
# értesítések
include('include_notifications.php');
break;
case 'delete_notification':
# ÉRTESÍTÉS TÖRLÉS (NULLÁZÁS)
include('include_delete_notification.php');
break;
case 'delete_training_type':
# EDZÉS TÍPUS TÖRLÉS
include('include_delete_training_type.php');
@@ -307,33 +239,6 @@ class page {
# BEVÉTEL TÖRLÉS
include('include_delete_money_income.php');
break;
case 'delete_backup':
# MENTÉS TÖRLÉS
include('include_delete_backup.php');
break;
case 'delete_camp_type':
# TÁBOR TÍPUS TÖRLÉS
include('include_delete_camp_type.php');
break;
case 'delete_camp':
# TÁBOR TÖRLÉS
include('include_delete_camp.php');
break;
case 'delete_camp_shirt':
# TÁBORI PÓLÓ TÖRLÉS
include('include_delete_camp_shirt.php');
break;
case 'delete_camp_leader':
# TÁBORVEZETŐ TÖRLÉS
include('include_delete_camp_leader.php');
break;
case 'delete_user_group':
# CSOPORT TÖRLÉS
include('include_delete_user_group.php');
break;
case 'diary_report':
include('include_diary_report.php');
break;
case 'logout':
# kijelentkezés
$from = "admin";
@@ -369,10 +274,6 @@ class page {
# információk
include('include_information.php');
break;
case 'profile':
# információk
include('include_profile.php');
break;
default:
include('include_diary.php');
break;
@@ -393,10 +294,6 @@ class page {
# információk
include('include_information.php');
break;
case 'profile':
# információk
include('include_profile.php');
break;
default:
include('include_diary.php');
break;
@@ -431,62 +328,6 @@ class page {
break;
}
break;
case 'tabor':
# TÁBOR OLDALAK
switch ($this->get_subpage()) {
case 'informaciok':
# tábori információk
include('include_camp_information.php');
break;
case 'jelentkezes':
# jelentkezés
include('include_camp_apply.php');
break;
case 'jelentkezesek':
# jelentkezések
include('include_camp_applies.php');
break;
case 'move_next':
# továbblépés mentés nélkül
include('include_move_next.php');
break;
case 'logout':
# kijelentkezés
$from = "tabor";
include('include_logout.php');
break;
case 'delete_apply':
# jelentkezés törlése
include('include_delete_apply.php');
break;
default:
include('include_camp_information.php');
break;
}
break;
case 'taborvezeto':
# TÁBORVEZETŐI NÉZET
switch ($this->get_subpage()) {
case 'taborok':
# turnusok
include('include_camp_details.php');
break;
case 'jelentkezes':
# turnusok
include('include_apply.php');
break;
case 'logout':
# kijelentkezés
$from = "taborvezeto";
include('include_logout.php');
break;
default:
include('include_camp_details.php');
break;
}
break;
default:
break;
}
}
}

View File

@@ -1,100 +1,100 @@
<?php
class setting_value {
private $setv_id;
private $setv_set_date;
private $setv_setting_set_id; //id
private $setv_setting; //obj
private $setv_int;
private $setv_varchar;
private $setv_text;
private $setv_date;
private $setv_id;
private $setv_set_date;
private $setv_setting_set_id; //id
private $setv_setting; //obj
private $setv_int;
private $setv_varchar;
private $setv_text;
private $setv_date;
public function set_setv_id($_item) {
$this->setv_id = $_item;
}
public function set_setv_id($_item) {
$this->setv_id = $_item;
}
public function set_setv_set_date($_item) {
$this->setv_set_date = $_item;
}
public function set_setv_set_date($_item) {
$this->setv_set_date = $_item;
}
public function set_setv_setting_set_id($_item) {
$this->setv_setting_set_id = $_item;
}
public function set_setv_setting_set_id($_item) {
$this->setv_setting_set_id = $_item;
}
public function set_setv_setting($_item) {
$this->setv_setting = $_item;
}
public function set_setv_setting($_item) {
$this->setv_setting = $_item;
}
public function set_setv_int($_item) {
$this->setv_int = $_item;
}
public function set_setv_int($_item) {
$this->setv_int = $_item;
}
public function set_setv_varchar($_item) {
$this->setv_varchar = $_item;
}
public function set_setv_varchar($_item) {
$this->setv_varchar = $_item;
}
public function set_setv_text($_item) {
$this->setv_text = $_item;
}
public function set_setv_text($_item) {
$this->setv_text = $_item;
}
public function set_setv_date($_item) {
$this->setv_date = $_item;
}
public function set_setv_date($_item) {
$this->setv_date = $_item;
}
public function get_setv_id() {
return $this->setv_id;
}
public function get_setv_id() {
return $this->setv_id;
}
public function get_setv_set_date() {
return $this->setv_set_date;
}
public function get_setv_set_date() {
return $this->setv_set_date;
}
public function get_setv_setting_set_id() {
return $this->setv_setting_set_id;
}
public function get_setv_setting_set_id() {
return $this->setv_setting_set_id;
}
public function get_setv_setting() {
return $this->setv_setting;
}
public function get_setv_setting() {
return $this->setv_setting;
}
public function get_setv_int() {
return $this->setv_int;
}
public function get_setv_int() {
return $this->setv_int;
}
public function get_setv_varchar() {
return $this->setv_varchar;
}
public function get_setv_varchar() {
return $this->setv_varchar;
}
public function get_setv_text() {
return $this->setv_text;
}
public function get_setv_text() {
return $this->setv_text;
}
public function get_setv_date() {
return $this->setv_date;
}
public function get_setv_date() {
return $this->setv_date;
}
public function set_setting_value_data_by_id($_id) {
//SETTING ID ALAPJÁN KÉRI LE;
//HA KELL, LEHET KÜLÖN FUNCTION-T ÍRNI HOGY ID ALAPJÁN KÉRJE
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from setting_value where setv_setting_set_id = " . $_id);
$set_data_array = $set_data_assoc_array[0];
foreach ($set_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
public function set_setting_value_data_by_id($_id) {
//SETTING ID ALAPJÁN KÉRI LE;
//HA KELL, LEHET KÜLÖN FUNCTION-T ÍRNI HOGY ID ALAPJÁN KÉRJE
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from setting_value where setv_setting_set_id = " . $_id);
$set_data_array = $set_data_assoc_array[0];
foreach ($set_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
if ($field == 'setv_setting_set_id') {
$new_set = new setting();
$new_set->set_setting_data_by_id($value);
$this->set_setv_setting($new_set);
}
}
if ($field == 'setv_setting_set_id') {
$new_set = new setting();
$new_set->set_setting_data_by_id($value);
$this->set_setv_setting($new_set);
}
}
}
}
}
?>
?>

View File

@@ -1,193 +0,0 @@
<?php
/**
* táborvezető
*/
class user_camp_leader
{
private $ucl_id;
private $ucl_name;
private $ucl_password;
private $ucl_last_login;
private $ucl_deleted;
private $logged_in;
/**
* gets the value of ucl_id.
*
* @return mixed
*/
public function get_ucl_id()
{
return $this->ucl_id;
}
/**
* sets the value of ucl_id.
*
* @param mixed $ucl_id the ucl id
*
* @return self
*/
private function set_ucl_id($ucl_id)
{
$this->ucl_id = $ucl_id;
return $this;
}
/**
* gets the value of ucl_name.
*
* @return mixed
*/
public function get_ucl_name()
{
return $this->ucl_name;
}
/**
* sets the value of ucl_name.
*
* @param mixed $ucl_name the ucl name
*
* @return self
*/
private function set_ucl_name($ucl_name)
{
$this->ucl_name = $ucl_name;
return $this;
}
/**
* gets the value of ucl_password.
*
* @return mixed
*/
public function get_ucl_password()
{
return $this->ucl_password;
}
/**
* sets the value of ucl_password.
*
* @param mixed $ucl_password the ucl password
*
* @return self
*/
private function set_ucl_password($ucl_password)
{
$this->ucl_password = $ucl_password;
return $this;
}
/**
* gets the value of ucl_last_login.
*
* @return mixed
*/
public function get_ucl_last_login()
{
return $this->ucl_last_login;
}
/**
* sets the value of ucl_last_login.
*
* @param mixed $ucl_last_login the ucl last login
*
* @return self
*/
private function set_ucl_last_login($ucl_last_login)
{
$this->ucl_last_login = $ucl_last_login;
return $this;
}
/**
* gets the value of ucl_deleted.
*
* @return mixed
*/
public function get_ucl_deleted()
{
return $this->ucl_deleted;
}
/**
* sets the value of ucl_deleted.
*
* @param mixed $ucl_deleted the ucl deleted
*
* @return self
*/
private function set_ucl_deleted($ucl_deleted)
{
$this->ucl_deleted = $ucl_deleted;
return $this;
}
public function update_login_time($_ucl_id = null) {
global $sql;
//az adott user_id-n updateli a login_time-ot
$sql->update_table('user_camp_leader', array('ucl_last_login' => date('Y-m-d')), array('ucl_id' => (empty($_ucl_id)?$this->get_ucl_id():$_ucl_id)));
}
public function is_logged_in() {
//leellenőrzi cookie alapján h be vagyunk-e jelentkezve
//JAVÍTVA: adja vissza az adattag igazságértékét
return $this->logged_in;
}
public function set_login($_login) {
//bool-t kap paraméterül
$this->logged_in = $_login;
}
public function set_user_data_by_id($_user_id) {
global $sql;
$ucl_assoc_array = $sql->assoc_array("select * from user_camp_leader where ucl_id = " . $_user_id);
$ucl_array = $ucl_assoc_array[0];
//alapadatok
foreach ($ucl_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
$this->set_login(true);
}
}
public static function create_camp_leader($_name, $_password) {
global $sql;
return $sql->insert_into('user_camp_leader', array(
'ucl_name' => $_name,
'ucl_password' => md5($_password)
));
}
public static function update_camp_leader($_name, $_password, $_ucl_id) {
global $sql;
if ($_password) {
$sql->update_table('user_camp_leader', array(
'ucl_name' => $_name,
'ucl_password' => md5($_password)
), array(
'ucl_id' => $_ucl_id
));
}
else {
$sql->update_table('user_camp_leader', array(
'ucl_name' => $_name
), array(
'ucl_id' => $_ucl_id
));
}
}
}
?>

View File

@@ -1,194 +0,0 @@
<?php
class user_group {
private $ug_id;
private $ug_name;
private $ug_description;
private $ug_is_automatic;
private $ug_deleted;
/**
* @return mixed
*/
public function get_ug_id()
{
return $this->ug_id;
}
/**
* @param mixed $ug_id
*
* @return self
*/
public function set_ug_id($ug_id)
{
$this->ug_id = $ug_id;
return $this;
}
/**
* @return mixed
*/
public function get_ug_name()
{
return $this->ug_name;
}
/**
* @param mixed $ug_name
*
* @return self
*/
public function set_ug_name($ug_name)
{
$this->ug_name = $ug_name;
return $this;
}
/**
* @return mixed
*/
public function get_ug_description()
{
return $this->ug_description;
}
/**
* @param mixed $ug_description
*
* @return self
*/
public function set_ug_description($ug_description)
{
$this->ug_description = $ug_description;
return $this;
}
/**
* @return mixed
*/
public function get_ug_is_automatic()
{
return $this->ug_is_automatic;
}
/**
* @param mixed $ug_is_automatic
*
* @return self
*/
public function set_ug_is_automatic($ug_is_automatic)
{
$this->ug_is_automatic = $ug_is_automatic;
return $this;
}
/**
* @return mixed
*/
public function get_ug_deleted()
{
return $this->ug_deleted;
}
/**
* @param mixed $ug_deleted
*
* @return self
*/
public function set_ug_deleted($ug_deleted)
{
$this->ug_deleted = $ug_deleted;
return $this;
}
/**
* @return mixed
*/
public function get_ug_filter()
{
return $this->ug_filter;
}
/**
* @param mixed $ug_filter
*
* @return self
*/
public function set_ug_filter($ug_filter)
{
$this->ug_filter = $ug_filter;
return $this;
}
public function set_ug_data_by_id($_id) {
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from user_group where ug_id = " . $_id);
$set_data_array = $set_data_assoc_array[0];
foreach ($set_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
}
}
public static function create_user_group($_name, $_description, $_is_automatic = 0) {
global $sql;
return $sql->insert_into('user_group', array(
'ug_name' => $_name,
'ug_description' => $_description,
'ug_is_automatic' => $_is_automatic,
)
);
}
public static function update_user_group($_name, $_description, $_id, $_is_automatic = 0) {
global $sql;
$sql->update_table('user_group', array(
'ug_name' => $_name,
'ug_description' => $_description,
'ug_is_automatic' => $_is_automatic,
),
array(
'ug_id' => $_id,
)
);
}
public static function empty_group($_group_id) {
//kitörli a usereket a groupból; categoryra szűrhető
global $sql;
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_group_ug_id = " . $_group_id);
$sql->execute_query("DELETE FROM user_group_category WHERE ugc_user_group_ug_id = " . $_group_id);
}
public function get_user_group_filter_values() {
global $sql;
$ugfv_array = array();
$ugfv_assoc_array = $sql->assoc_array("SELECT * FROM user_group_filter_value WHERE ugfv_group_id = " . $this->get_ug_id());
foreach ($ugfv_assoc_array as $u) {
$ugfv = new user_group_filter_value();
$ugfv->set_ugfv_data_by_id($u['ugfv_id']);
$ugfv_array[] = $ugfv;
}
return $ugfv_array;
}
}
?>

View File

@@ -1,86 +0,0 @@
<?php
class user_group_category {
private $ugc_id;
private $ugc_name;
private $ugc_user_group_ug_id;
/**
* @return mixed
*/
public function get_ugc_id()
{
return $this->ugc_id;
}
/**
* @param mixed $ugc_id
*
* @return self
*/
public function set_ugc_id($ugc_id)
{
$this->ugc_id = $ugc_id;
return $this;
}
/**
* @return mixed
*/
public function get_ugc_name()
{
return $this->ugc_name;
}
/**
* @param mixed $ugc_name
*
* @return self
*/
public function set_ugc_name($ugc_name)
{
$this->ugc_name = $ugc_name;
return $this;
}
/**
* @return mixed
*/
public function get_ugc_user_group_ug_id()
{
return $this->ugc_user_group_ug_id;
}
/**
* @param mixed $ugc_user_group_ug_id
*
* @return self
*/
public function set_ugc_user_group_ug_id($ugc_user_group_ug_id)
{
$this->ugc_user_group_ug_id = $ugc_user_group_ug_id;
return $this;
}
public function set_ugc_data_by_id($_id) {
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from user_group_category where ugc_id = " . $_id);
$set_data_array = $set_data_assoc_array[0];
foreach ($set_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
}
}
public static function get_ugc_by_name($_name, $_group_id) {
global $sql;
return $sql->single_varible("select ugc_id from user_group_category where ugc_user_group_ug_id = " . $_group_id . " AND ugc_name = '".$_name."';");
}
}
?>

View File

@@ -1,167 +0,0 @@
<?php
class user_group_filter {
private $ugf_id;
private $ugf_name;
private $ugf_field;
private $ugf_table;
private $ugf_label;
private $ugf_value;
private $ugf_condition;
/**
* @return mixed
*/
public function get_ugf_id()
{
return $this->ugf_id;
}
/**
* @param mixed $ugf_id
*
* @return self
*/
public function set_ugf_id($ugf_id)
{
$this->ugf_id = $ugf_id;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_name()
{
return $this->ugf_name;
}
/**
* @param mixed $ugf_name
*
* @return self
*/
public function set_ugf_name($ugf_name)
{
$this->ugf_name = $ugf_name;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_field()
{
return $this->ugf_field;
}
/**
* @param mixed $ugf_field
*
* @return self
*/
public function set_ugf_field($ugf_field)
{
$this->ugf_field = $ugf_field;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_table()
{
return $this->ugf_table;
}
/**
* @param mixed $ugf_table
*
* @return self
*/
public function set_ugf_table($ugf_table)
{
$this->ugf_table = $ugf_table;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_label()
{
return $this->ugf_label;
}
/**
* @param mixed $ugf_label
*
* @return self
*/
public function set_ugf_label($ugf_label)
{
$this->ugf_label = $ugf_label;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_value()
{
return $this->ugf_value;
}
/**
* @param mixed $ugf_value
*
* @return self
*/
public function set_ugf_value($ugf_value)
{
$this->ugf_value = $ugf_value;
return $this;
}
/**
* @return mixed
*/
public function get_ugf_condition()
{
return $this->ugf_condition;
}
/**
* @param mixed $ugf_condition
*
* @return self
*/
public function set_ugf_condition($ugf_condition)
{
$this->ugf_condition = $ugf_condition;
return $this;
}
public function set_ugf_data_by_id($_ugf_id) {
global $sql;
$ugf_assoc_array = $sql->assoc_array("select * from user_group_filter where ugf_id = " . $_ugf_id);
$ugf_array = $ugf_assoc_array[0];
//alapadatok
foreach ($ugf_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
}
}
}
?>

View File

@@ -1,232 +0,0 @@
<?php
class user_group_filter_value {
private $ugfv_id;
private $ugfv_filter_id; //obj
private $ugfv_group_id; //obj
private $ugfv_value;
/**
* @return mixed
*/
public function get_ugfv_id()
{
return $this->ugfv_id;
}
/**
* @param mixed $ugfv_id
*
* @return self
*/
public function set_ugfv_id($ugfv_id)
{
$this->ugfv_id = $ugfv_id;
return $this;
}
/**
* @return mixed
*/
public function get_ugfv_filter_id()
{
return $this->ugfv_filter_id;
}
/**
* @param mixed $ugfv_filter_id
*
* @return self
*/
public function set_ugfv_filter_id($ugfv_filter_id)
{
$this->ugfv_filter_id = $ugfv_filter_id;
return $this;
}
/**
* @return mixed
*/
public function get_ugfv_group_id()
{
return $this->ugfv_group_id;
}
/**
* @param mixed $ugfv_group_id
*
* @return self
*/
public function set_ugfv_group_id($ugfv_group_id)
{
$this->ugfv_group_id = $ugfv_group_id;
return $this;
}
/**
* @return mixed
*/
public function get_ugfv_value()
{
return $this->ugfv_value;
}
/**
* @param mixed $ugfv_value
*
* @return self
*/
public function set_ugfv_value($ugfv_value)
{
$this->ugfv_value = $ugfv_value;
return $this;
}
public function set_ugfv_data_by_id($_sc_id) {
global $sql;
$ugfv_data_assoc_array = $sql->assoc_array("select * from user_group_filter_value where ugfv_id = " . $_sc_id);
$ugfv_data_array = $ugfv_data_assoc_array[0];
foreach ($ugfv_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value); //alapadatok beállítása
if ($field == 'ugfv_filter_id' && !empty($value)) {
$filter = new user_group_filter();
$filter->set_ugf_data_by_id($value);
$this->set_ugfv_filter_id($filter);
}
if ($field == 'ugfv_group_id' && !empty($value)) {
$group = new user_group();
$group->set_ug_data_by_id($value);
$this->set_ugfv_group_id($group);
}
}
}
public function apply($intersect = 0) {
global $sql;
//EZ CSAK BEILLESZT, A SZÜKSÉGES TÖRLÉSEKET ELŐTTE KELL MEGCSINÁLNI
//$this->get_ugfv_group_id()->empty_group($ugc_id);
//$this->get_ugfv_group_id()->empty_group($ugc_id);
//lekéri az usereket a megadott értékek alapján, és ha még nincs ilyen user a csoportban ezzel a category-val, akkor beilleszti
if (!$intersect) {
$ugc_id = $sql->insert_into('user_group_category', array(
'ugc_name' => $this->get_ugfv_value(),
'ugc_user_group_ug_id' => $this->get_ugfv_group_id()->get_ug_id(),
'ugc_ugfv_id' => $this->get_ugfv_id()
));
}
if ($this->get_ugfv_filter_id()->get_ugf_table()) {
//ha meg van adva table, akkor az alapján rakjuk össze a query-t
$table = $this->get_ugfv_filter_id()->get_ugf_table();
$uk_field = 'uk_'.$this->get_ugfv_filter_id()->get_ugf_field();
$value = $this->get_ugfv_filter_id()->get_ugf_value();
$condition = $this->get_ugfv_filter_id()->get_ugf_condition();
$filter_query = "
SELECT
uk_id
FROM
user_kid
JOIN
".$table." ON ".$value." = ".$uk_field."
WHERE ".($table!='user_kid_is_active'?"uk_is_active = 1 ":"")." AND uk_deleted = 0 AND
".$uk_field." = ".$this->get_ugfv_value() . ($condition?" AND " . $condition:"") .
";";
}
else {
$filter_query = "
SELECT uk_id FROM user_kid
WHERE uk_is_active = 1 AND uk_deleted = 0 AND uk_".$this->get_ugfv_filter_id()->get_ugf_field()." = '".$this->get_ugfv_value()."';
";
}
//var_dump($filter_query);
$uk_assoc_array = $sql->assoc_array($filter_query);
$uk_ids = [];
foreach ($uk_assoc_array as $uk_array) {
$uk_ids[] = $uk_array['uk_id'];
}
$ugfv_list = $sql->assoc_array('SELECT * FROM user_group_kid WHERE ugk_ugfv_id in (SELECT ugfv_id FROM user_group_filter_value WHERE ugfv_group_id = ' . $this->get_ugfv_group_id()->get_ug_id(). ');');
if ($intersect && count($ugfv_list)) {
//ha már van vmi a metszetben
//végigmegyünk a metszeten, és ha az aktuális elem nincs benne az uk_assoc_arrayben, akkor kivesszük a metszetből
foreach ($ugfv_list as $index => $ugfv_array) {
if (!in_array($ugfv_array['ugk_user_kid_uk_id'], $uk_ids)) {
$sql->execute_query('DELETE FROM user_group_kid WHERE ugk_id = ' . $ugfv_array['ugk_id']);
unset($ugfv_list[$index]);
}
}
}
else {
foreach ($uk_assoc_array as $uk) {
$sql->insert_into('user_group_kid', array(
'ugk_user_kid_uk_id' => $uk['uk_id'],
'ugk_user_group_ug_id' => $this->get_ugfv_group_id()->get_ug_id(),
'ugk_category_ugc_id' => ($intersect?'null':$ugc_id),
'ugk_ugfv_id' => $this->get_ugfv_id(),
));
}
}
}
public function is_user_filterable($user) {
global $sql;
if ($this->get_ugfv_filter_id()->get_ugf_table()) {
//ha meg van adva table, akkor az alapján rakjuk össze a query-t
$table = $this->get_ugfv_filter_id()->get_ugf_table();
$uk_field = 'uk_'.$this->get_ugfv_filter_id()->get_ugf_field();
$value = $this->get_ugfv_filter_id()->get_ugf_value();
$condition = $this->get_ugfv_filter_id()->get_ugf_condition();
$filter_query = "
SELECT
uk_id
FROM
user_kid
JOIN
".$table." ON ".$value." = ".$uk_field."
WHERE ".($table!='user_kid_is_active'?"uk_is_active = 1 ":"")." AND uk_id = ".$user->get_uk_id()." AND uk_deleted = 0 AND
".$uk_field." = ".$this->get_ugfv_value() . ($condition?" AND " . $condition:"") .
";";
}
else {
$filter_query = "
SELECT uk_id FROM user_kid
WHERE uk_is_active = 1 AND uk_deleted = 0 AND uk_id = ".$user->get_uk_id()." AND uk_".$this->get_ugfv_filter_id()->get_ugf_field()." = '".$this->get_ugfv_value()."';
";
}
//var_dump($filter_query);
return $sql->num_of_rows($filter_query);
}
public function is_intersect() {
global $sql;
return empty($sql->single_variable('SELECT ugk_category_ugc_id FROM user_group_kid WHERE ugk_user_group_ug_id = ' . $this->get_ugfv_group_id()->get_ug_id(). ' AND ugk_ugfv_id = ' . $this->get_ugfv_id()));
}
}
?>

View File

@@ -529,34 +529,17 @@ class user_kid extends user_parent {
$_de->set_de_balance($balance);
}
if ($_de->get_de_type() == 'training') {
//ha edzés, akkor -1200 levonás, kivéve, ha kedvezményes:
//1-nél több edzés / nap
//10-nál több edzés / hónap
//első két alkalom egyike
//var_dump($_de);
//echo $_de->get_de_first_two() . '<br>';
//echo $_de->get_de_training_per_month() . '<br>';
//echo $_de->get_de_training_per_day() . '<br><br><br>';
if ($_de->get_de_first_two() > 0 || $_de->get_de_training_per_month() > 10 || $_de->get_de_training_per_day() > 1) {
//do nothing
$_de->set_de_transaction(0);
$_de->set_de_has_discount(true);
//TODO: ha van már havi 10+ akk ne nézze a duplázót!
if ($_de->get_de_first_two() > 0) $_de->set_de_discount_id(1);
if ($_de->get_de_training_per_day() > 1) $_de->set_de_discount_id(3);
if ($_de->get_de_training_per_month() > 10) $_de->set_de_discount_id(2);
//$balance -= 1200;
$_de->set_de_transaction(-1000); //beállítjuk, mennyivel csökken az egyenleg
if (0 == $i) {
$_de->set_de_balance($balance+$_de->get_de_transaction()); //beállítjuk az új egyenleget
}
else {
//$balance -= 1200;
$_de->set_de_transaction(-1200); //beállítjuk, mennyivel csökken az egyenleg
if (0 == $i) {
$_de->set_de_balance($balance+$_de->get_de_transaction()); //beállítjuk az új egyenleget
}
else {
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction()); //beállítjuk az új egyenleget
}
//echo $_de->get_de_date() . " minusz 1200<br><br>";
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction()); //beállítjuk az új egyenleget
}
//echo $_de->get_de_date() . " minusz 1200<br><br>";
}
elseif ($_de->get_de_type() == 'money_deposit') {
$_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_money_income()->get_mi_sum());
@@ -588,89 +571,6 @@ class user_kid extends user_parent {
return $group_array;
}
public function update_filters() {
global $sql;
//azok a csoportokban, amikben az user benne van
$user_groups = $this->get_groups();
//az user csoportjainak ugfv-i; tömb[tömb]
$my_ugfv_array = array();
foreach ($user_groups as $user_group) {
$ugfv = $user_group->get_user_group_filter_values();
$no_falses = 0;
$index = 0;
foreach ($ugfv as $ugfv_obj) {
//var_dump($ugfv_obj->is_intersect());
if(!$ugfv_obj->is_user_filterable($this) && $ugfv_obj->is_intersect()) {
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id());
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id());
continue 2;
}
elseif (!$ugfv_obj->is_user_filterable($this) && !$ugfv_obj->is_intersect()) {
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $ugfv_obj->get_ugfv_id());
$sql->execute_query("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $ugfv_obj->get_ugfv_id());
$no_falses++;
}
$index ++;
}
if($no_falses == $index) {
//var_dump("DELETE FROM user_group_kid WHERE ugk_user_kid_uk_id = " . $this->get_uk_id() . " AND ugk_user_group_ug_id = " . $user_group->get_ug_id() . " AND ugfv_id = " . $this->get_ugfv_id());
}
}
//lekérni minden csoport (ami nem az előzőek egyike) minden filtervalue-ját, és megnézni, hogy beszűrné-e
//minden csoport, ami nem az előzőek
$user_groups_assoc = $sql->assoc_array("select * from user_group where ug_id not in (select distinct ugk_user_group_ug_id from user_group_kid where ugk_user_kid_uk_id = ".$this->get_uk_id().") and ug_is_automatic = 1 and ug_deleted = 0;");
$user_groups = array();
foreach ($user_groups_assoc as $ug) {
$new_ug = new user_group();
$new_ug->set_ug_data_by_id($ug['ug_id']);
$user_groups[] = $new_ug;
}
foreach ($user_groups as $user_group) {
$ugfv = $user_group->get_user_group_filter_values();
$no_success = 0;
$index = 0;
foreach ($ugfv as $ugfv_obj) {
if($ugfv_obj->is_user_filterable($this) && !$ugfv_obj->is_intersect()) {
$category_id = $sql->single_variable("SELECT ugc_id FROM user_group_category WHERE ugc_ugfv_id =" . $ugfv_obj->get_ugfv_id());
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id, ugk_category_ugc_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().", " . $category_id . ");");
$sql->insert_into(
'user_group_kid',
array(
'ugk_user_kid_uk_id' => $this->get_uk_id(),
'ugk_user_group_ug_id' => $user_group->get_ug_id(),
'ugk_category_ugc_id' => $category_id,
'ugk_ugfv_id' => $ugfv_obj->get_ugfv_id()
)
);
}
elseif ($ugfv_obj->is_user_filterable($this) && $ugfv_obj->is_intersect()) {
$no_success++;
//continue 2;
}
$index ++;
}
if($no_success == $index) {
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().");");
//var_dump("INSERT INTO user_group_kid (ugk_user_kid_uk_id, ugk_user_group_ug_id) VALUES (".$this->get_uk_id().", ".$user_group->get_ug_id().");");
$sql->insert_into(
'user_group_kid',
array(
'ugk_user_kid_uk_id' => $this->get_uk_id(),
'ugk_user_group_ug_id' => $user_group->get_ug_id(),
'ugk_ugfv_id' => $ugfv_obj->get_ugfv_id()
)
);
}
}
}
public function update_balance() {
global $sql;
@@ -680,80 +580,7 @@ class user_kid extends user_parent {
SELECT
object_id,
timestamp(object_date) as object_date,
object_type,
(SELECT
count(distinct date(tr_date))
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
YEAR(tr_date) = YEAR(object_date)
AND MONTH(tr_date) = MONTH(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$userId."
AND tr_date > (select
if(max(trd) is null,
'1900-01-01',
max(trd))
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$userId."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$userId."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) as elso_ket_edzes)) as 'training_per_month',
(SELECT
count(pr_id)
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
DATE(tr_date) = DATE(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$userId.") as 'training_per_day',
(select
if(sum(if(trd = object_date, 1, 0)) > 0,
1,
0)
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$userId."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$userId."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) elso2edzes) as 'first_two'
object_type
FROM
((SELECT
pr_training_tr_id as object_id,
@@ -789,13 +616,13 @@ class user_kid extends user_parent {
$new_training = new training();
$new_training->set_training_data_by_id($action['object_id']);
//$actions[] = $new_training;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], $new_training);
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], 0, 0, 0, $new_training);
}
elseif ($action['object_type'] == 'money_deposit') {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($action['object_id']);
//$actions[] = $new_mod;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], null, $new_mod);
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], 0, 0, 0, null, $new_mod);
}
$de_array[] = $new_diary_entry;

View File

@@ -1,118 +0,0 @@
nav {
box-shadow: none;
width: 100%;
}
ul.topnav {
background-color: #0052CC;
}
main #main_content, main #loading {
width: 100%;
box-shadow: none;
}
.info {
padding: 0px 8%;
}
#cct_extra_row {
margin-top: 10px;
display: none;
}
#add_more_cct, #move_next {
margin-bottom: 15px;
}
h1, p {
text-align: center;
}
.info p, .info h1{
text-align: unset;
}
form table {
margin: 0px auto;
border-collapse: collapse;
border: 2px solid black;
background: #e7d6d6;
min-width: 400px;
}
form table td {
font-size: 20px;
padding: 5px 10px;
}
form table tr:hover td {
background-color: #602f2f;
color: #fff;
}
.danger {
width: 64%;
display: block;
margin: 20px auto;
padding: 15px;
}
.middle {
display: block;
margin: 20px auto;
}
h2 {
text-align: center;
margin-top: 50px;
}
.apply_table img:hover {
cursor: pointer;
}
.reset img {
width: 15px;
display: inline-block;
position: relative;
top: 2px;
left: 5px;
}
.reset a {
color: #000;
}
.reset a:hover {
text-decoration: underline;
}
.apply_table a, .apply_table a:link, .apply_table a:visited, .apply_table a:active {
color: #000;
}
.apply_table a:hover {
text-decoration: underline;
}
.accept_terms_box {
width: 80%;
border: 0;
border-left: 2px solid black;
margin: 30px auto 20px auto;
}
.accept_terms_box a, .accept_terms_box a:link, .accept_terms_box a:visited, .accept_terms_box a:active {
color: #000;
}
.accept_terms_box a:hover {
text-decoration: underline;
}
input.apply {
font-size: 20px;
font-weight: bold;
}

View File

@@ -1,118 +0,0 @@
nav {
box-shadow: none;
width: 100%;
}
ul.topnav {
background-color: #419012;
}
main #main_content, main #loading {
width: 100%;
box-shadow: none;
}
.info {
padding: 0px 8%;
}
#cct_extra_row {
margin-top: 10px;
display: none;
}
#add_more_cct, #move_next {
margin-bottom: 15px;
}
h1, p {
text-align: center;
}
.info p, .info h1{
text-align: unset;
}
form table {
margin: 0px auto;
border-collapse: collapse;
border: 2px solid black;
background: #e7d6d6;
min-width: 400px;
}
form table td {
font-size: 20px;
padding: 5px 10px;
}
form table tr:hover td {
background-color: #602f2f;
color: #fff;
}
.danger {
width: 64%;
display: block;
margin: 20px auto;
padding: 15px;
}
.middle {
display: block;
margin: 20px auto;
}
h2 {
text-align: center;
margin-top: 50px;
}
.apply_table img:hover {
cursor: pointer;
}
.reset img {
width: 15px;
display: inline-block;
position: relative;
top: 2px;
left: 5px;
}
.reset a {
color: #000;
}
.reset a:hover {
text-decoration: underline;
}
.apply_table a, .apply_table a:link, .apply_table a:visited, .apply_table a:active {
color: #000;
}
.apply_table a:hover {
text-decoration: underline;
}
.accept_terms_box {
width: 80%;
border: 0;
border-left: 2px solid black;
margin: 30px auto 20px auto;
}
.accept_terms_box a, .accept_terms_box a:link, .accept_terms_box a:visited, .accept_terms_box a:active {
color: #000;
}
.accept_terms_box a:hover {
text-decoration: underline;
}
input.apply {
font-size: 20px;
font-weight: bold;
}

View File

@@ -1,21 +0,0 @@
<?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());
}
?>

View File

@@ -1,50 +0,0 @@
<?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 {
}
?>

View File

@@ -6,10 +6,6 @@
$where = '';
if ($this->is_id()) {
# RENDEZÉS
/*
*/
switch ($this->get_id()) {
case 1:
//1 - egyenleg szerint növekvő
@@ -22,31 +18,10 @@ if ($this->is_id()) {
$order_by = 'uk_name ASC';
$url_postfix = '/' . $this->get_id();
break;
case 3:
//3 - tartozások csökkenőben
$where = ' AND uk_balance < 0';
$order_by = 'uk_balance ASC, uk_name ASC';
$url_postfix = '/' . $this->get_id();
break;
case 4:
//4 - tartozások növekvőben
$where = ' AND uk_balance < 0';
$order_by = 'uk_balance DESC, uk_name ASC';
$url_postfix = '/' . $this->get_id();
break;
case 5:
//5 - tartozások növekvőben
$where = ' AND uk_balance < 0';
$order_by = 'uk_last_notification DESC, uk_name ASC';
$url_postfix = '/' . $this->get_id();
break;
default:
# code...
break;
}
}
else {
# EGYENLEG LISTA

View File

@@ -1,77 +0,0 @@
<?php
if ($this->is_id()) {
//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 {
# 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');
}
?>

View File

@@ -1,170 +0,0 @@
<?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);
//van-e már jelentkező
$has_contact = camp_apply::has_contact($_COOKIE['badminton_camp_session_id']);
//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);
//van-e
$smarty->assign('camp_kid', $new_camp_kid);
$smarty->assign('has_contact', $has_contact);
$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");
}
?>

View File

@@ -1,22 +0,0 @@
<?php
if ($this->is_id()) {
# empty
}
else {
# TURNUS LISTA, LEGÖRDÜLŐ GYEREKEKKEL
$camps_assoc_array = $sql->assoc_array("SELECT * FROM camp WHERE camp_deleted = 0 ORDER BY camp_from ASC;");
$camps = array();
foreach ($camps_assoc_array as $camp_array) {
$new_camp = new camp();
$new_camp->set_camp_data_by_id($camp_array['camp_id']);
$camps[] = $new_camp;
}
$smarty->assign('camps', $camps);
$smarty->display('camp_details.tpl');
}
?>

View File

@@ -1,18 +0,0 @@
<?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');
?>

View File

@@ -1,28 +0,0 @@
<?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_id DESC";
$shirt_assoc_array = $sql->assoc_array($camp_shirt_query);
$smarty->assign('shirt_assoc_array',$shirt_assoc_array);
$smarty->display('camp_shirt_list.tpl');
}
?>

View File

@@ -1,37 +0,0 @@
<?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');
}
?>

View File

@@ -1,140 +0,0 @@
<?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());
$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;
}
//lekérjük a töröltó 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 = 5 ORDER BY capp_accept_date DESC;;");
$apply_array_3 = array();
foreach ($pending_applies as $apply) {
$new_apply = new camp_apply();
$new_apply->set_capp_data_by_id($apply['capp_id']);
$apply_array_3[] = $new_apply;
}
//var_dump($apply_array_3);
$smarty->assign('apply_array', $apply_array);
$smarty->assign('pending_apply_array', $apply_array_2);
$smarty->assign('deleted_apply_array', $apply_array_3);
$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');
}
?>

View File

@@ -167,78 +167,6 @@ switch ($this->get_id()) {
$smarty->assign('mic_array', $mic_array);
$smarty->display('money_income_create.tpl');
break;
case 'backup':
# BACKUP
//létrehozzá, és hozzáfűzi az ID-t a dátumhoz
//visszatér a backup oldalra
//backup classből hívogat, statikusan
$new_bu_id = $sql->insert_into('backup', array('bu_date' => date('Y-m-d H:i:s')));
$sql->update_table('backup', array('bu_name' => date('Ymd_Hi') . '_' . $new_bu_id), array('bu_id' => $new_bu_id));
//log
$dump_content = $sql->export_database();
$file_name = date('Ymd_Hi_') . $new_bu_id . '.sql';
$path = 'backup/';
touch($path.$file_name);
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;
case 'user_camp_leader':
# táborvezető létrehozása
$smarty->display('user_camp_leader_create.tpl');
break;
case 'user_group':
# táborvezető létrehozása
$smarty->display('user_group_create.tpl');
break;
case 'training_template':
# edzés sablon létrehozása
//TRAINING TYPE ARRAY

View File

@@ -1,23 +0,0 @@
<?php
if ($this->is_id()) {
# JELENTKEZÉS ÁTÁLLÍTÁSA TÖRÖLT STÁTUSZRA
$sql->update_table('camp_apply', array('capp_status' => 5, 'capp_accept_date' => date("Y-m-d H:i:s")), array('capp_id' => $this->get_id()));
header("Location: /tabor/jelentkezesek");
}
else {
}
?>

View File

@@ -1,12 +0,0 @@
<?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('backup', array('bu_deleted' => 1), array('bu_id' => $this->get_id()));
log::register('delete_backup', $this->get_id());
header("Location: /admin/settings/3");
}
?>

View File

@@ -1,14 +0,0 @@
<?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");
}
?>

View File

@@ -1,10 +0,0 @@
<?php
if ($this->is_id()) {
$sql->update_table('user_camp_leader', array('ucl_deleted' => 1), array('ucl_id' => $this->get_id()));
log::register('delete_camp_leader', $this->get_id());
header("Location: /admin/camp_user");
}
?>

View File

@@ -1,19 +0,0 @@
<?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");
}
?>

View File

@@ -1,12 +0,0 @@
<?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");
}
?>

View File

@@ -1,12 +0,0 @@
<?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('user_group', array('ug_deleted' => 1), array('ug_id' => $this->get_id()));
log::register('delete_user_group', $this->get_id());
header("Location: /admin/user_groups");
}
?>

View File

@@ -1,21 +0,0 @@
<?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());
}
?>

View File

@@ -1,85 +1,10 @@
<?php
$action_list_query = "
SELECT
$action_list_query = "
SELECT
object_id,
timestamp(object_date) as object_date,
object_type,
(SELECT
count(distinct date(tr_date))
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
YEAR(tr_date) = YEAR(object_date)
AND MONTH(tr_date) = MONTH(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$user->get_uk_id()."
AND tr_date > (select
if(max(trd) is null,
'1900-01-01',
max(trd))
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) as elso_ket_edzes)) as 'training_per_month',
(SELECT
count(pr_id)
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
DATE(tr_date) = DATE(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$user->get_uk_id().") as 'training_per_day',
(select
if(sum(if(trd = object_date, 1, 0)) > 0,
1,
0)
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) elso2edzes) as 'first_two'
object_type
FROM
((SELECT
pr_training_tr_id as object_id,
@@ -102,31 +27,31 @@ FROM
mod_user_kid_uk_id = ".$user->get_uk_id()."
and mod_deleted = 0)) actions
order by object_date ASC;
";
";
$action_assoc_array = $sql->assoc_array($action_list_query);
$action_assoc_array = $sql->assoc_array($action_list_query);
$actions = array();
$de_array = array();
foreach ($action_assoc_array as $action) {
$actions = array();
$de_array = array();
foreach ($action_assoc_array as $action) {
if ($action['object_type'] == 'training') {
$new_training = new training();
$new_training->set_training_data_by_id($action['object_id']);
//$actions[] = $new_training;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], $new_training);
}
elseif ($action['object_type'] == 'money_deposit') {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($action['object_id']);
//$actions[] = $new_mod;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], null, $new_mod);
}
if ($action['object_type'] == 'training') {
$new_training = new training();
$new_training->set_training_data_by_id($action['object_id']);
//$actions[] = $new_training;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], 0, 0, 0, $new_training);
}
elseif ($action['object_type'] == 'money_deposit') {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($action['object_id']);
//$actions[] = $new_mod;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], 0, 0, 0, null, $new_mod);
}
$de_array[] = $new_diary_entry;
$de_array[] = $new_diary_entry;
}
}
//itt csak hivatkozással adjuk át a tömböt, a calculate_balance kiszámolja, belerakja és visszadja
@@ -137,16 +62,16 @@ order by object_date ASC;
$balance_transfer = 0;
}
$de_array = array_reverse($de_array);
$de_array = array_reverse($de_array);
//$de_array[] = $first_entry;
//var_dump($de_array);
//var_dump($de_array);
//$smarty->assign('actions', $actions);
$smarty->assign('actions', $de_array);
$smarty->assign('balance_transfer', $balance_transfer);
$smarty->assign('balance_transfer', $balance_transfer);
//$smarty->assign('balance', $balance);
$smarty->display('user_diary.tpl');
//$smarty->assign('balance', $balance);
$smarty->display('user_diary.tpl');

View File

@@ -1,35 +0,0 @@
<?php
# BACKUP DOWNLOAD
if ($this->is_id()) {
$backup = new backup();
$backup->set_backup_data_by_id($this->get_id());
$filename = "\backup\/".$backup->get_bu_name() . "\.sql";
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
//header("Content-disposition: attachment; filename='backup/".$backup->get_bu_name().".sql'");
//header("Content-disposition: attachment; filename=\"backup/".$backup->get_bu_name().".sql\"");
header("Content-disposition: attachment; filename=\"".$filename."\"");
//var_dump(is_file("backup/".$backup->get_bu_name() . ".sql"));
//header('Location: /admin/settings/3');
}
else {
# NEM LEHET
}
?>

View File

@@ -1,17 +0,0 @@
<?php
if ($this->is_id()) {
# EMAIL LOG RÉSZLETEK
$email_log = new email_log();
$email_log->set_el_data_by_id($this->get_id());
$smarty->assign('email', $email_log);
$smarty->display('email.tpl');
}
else {
}
?>

View File

@@ -1,37 +0,0 @@
<?php
if ($this->is_id()) {
# EMAIL LISTA (50 / oldal)
$all_emails_query = "SELECT count(DISTINCT el_id) FROM email_log";
$emails_query = "SELECT * FROM email_log ORDER BY el_sent_date DESC LIMIT ".($this->is_id()?($this->get_id()-1) * 50:"0").",50";
$el_assoc_array = $sql->assoc_array($emails_query);
$el_count = $sql->single_variable($all_emails_query);
$next_link = true;
$el_array = array();
foreach ($el_assoc_array as $key => $el) {
$new_el = new email_log();
$new_el->set_el_data_by_id($el['el_id']);
$el_array[] = $new_el;
}
$fold = $el_count > 50;
if ($el_count <= $this->get_id()*50) {
$next_link = false;
}
$smarty->assign('el_array', $el_array);
$smarty->assign('fold', $fold);
$smarty->assign('next_id', $next_link?$this->get_id()+1:false);
$smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false));
$smarty->display('emails.tpl');
}
else {
header("Location: /admin/emails/1");
}
?>

View File

@@ -1,17 +1,14 @@
<?php
# INFORMÁCIÓK
# INFORMÁCIÓK
$info_query = "SELECT set_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = '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');
$info_query = "SELECT set_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = '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');
?>

View File

@@ -1,35 +0,0 @@
<?php
# HA VAN ID, AKKOR PROFIL FELTÖLTÉS
if ($this->is_id()) {
switch ($this->get_id()) {
case '1':
$smarty->assign('error', 'Nem található a fájlnévvel egyező gyerek a rendszerben!');
break;
case '2':
$smarty->assign('error', 'Ismeretlen esemény típus');
break;
case '3':
$smarty->assign('error', 'A fájlnak szezonnal kell kezdődnie!');
break;
case 'success':
# code...
$smarty->assign('success', 'Sikeres feltöltés!');
break;
default:
# code...
break;
}
}
else {
# PROFIL FELTÖLTÉS
}
$smarty->display('upload_milestone.tpl');
?>

View File

@@ -1,34 +0,0 @@
<?php
# HA NINCS ID, AKKOR VÁROSLISTA
if ($this->is_id()) {
# VÁROS SZERKESZTÉSE
}
else {
# VÁROS LISTA
//megnézzük, hogy adott-e meg felelős kapcsolattartót
//ha nem, akkor a 3-as oldalon kilistázzuk a megadott kapcsolattartókat, és kattintással lehet választani
//ha igen, akkor a negyedik oldalra megyünk
if (camp_apply::has_responsible_contact($_COOKIE['badminton_camp_session_id'])) {
header('Location: /tabor/jelentkezes/4');
}
else {
header('Location: /tabor/jelentkezes/3');
}
}
?>

View File

@@ -1,21 +0,0 @@
<?php
if ($this->is_id()) {
# JELENTEKEZÉS ELFOGADÁSA
camp_apply::apply_response($this->get_id(), 6);
$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());
}
?>

View File

@@ -3,68 +3,68 @@
# HA NINCS ID, AKKOR BEÁLLÍTÁSOK
# HA VAN ID, AKKOR ADOTT BEÁLLÍTÁS
if ($this->is_id()) {
# ADOTT BEÁLLÍTÁS
# ADOTT BEÁLLÍTÁS
//először ellenőrizzük, hogy létezik-e hozzá setting_value, ha nem, akkor létrehozzuk
if (!$sql->num_of_rows('SELECT * FROM setting_value WHERE setv_setting_set_id = ' . $this->get_id())) {
$new_set = new setting();
$new_set->set_setting_data_by_id($this->get_id());
$new_setting_value_id = $sql->insert_into('setting_value', array(
'setv_set_date' => date('Y-m-d H:i:s'),
'setv_setting_set_id' => $this->get_id()
));
}
$new_setting = new setting_value();
$new_setting->set_setting_value_data_by_id($this->get_id());
//először ellenőrizzük, hogy létezik-e hozzá setting_value, ha nem, akkor létrehozzuk
if (!$sql->num_of_rows('SELECT * FROM setting_value WHERE setv_setting_set_id = ' . $this->get_id())) {
$new_set = new setting();
$new_set->set_setting_data_by_id($this->get_id());
$new_setting_value_id = $sql->insert_into('setting_value', array(
'setv_set_date' => date('Y-m-d H:i:s'),
'setv_setting_set_id' => $this->get_id()
));
}
$new_setting = new setting_value();
$new_setting->set_setting_value_data_by_id($this->get_id());
if ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 1) {
//textarea
}
if ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 1) {
//textarea
}
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 2) {
//biztonsági mentés
$backup_assoc_array = $sql->assoc_array("SELECT * FROM backup WHERE bu_deleted = 0 ORDER BY bu_date DESC, bu_id DESC limit 14;");
$backups = array();
foreach ($backup_assoc_array as $value) {
$new_backup = new backup();
$new_backup->set_backup_data_by_id($value['bu_id']);
$backups[] = $new_backup;
}
$smarty->assign('backups', $backups);
}
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 2) {
//biztonsági mentés
$backup_assoc_array = $sql->assoc_array("SELECT * FROM backup WHERE bu_deleted = 0 ORDER BY bu_date DESC, bu_id DESC limit 14;");
$backups = array();
foreach ($backup_assoc_array as $value) {
$new_backup = new backup();
$new_backup->set_backup_data_by_id($value['bu_id']);
$backups[] = $new_backup;
}
$smarty->assign('backups', $backups);
}
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 3) {
//url -> hozzáfűzi az admin után a varcharban lévő url-t
header('Location: /admin/' . $new_setting->get_setv_varchar());
}
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 3) {
//url -> hozzáfűzi az admin után a varcharban lévő url-t
header('Location: /admin/' . $new_setting->get_setv_varchar());
}
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 4) {
elseif ($new_setting->get_setv_setting()->get_set_setting_type_st_id() == 4) {
}
}
$smarty->assign("setting", $new_setting);
$smarty->assign("setting", $new_setting);
$smarty->display("setting_data_edit.tpl");
$smarty->display("setting_data_edit.tpl");
}
else {
# BEÁLLÍTÁSOK
# BEÁLLÍTÁSOK
$settings_query = "SELECT * FROM setting ORDER BY set_name ASC";
$settings_assoc_array = $sql->assoc_array($settings_query);
$settings_query = "SELECT * FROM setting ORDER BY set_name ASC";
$settings_assoc_array = $sql->assoc_array($settings_query);
$settings = array();
$settings = array();
foreach ($settings_assoc_array as $value) {
$new_setting = new setting();
$new_setting->set_setting_data_by_id($value['set_id']);
$settings[] = $new_setting;
}
foreach ($settings_assoc_array as $value) {
$new_setting = new setting();
$new_setting->set_setting_data_by_id($value['set_id']);
$settings[] = $new_setting;
}
$smarty->assign('settings',$settings);
$smarty->display('settings.tpl');
$smarty->assign('settings',$settings);
$smarty->display('settings.tpl');

View File

@@ -1,45 +0,0 @@
<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
//use PHPMailer\PHPMailer\PHPMailer;
//use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
//require 'vendor/autoload.php';
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'mail.gginternet.com '; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'hirlevel@tollaslabda.info'; // SMTP username
$mail->Password = 'tollas12'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
//Recipients
$mail->setFrom('from@example.com', 'Mailer');
$mail->addAddress('tricsusz@gmail.com', 'Tóth Richárd'); // Add a recipient
//$mail->addAddress('ellen@example.com'); // Name is optional
//$mail->addReplyTo('info@example.com', 'Information');
//$mail->addCC('cc@example.com');
//$mail->addBCC('bcc@example.com');
//Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}

View File

@@ -1,30 +0,0 @@
<?php
if ($this->is_id()) {
# TÁBORVEZETŐ SZERKESZTÉSE
$ucl = new user_camp_leader();
$ucl->set_user_data_by_id($this->get_id());
$smarty->assign('user', $ucl);
$smarty->display('user_camp_leader_data_edit.tpl');
}
else {
# TÁBORVEZETŐ LISTA
$ucl_assoc_array = $sql->assoc_array("SELECT * FROM user_camp_leader WHERE ucl_deleted = 0 ORDER BY ucl_name ASC;");
$ucl_array = array();
foreach ($ucl_assoc_array as $ucl) {
$new_ucl = new user_camp_leader();
$new_ucl->set_user_data_by_id($ucl['ucl_id']);
$ucl_array[] = $new_ucl;
}
$smarty->assign('ucl_array', $ucl_array);
$smarty->display('user_camp_leader_list.tpl');
}
?>

View File

@@ -1,34 +0,0 @@
<?php
# HA NINCS ID, AKKOR CSOPORTLISTA
if ($this->is_id()) {
# CSOPORT SZERKESZTÉSE /TAGLISTA
$group = new user_group();
$group->set_ug_data_by_id($this->get_id());
$smarty->assign('user_group', $group);
$smarty->display('user_group_data_edit.tpl');
}
else {
# CSOPORT LISTA
$group_query = "SELECT * FROM user_group WHERE ug_deleted = 0 ORDER By ug_name ASC;";
$group_assoc_array = $sql->assoc_array($group_query);
$group_array = array();
foreach ($group_assoc_array as $group) {
$new_ug = new user_group();
$new_ug->set_ug_data_by_id($group['ug_id']);
$group_array[] = $new_ug;
}
$smarty->assign('user_group_array',$group_array);
$smarty->display('user_group_list.tpl');
}
?>

View File

@@ -3,29 +3,27 @@
# HA NINCS ID, AKKOR SEMMI
# HA VAN ID, AKKOR BEFIZETÉS / USER
if ($this->is_id()) {
# USERHEZ TARTOZÓ BEFIZETÉSEK
$user_mod_query = "SELECT * FROM money_deposit WHERE mod_user_kid_uk_id = " . $this->get_id() . " and mod_deleted = 0 ORDER BY mod_date DESC;";
$umod_assoc_array = $sql->assoc_array($user_mod_query);
# USERHEZ TARTOZÓ BEFIZETÉSEK
$user_mod_query = "SELECT * FROM money_deposit JOIN money_income ON mi_id = mod_money_income_mi_id WHERE mod_user_kid_uk_id = " . $this->get_id() . " and mod_deleted = 0 ORDER BY mi_date DESC;";
$umod_assoc_array = $sql->assoc_array($user_mod_query);
$mods = array();
foreach ($umod_assoc_array as $key => $value) {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($value['mod_id']);
$mods[] = $new_mod;
}
$mods = array();
foreach ($umod_assoc_array as $key => $value) {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($value['mod_id']);
$mods[] = $new_mod;
}
$smarty->assign("mod_array", $mods);
$smarty->assign("balance", $sql->single_variable('SELECT uk_balance FROM user_kid WHERE uk_id = ' . $this->get_id()));
$smarty->assign("mod_user_kid_id", $this->get_id());
$smarty->display("view_deposit.tpl");
$smarty->assign("mod_array", $mods);
$smarty->assign("balance", $sql->single_variable('SELECT uk_balance FROM user_kid WHERE uk_id = ' . $this->get_id()));
$smarty->assign("mod_user_kid_id", $this->get_id());
$smarty->display("view_deposit.tpl");
}
else {
# EMPTY
# EMPTY
}
?>
?>

View File

View File

@@ -96,10 +96,10 @@ $smarty->assign('today', date('Y-m-d'));
$smarty->assign('error_msg', $error_msg);
//SQL KAPCSOLAT BEÁLLÍTÁSA
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu') $sql = new sql('bcd_mysql','root','','badminton_coach');
else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$dev = $_SERVER['HTTP_HOST'] == 'badmintoncoach.hu';
$dev = $_SERVER['HTTP_HOST'] == 'badmintoncoach-demo.hu';
//var_dump($sql);

View File

@@ -93,11 +93,6 @@ if (isset($_POST['action'])) {
$uid = $_POST['uk_id'];
unset($_POST['uk_id']);
user_kid::update_user($_POST, $uid);
//filter_update
$kid = new user_kid();
$kid->set_user_data_by_id($uid);
$kid->update_filters();
//filter update end
log::register('update_member', $uid);
header("Location: " . $actual_link);
break;
@@ -114,11 +109,6 @@ if (isset($_POST['action'])) {
//var_dump($_POST);
//die("aaa");
$new_user_id = user_kid::create_user($_POST);
//filter_update
$kid = new user_kid();
$kid->set_user_data_by_id($new_user_id);
$kid->update_filters();
//filter update end
log::register('new_member', $new_user_id);
header("Location: /admin/edit_member/" . $new_user_id);
break;

View File

@@ -133,16 +133,5 @@ setlocale(LC_ALL, 'hu_HU');
}
?>
</body>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72772703-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-72772703-2');
</script>
</html>

View File

@@ -1,109 +0,0 @@
<div class="danger">Probléma, kérdés, hibás adat esetén kérjük, küldjön üzenetet a <a href="mailto:szucs.zoltan@tollaslabda.info">szucs.zoltan@tollaslabda.info</a> címre!</div>
<h1 class="apply">Visszaigazolt jelentkezések</h1>
<p class="center italic">A jelentkezés részleteinek megtekintéséhez kattintson az adatokra!</p>
<div class="outer">
<table class="apply_table">
<tr>
<th>#</th>
<th>Táborozó</th>
<th>Tábor helye, ideje</th>
<th>Jelentkezés ideje</th>
<th>Státusz</th>
<th>Visszaigazolás dátuma</th>
<th>Jelentkezés törlése</th>
</tr>
{if !count($apply_array)}
<tr>
<td colspan="7" class="no_data">Nincs még visszaigazolt jelentkezése</td>
</tr>
{else}
{foreach $apply_array as $apply}
<tr>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_id()}</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_camp_id()->get_camp_city()}
({$short_months[$apply->get_capp_camp_id()->get_camp_from()|date_format:"%m"]}. {$apply->get_capp_camp_id()->get_camp_from()|date_format:"%e"}. -
{if $apply->get_capp_camp_id()->get_camp_from()|date_format:"%m" != $apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"}
{$short_months[$apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"]}.
{/if}
{$apply->get_capp_camp_id()->get_camp_to()|date_format:"%e"}.)</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_date()|substr:0:16}</a>
</td>
<td style="color: {$color}; font-weight: bold;">
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_status()}</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_accept_date()|substr:0:16}</a>
</td>
<td>
<img id="{$apply->get_capp_id()}" onclick="delete_apply(this);" src="/_image/delete.png">
</td>
</tr>
{/foreach}
{/if}
</table>
</div>
<h1 class="apply">Függőben lévő jelentkezések</h1>
<p class="center italic">A jelentkezés részleteinek megtekintéséhez kattintson az adatokra!</p>
<div class="outer">
<table class="apply_table">
<tr>
<th>#</th>
<th>Táborozó</th>
<th>Tábor helye, ideje</th>
<th>Jelentkezés ideje</th>
<th>Jelentkezés törlése</th>
</tr>
{if !count($pending_apply_array)}
<tr>
<td colspan="5" class="no_data">Nincs függőben lévő jelentkezése</td>
</tr>
{else}
{foreach $pending_apply_array as $apply}
<tr>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_id()}</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_camp_id()->get_camp_city()}
({$short_months[$apply->get_capp_camp_id()->get_camp_from()|date_format:"%m"]}. {$apply->get_capp_camp_id()->get_camp_from()|date_format:"%e"}. -
{if $apply->get_capp_camp_id()->get_camp_from()|date_format:"%m" != $apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"}
{$short_months[$apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"]}.
{/if}
{$apply->get_capp_camp_id()->get_camp_to()|date_format:"%e"}.)</a>
</td>
<td>
<a href="/tabor/jelentkezesek/{$apply->get_capp_id()}">{$apply->get_capp_date()|substr:0:16}</a>
</td>
<td>
<img id="{$apply->get_capp_id()}" onclick="delete_apply(this);" src="/_image/delete.png">
</td>
</tr>
{/foreach}
{/if}
</table>
</div>
<script type="text/javascript">
function delete_apply(img) {
var r = confirm("Biztos törli ezt a jelentkezést?");
if (r == true) {
location.href = '/tabor/delete_apply/' + $(img).attr("id");
} else {
return false;
}
}
</script>

View File

@@ -1,227 +0,0 @@
<div class="list">
<h1>Táborozó adatai</h1>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Név:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Születés éve:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_birth_year()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
TAJ-szám:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_ss_number()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
E-mail cím:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_email()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Mobilszám:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_mobile()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tollaslabda múlt:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_badminton_history())}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Sport múlt:
</label>
<div>{$apply->get_capp_camp_kid_ck_id()->get_ck_sport_history()}</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">
<label class="desc">
<img src="/_image/person.png">
Étkezéssel kapcsolatos információk:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_food_info())}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tisztálkodással kapcsolatos információk:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_hygiene_info())}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Egészségügyi információk:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_health_info())}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Rendszeres vagy alkalmi gyógyszerek:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_pharma_info())}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Egyéb információk:
</label>
<div><br>{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_other_info())}</div>
</div>
<h1>Tábor adatok</h1>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tábor helyszíne:
</label>
<div>{$apply->get_capp_camp_id()->get_camp_city()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tábor időpontja:
</label>
<div>
{$apply->get_capp_camp_id()->get_camp_from()|substr:0:4}.
{$months[$apply->get_capp_camp_id()->get_camp_from()|date_format:"%m"]} {$apply->get_capp_camp_id()->get_camp_from()|date_format:"%e"}. -
{if $apply->get_capp_camp_id()->get_camp_from()|date_format:"%m" != $apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"}
{$months[$apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"]}.
{/if}
{$apply->get_capp_camp_id()->get_camp_to()|date_format:"%e"}.
</div>
</div>
{if $page != "tabor"}
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Táborvezető:
</label>
<div>{$apply->get_capp_camp_id()->get_camp_leader()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Segítők:
</label>
<div>{$apply->get_capp_camp_id()->get_camp_helpers()}</div>
</div>
{/if}
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Tábor típus:
</label>
<div>{$apply->get_capp_accomodation_type()->get_cat_name()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Labda típus:
</label>
<div>{$apply->get_capp_shuttle_type()->get_cst_name()}</div>
</div>
<h1>Felelős kapcsolattartó</h1>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Név:
</label>
<div>{$res_cc->get_cc_name()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Mobil:
</label>
<div>{$res_cc->get_cc_mobile()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
E-mail cím:
</label>
<div>{$res_cc->get_cc_email()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Facebook:
</label>
<div>{$res_cc->get_cc_facebook()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Kapcsolat:
</label>
<div>{$res_cc->get_cc_camp_contact_type()->get_cct_name()}</div>
</div>
<h1>További kapcsolattartó(k)</h1>
{foreach $contacts as $res_cc}
<h2>{$res_cc->get_cc_name()}</h2>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Mobil:
</label>
<div>{$res_cc->get_cc_mobile()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
E-mail cím:
</label>
<div>{$res_cc->get_cc_email()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Facebook:
</label>
<div>{$res_cc->get_cc_facebook()}</div>
</div>
<div class="list_item">
<label class="desc">
<img src="/_image/person.png">
Kapcsolat:
</label>
<div>{$res_cc->get_cc_camp_contact_type()->get_cct_name()}</div>
</div>
{/foreach}
</div>

View File

@@ -1,385 +0,0 @@
{if $step == 1}
<div class="form_wrapper">
<form method="post" id="apply_1">
<div><div><h1>1/3. Táborozó adatainak megadása</h1></div></div>
<input type="hidden" name="action" id="action" value="apply_1">
<input type="hidden" name="ck_original_id" id="ck_original_id" value="null">
<input type="hidden" name="ck_owner_id" id="ck_owner_id" value="{$user_login->get_cu_id()}">
<div>
<label class="desc" for="ck_list">Korábban megadott adatok:</label>
<div>
<select name="ck_list" id="ck_list">
<option value="null"> - (új adatok megadása) </option>
{foreach $kids as $kid}
<option value="{$kid->get_ck_id()}">
{$kid->get_ck_name()}
</option>
{/foreach}
</select>
</div>
</div>
<br>
<div>
<label class="desc" for="ck_name">Táborozó neve:</label>
<div><input type="text" name="ck_name" id="ck_name" required></div>
</div>
<div>
<label class="desc" for="ck_birth_year">Születési év:</label>
<div><input type="text" name="ck_birth_year" id="ck_birth_year" required></div>
</div>
<div>
<label class="desc" for="ck_ss_number">TAJ szám:</label>
<div><input type="text" name="ck_ss_number" id="ck_ss_number" required></div>
</div>
<div>
<label class="desc" for="ck_email">E-mail cím:</label>
<div><input type="text" name="ck_email" id="ck_email"></div>
</div>
<div>
<label class="desc" for="ck_mobile">Telefonszám:</label>
<div><input type="text" name="ck_mobile" id="ck_mobile"></div>
</div>
<div>
<label class="desc" for="ck_badminton_history">Tollaslabda múlt:</label>
<div><textarea rows="5" name="ck_badminton_history" id="ck_badminton_history"></textarea></div>
</div>
<div>
<label class="desc" for="ck_sport_history">Sport múlt:</label>
<div><textarea rows="5" name="ck_sport_history" id="ck_sport_history"></textarea></div>
</div>
<div>
<label class="desc" for="ck_list">Pólóméret:</label>
<div>
<select name="ck_shirt_size_id" id="ck_shirt_size_id">
{foreach $shirts as $shirt}
<option value="{$shirt->get_cshirt_id()}">
{$shirt->get_cshirt_name()}
</option>
{/foreach}
</select>
</div>
</div>
<div>
<label class="desc" for="ck_food_info">Étkezéssel kapcsolatos tudnivalók:</label>
<div><textarea rows="5" name="ck_food_info" id="ck_food_info"></textarea></div>
</div>
<div>
<label class="desc" for="ck_hygiene_info">Tisztálkodással kapcsolatos tudnivalók:</label>
<div><textarea rows="5" name="ck_hygiene_info" id="ck_hygiene_info"></textarea></div>
</div>
<div>
<label class="desc" for="ck_health_info">Egészségügyi tudnivalók:</label>
<div><textarea rows="5" name="ck_health_info" id="ck_health_info"></textarea></div>
</div>
<div>
<label class="desc" for="ck_pharma_info">Rendszeres vagy alkalmi gyógyszer:</label>
<div><textarea rows="5" name="ck_pharma_info" id="ck_pharma_info"></textarea></div>
</div>
<div>
<label class="desc" for="ck_other_info">Egyéb tudnivalók:</label>
<div><textarea rows="5" name="ck_other_info" id="ck_other_info"></textarea></div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Tovább a kapcsolattartó adataihoz">
</div>
</div>
</form>
</div>
{elseif $step == 2}
<h1 class="apply">2/3. Kapcsolattartó adatainak megadása</h1>
<p class="center reset"><a href="/tabor/jelentkezes/1">Jelentkezés újrakezdése</a><img src="/_image/delete.png"></p>
<div class="form_wrapper">
<form method="post" id="apply_2">
<input type="hidden" name="action" id="action" value="apply_2">
<input type="hidden" name="camp_apply_id" id="camp_apply_id" value="{$camp_apply_id}">
<input type="hidden" name="cc_original_id" id="cc_original_id" value="null">
<input type="hidden" name="cc_owner_id" id="cc_owner_id" value="{$user_login->get_cu_id()}">
<input type="hidden" name="add_more" id="add_more" value="0">
<div>
<label class="desc" for="ck_list">Korábban megadott adatok:</label>
<div>
<select name="cc_list" id="cc_list">
<option value="null"> - (új adatok megadása) </option>
{foreach $contacts as $contact}
<option value="{$contact->get_cc_id()}">
{$contact->get_cc_name()}
</option>
{/foreach}
</select>
</div>
</div>
<br>
<div>
<label class="desc" for="cc_name">Kapcsolattartó neve:</label>
<div><input type="text" name="cc_name" id="cc_name" required></div>
</div>
{if !$has_responsible}
<div>
<label class="desc" for="cc_is_responsible">Felelős kapcsolattartó (Táborozónként 1 felelős kapcsolattartó megadása kötelező!):</label>
<div><input type="checkbox" name="cc_is_responsible" id="cc_is_responsible" value="1" checked></div>
</div>
{/if}
<div>
<label class="desc" for="cc_mobile">Telefonszám:</label>
<div><input type="text" name="cc_mobile" id="cc_mobile" required></div>
</div>
<div>
<label class="desc" for="cc_email">E-mail cím:</label>
<div><input type="text" name="cc_email" id="cc_email" required></div>
</div>
<div>
<label class="desc" for="cc_facebook">Facebook:</label>
<div><input type="text" name="cc_facebook" id="cc_facebook"></div>
</div>
<div>
<label class="desc" for="ck_list">Kapcsolat a Táborozóval:</label>
<div>
<select name="cc_camp_contact_type_cct_id" id="cc_camp_contact_type_cct_id">
{foreach $cct_array as $cct}
<option value="{$cct->get_cct_id()}">
{$cct->get_cct_name()}
</option>
{/foreach}
<option value="new">- új megadása -</option>
</select>
</div>
<div id="cct_extra_row"><input type="text" name="cct_add_new" id="cct_add_new" placeholder="Új kapcsolat megadása"></div>
</div>
<div>
<div>
<button class="button black" id="add_more_cct">Mentés és új kapcsolattartó hozzáadása</button>
</div>
{if $has_contact}
<div>
<button class="button black" id="move_next">Továbblépés mentés nélkül</button>
</div>
{/if}
<div>
<input class="button black" type="submit" value="Mentés és tovább a tábor adatok megadásához">
</div>
</div>
</form>
</div>
{elseif $step == 3}
<div><h1>2/3. Kapcsolattartó adatainak megadása</h1></div>
<div class="danger">Ön nem adott meg felelős kapcsolattartót. Kérjük, a jelentkezéshez válasszon ki 1 felelős kapcsolattartót!</div>
<form method="post" id="apply_3">
<input type="hidden" name="action" id="action" value="apply_3">
<input type="hidden" name="camp_apply_id" id="camp_apply_id" value="{$camp_apply_id}">
<table>
{foreach $contacts as $contact}
<tr>
<td>{$contact->get_cc_name()}</td>
<td><input type="radio" name="cc_is_responsible" value="{$contact->get_cc_id()}" {if $contact@first} checked{/if}></td>
</tr>
{/foreach}
</table>
<div>
<input class="button black middle" type="submit" value="Tovább a tábor adatok megadásához">
</div>
</form>
{elseif $step == 4}
<div><h1>3/3. Tábor kiválasztása</h1></div>
<p class="center reset"><a href="/tabor/jelentkezes/1">Jelentkezés újrakezdése</a><img src="/_image/delete.png"></p>
<form method="post" id="apply_4">
<input type="hidden" name="action" id="action" value="apply_4">
<input type="hidden" name="camp_apply_id" id="camp_apply_id" value="{$camp_apply_id}">
<table>
{foreach $camp_array as $camp}
<td>{$camp->get_camp_city()}</td>
<td>({$short_months[$camp->get_camp_from()|date_format:"%m"]}. {$camp->get_camp_from()|date_format:"%e"}. -
{if $camp->get_camp_from()|date_format:"%m" != $camp->get_camp_to()|date_format:"%m"}
{$short_months[$camp->get_camp_to()|date_format:"%m"]}.
{/if}
{$camp->get_camp_to()|date_format:"%e"}.{if $camp->get_camp_type()->get_ct_name() != " "}, {$camp->get_camp_type()->get_ct_name()}{/if})</td>
<td><input id="camp_{$camp->get_camp_id()}" class="camp_id" type="radio" name="camp_id" value="{$camp->get_camp_id()}" {if $camp@first} checked{/if}></td>
</tr>
{/foreach}
</table>
<div id="accom_list"></div>
<div id="shuttle_list"></div>
<table class="accept_terms_box">
<tr>
<td>Kijelentem, hogy minden, az edzőtábor szempontjából fontos információt megadtam, a gyerek egyesületének edzőjét az edzőtáborról tájékoztattam.</td>
<td><input type="checkbox" name="accept_terms" id="accept_terms"></td>
</tr>
</table>
<table class="accept_terms_box">
<tr>
<td>Kérjük, a tábor kezdetére hozzák magukkal a táborozó egészégügyi igazolását! Ehhez mintát az <a href="http://www.janoczki.hu/doc/szuloi_nyilatkozat_taborozashoz.pdf" target="_blank">alábbi linken</a> talál.</td>
</tr>
</table>
<div>
<input id="submit_apply" class="button apply middle" type="submit" value="Jelentkezés leadása" disabled="disabled">
</div>
</form>
<script type="text/javascript">
$( document ).ready(function() {
$('.camp_id:checked').trigger('change');
});
</script>
{elseif $step == 5}
<h1>Jelentkezését sikeresen rögzítettük!</h1><br><br>
<h2>A jelentkezés állapotát a 'Korábbi jelentkezések' menüpont alatt tekintheti meg!
{/if}
<script type="text/javascript">
$("#cc_camp_contact_type_cct_id" ).change(function() {
if ($(this).val() == 'new') {
$("#cct_extra_row" ).show();
}
else {
$("#cct_extra_row" ).hide();
}
});
$("#add_more_cct" ).click(function() {
$("#add_more").val('1');
$("#apply_2").submit();
});
$("#move_next" ).click(function() {
location.href = "/tabor/move_next";
});
$(".camp_id").change(function() {
$.post("/_ajax/get_camp_shuttle_list.php",
{
camp_id: $(this).val()
},
function(data, status){
var pdata = JSON.parse(data);
console.log(pdata);
if (pdata.length >= 2) {
var content = '<h2>Kérjük, válassza ki a Táborozó által előnyben részesített labda típust!</h2><table>';
$.each(pdata, function(shuttle_id, shuttle_name){
content +=
'\
<tr>\
<td>'+shuttle_name['cst_name']+'</td>\
<td><input type="radio" name="camp_shuttle" value="'+shuttle_name['cst_id']+ '"' + (shuttle_id==0?' checked':'') +'></td>\
</tr>\
'
});
content += '</table>';
}
else {
content = '<input type="hidden" name="camp_shuttle" value="'+pdata[0]['cst_id']+'">';
}
document.getElementById('shuttle_list').innerHTML = content;
});
$.post("/_ajax/get_camp_accomodation_list.php",
{
camp_id: $(this).val()
},
function(data, status){
var pdata = JSON.parse(data);
console.log(pdata);
if (pdata.length >= 2) {
var content = '<h2>Kérjük, válassza ki a tábor típusát!</h2><table>';
$.each(pdata, function(accom_id, accom_data){
content +=
'\
<tr>\
<td>'+accom_data['cat_name']+'</td>\
<td><input type="radio" name="camp_accomodation" value="'+accom_data['cat_id']+ '"' + (accom_id==0?' checked':'') +'></td>\
</tr>\
'
});
content += '</table>';
}
else {
content = '<input type="hidden" name="camp_accomodation" value="'+pdata[0]['cat_id']+'">';
}
document.getElementById('accom_list').innerHTML = content;
});
});
$("#ck_list").change(function() {
if ($("#ck_list").val() == 'null') {
document.getElementById("apply_1").reset();
}
else {
$.post("/_ajax/get_camp_kid_data.php",
{
camp_kid_id: $(this).val()
},
function(data, status){
var pdata = JSON.parse(data);
//console.log(pdata);
$.each(pdata[0], function(index, ck_data){
if (
index != 'ck_deleted' &&
index != 'ck_id' &&
index != 'ck_original_id' &&
index != 'ck_owner_id'
) {
$("#"+index).val(ck_data);
}
});
});
}
});
$("#cc_list").change(function() {
if ($("#cc_list").val() == 'null') {
document.getElementById("apply_2").reset();
}
else {
$.post("/_ajax/get_camp_contact_data.php",
{
camp_contact_id: $(this).val()
},
function(data, status){
var pdata = JSON.parse(data);
//console.log(pdata);
$.each(pdata[0], function(index, ck_data){
if (
index != 'cc_id' &&
index != 'cc_original_id' &&
index != 'cc_owner_id'
) {
$("#"+index).val(ck_data);
}
});
});
}
});
$("#accept_terms").change(function() {
if ($("#accept_terms").is(':checked')) {
$("#submit_apply").prop('disabled', false);
}
else {
$("#submit_apply").prop('disabled', true);
}
});
</script>

View File

@@ -1,71 +0,0 @@
<div class="form_wrapper">
<form method="post">
<input type="hidden" name="action" value="camp_create">
<div>
<label class="desc" for="camp_city">Helyszín:</label>
<div><input type="text" name="camp_city" id="camp_city" required></div>
</div>
<div>
<label class="desc" for="camp_from">Tábor kezdete:</label>
<div><input type="text" name="camp_from" id="camp_from" required></div>
</div>
<div>
<label class="desc" for="camp_to">Tábor vége:</label>
<div><input type="text" name="camp_to" id="camp_to" required></div>
</div>
<div>
<label class="desc" for="camp_leader">Táborvezető:</label>
<div><input type="text" name="camp_leader" id="camp_leader"></div>
</div>
<div>
<label class="desc" for="camp_helpers">Segítők:</label>
<div><input type="text" name="camp_helpers" id="camp_helpers"></div>
</div>
<div>
<label class="desc" for="camp_is_open">Lehet jelentkezni:</label>
<div><input type="checkbox" name="camp_is_open" id="camp_is_open" value="1" checked></div>
</div>
<div>
<label class="desc" for="camp_camp_type_ct_id">Típus:</label>
<div>
<select name="camp_camp_type_ct_id" id="camp_camp_type_ct_id">
{foreach $camp_type_array as $camp_type}
<option value="{$camp_type->get_ct_id()}">
{$camp_type->get_ct_name()}
</option>
{/foreach}
</select>
</div>
</div>
<div>
<label class="desc" for="shuttles">Labda típus:</label>
<table>
{foreach $shuttle_array as $shuttle}
<tr>
<td><input type="checkbox" name="shuttles[]" value="{$shuttle->get_cst_id()}" class="coach_type"></td>
<td class="coach">{$shuttle->get_cst_name()}</td>
</tr>
{/foreach}
</table>
</div>
<div>
<label class="desc" for="shuttles">Bejárás típusa:</label>
<table>
{foreach $accomodation_array as $accomodation}
<tr>
<td><input type="checkbox" name="accomodations[]" value="{$accomodation->get_cat_id()}" class="coach_type"></td>
<td class="coach">{$accomodation->get_cat_name()}</td>
</tr>
{/foreach}
</table>
</div>
<div>
<div>
<input class="button black" type="submit" value="Létrehozás">
</div>
</div>
</form>
</div>

View File

@@ -1,195 +0,0 @@
<div class="form_wrapper">
<form method="post">
<div class="buttons">
<a href="/admin/delete_camp/{$camp->get_camp_id()}" class="addbutton delete-big">Tábor törlése</a>
</div>
<input type="hidden" name="action" value="camp_update">
<input type="hidden" name="camp_id" value="{$camp->get_camp_id()}">
<div>
<label class="desc" for="camp_city">Helyszín:</label>
<div><input type="text" name="camp_city" id="camp_city" value="{$camp->get_camp_city()}" required></div>
</div>
<div>
<label class="desc" for="camp_from">Tábor kezdete:</label>
<div><input type="text" name="camp_from" id="camp_from" value="{$camp->get_camp_from()}" required></div>
</div>
<div>
<label class="desc" for="camp_to">Tábor vége:</label>
<div><input type="text" name="camp_to" id="camp_to" value="{$camp->get_camp_to()}" required></div>
</div>
<div>
<label class="desc" for="camp_leader">Táborvezető:</label>
<div><input type="text" name="camp_leader" id="camp_leader" value="{$camp->get_camp_leader()}"></div>
</div>
<div>
<label class="desc" for="camp_helpers">Segítők:</label>
<div><input type="text" name="camp_helpers" id="camp_helpers" value="{$camp->get_camp_helpers()}"></div>
</div>
<div>
<label class="desc" for="camp_is_open">Lehet jelentkezni:</label>
<div><input type="checkbox" name="camp_is_open" id="camp_is_open" value="1" {if 1==$camp->get_camp_is_open()}checked{/if}></div>
</div>
<div>
<label class="desc" for="camp_camp_type_ct_id">Típus:</label>
<div>
<select name="camp_camp_type_ct_id" id="camp_camp_type_ct_id">
{foreach $camp_type_array as $camp_type}
<option value="{$camp_type->get_ct_id()}" {if $camp->get_camp_camp_type_ct_id() == $camp_type->get_ct_id()}selected{/if}>
{$camp_type->get_ct_name()}
</option>
{/foreach}
</select>
</div>
</div>
<div>
<label class="desc" for="shuttles">Labda típus:</label>
<table>
{foreach $shuttle_array as $shuttle}
<tr>
<td><input type="checkbox" name="shuttles[]" value="{$shuttle->get_cst_id()}" class="coach_type" {if in_array($shuttle->get_cst_id(), $shuttles)}checked{/if}></td>
<td class="coach">{$shuttle->get_cst_name()}</td>
</tr>
{/foreach}
</table>
</div>
<div>
<label class="desc" for="shuttles">Bejárás típusa:</label>
<table>
{foreach $accomodation_array as $accomodation}
<tr>
<td><input type="checkbox" name="accomodations[]" value="{$accomodation->get_cat_id()}" class="coach_type" {if in_array($accomodation->get_cat_id(), $accomodations)}checked{/if}></td>
<td class="coach">{$accomodation->get_cat_name()}</td>
</tr>
{/foreach}
</table>
</div>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form>
</div>
<br><br>
<h1 class="apply" id="applies">Függőben lévő jelentkezések</h1>
<div class="outer">
<table class="apply_table">
<tr>
<th>#</th>
<th>Jelentkező</th>
<th>Jelentkezés ideje</th>
<th>Elfogadás</th>
<th>Elutasítás</th>
<th>E-mail</th>
</tr>
{if !count($pending_apply_array)}
<tr>
<td colspan="6" class="no_data">Nincs függőben lévő jelentkezés</td>
</tr>
{else}
{foreach $pending_apply_array as $apply}
<tr>
<td>
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>
</td>
<td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</td>
<td>
{$apply->get_capp_date()|substr:0:16}
</td>
<td>
<a href="/admin/accept_apply/{$apply->get_capp_id()}"><img src="/_image/tick.png"></a>
</td>
<td>
<a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
</td>
<td>
<a href='mailto:{$apply->get_responsible_contact()->get_cc_email()}?subject=Tollaslabda tábor {$camp->get_camp_from()|substr:0:4}. {$months[$camp->get_camp_from()|date_format:"%m"]} {$camp->get_camp_from()|date_format:"%e"}. - {if $camp->get_camp_from()|date_format:"%m" != $camp->get_camp_to()|date_format:"%m"} {$months[$camp->get_camp_to()|date_format:"%m"]}.{/if}{$camp->get_camp_to()|date_format:"%e"}.
&body=Kedves {$apply->get_responsible_contact()->get_cc_name()}!'>{$apply->get_responsible_contact()->get_cc_email()}</a>
</td>
</tr>
{/foreach}
{/if}
</table>
</div>
{if count($deleted_apply_array)}
<h1 class="apply">Törölt jelentkezések</h1>
<div class="outer">
<table class="apply_table">
<tr>
<th>#</th>
<th>Jelentkező</th>
<th>Törlés ideje</th>
<th>Eltávolítás a listából</th>
</tr>
{foreach $deleted_apply_array as $apply}
<tr>
<td class="bold">
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>
</td>
<td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</td>
<td>
{$apply->get_capp_accept_date()|substr:0:16}
</td>
<td>
<a href="/admin/remove_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
</td>
</tr>
{/foreach}
</table>
</div>
{/if}
<h1 class="apply">Visszaigazolt jelentkezések ({count($camp->get_camp_applies())} fő)</h1>
<div class="outer">
<table class="apply_table">
<tr>
<th>#</th>
<th>Jelentkező</th>
<th>Jelentkezés ideje</th>
<th>Státusz</th>
<th>Visszaigazolva</th>
<th>Módosítás</th>
</tr>
{if !count($apply_array)}
<tr>
<td colspan="6" class="no_data">Nincs még visszaigazolt jelentkezés</td>
</tr>
{else}
{foreach $apply_array as $apply}
<tr>
<td class="bold">
<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>
</td>
<td>
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</td>
<td>
{$apply->get_capp_date()|substr:0:16}
</td>
<td style="color: {if $apply->get_capp_status() == 'Elfogadva'}green{else}red{/if}; font-weight: bold;">
{$apply->get_capp_status()}
</td>
<td>
{$apply->get_capp_accept_date()|substr:0:16}
</td>
<td>
{if $apply->get_capp_status() == 'Elutasítva'}
<a href="/admin/accept_apply/{$apply->get_capp_id()}"><img src="/_image/tick.png"></a>
{else}
<a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
{/if}
</td>
</tr>
{/foreach}
{/if}
</table>
</div>

View File

@@ -1,65 +0,0 @@
<div class="list full_width camp_list">
{foreach $camps as $camp}
<span onclick="block_action('camp_'+{$camp->get_camp_id()})" class="date_separator clickable">
{$camp->get_camp_from()|substr:0:4}.
{$months[$camp->get_camp_from()|date_format:"%m"]} {$camp->get_camp_from()|date_format:"%e"}. -
{if $camp->get_camp_from()|date_format:"%m" != $camp->get_camp_to()|date_format:"%m"}
{$months[$camp->get_camp_to()|date_format:"%m"]}.
{/if}
{$camp->get_camp_to()|date_format:"%e"}., {$camp->get_camp_type()->get_ct_name()}
({$camp->get_camp_city()})
<img src="/_image/open_folder.png">
<div class="float_right">
{count($camp->get_camp_applies())} fő &nbsp;&nbsp;
</div>
</span>
<div id="camp_{$camp->get_camp_id()}" class="month_block">
{foreach $camp->get_camp_applies() as $apply}
<a href="/{if $page == 'admin'}admin{else}taborvezeto{/if}/{if $page == 'admin'}apply{else}jelentkezes{/if}/{$apply->get_capp_id()}">
<div class="list_item">
<img src="/_image/person.png">
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
</div>
</a>
{/foreach}
</div>
{/foreach}
</div>
<script>
function open_block(block_id) {
$("#"+block_id).slideDown("slow");
}
function close_block(block_id) {
$("#"+block_id).slideUp("slow");
}
function block_action(block_id) {
if ($("#"+block_id).is(':hidden')) {
open_block(block_id);
}
else {
close_block(block_id);
}
}
$( document ).ready(function() {
var divs = $( "div[class=month_block]" );
$( ".list" ).find( divs ).hide();
var div_list = $( ".list" ).find( divs );
//open_block(div_list[0].id);
});
</script>

Some files were not shown because too many files have changed in this diff Show More