camps 1
This commit is contained in:
336
_class/class_camp.php
Normal file
336
_class/class_camp.php
Normal file
@@ -0,0 +1,336 @@
|
||||
<?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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
82
_class/class_camp_accomodation_type.php
Normal file
82
_class/class_camp_accomodation_type.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
307
_class/class_camp_apply.php
Normal file
307
_class/class_camp_apply.php
Normal file
@@ -0,0 +1,307 @@
|
||||
<?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' && $value !== null) {
|
||||
$new_cat = new camp_accomodation_type();
|
||||
$new_cat->set_cat_data_by_id($value);
|
||||
$this->$function_name($new_cat);
|
||||
}
|
||||
if ($field == 'capp_shuttle_type' && $value !== null) {
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
327
_class/class_camp_contact.php
Normal file
327
_class/class_camp_contact.php
Normal file
@@ -0,0 +1,327 @@
|
||||
<?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,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
53
_class/class_camp_contact_type.php
Normal file
53
_class/class_camp_contact_type.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
516
_class/class_camp_kid.php
Normal file
516
_class/class_camp_kid.php
Normal file
@@ -0,0 +1,516 @@
|
||||
<?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']),
|
||||
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
45
_class/class_camp_shirt.php
Normal file
45
_class/class_camp_shirt.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
82
_class/class_camp_shuttle_type.php
Normal file
82
_class/class_camp_shuttle_type.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
98
_class/class_camp_type.php
Normal file
98
_class/class_camp_type.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
197
_class/class_camp_user.php
Normal file
197
_class/class_camp_user.php
Normal file
@@ -0,0 +1,197 @@
|
||||
<?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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -346,6 +346,58 @@ class page {
|
||||
$from = "admin";
|
||||
include('include_logout.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 '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;
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
@@ -430,6 +482,39 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user