This commit is contained in:
Tóth Richárd
2018-10-18 23:50:57 +02:00
parent 59c984dd9b
commit 19aaa4a770
15 changed files with 8753 additions and 1653 deletions

View File

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

138
_class/class_OAuth.php Normal file
View File

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

4483
_class/class_PHPMailer.php Normal file

File diff suppressed because it is too large Load Diff

419
_class/class_POP3.php Normal file
View File

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

1326
_class/class_SMTP.php Normal file

File diff suppressed because it is too large Load Diff

187
_class/class_email_log.php Normal file
View File

@@ -0,0 +1,187 @@
<?php
class email_log {
private $el_id;
private $el_message;
private $el_subject;
private $el_from_name;
private $el_from_email;
private $el_sent_date;
private $el_exception;
private $el_email_template_et_id;
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_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_from_name()
{
return $this->el_from_name;
}
/**
* @param mixed $el_from_name
*
* @return self
*/
public function set_el_from_name($el_from_name)
{
$this->el_from_name = $el_from_name;
return $this;
}
/**
* @return mixed
*/
public function get_el_from_email()
{
return $this->el_from_email;
}
/**
* @param mixed $el_from_email
*
* @return self
*/
public function set_el_from_email($el_from_email)
{
$this->el_from_email = $el_from_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

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,33 +1,119 @@
<?php <?php
# EDZÉS ZÁROLÁS # EDZÉS ZÁROLÁS
if ($this->is_id()) { if ($this->is_id()) {
# EDZÉS ZÁROLÁS/FELOLDÁS # EDZÉS ZÁROLÁS/FELOLDÁS
$locked = $sql->single_variable('select tr_locked from training where tr_id =' . $this->get_id()); $locked = $sql->single_variable('select tr_locked from training where tr_id =' . $this->get_id());
$sql->update_table('training', array( /*
'tr_locked' => ($locked?0:1) $sql->update_table('training', array(
), 'tr_locked' => ($locked?0:1)
array( ),
'tr_id' => $this->get_id() array(
) 'tr_id' => $this->get_id()
); )
log::register(($locked?'training_open':'training_close'), $this->get_id()); );
header('Location: /admin/presence/' . $this->get_id()); log::register(($locked?'training_open':'training_close'), $this->get_id());
*/
//SEND NOTIFICATION
if (!$locked) {
//get kids from training
$kid_ids = $sql->assoc_array('SELECT pr_user_kid_uk_id FROM presence WHERE pr_training_tr_id = ' . $this->get_id());
//iterate and collect them
$kid_array = array();
foreach ($kid_ids as $k_array) {
$kid = new user_kid();
$kid->set_user_data_by_id($k_array['pr_user_kid_uk_id']);
$kid->update_balance();
if (null === $kid->get_uk_last_notification() && null !== $kid->get_uk_notify_email() && $kid->get_uk_balance() < 0) {
$kid_array[] = $kid;
}
elseif (null !== $kid->get_uk_last_notification() && null !== $kid->get_uk_notify_email() && $kid->get_uk_balance() < 0) {
$notify_hours = $sql->single_variable(' SELECT
setv_int
FROM
setting_value
JOIN
setting ON setv_setting_set_id = set_id
WHERE
set_name = "Értesítések közt eltelt idő";
;');
if (null !== $notify_hours) {
$timestamp = strtotime($kid->get_uk_last_notification()) + $notify_hours*60;
$expireDate = date('Y-m-d H:i:s', $timestamp);
if (time() >= $timestamp) {
$kid_array[] = $kid;
}
}
}
}
//send email
$email_template_id = $sql->single_variable('select et_id from email_template where et_name = \'below_zero\'');
if (null !== $email_template_id) {
$emailTemplate = new email_template();
$emailTemplate->set_et_data_by_id($email_template_id);
$raw_subject = $emailTemplate->get_et_subject();
$raw_message = $emailTemplate->get_et_message();
foreach ($kid_array as $kid) {
$personalizedSubject = $emailTemplate->personalize($raw_subject, array(
'uk_name' => $kid->get_uk_name(),
));
$personalizedMessage = $emailTemplate->personalize($raw_message, array(
'notify_name' => $kid->get_uk_notify_name(),
'uk_name' => $kid->get_uk_name(),
'uk_balance' => $kid->get_uk_balance(),
'uk_password' => $kid->get_uk_password(),
));
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'mail.gginternet.com '; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'hirlevel@tollaslabda.info'; // SMTP username
$mail->Password = 'tollas12'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
//Recipients
$mail->setFrom($emailTemplate->get_et_from_email(), $emailTemplate->get_et_from_name());
$mail->addBCC('tricsusz@gmail.com', 'Tóth Richárd'); // TEST
$mail->addBCC($kid->get_uk_notify_email(), $kid->get_uk_notify_name());
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $personalizedSubject;
$mail->Body = $personalizedMessage;
$mail->AltBody = 'Az Ön levelezője nem támogatja a HTML tartalom megjelenítését!';
//$mail->send();
//LOG SUCCESS
} catch (Exception $e) {
//LOG ERROR
}
}
}
}
//header('Location: /admin/presence/' . $this->get_id());
} }
else {
# NEM LEHET
}
?> ?>

View File

@@ -8,11 +8,7 @@
$user->set_user_data_by_id($value['uk_id']); $user->set_user_data_by_id($value['uk_id']);
$action_list_query = "
# EDZÉS LISTA
$action_list_query = "
SELECT SELECT
object_id, object_id,
timestamp(object_date) as object_date, timestamp(object_date) as object_date,

View File

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

View File

@@ -1,281 +1,293 @@
<div class="form_wrapper"> <div class="form_wrapper">
<form method="post"> <form method="post">
<input type="hidden" name="action" id="action" value="user_data_create"> <input type="hidden" name="action" id="action" value="user_data_create">
<div> <div>
<label class="desc" for="uk_name">Név:</label> <label class="desc" for="uk_name">Név:</label>
<div><input type="text" name="uk_name" id="uk_name" size="8" class="field text fn" required></div> <div><input type="text" name="uk_name" id="uk_name" size="8" class="field text fn" required></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_is_active">Aktív:</label> <label class="desc" for="uk_is_active">Aktív:</label>
<div><input type="checkbox" name="uk_is_active" id="uk_is_active" value="1" checked></div> <div><input type="checkbox" name="uk_is_active" id="uk_is_active" value="1" checked></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_last_modified">Utolsó módosítás dátuma:</label> <label class="desc" for="uk_last_modified">Utolsó módosítás dátuma:</label>
<div><input type="text" name="uk_last_modified" id="uk_last_modified" value="{$today}"></div> <div><input type="text" name="uk_last_modified" id="uk_last_modified" value="{$today}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_password">Jelszó:</label> <label class="desc" for="uk_password">Jelszó:</label>
<div><input type="text" name="uk_password" id="uk_password"></div> <div><input type="text" name="uk_password" id="uk_password"></div>
</div> </div>
<div> <div>
<legend class="desc" for="uk_gender">Nem: </legend> <legend class="desc" for="uk_gender">Nem: </legend>
<div> <div>
<input id="r_01" type="radio" name="uk_gender" value="1" checked> <input id="r_01" type="radio" name="uk_gender" value="1" checked>
<label class="choice" for="r_01">Fiú</label> <label class="choice" for="r_01">Fiú</label>
</div> </div>
<div> <div>
<input id="r_02" type="radio" name="uk_gender" value="2"> <input id="r_02" type="radio" name="uk_gender" value="2">
<label class="choice" for="r_02">Lány</label> <label class="choice" for="r_02">Lány</label>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_birth_date">Születési dátum:</label> <label class="desc" for="uk_birth_date">Születési dátum:</label>
<div><input type="text" name="uk_birth_date" id="uk_birth_date"></div> <div><input type="text" name="uk_birth_date" id="uk_birth_date"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_birth_year">Születési év:</label> <label class="desc" for="uk_birth_year">Születési év:</label>
<div><input type="text" name="uk_birth_year" id="uk_birth_year"></div> <div><input type="text" name="uk_birth_year" id="uk_birth_year"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_address_scc_id">Lakhely (település):</label> <label class="desc" for="uk_address_scc_id">Lakhely (település):</label>
<div> <div>
<select name="uk_address_scc_id" id="uk_address_scc_id"> <select name="uk_address_scc_id" id="uk_address_scc_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $school_city_assoc_array as $school_city_array} {foreach $school_city_assoc_array as $school_city_array}
<option value="{$school_city_array->get_scc_id()}"> <option value="{$school_city_array->get_scc_id()}">
{$school_city_array->get_scc_city()} {$school_city_array->get_scc_city()}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_first_training">Első edzés dátuma:</label> <label class="desc" for="uk_first_training">Első edzés dátuma:</label>
<div><input type="text" name="uk_first_training" id="uk_first_training"></div> <div><input type="text" name="uk_first_training" id="uk_first_training"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_beforehand">Előzmény:</label> <label class="desc" for="uk_beforehand">Előzmény:</label>
<div><input type="text" name="uk_beforehand" id="uk_beforehand"></div> <div><input type="text" name="uk_beforehand" id="uk_beforehand"></div>
</div> </div>
<div> <div>
<legend class="desc" for="uk_hand">Kéz: </legend> <legend class="desc" for="uk_hand">Kéz: </legend>
<div> <div>
<input id="r_03" type="radio" name="uk_hand" value="1"> <input id="r_03" type="radio" name="uk_hand" value="1">
<label class="choice" for="r_03">Bal</label> <label class="choice" for="r_03">Bal</label>
</div> </div>
<div> <div>
<input id="r_04" type="radio" name="uk_hand" value="2" checked> <input id="r_04" type="radio" name="uk_hand" value="2" checked>
<label class="choice" for="r_04">Jobb</label> <label class="choice" for="r_04">Jobb</label>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_level">Szint:</label> <label class="desc" for="uk_level">Szint:</label>
<div><input type="text" name="uk_level" id="uk_level"></div> <div><input type="text" name="uk_level" id="uk_level"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_email">E-mail cím:</label> <label class="desc" for="uk_email">E-mail cím:</label>
<div><input type="email" name="uk_email" id="uk_email"></div> <div><input type="email" name="uk_email" id="uk_email"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_phone">Telefonszám:</label> <label class="desc" for="uk_phone">Telefonszám:</label>
<div><input type="text" name="uk_phone" id="uk_phone"></div> <div><input type="text" name="uk_phone" id="uk_phone"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_facebook">Facebook:</label> <label class="desc" for="uk_facebook">Facebook:</label>
<div><input type="text" name="uk_facebook" id="uk_facebook"></div> <div><input type="text" name="uk_facebook" id="uk_facebook"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_shirt_size_ss_id">Pólóméret:</label> <label class="desc" for="uk_shirt_size_ss_id">Pólóméret:</label>
<div> <div>
<select name="uk_shirt_size_ss_id" id="uk_shirt_size_ss_id"> <select name="uk_shirt_size_ss_id" id="uk_shirt_size_ss_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $shirt_size_assoc_array as $shirt_size_array} {foreach $shirt_size_assoc_array as $shirt_size_array}
<option value="{$shirt_size_array.shirt_id}"> <option value="{$shirt_size_array.shirt_id}">
{$shirt_size_array.shirt_name} {$shirt_size_array.shirt_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_shirt_note">Póló megjegyzés:</label> <label class="desc" for="uk_shirt_note">Póló megjegyzés:</label>
<div><input type="text" name="uk_shirt_note" id="uk_shirt_note"></div> <div><input type="text" name="uk_shirt_note" id="uk_shirt_note"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_balance_transfer">Áthozat (Ft):</label> <label class="desc" for="uk_balance_transfer">Áthozat (Ft):</label>
<div><input type="text" name="uk_balance_transfer" id="uk_balance_transfer"></div> <div><input type="text" name="uk_balance_transfer" id="uk_balance_transfer"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_school_sc_id">Iskola neve:</label> <label class="desc" for="uk_school_sc_id">Iskola neve:</label>
<div> <div>
<select name="uk_school_sc_id" id="uk_school_sc_id"> <select name="uk_school_sc_id" id="uk_school_sc_id">
<option value="null"> - (állítsd erre új iskola felvételéhez)</option> <option value="null"> - (állítsd erre új iskola felvételéhez)</option>
{foreach $school_assoc_array as $school_array} {foreach $school_assoc_array as $school_array}
<option value="{$school_array->get_sc_id()}"> <option value="{$school_array->get_sc_id()}">
{$school_array->get_sc_name()} {$school_array->get_sc_name()}
{if $school_array->get_sc_school_city()}({$school_array->get_sc_school_city()->get_scc_city()}){/if} {if $school_array->get_sc_school_city()}({$school_array->get_sc_school_city()->get_scc_city()}){/if}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_school"> <div class="add_school">
<label class="desc" for="add_school">Új iskola neve:</label> <label class="desc" for="add_school">Új iskola neve:</label>
<div><input type="text" name="add_school" id="add_school"></div> <div><input type="text" name="add_school" id="add_school"></div>
</div> </div>
<div class="add_school"> <div class="add_school">
<label class="desc" for="uk_school_city_scc_id">Új iskola települése:</label> <label class="desc" for="uk_school_city_scc_id">Új iskola települése:</label>
<div> <div>
<select name="uk_school_city_scc_id" id="uk_school_city_scc_id"> <select name="uk_school_city_scc_id" id="uk_school_city_scc_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $school_city_assoc_array as $school_city_array} {foreach $school_city_assoc_array as $school_city_array}
<option value="{$school_city_array->get_scc_id()}"> <option value="{$school_city_array->get_scc_id()}">
{$school_city_array->get_scc_city()} {$school_city_array->get_scc_city()}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_region_reg_id">Diákolimpia körzet:</label> <label class="desc" for="uk_region_reg_id">Diákolimpia körzet:</label>
<div> <div>
<select name="uk_region_reg_id" id="uk_region_reg_id"> <select name="uk_region_reg_id" id="uk_region_reg_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $region_assoc_array as $region_array} {foreach $region_assoc_array as $region_array}
<option value="{$region_array.reg_id}"> <option value="{$region_array.reg_id}">
{$region_array.reg_name} {$region_array.reg_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_age_category">Diákolimpia korcsoport:</label> <label class="desc" for="uk_age_category">Diákolimpia korcsoport:</label>
<div><input type="text" name="uk_age_category" id="uk_age_category"></div> <div><input type="text" name="uk_age_category" id="uk_age_category"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_official_age_category">MTLSz korosztály:</label> <label class="desc" for="uk_official_age_category">MTLSz korosztály:</label>
<div><input type="text" name="uk_official_age_category" id="uk_official_age_category"></div> <div><input type="text" name="uk_official_age_category" id="uk_official_age_category"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_parent_1">Szülő:</label> <label class="desc" for="uk_parent_1">Szülő:</label>
<div> <div>
<select name="uk_parent_1" id="uk_parent_1"> <select name="uk_parent_1" id="uk_parent_1">
<option value="null"> - (állítsd erre új szülő felvételéhez)</option> <option value="null"> - (állítsd erre új szülő felvételéhez)</option>
{foreach $parent_assoc_array as $parent_array} {foreach $parent_assoc_array as $parent_array}
<option value="{$parent_array.up_id}"> <option value="{$parent_array.up_id}">
{$parent_array.up_name} {$parent_array.up_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_parent_1_block"> <div class="add_parent_1_block">
<label class="desc" for="add_parent_1">Új szülő neve:</label> <label class="desc" for="add_parent_1">Új szülő neve:</label>
<div><input type="text" name="add_parent_1" id="add_parent_1"></div> <div><input type="text" name="add_parent_1" id="add_parent_1"></div>
</div> </div>
<div class="add_parent_1_block"> <div class="add_parent_1_block">
<label class="desc" for="parent_1_email">E-mail cím:</label> <label class="desc" for="parent_1_email">E-mail cím:</label>
<div><input type="text" name="parent_1_email" id="parent_1_email"></div> <div><input type="text" name="parent_1_email" id="parent_1_email"></div>
</div> </div>
<div class="add_parent_1_block"> <div class="add_parent_1_block">
<label class="desc" for="parent_1_phone">Telefonszám:</label> <label class="desc" for="parent_1_phone">Telefonszám:</label>
<div><input type="text" name="parent_1_phone" id="parent_1_phone"></div> <div><input type="text" name="parent_1_phone" id="parent_1_phone"></div>
</div> </div>
<div class="add_parent_1_block"> <div class="add_parent_1_block">
<label class="desc" for="parent_1_facebook">Facebook:</label> <label class="desc" for="parent_1_facebook">Facebook:</label>
<div><input type="text" name="parent_1_facebook" id="parent_1_facebook"></div> <div><input type="text" name="parent_1_facebook" id="parent_1_facebook"></div>
</div> </div>
<div> <div>
<label class="desc" id="title2" for="uk_parent_2">Szülő:</label> <label class="desc" id="title2" for="uk_parent_2">Szülő:</label>
<div> <div>
<select name="uk_parent_2" id="uk_parent_2"> <select name="uk_parent_2" id="uk_parent_2">
<option value="null"> - (állítsd erre új szülő felvételéhez)</option> <option value="null"> - (állítsd erre új szülő felvételéhez)</option>
{foreach $parent_assoc_array as $parent_array} {foreach $parent_assoc_array as $parent_array}
<option value="{$parent_array.up_id}"> <option value="{$parent_array.up_id}">
{$parent_array.up_name} {$parent_array.up_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_parent_2_block"> <div class="add_parent_2_block">
<label class="desc" id="title2" for="add_parent_2">Új szülő neve:</label> <label class="desc" id="title2" for="add_parent_2">Új szülő neve:</label>
<div><input type="text" name="add_parent_2" id="add_parent_2"></div> <div><input type="text" name="add_parent_2" id="add_parent_2"></div>
</div> </div>
<div class="add_parent_2_block"> <div class="add_parent_2_block">
<label class="desc" id="title2" for="parent_2_email">E-mail cím:</label> <label class="desc" id="title2" for="parent_2_email">E-mail cím:</label>
<div><input type="text" name="parent_2_email" id="parent_2_email"></div> <div><input type="text" name="parent_2_email" id="parent_2_email"></div>
</div> </div>
<div class="add_parent_2_block"> <div class="add_parent_2_block">
<label class="desc" id="title2" for="parent_2_phone">Telefonszám:</label> <label class="desc" id="title2" for="parent_2_phone">Telefonszám:</label>
<div><input type="text" name="parent_2_phone" id="parent_2_phone"></div> <div><input type="text" name="parent_2_phone" id="parent_2_phone"></div>
</div> </div>
<div class="add_parent_2_block"> <div class="add_parent_2_block">
<label class="desc" id="title2" for="parent_2_facebook">Facebook:</label> <label class="desc" id="title2" for="parent_2_facebook">Facebook:</label>
<div><input type="text" name="parent_2_facebook" id="parent_2_facebook"></div> <div><input type="text" name="parent_2_facebook" id="parent_2_facebook"></div>
</div> </div>
<br> <br>
<div> <div>
<label class="desc" id="title2" for="uk_contact">Kapcsolat tartás:</label> <label class="desc" for="uk_notify_name">Értesítési név:</label>
<div><textarea rows="7" name="uk_contact" id="uk_contact"></textarea></div> <div><input type="text" name="uk_notify_name" id="uk_notify_name"></div>
</div> </div>
<br> <div>
<label class="desc" for="uk_notify_email">Értesítési e-mail cím:</label>
<div><input type="text" name="uk_notify_email" id="uk_notify_email"></div>
</div>
<div> <br>
<label class="desc" id="title2" for="uk_other">Egyéb:</label>
<div><textarea rows="5" name="uk_other" id="uk_other"></textarea></div>
</div>
<br> <div>
<label class="desc" id="title2" for="uk_contact">Kapcsolat tartás:</label>
<div><textarea rows="7" name="uk_contact" id="uk_contact"></textarea></div>
</div>
<br>
<div>
<label class="desc" id="title2" for="uk_other">Egyéb:</label>
<div><textarea rows="5" name="uk_other" id="uk_other"></textarea></div>
</div>
<br>
<div> <div>
<div> <div>
<input class="button black" type="submit" value="Létrehozás"> <input class="button black" type="submit" value="Létrehozás">
</div> </div>
</div> </div>
</form> </form>

View File

@@ -1,321 +1,330 @@
<div class="form_wrapper"> <div class="form_wrapper">
<div class="buttons"> <div class="buttons">
<a href="/admin/delete_member/{$user_data.uk_id}" class="addbutton delete-big">Törlés</a> <a href="/admin/delete_member/{$user_data.uk_id}" class="addbutton delete-big">Törlés</a>
</div> </div>
<form method="post"> <form method="post">
<input type="hidden" name="action" id="action" value="user_data_edit"> <input type="hidden" name="action" id="action" value="user_data_edit">
<input type="hidden" name="user_type" id="user_type" value="1"> <input type="hidden" name="user_type" id="user_type" value="1">
<input type="hidden" name="uk_id" id="uk_id" value="{$user_data.uk_id}"> <input type="hidden" name="uk_id" id="uk_id" value="{$user_data.uk_id}">
<div> <div>
<label class="desc" for="uk_name">Név:</label> <label class="desc" for="uk_name">Név:</label>
<div><input type="text" name="uk_name" id="uk_name" size="8" class="field text fn" value="{$user_data.uk_name}" required></div> <div><input type="text" name="uk_name" id="uk_name" size="8" class="field text fn" value="{$user_data.uk_name}" required></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_is_active">Aktív:</label> <label class="desc" for="uk_is_active">Aktív:</label>
<div><input type="checkbox" name="uk_is_active" id="uk_is_active" value="1" {if 1==$user_data.uk_is_active}checked{/if}></div> <div><input type="checkbox" name="uk_is_active" id="uk_is_active" value="1" {if 1==$user_data.uk_is_active}checked{/if}></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_last_modified">Utolsó módosítás dátuma:</label> <label class="desc" for="uk_last_modified">Utolsó módosítás dátuma:</label>
<div><input type="text" name="uk_last_modified" id="uk_last_modified" value="{$user_data.uk_last_modified}"></div> <div><input type="text" name="uk_last_modified" id="uk_last_modified" value="{$user_data.uk_last_modified}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_password">Jelszó:</label> <label class="desc" for="uk_password">Jelszó:</label>
<div><input type="text" name="uk_password" id="uk_password" value="{$user_data.uk_password}"></div> <div><input type="text" name="uk_password" id="uk_password" value="{$user_data.uk_password}"></div>
</div> </div>
<div> <div>
<legend class="desc" for="uk_gender">Nem: </legend> <legend class="desc" for="uk_gender">Nem: </legend>
<div> <div>
<input id="r_01" type="radio" name="uk_gender" value="1" {if 1==$user_data.uk_gender}checked{/if}> <input id="r_01" type="radio" name="uk_gender" value="1" {if 1==$user_data.uk_gender}checked{/if}>
<label class="choice" for="r_01">Fiú</label> <label class="choice" for="r_01">Fiú</label>
</div> </div>
<div> <div>
<input id="r_02" type="radio" name="uk_gender" value="2" {if 2==$user_data.uk_gender}checked{/if}> <input id="r_02" type="radio" name="uk_gender" value="2" {if 2==$user_data.uk_gender}checked{/if}>
<label class="choice" for="r_02">Lány</label> <label class="choice" for="r_02">Lány</label>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_birth_date">Születési dátum:</label> <label class="desc" for="uk_birth_date">Születési dátum:</label>
<div><input type="text" name="uk_birth_date" id="uk_birth_date" value="{$user_data.uk_birth_date}"></div> <div><input type="text" name="uk_birth_date" id="uk_birth_date" value="{$user_data.uk_birth_date}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_birth_year">Születési év:</label> <label class="desc" for="uk_birth_year">Születési év:</label>
<div><input type="text" name="uk_birth_year" id="uk_birth_year" value="{$user_data.uk_birth_year}"></div> <div><input type="text" name="uk_birth_year" id="uk_birth_year" value="{$user_data.uk_birth_year}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_address_scc_id">Lakhely (település):</label> <label class="desc" for="uk_address_scc_id">Lakhely (település):</label>
<div> <div>
<select name="uk_address_scc_id" id="uk_address_scc_id"> <select name="uk_address_scc_id" id="uk_address_scc_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $school_city_assoc_array as $school_city_array} {foreach $school_city_assoc_array as $school_city_array}
<option value="{$school_city_array->get_scc_id()}"{if $user_data.uk_address_scc_id == $school_city_array->get_scc_id()} selected{/if}> <option value="{$school_city_array->get_scc_id()}"{if $user_data.uk_address_scc_id == $school_city_array->get_scc_id()} selected{/if}>
{$school_city_array->get_scc_city()} {$school_city_array->get_scc_city()}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_first_training">Első edzés dátuma:</label> <label class="desc" for="uk_first_training">Első edzés dátuma:</label>
<div><input type="text" name="uk_first_training" id="uk_first_training" value="{$user_data.uk_first_training}"></div> <div><input type="text" name="uk_first_training" id="uk_first_training" value="{$user_data.uk_first_training}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_beforehand">Előzmény:</label> <label class="desc" for="uk_beforehand">Előzmény:</label>
<div><input type="text" name="uk_beforehand" id="uk_beforehand" value="{$user_data.uk_beforehand}"></div> <div><input type="text" name="uk_beforehand" id="uk_beforehand" value="{$user_data.uk_beforehand}"></div>
</div> </div>
<div> <div>
<legend class="desc" for="uk_hand">Kéz: </legend> <legend class="desc" for="uk_hand">Kéz: </legend>
<div> <div>
<input id="r_03" type="radio" name="uk_hand" value="1" {if 1==$user_data.uk_hand}checked{/if}> <input id="r_03" type="radio" name="uk_hand" value="1" {if 1==$user_data.uk_hand}checked{/if}>
<label class="choice" for="r_03">Bal</label> <label class="choice" for="r_03">Bal</label>
</div> </div>
<div> <div>
<input id="r_04" type="radio" name="uk_hand" value="2" {if 2==$user_data.uk_hand}checked{/if}> <input id="r_04" type="radio" name="uk_hand" value="2" {if 2==$user_data.uk_hand}checked{/if}>
<label class="choice" for="r_04">Jobb</label> <label class="choice" for="r_04">Jobb</label>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_level">Szint:</label> <label class="desc" for="uk_level">Szint:</label>
<div><input type="text" name="uk_level" id="uk_level" value="{$user_data.uk_level}"></div> <div><input type="text" name="uk_level" id="uk_level" value="{$user_data.uk_level}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_email">E-mail cím:</label> <label class="desc" for="uk_email">E-mail cím:</label>
<div><input type="email" name="uk_email" id="uk_email" value="{$user_data.uk_email}"></div> <div><input type="email" name="uk_email" id="uk_email" value="{$user_data.uk_email}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_phone">Telefonszám:</label> <label class="desc" for="uk_phone">Telefonszám:</label>
<div><input type="text" name="uk_phone" id="uk_phone" value="{$user_data.uk_phone}"></div> <div><input type="text" name="uk_phone" id="uk_phone" value="{$user_data.uk_phone}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_facebook">Facebook:</label> <label class="desc" for="uk_facebook">Facebook:</label>
<div><input type="text" name="uk_facebook" id="uk_facebook" value="{$user_data.uk_facebook}"></div> <div><input type="text" name="uk_facebook" id="uk_facebook" value="{$user_data.uk_facebook}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_shirt_size_ss_id">Pólóméret:</label> <label class="desc" for="uk_shirt_size_ss_id">Pólóméret:</label>
<div> <div>
<select name="uk_shirt_size_ss_id" id="uk_shirt_size_ss_id"> <select name="uk_shirt_size_ss_id" id="uk_shirt_size_ss_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $shirt_size_assoc_array as $shirt_size_array} {foreach $shirt_size_assoc_array as $shirt_size_array}
<option value="{$shirt_size_array.shirt_id}"{if $shirt_size_array.shirt_id == $user_data.uk_shirt_size_ss_id} selected{/if}> <option value="{$shirt_size_array.shirt_id}"{if $shirt_size_array.shirt_id == $user_data.uk_shirt_size_ss_id} selected{/if}>
{$shirt_size_array.shirt_name} {$shirt_size_array.shirt_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_shirt_note">Póló megjegyzés:</label> <label class="desc" for="uk_shirt_note">Póló megjegyzés:</label>
<div><input type="text" name="uk_shirt_note" id="uk_shirt_note" value="{$user_data.uk_shirt_note}"></div> <div><input type="text" name="uk_shirt_note" id="uk_shirt_note" value="{$user_data.uk_shirt_note}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_balance_transfer">Áthozat (Ft):</label> <label class="desc" for="uk_balance_transfer">Áthozat (Ft):</label>
<div><input type="text" name="uk_balance_transfer" id="uk_balance_transfer" value="{$user_data.uk_balance_transfer}"></div> <div><input type="text" name="uk_balance_transfer" id="uk_balance_transfer" value="{$user_data.uk_balance_transfer}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_school_sc_id">Iskola neve:</label> <label class="desc" for="uk_school_sc_id">Iskola neve:</label>
<div> <div>
<select name="uk_school_sc_id" id="uk_school_sc_id"> <select name="uk_school_sc_id" id="uk_school_sc_id">
<option value="null"> - (állítsd erre új iskola felvételéhez)</option> <option value="null"> - (állítsd erre új iskola felvételéhez)</option>
{foreach $school_assoc_array as $school_array} {foreach $school_assoc_array as $school_array}
<option value="{$school_array->get_sc_id()}"{if $school_array->get_sc_id() == $user_data.uk_school_sc_id} selected{/if}> <option value="{$school_array->get_sc_id()}"{if $school_array->get_sc_id() == $user_data.uk_school_sc_id} selected{/if}>
{$school_array->get_sc_name()} {$school_array->get_sc_name()}
{if $school_array->get_sc_school_city()}({$school_array->get_sc_school_city()->get_scc_city()}){/if} {if $school_array->get_sc_school_city()}({$school_array->get_sc_school_city()->get_scc_city()}){/if}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_school"> <div class="add_school">
<label class="desc" for="add_school">Új iskola neve:</label> <label class="desc" for="add_school">Új iskola neve:</label>
<div><input type="text" name="add_school" id="add_school"></div> <div><input type="text" name="add_school" id="add_school"></div>
</div> </div>
<div class="add_school"> <div class="add_school">
<label class="desc" for="uk_school_city_scc_id">Új iskola települése:</label> <label class="desc" for="uk_school_city_scc_id">Új iskola települése:</label>
<div> <div>
<select name="uk_school_city_scc_id" id="uk_school_city_scc_id"> <select name="uk_school_city_scc_id" id="uk_school_city_scc_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $school_city_assoc_array as $school_city_array} {foreach $school_city_assoc_array as $school_city_array}
<option value="{$school_city_array->get_scc_id()}"> <option value="{$school_city_array->get_scc_id()}">
{$school_city_array->get_scc_city()} {$school_city_array->get_scc_city()}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_region_reg_id">Diákolimpia körzet:</label> <label class="desc" for="uk_region_reg_id">Diákolimpia körzet:</label>
<div> <div>
<select name="uk_region_reg_id" id="uk_region_reg_id"> <select name="uk_region_reg_id" id="uk_region_reg_id">
<option value="null"> - </option> <option value="null"> - </option>
{foreach $region_assoc_array as $region_array} {foreach $region_assoc_array as $region_array}
<option value="{$region_array.reg_id}"{if $region_array.reg_id == $user_data.uk_region_reg_id} selected{/if}> <option value="{$region_array.reg_id}"{if $region_array.reg_id == $user_data.uk_region_reg_id} selected{/if}>
{$region_array.reg_name} {$region_array.reg_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div> <div>
<label class="desc" for="uk_age_category">Diákolimpia korcsoport:</label> <label class="desc" for="uk_age_category">Diákolimpia korcsoport:</label>
<div><input type="text" name="uk_age_category" id="uk_age_category" value="{$user_data.uk_age_category}"></div> <div><input type="text" name="uk_age_category" id="uk_age_category" value="{$user_data.uk_age_category}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_official_age_category">MTLSz korosztály:</label> <label class="desc" for="uk_official_age_category">MTLSz korosztály:</label>
<div><input type="text" name="uk_official_age_category" id="uk_official_age_category" value="{$user_data.uk_official_age_category}"></div> <div><input type="text" name="uk_official_age_category" id="uk_official_age_category" value="{$user_data.uk_official_age_category}"></div>
</div> </div>
<div> <div>
<label class="desc" for="uk_parent_1">Szülő:</label> <label class="desc" for="uk_parent_1">Szülő:</label>
<div> <div>
<select name="uk_parent_1" id="uk_parent_1"> <select name="uk_parent_1" id="uk_parent_1">
<option value="null"> - (állítsd erre új szülő felvételéhez)</option> <option value="null"> - (állítsd erre új szülő felvételéhez)</option>
{foreach $parent_assoc_array as $parent_array} {foreach $parent_assoc_array as $parent_array}
<option value="{$parent_array.up_id}"{if $parent_array.up_id == $user_data.uk_parent_1} selected{/if}> <option value="{$parent_array.up_id}"{if $parent_array.up_id == $user_data.uk_parent_1} selected{/if}>
{$parent_array.up_name} {$parent_array.up_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_parent_1_block"> <div class="add_parent_1_block">
<label class="desc" for="add_parent_1">Új szülő neve:</label> <label class="desc" for="add_parent_1">Új szülő neve:</label>
<div><input type="text" name="add_parent_1" id="add_parent_1"></div> <div><input type="text" name="add_parent_1" id="add_parent_1"></div>
</div> </div>
<div> <div>
<label class="desc" for="parent_1_email">E-mail cím:</label> <label class="desc" for="parent_1_email">E-mail cím:</label>
<div><input type="text" name="parent_1_email" id="parent_1_email"></div> <div><input type="text" name="parent_1_email" id="parent_1_email"></div>
</div> </div>
<div> <div>
<label class="desc" for="parent_1_phone">Telefonszám:</label> <label class="desc" for="parent_1_phone">Telefonszám:</label>
<div><input type="text" name="parent_1_phone" id="parent_1_phone"></div> <div><input type="text" name="parent_1_phone" id="parent_1_phone"></div>
</div> </div>
<div> <div>
<label class="desc" for="parent_1_facebook">Facebook:</label> <label class="desc" for="parent_1_facebook">Facebook:</label>
<div><input type="text" name="parent_1_facebook" id="parent_1_facebook"></div> <div><input type="text" name="parent_1_facebook" id="parent_1_facebook"></div>
</div> </div>
<div> <div>
<label class="desc" id="title2" for="uk_parent_2">Szülő:</label> <label class="desc" id="title2" for="uk_parent_2">Szülő:</label>
<div> <div>
<select name="uk_parent_2" id="uk_parent_2"> <select name="uk_parent_2" id="uk_parent_2">
<option value="null"> - (állítsd erre új szülő felvételéhez)</option> <option value="null"> - (állítsd erre új szülő felvételéhez)</option>
{foreach $parent_assoc_array as $parent_array} {foreach $parent_assoc_array as $parent_array}
<option value="{$parent_array.up_id}"{if $parent_array.up_id == $user_data.uk_parent_2} selected{/if}> <option value="{$parent_array.up_id}"{if $parent_array.up_id == $user_data.uk_parent_2} selected{/if}>
{$parent_array.up_name} {$parent_array.up_name}
</option> </option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
</div> </div>
<div class="add_parent_2_block"> <div class="add_parent_2_block">
<label class="desc" id="title2" for="add_parent_2">Új szülő neve:</label> <label class="desc" id="title2" for="add_parent_2">Új szülő neve:</label>
<div><input type="text" name="add_parent_2" id="add_parent_2"></div> <div><input type="text" name="add_parent_2" id="add_parent_2"></div>
</div> </div>
<div> <div>
<label class="desc" id="title2" for="parent_2_email">E-mail cím:</label> <label class="desc" id="title2" for="parent_2_email">E-mail cím:</label>
<div><input type="text" name="parent_2_email" id="parent_2_email"></div> <div><input type="text" name="parent_2_email" id="parent_2_email"></div>
</div> </div>
<div> <div>
<label class="desc" id="title2" for="parent_2_phone">Telefonszám:</label> <label class="desc" id="title2" for="parent_2_phone">Telefonszám:</label>
<div><input type="text" name="parent_2_phone" id="parent_2_phone"></div> <div><input type="text" name="parent_2_phone" id="parent_2_phone"></div>
</div> </div>
<div> <div>
<label class="desc" id="title2" for="parent_2_facebook">Facebook:</label> <label class="desc" id="title2" for="parent_2_facebook">Facebook:</label>
<div><input type="text" name="parent_2_facebook" id="parent_2_facebook"></div> <div><input type="text" name="parent_2_facebook" id="parent_2_facebook"></div>
</div> </div>
<br>
<div>
<label class="desc" for="uk_notify_name">Értesítési név:</label>
<div><input type="text" name="uk_notify_name" id="uk_notify_name" value="{$user_data.uk_notify_name}"></div>
</div>
<div>
<label class="desc" for="uk_notify_email">Értesítési e-mail cím:</label>
<div><input type="text" name="uk_notify_email" id="uk_notify_email" value="{$user_data.uk_notify_email}"></div>
</div>
<br>
<div>
<label class="desc" id="title2" for="uk_contact">Kapcsolat tartás:</label>
<div><textarea rows="7" name="uk_contact" id="uk_contact">{$user_data.uk_contact}</textarea></div>
</div>
<br>
<div>
<label class="desc" id="title2" for="uk_other">Egyéb:</label>
<div><textarea rows="5" name="uk_other" id="uk_other">{$user_data.uk_other}</textarea></div>
</div>
<br>
<div>
<div>
<br> <input class="button black" type="submit" value="Mentés">
</div>
<div> </div>
<label class="desc" id="title2" for="uk_contact">Kapcsolat tartás:</label>
<div><textarea rows="7" name="uk_contact" id="uk_contact">{$user_data.uk_contact}</textarea></div>
</div>
<br>
<div>
<label class="desc" id="title2" for="uk_other">Egyéb:</label>
<div><textarea rows="5" name="uk_other" id="uk_other">{$user_data.uk_other}</textarea></div>
</div>
<br>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form> </form>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
if ($("#uk_parent_1").val() == 'null') $(".add_parent_1_block").show(); if ($("#uk_parent_1").val() == 'null') $(".add_parent_1_block").show();
else $(".add_parent_1_block").hide(); else $(".add_parent_1_block").hide();
if ($("#uk_parent_2").val() == 'null') $(".add_parent_2_block").show(); if ($("#uk_parent_2").val() == 'null') $(".add_parent_2_block").show();
else $(".add_parent_2_block").hide(); else $(".add_parent_2_block").hide();
if ($("#uk_school_sc_id").val() == 'null') $(".add_school").show(); if ($("#uk_school_sc_id").val() == 'null') $(".add_school").show();
else $(".add_school").hide(); else $(".add_school").hide();
$("#uk_parent_1").trigger("change"); $("#uk_parent_1").trigger("change");
$("#uk_parent_2").trigger("change"); $("#uk_parent_2").trigger("change");
}); });
$('#uk_parent_1').change(function() { $('#uk_parent_1').change(function() {
$(".add_parent_1_block").toggle(this.value == 'null'); $(".add_parent_1_block").toggle(this.value == 'null');
}); });
$('#uk_parent_2').change(function() { $('#uk_parent_2').change(function() {
$(".add_parent_2_block").toggle(this.value == 'null'); $(".add_parent_2_block").toggle(this.value == 'null');
}); });
$('#uk_school_sc_id').change(function() { $('#uk_school_sc_id').change(function() {
$(".add_school").toggle(this.value == 'null'); $(".add_school").toggle(this.value == 'null');
}); });
$("#uk_parent_1").change(function(){ $("#uk_parent_1").change(function(){
$.post("/_ajax/get_parent_data.php", $.post("/_ajax/get_parent_data.php",
{ {
parent_id: $("#uk_parent_1").val(), parent_id: $("#uk_parent_1").val(),
@@ -323,22 +332,22 @@
}, },
function(data, status){ function(data, status){
if (!data) { if (!data) {
$("#parent_1_phone").val(''); $("#parent_1_phone").val('');
$("#parent_1_email").val(''); $("#parent_1_email").val('');
$("#parent_1_facebook").val(''); $("#parent_1_facebook").val('');
} }
else { else {
var pdata = JSON.parse(data); var pdata = JSON.parse(data);
$("#parent_1_phone").val(pdata[1]); $("#parent_1_phone").val(pdata[1]);
$("#parent_1_email").val(pdata[0]); $("#parent_1_email").val(pdata[0]);
$("#parent_1_facebook").val(pdata[2]); $("#parent_1_facebook").val(pdata[2]);
} }
}); });
}); });
$("#uk_parent_2").change(function(){ $("#uk_parent_2").change(function(){
$.post("/_ajax/get_parent_data.php", $.post("/_ajax/get_parent_data.php",
{ {
parent_id: $("#uk_parent_2").val(), parent_id: $("#uk_parent_2").val(),
@@ -346,18 +355,18 @@
}, },
function(data, status){ function(data, status){
if (!data) { if (!data) {
$("#parent_2_phone").val(''); $("#parent_2_phone").val('');
$("#parent_2_email").val(''); $("#parent_2_email").val('');
$("#parent_2_facebook").val(''); $("#parent_2_facebook").val('');
} }
else { else {
var pdata = JSON.parse(data); var pdata = JSON.parse(data);
$("#parent_2_phone").val(pdata[1]); $("#parent_2_phone").val(pdata[1]);
$("#parent_2_email").val(pdata[0]); $("#parent_2_email").val(pdata[0]);
$("#parent_2_facebook").val(pdata[2]); $("#parent_2_facebook").val(pdata[2]);
} }
}); });
}); });
</script> </script>