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

@@ -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;