diff --git a/_ajax/get_camp_accomodation_list.php b/_ajax/get_camp_accomodation_list.php
new file mode 100755
index 0000000..2dbeb45
--- /dev/null
+++ b/_ajax/get_camp_accomodation_list.php
@@ -0,0 +1,13 @@
+assoc_array("SELECT * FROM camp_accomodation JOIN camp_accomodation_type on cat_id = ca_accomodation_id WHERE ca_camp_id = " . $_POST['camp_id']);
+
+echo json_encode($accom_assoc_array);
+?>
\ No newline at end of file
diff --git a/_ajax/get_camp_contact_data.php b/_ajax/get_camp_contact_data.php
new file mode 100755
index 0000000..f11824c
--- /dev/null
+++ b/_ajax/get_camp_contact_data.php
@@ -0,0 +1,13 @@
+assoc_array("SELECT * FROM camp_contact WHERE cc_id = " . $_POST['camp_contact_id']);
+
+echo json_encode($cc_assoc_array);
+?>
\ No newline at end of file
diff --git a/_ajax/get_camp_kid_data.php b/_ajax/get_camp_kid_data.php
new file mode 100755
index 0000000..2ff6fe6
--- /dev/null
+++ b/_ajax/get_camp_kid_data.php
@@ -0,0 +1,13 @@
+assoc_array("SELECT * FROM camp_kid WHERE ck_id = " . $_POST['camp_kid_id']);
+
+echo json_encode($ck_assoc_array);
+?>
\ No newline at end of file
diff --git a/_ajax/get_camp_shuttle_list.php b/_ajax/get_camp_shuttle_list.php
new file mode 100755
index 0000000..4862a33
--- /dev/null
+++ b/_ajax/get_camp_shuttle_list.php
@@ -0,0 +1,18 @@
+assoc_array("SELECT * FROM camp_shuttle JOIN camp_shuttle_type on cst_id = cs_shuttle_id WHERE cs_camp_id = " . $_POST['camp_id']);
+
+$shuttle_array = array();
+foreach ($shuttle_assoc_array as $shuttle) {
+ $shuttle_array[$shuttle['cst_id']] = $shuttle['cst_name'];
+}
+
+echo json_encode($shuttle_assoc_array);
+?>
\ No newline at end of file
diff --git a/_class/class_camp.php b/_class/class_camp.php
new file mode 100644
index 0000000..7278e3b
--- /dev/null
+++ b/_class/class_camp.php
@@ -0,0 +1,292 @@
+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 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 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, $_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_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, $_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_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));
+ }
+ }
+
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_accomodation_type.php b/_class/class_camp_accomodation_type.php
new file mode 100644
index 0000000..a19375c
--- /dev/null
+++ b/_class/class_camp_accomodation_type.php
@@ -0,0 +1,82 @@
+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);
+ }
+
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_apply.php b/_class/class_camp_apply.php
new file mode 100644
index 0000000..88e7eed
--- /dev/null
+++ b/_class/class_camp_apply.php
@@ -0,0 +1,294 @@
+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 function set_capp_data_by_id($_id) {
+ global $sql;
+ $capp_data_assoc_array = $sql->assoc_array("select * from camp_apply where capp_id = " . $_id);
+ $capp_array = $capp_data_assoc_array[0];
+ foreach ($capp_array as $field => $value) {
+ $function_name = "set_" . $field;
+ $this->$function_name($value);
+ if ($field == 'capp_camp_kid_ck_id') {
+ $new_kid = new camp_kid();
+ $new_kid->set_ck_data_by_id($value);
+ $this->$function_name($new_kid);
+ }
+ if ($field == 'capp_accomodation_type') {
+ $new_cat = new camp_accomodation_type();
+ $new_cat->set_cat_data_by_id($value);
+ $this->$function_name($new_cat);
+ }
+ if ($field == 'capp_shuttle_type') {
+ $new_cst = new camp_shuttle_type();
+ $new_cst->set_cst_data_by_id($value);
+ $this->$function_name($new_cst);
+ }
+ if ($field == 'capp_camp_id') {
+ $new_camp = new camp();
+ $new_camp->set_camp_data_by_id($value);
+ $this->$function_name($new_camp);
+ }
+ }
+ }
+
+ //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));
+ }
+}
+
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_contact.php b/_class/class_camp_contact.php
new file mode 100644
index 0000000..9212a06
--- /dev/null
+++ b/_class/class_camp_contact.php
@@ -0,0 +1,327 @@
+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,
+ )
+ );
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_contact_type.php b/_class/class_camp_contact_type.php
new file mode 100644
index 0000000..cf9591e
--- /dev/null
+++ b/_class/class_camp_contact_type.php
@@ -0,0 +1,53 @@
+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);
+ }
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_kid.php b/_class/class_camp_kid.php
new file mode 100644
index 0000000..c6c6cee
--- /dev/null
+++ b/_class/class_camp_kid.php
@@ -0,0 +1,516 @@
+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']),
+
+ ));
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_shirt.php b/_class/class_camp_shirt.php
new file mode 100644
index 0000000..95d24a0
--- /dev/null
+++ b/_class/class_camp_shirt.php
@@ -0,0 +1,45 @@
+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);
+ }
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_shuttle_type.php b/_class/class_camp_shuttle_type.php
new file mode 100644
index 0000000..65e8e68
--- /dev/null
+++ b/_class/class_camp_shuttle_type.php
@@ -0,0 +1,82 @@
+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);
+ }
+
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_type.php b/_class/class_camp_type.php
new file mode 100644
index 0000000..799cd5d
--- /dev/null
+++ b/_class/class_camp_type.php
@@ -0,0 +1,98 @@
+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));
+ }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/_class/class_camp_user.php b/_class/class_camp_user.php
new file mode 100644
index 0000000..99bf367
--- /dev/null
+++ b/_class/class_camp_user.php
@@ -0,0 +1,197 @@
+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')), 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,
+ ));
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/_class/class_log.php b/_class/class_log.php
index 98034f1..0bc62b3 100644
--- a/_class/class_log.php
+++ b/_class/class_log.php
@@ -18,6 +18,7 @@ class log {
//ha a user változó objektum, akkor megvizsgáljuk, hogy coach vagy parent
if (get_class($user) == 'user') $function_name = 'get_ua_id';
elseif(get_class($user) == 'user_kid') $function_name = 'get_uk_id';
+ elseif(get_class($user) == 'camp_user') $function_name = 'get_cu_id';
}
$sql->insert_into('log', array(
@@ -117,7 +118,7 @@ class log {
elseif (strstr($this->get_log_category()->get_logc_name(), 'delete')) return 'delete';
elseif (strstr($this->get_log_category()->get_logc_name(), 'update')) return 'edit';
elseif (in_array($this->get_log_category()->get_logc_name(), array('training_close', 'training_open'))) return 'lock';
- elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout', 'coach_login', 'coach_logout'))) return 'login';
+ elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout', 'coach_login', 'coach_logout', 'camp_user_login', 'camp_user_logout'))) return 'login';
}
public function set_log_data_by_id($_log_id) {
@@ -138,6 +139,7 @@ class log {
//beállítja a log_user objektumot
if ($this->get_log_category()->get_logc_type() == 1) $new_user = new user();
elseif($this->get_log_category()->get_logc_type() == 2) $new_user = new user_kid();
+ elseif($this->get_log_category()->get_logc_type() == 3) $new_user = new camp_user();
$new_user->set_user_data_by_id($value);
$this->set_log_user($new_user);
}
diff --git a/_class/class_login.php b/_class/class_login.php
index f532610..1f43de7 100755
--- a/_class/class_login.php
+++ b/_class/class_login.php
@@ -93,6 +93,21 @@ class login {
return null;
}
+ public function check_camp_login($_user_name, $_user_password) {
+ global $sql;
+ $check_query =
+ "
+ SELECT cu_id FROM camp_user WHERE
+ (cu_email = '" . $_user_name . "' AND
+ cu_password = '" . md5($_user_password ) . "') AND cu_deleted = 0";
+
+ //echo $check_query;
+
+ if ($sql->num_of_rows($check_query)) return $sql->single_variable($check_query);
+
+ return null;
+ }
+
public function login_user($_user_id, $_cookie_name, $_user_type) {
//beállítja a belépett user adatait cookieba (ha még nincs)
global $sql;
@@ -108,6 +123,9 @@ class login {
elseif ($_user_type == 3) {
$user_login = new user();
}
+ elseif ($_user_type == 4) {
+ $user_login = new camp_user();
+ }
$user_login->set_user_data_by_id($_user_id);
$user_login->update_login_time();
setcookie($_cookie_name, $_user_id, time()+60*60*168, '/');
diff --git a/_class/class_page.php b/_class/class_page.php
index 9ac3998..3fbaa4a 100755
--- a/_class/class_page.php
+++ b/_class/class_page.php
@@ -38,6 +38,11 @@ class page {
$menu_assoc_array = $sql->assoc_array($menus_query);
$smarty->assign('menus', $menu_assoc_array);
}
+ elseif ($this->get_page() == 'tabor') {
+ $menus_query = "SELECT * FROM subpage WHERE spage_page_id = 4;";
+ $menu_assoc_array = $sql->assoc_array($menus_query);
+ $smarty->assign('menus', $menu_assoc_array);
+ }
$smarty->assign('page', $this->get_page());
$smarty->display('nav.tpl');
@@ -173,6 +178,30 @@ class page {
# BIZTONSÁGI MENTÉS LETÖLTÉS
include('include_download_backup.php');
break;
+ case 'camps':
+ # TÁBOROK
+ include('include_camps.php');
+ break;
+ case 'camp_types':
+ # TÁBOR TÍPUSOK
+ include('include_camp_types.php');
+ break;
+ case 'camp_shirt_type':
+ # TÁBOR PÓLÓ TÍPUSOK
+ include('include_camp_shirt_types.php');
+ break;
+ case 'accept_apply':
+ # TÁBOR JELENTKEZÉS ELFOGADÁSA
+ include('include_accept_apply.php');
+ break;
+ case 'deny_apply':
+ # TÁBOR JELENTKEZÉS ELUTASÍTÁSA
+ include('include_deny_apply.php');
+ break;
+ case 'apply':
+ # TÁBORI JELENTKEZŐ ADATAINAK MEGTEKINTÉSE
+ include('include_apply.php');
+ break;
case 'delete_training_type':
# EDZÉS TÍPUS TÖRLÉS
include('include_delete_training_type.php');
@@ -213,10 +242,22 @@ class page {
# MENTÉS TÖRLÉS
include('include_delete_backup.php');
break;
+ case 'delete_camp_type':
+ # TÁBOR TÍPUS TÖRLÉS
+ include('include_delete_camp_type.php');
+ break;
+ case 'delete_camp':
+ # TÁBOR TÖRLÉS
+ include('include_delete_camp.php');
+ break;
+ case 'delete_camp_shirt':
+ # TÁBORI PÓLÓ TÖRLÉS
+ include('include_delete_camp_shirt.php');
+ break;
case 'logout':
# kijelentkezés
$from = "admin";
- include('include_logout.php');
+ include('include_logout.php');
break;
default:
# code...
@@ -302,8 +343,32 @@ 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és
+ include('include_camp_applies.php');
+ break;
+ case 'logout':
+ # kijelentkezés
+ $from = "tabor";
+ include('include_logout.php');
+ break;
+ default:
+ include('include_camp_information.php');
+ break;
+ }
+ break;
default:
- # code...
break;
}
}
@@ -311,7 +376,16 @@ class page {
else {
//nincs bejelentkezve
$smarty->assign("page", $this->get_page());
- $smarty->display("login.tpl");
+ if ('tabor' == $this->get_page() && $this->is_subpage() && 'regisztracio' == $this->get_subpage()) {
+ if (isset($_COOKIE['bc_reg_error'])) {
+ $smarty->assign('error_code', $_COOKIE['bc_reg_error']);
+ setcookie('bc_reg_error', null, time()-60*60);
+ }
+ $smarty->display("register.tpl");
+ }
+ else {
+ $smarty->display("login.tpl");
+ }
}
}
diff --git a/_class/class_shuttle.php b/_class/class_shuttle.php
new file mode 100644
index 0000000..c6bb3be
--- /dev/null
+++ b/_class/class_shuttle.php
@@ -0,0 +1,73 @@
+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;
+ }
+
+ 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);
+ }
+
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/_css/camp.css b/_css/camp.css
new file mode 100644
index 0000000..211fe26
--- /dev/null
+++ b/_css/camp.css
@@ -0,0 +1,93 @@
+nav {
+ box-shadow: none;
+ width: 100%;
+}
+
+ul.topnav {
+ background-color: #0052CC;
+}
+
+main #main_content, main #loading {
+ width: 100%;
+ box-shadow: none;
+}
+
+.info {
+ padding: 0px 8%;
+}
+
+#cct_extra_row {
+ margin-top: 10px;
+ display: none;
+}
+
+#add_more_cct {
+ margin-bottom: 15px;
+}
+
+h1, p {
+ text-align: center;
+}
+
+form table {
+ margin: 0px auto;
+ border-collapse: collapse;
+ border: 2px solid black;
+ background: #e7d6d6;
+ min-width: 400px;
+ cursor: pointer;
+}
+
+form table td {
+ font-size: 20px;
+ padding: 5px 10px;
+}
+
+form table tr:hover td {
+ background-color: #602f2f;
+ color: #fff;
+}
+
+.danger {
+ width: 64%;
+ display: block;
+ margin: 20px auto;
+ padding: 15px;
+}
+
+.middle {
+ display: block;
+ margin: 20px auto;
+}
+
+h2 {
+ text-align: center;
+ margin-top: 50px;
+}
+
+.apply_table {
+ width: 80%;
+ text-align: center;
+ min-width: 800px;
+ border-collapse: collapse;
+ margin: 30px auto 50px auto;
+}
+
+.smaller {
+ min-width: 588px;
+ width: 50%;
+}
+
+.apply_table th {
+ background-color: #000;
+ color: #fff;
+ padding: 5px;
+}
+
+.apply_table td {
+ padding: 5px;
+}
+
+.apply_table tr:hover td{
+ background: #eeeeee;
+}
\ No newline at end of file
diff --git a/_css/default.css b/_css/default.css
index d0a5248..faf1e27 100644
--- a/_css/default.css
+++ b/_css/default.css
@@ -35,9 +35,7 @@ main #main_content {
background-color: #fff;
padding: 30px 10px 10px 10px;
- webkit-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- -moz-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
+
}
@@ -49,9 +47,7 @@ main #loading {
background-color: #fff;
padding: 30px 10px 10px 10px;
- webkit-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- -moz-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
+
z-index: 100;
@@ -77,6 +73,18 @@ main #loading {
float: right;
}
+.float_left {
+ float: left;
+}
+
+.shuttle_block {
+ height: 25px;
+}
+
+.z10 {
+ z-index: 10;
+}
+
.danger {
background-color: #ffdddd;
border-left: 6px solid #002E4C;
@@ -87,6 +95,19 @@ main #loading {
font-weight: bold;
}
+.
+
+.checkbox_label {
+ position: relative;
+ top: 3px;
+ left: 5px;
+}
+
+.error_msg {
+ color: #ff0000;
+ font-style: italic;
+}
+
ul.topnav span {
color: #f2f2f2;
@@ -491,6 +512,45 @@ table.log tr.delete:hover {
filter: alpha(opacity=30); /* For IE8 and earlier */
}
+.apply_table {
+ width: 80%;
+ text-align: center;
+ min-width: 800px;
+ border-collapse: collapse;
+ margin: 30px 0px 50px 20px;
+}
+
+.smaller {
+ min-width: 588px;
+ width: 50%;
+}
+
+.apply_table th {
+ background-color: #000;
+ color: #fff;
+ padding: 5px;
+}
+
+.apply_table td {
+ padding: 5px;
+}
+
+.apply_table tr:hover td{
+ background: #eeeeee;
+}
+
+.apply_table img {
+ width: 25px;
+}
+
+.pending {
+ float: right;
+}
+
+h1.apply {
+ margin-left: 20px;
+}
+
@media (min-width: 680px) {
@@ -568,7 +628,7 @@ table.log tr.delete:hover {
}
main #main_content, main #loading {
- width: 80%;
+ width: 100%;
margin: 0px auto;
}
diff --git a/_css/login.css b/_css/login.css
new file mode 100644
index 0000000..963c9cf
--- /dev/null
+++ b/_css/login.css
@@ -0,0 +1,45 @@
+body {
+ background: #eee !important;
+}
+
+.wrapper {
+ margin-top: 80px;
+ margin-bottom: 80px;
+}
+
+.form-signin {
+ max-width: 380px;
+ padding: 15px 35px 45px;
+ margin: 0 auto;
+ background-color: #fff;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+}
+.form-signin .form-signin-heading,
+.form-signin .checkbox {
+ margin-bottom: 30px;
+}
+.form-signin .checkbox {
+ font-weight: normal;
+}
+.form-signin .form-control {
+ position: relative;
+ font-size: 16px;
+ height: auto;
+ padding: 10px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.form-signin .form-control:focus {
+ z-index: 2;
+}
+.form-signin input[type="text"] {
+ margin-bottom: -1px;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.form-signin input[type="password"] {
+ margin-bottom: 20px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
diff --git a/_css/login_form.css b/_css/login_form.css
new file mode 100644
index 0000000..4cd4125
--- /dev/null
+++ b/_css/login_form.css
@@ -0,0 +1,92 @@
+.login-page {
+ width: 360px;
+ padding: 3% 0 0;
+ margin: auto;
+}
+.form {
+ position: relative;
+ z-index: 1;
+ background: #FFFFFF;
+ max-width: 360px;
+ margin: 0 auto 100px;
+ padding: 15px 45px 45px 45px;
+ text-align: center;
+ box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
+}
+.form input[type=text],
+.form input[type=password]
+ {
+ font-family: sans-serif;
+ outline: 0;
+ background: #f2f2f2;
+ width: 100%;
+ border: 0;
+ margin: 0 0 15px;
+ padding: 15px;
+ box-sizing: border-box;
+ font-size: 14px;
+ height: auto;
+}
+.form input[type=submit] {
+ font-family: "Roboto", sans-serif;
+ text-transform: uppercase;
+ outline: 0;
+ background: #4C74AF;;
+ width: 100%;
+ border: 0;
+ padding: 15px;
+ color: #FFFFFF;
+ font-size: 14px;
+ -webkit-transition: all 0.3 ease;
+ transition: all 0.3 ease;
+ cursor: pointer;
+ font-weight: bold;
+}
+.form button:hover,.form button:active,.form button:focus {
+ background: #4F40DE;
+}
+.form .message {
+ margin: 15px 0 0;
+ color: #b3b3b3;
+ font-size: 12px;
+}
+.form .message a {
+ color: #4C74AF;
+ text-decoration: none;
+}
+.form .register-form {
+ display: none;
+}
+.container {
+ position: relative;
+ z-index: 1;
+ max-width: 300px;
+ margin: 0 auto;
+}
+.container:before, .container:after {
+ content: "";
+ display: block;
+ clear: both;
+}
+.container .info {
+ margin: 50px auto;
+ text-align: center;
+}
+.container .info h1 {
+ margin: 0 0 15px;
+ padding: 0;
+ font-size: 36px;
+ font-weight: 300;
+ color: #1a1a1a;
+}
+.container .info span {
+ color: #4d4d4d;
+ font-size: 12px;
+}
+.container .info span a {
+ color: #000000;
+ text-decoration: none;
+}
+.container .info span .fa {
+ color: #EF3B3A;
+}
\ No newline at end of file
diff --git a/_css/nav.css b/_css/nav.css
index b4397d7..4af7f94 100644
--- a/_css/nav.css
+++ b/_css/nav.css
@@ -1,11 +1,8 @@
nav {
display: block;
- width: 80%;
+ width: 100%;
margin: 0px auto;
height: 50px;
- webkit-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- -moz-box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
- box-shadow: 0px 0px 11px 4px rgba(0,0,0,0.75);
font-weight: bold;
}
diff --git a/_image/camp.png b/_image/camp.png
new file mode 100644
index 0000000..1cd466c
Binary files /dev/null and b/_image/camp.png differ
diff --git a/_include/include_accept_apply.php b/_include/include_accept_apply.php
new file mode 100644
index 0000000..d50ddf4
--- /dev/null
+++ b/_include/include_accept_apply.php
@@ -0,0 +1,21 @@
+is_id()) {
+
+ # JELENTEKEZÉS ELFOGADÁSA
+ camp_apply::apply_response($this->get_id(), 3);
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($this->get_id());
+ header('Location: /admin/camps/' . $new_apply->get_capp_camp_id()->get_camp_id());
+
+
+}
+
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_apply.php b/_include/include_apply.php
new file mode 100644
index 0000000..fa7cc22
--- /dev/null
+++ b/_include/include_apply.php
@@ -0,0 +1,50 @@
+is_id()) {
+
+ # TÁBORI JELENTKEZÉS
+
+ //jelentkező
+ $apply = new camp_apply();
+ $apply->set_capp_data_by_id($this->get_id());
+
+ //felelős kapcsolattartó
+ $res_cc_id = $sql->single_variable("SELECT cac_camp_contact_cc_id FROM camp_apply_contact WHERE cac_is_responsible = 1 AND cac_camp_apply_capp_id = " . $this->get_id() );
+ $res_cc = new camp_contact();
+ $res_cc->set_cc_data_by_id($res_cc_id);
+
+ //további kapcst-ók
+
+ $cc_ids = $sql->assoc_array("SELECT cac_camp_contact_cc_id FROM camp_apply_contact WHERE cac_is_responsible = 0 AND cac_camp_apply_capp_id = " . $this->get_id() );
+
+ $contacts = array();
+ foreach ($cc_ids as $cc) {
+ $contact = new camp_contact();
+ $contact->set_cc_data_by_id($cc['cac_camp_contact_cc_id']);
+ $contacts[] = $contact;
+ }
+
+
+
+
+
+
+ $smarty->assign('apply',$apply);
+ $smarty->assign('res_cc',$res_cc);
+ $smarty->assign('contacts',$contacts);
+ $smarty->display('apply.tpl');
+
+}
+
+else {
+
+
+}
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_camp_applies.php b/_include/include_camp_applies.php
new file mode 100644
index 0000000..60887a5
--- /dev/null
+++ b/_include/include_camp_applies.php
@@ -0,0 +1,57 @@
+is_id()) {
+
+
+
+
+}
+
+else {
+
+ # JELENTKEZÉSEK: 2 táblázat
+ // elbírált jelentkezések
+ // elfogadásra váró jelentkezések
+
+ //lekérjük az elbírált jelentkezéseket
+ $accepted_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE ck_owner_id = " . $user->get_cu_id() . " AND capp_status in (3,4);");
+ $color = "";
+ $apply_array = array();
+ foreach ($accepted_applies as $apply) {
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($apply['capp_id']);
+ //lekérjük a státuszt
+ //TODO: objektummal
+ $status = $sql->single_variable('SELECT cas_name FROM camp_apply_status WHERE cas_id = ' . $new_apply->get_capp_status());
+ if ($new_apply->get_capp_status() == 3) {
+ $color = "green";
+ }
+ else {
+ $color = "red";
+ }
+ $new_apply->set_capp_status($status);
+ $apply_array[] = $new_apply;
+ }
+
+
+ //lekérjük az elfogadásra váró jelentkezéseket
+ $pending_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE ck_owner_id = " . $user->get_cu_id() . " AND capp_status = 2;");
+
+ $apply_array_2 = array();
+ foreach ($pending_applies as $apply) {
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($apply['capp_id']);
+ $apply_array_2[] = $new_apply;
+ }
+
+ $smarty->assign('color', $color);
+ $smarty->assign('apply_array', $apply_array);
+ $smarty->assign('pending_apply_array', $apply_array_2);
+ $smarty->display('applies.tpl');
+
+}
+
+?>
\ No newline at end of file
diff --git a/_include/include_camp_apply.php b/_include/include_camp_apply.php
new file mode 100644
index 0000000..b0e3bc6
--- /dev/null
+++ b/_include/include_camp_apply.php
@@ -0,0 +1,167 @@
+is_id()) {
+
+ # TÁBORI JELENTKEZÉS
+ //var_dump($_COOKIE);
+
+ if ($this->get_id() == 1) {
+ //1. LÉPÉS JELENTKEZŐ ADATAI
+ //lekérjük a camp_user kid-jeit egy tömbbe
+ $kid_assoc_array = $sql->assoc_array("SELECT * FROM camp_kid WHERE ck_owner_id = " . $user->get_cu_id() . " AND ck_original_id IS NULL");
+ $kids = array();
+ foreach ($kid_assoc_array as $kid_array) {
+ $new_kid = new camp_kid();
+ $new_kid->set_ck_data_by_id($kid_array['ck_id']);
+ $kids[] = $new_kid;
+ }
+
+ $shirt_assoc_array = $sql->assoc_array("SELECT * FROM camp_shirt WHERE cshirt_deleted = 0 ORDER BY cshirt_id ASC;");
+ $shirts = array();
+ foreach ($shirt_assoc_array as $shirt) {
+ $new_shirt = new camp_shirt();
+ $new_shirt->set_cshirt_data_by_id($shirt['cshirt_id']);
+ $shirts[] = $new_shirt;
+ }
+
+
+ $smarty->assign('step',1);
+ $smarty->assign('kids',$kids);
+ $smarty->assign('shirts',$shirts);
+ $smarty->display('camp_apply.tpl');
+
+ //var_dump($user);
+ }
+
+ elseif ($this->get_id() == 2) {
+ //2. LÉPÉS KAPCSOLATTARTÓ ADATAI
+ //csak akkor érhető el, ha van cookie, egyébként visszadob az első lépésre
+ if (!isset($_COOKIE['badminton_camp_session_id'])) {
+ header('Location: /tabor/jelentkezes/1');
+ }
+
+ else {
+
+
+ //lekérjük a korábban megadott kapcsolattartókat
+ $contact_assoc_array = $sql->assoc_array("SELECT * FROM camp_contact WHERE cc_owner_id = " . $user->get_cu_id() . " AND cc_original_id IS NULL");
+ $contacts = array();
+ foreach ($contact_assoc_array as $contact_array) {
+ $new_cc = new camp_contact();
+ $new_cc->set_cc_data_by_id($contact_array['cc_id']);
+ $contacts[] = $new_cc;
+ }
+
+ //lekérjük van-e felelős kapcsolattartó
+ //ha van, akkor nem lehet bepipálni
+ //ha nincs, akkor van pipa
+ $has_responsible = camp_apply::has_responsible_contact($_COOKIE['badminton_camp_session_id']);
+
+
+ //lekérjük a contact type-okat
+ $cct_assoc_array = $sql->assoc_array("SELECT * FROM camp_contact_type WHERE cct_owner IS NULL OR cct_owner = " . $user->get_cu_id() . ";");
+ $cct_array = array();
+ foreach ($cct_assoc_array as $cct) {
+ $new_cct = new camp_contact_type();
+ $new_cct->set_cct_data_by_id($cct['cct_id']);
+ $cct_array[] = $new_cct;
+ }
+
+ $smarty->assign('cct_array', $cct_array);
+
+
+
+ //lekérjük a session_id alapján a camp_kid it-t, objektumot csinálunk belőle és úgy adjuk át
+ $ck_id = $sql->single_variable("SELECT capp_camp_kid_ck_id FROM camp_apply WHERE capp_id = " . $_COOKIE['badminton_camp_session_id']);
+ $new_camp_kid = new camp_kid();
+ $new_camp_kid->set_ck_data_by_id($ck_id);
+
+ $smarty->assign('camp_kid', $new_camp_kid);
+ $smarty->assign('contacts', $contacts);
+ $smarty->assign('step',2);
+ $smarty->assign('has_responsible',($has_responsible?true:false));
+ $smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
+ $smarty->display('camp_apply.tpl');
+ }
+ }
+
+ elseif ($this->get_id() == 3) {
+ # amikor nem választott felelős kapcsolattartót
+
+ //megnézzük van-e sessionj-e
+ if (!isset($_COOKIE['badminton_camp_session_id'])) {
+ header('Location: /tabor/jelentkezes/1');
+ }
+
+ //lekérjük a contact-okat
+ $contact_assoc_array = $sql->assoc_array('SELECT * FROM camp_apply_contact WHERE cac_camp_apply_capp_id = ' . $_COOKIE['badminton_camp_session_id']);
+ $contacts = array();
+ foreach ($contact_assoc_array as $contact_array) {
+ $new_contact = new camp_contact();
+ $new_contact->set_cc_data_by_id($contact_array['cac_camp_contact_cc_id']);
+ $contacts[] = $new_contact;
+ }
+
+ $smarty->assign('contacts', $contacts);
+ $smarty->assign('step',3);
+ $smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
+ $smarty->display('camp_apply.tpl');
+
+ }
+
+ elseif ($this->get_id() == 4) {
+ # tábor adatok megadása
+
+ //megnézzük van-e sessionj-e
+ if (!isset($_COOKIE['badminton_camp_session_id'])) {
+ header('Location: /tabor/jelentkezes/1');
+ }
+
+ //lekérjük azokat a táborokat, amikre lehet jelentkezni, és a kezdődátum a mainál később van (>), és nem törölt
+ $camp_assoc_array = $sql->assoc_array("SELECT * FROM camp WHERE camp_deleted = 0 AND camp_is_open = 1 AND camp_from > NOW() ORDER BY camp_from ASC;");
+
+ $camp_array = array();
+ foreach ($camp_assoc_array as $camp) {
+ $new_camp = new camp();
+ $new_camp->set_camp_data_by_id($camp['camp_id']);
+ $camp_array[] = $new_camp;
+ }
+
+ $smarty->assign('step',4);
+ $smarty->assign('camp_array',$camp_array);
+ $smarty->assign('camp_apply_id', $_COOKIE['badminton_camp_session_id']);
+ $smarty->display('camp_apply.tpl');
+
+ }
+
+ elseif ($this->get_id() == 5) {
+ # visszaigazoló szöveg
+
+ //megnézzük van-e sessionj-e
+ if (!isset($_COOKIE['badminton_camp_session_id']) || empty($_COOKIE['badminton_camp_session_id'])) {
+ header('Location: /tabor/jelentkezes/1');
+ }
+
+ setcookie('badminton_camp_session_id', null, time()-60*60, '/');
+ $smarty->assign('step',5);
+ $smarty->display('camp_apply.tpl');
+
+ }
+
+
+}
+
+else {
+
+ # REDIRECT
+ header("Location: /tabor/jelentkezes/1");
+
+
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/_include/include_camp_information.php b/_include/include_camp_information.php
new file mode 100644
index 0000000..32d521f
--- /dev/null
+++ b/_include/include_camp_information.php
@@ -0,0 +1,18 @@
+single_variable($info_query);
+
+ $new_setval = new setting_value();
+ $new_setval->set_setting_value_data_by_id($setv_id);
+
+ $smarty->assign('setting', $new_setval);
+
+ $smarty->display('information.tpl');
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_camp_shirt_types.php b/_include/include_camp_shirt_types.php
new file mode 100644
index 0000000..30737d2
--- /dev/null
+++ b/_include/include_camp_shirt_types.php
@@ -0,0 +1,28 @@
+is_id()) {
+
+ # TÁBORI PÓLÓ SZERKESZTÉSE
+ $camp_shirt_query = "SELECT * FROM camp_shirt WHERE cshirt_id = " . $this->get_id();
+ $camp_shirt_assoc_array = $sql->assoc_array($camp_shirt_query);
+ $smarty->assign('camp_shirt_array',$camp_shirt_assoc_array[0]);
+ $smarty->display('camp_shirt_data_edit.tpl');
+}
+
+else {
+
+ # TÁBORI PÓLÓ LISTA
+
+ $camp_shirt_query = "SELECT * FROM camp_shirt WHERE cshirt_deleted = 0 ORDER BY cshirt_name ASC";
+ $shirt_assoc_array = $sql->assoc_array($camp_shirt_query);
+
+ $smarty->assign('shirt_assoc_array',$shirt_assoc_array);
+ $smarty->display('camp_shirt_list.tpl');
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/_include/include_camp_types.php b/_include/include_camp_types.php
new file mode 100644
index 0000000..270e3e5
--- /dev/null
+++ b/_include/include_camp_types.php
@@ -0,0 +1,37 @@
+is_id()) {
+
+ # TÁBOR_TÍPUS SZERKESZTÉSE
+
+
+}
+
+else {
+
+ # TÁBOR_TÍPUS LISTA
+
+ $ct_query = "SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC";
+ $ct_assoc_array = $sql->assoc_array($ct_query);
+
+ $ct_array = array();
+ foreach ($ct_assoc_array as $value) {
+ $new_ct = new camp_type();
+ $new_ct->set_ct_data_by_id($value['ct_id']);
+ $ct_array[] = $new_ct;
+ }
+
+ $smarty->assign('ct_array',$ct_array);
+ $smarty->display('camp_type_list.tpl');
+
+
+}
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_camps.php b/_include/include_camps.php
new file mode 100644
index 0000000..0897a3f
--- /dev/null
+++ b/_include/include_camps.php
@@ -0,0 +1,134 @@
+is_id()) {
+
+ # TÁBOR SZERKESZTÉSE
+
+ $camp = new camp();
+ $camp->set_camp_data_by_id($this->get_id());
+
+ //labda típusok hozzáadása
+ $shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle_type WHERE cst_deleted = 0 ORDER BY cst_id ASC");
+ $shuttle_array = array();
+ foreach ($shuttle_assoc_array as $shuttle_type) {
+ $new_cst = new camp_shuttle_type();
+ $new_cst->set_cst_data_by_id($shuttle_type['cst_id']);
+ $shuttle_array[] = $new_cst;
+ }
+ $smarty->assign('shuttle_array', $shuttle_array);
+
+
+ //ottalvós opciók hozzáadása
+ $accomodation_assoc = $sql->assoc_array("SELECT * FROM camp_accomodation_type WHERE cat_deleted = 0 ORDER BY cat_id ASC");
+ $accomodation_array = array();
+ foreach ($accomodation_assoc as $accomodation_type) {
+ $new_cat = new camp_accomodation_type();
+ $new_cat->set_cat_data_by_id($accomodation_type['cat_id']);
+ $accomodation_array[] = $new_cat;
+ }
+ $smarty->assign('accomodation_array', $accomodation_array);
+
+
+ //tábor típusok
+ $ct_assoc_array = $sql->assoc_array("SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC");
+ $camp_type_array = array();
+ foreach ($ct_assoc_array as $ct) {
+ $new_ct = new camp_type();
+ $new_ct->set_ct_data_by_id($ct['ct_id']);
+ $camp_type_array[] = $new_ct;
+ }
+ $smarty->assign('camp_type_array', $camp_type_array);
+
+
+
+ //shuttles
+ $shuttles_assoc_array = $sql->assoc_array('SELECT * FROM camp_shuttle WHERE cs_camp_id = ' . $this->get_id());
+ $shuttles = array();
+ foreach ($shuttles_assoc_array as $shuttle) {
+ $new_sh = new camp_shuttle_type();
+ $new_sh->set_cst_data_by_id($shuttle['cs_shuttle_id']);
+ $shuttles[] = $new_sh->get_cst_id(); //csak az id-t rakjuk bele, hogy in_array-jel könnyebb legyen keresni
+ }
+
+ //accomodations
+ $accom_assoc_array = $sql->assoc_array('SELECT * FROM camp_accomodation WHERE ca_camp_id = ' . $this->get_id());
+ $accoms = array();
+ foreach ($accom_assoc_array as $accom) {
+ $new_ac = new camp_accomodation_type();
+ $new_ac->set_cat_data_by_id($accom['ca_accomodation_id']);
+ $accoms[] = $new_ac->get_cat_id(); //csak az id-t rakjuk bele, hogy in_array-jel könnyebb legyen keresni
+ }
+
+ //visszaigazolt jelentkezések
+ $accepted_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE capp_camp_id = " . $this->get_id() . " AND capp_status in (3,4) ORDER BY ck_name ASC;");
+ $color = "";
+ $apply_array = array();
+ foreach ($accepted_applies as $apply) {
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($apply['capp_id']);
+ //lekérjük a státuszt
+ //TODO: objektummal
+ $status = $sql->single_variable('SELECT cas_name FROM camp_apply_status WHERE cas_id = ' . $new_apply->get_capp_status());
+ if ($new_apply->get_capp_status() == 3) {
+ $color = "green";
+ }
+ else {
+ $color = "red";
+ }
+ $new_apply->set_capp_status($status);
+ $apply_array[] = $new_apply;
+ }
+
+ //lekérjük az elfogadásra váró jelentkezéseket
+ $pending_applies = $sql->assoc_array("SELECT * FROM camp_apply JOIN camp_kid on ck_id = capp_camp_kid_ck_id WHERE capp_camp_id = " . $this->get_id() . " AND capp_status = 2 ORDER BY capp_date DESC;;");
+
+ $apply_array_2 = array();
+ foreach ($pending_applies as $apply) {
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($apply['capp_id']);
+ $apply_array_2[] = $new_apply;
+ }
+
+ $smarty->assign('color', $color);
+ $smarty->assign('apply_array', $apply_array);
+ $smarty->assign('pending_apply_array', $apply_array_2);
+
+ $smarty->assign('camp', $camp);
+ $smarty->assign('shuttles', $shuttles);
+ $smarty->assign('accomodations', $accoms);
+
+
+ $smarty->display('camp_data_update.tpl');
+
+}
+
+else {
+
+ # TÁBOR LISTA
+
+ //tábor adatok
+ $camp_query = "SELECT * FROM camp WHERE camp_deleted = 0 ORDER BY camp_from DESC";
+ $camp_assoc_array = $sql->assoc_array($camp_query);
+
+ $camp_array = array();
+ foreach ($camp_assoc_array as $camp_data) {
+ $new_camp = new camp();
+ $new_camp->set_camp_data_by_id($camp_data['camp_id']);
+ $camp_array[] = $new_camp;
+ }
+
+
+ $smarty->assign('camp_array',$camp_array);
+ $smarty->display('camp_list.tpl');
+
+
+}
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_coach_diary.php b/_include/include_coach_diary.php
index 43e2be6..7f290cf 100644
--- a/_include/include_coach_diary.php
+++ b/_include/include_coach_diary.php
@@ -4,27 +4,45 @@
SELECT
*
FROM
- training
- JOIN
- training_coach ON trc_training_tr_id = tr_id
+ (SELECT
+ tr_id AS obj_id,
+ TIMESTAMP(tr_date) AS obj_date,
+ 'training' AS obj_type
+ FROM
+ training
+ JOIN training_coach ON trc_training_tr_id = tr_id
+ WHERE
+ trc_coach_uc_id = " . $user->get_ua_id() . " AND tr_deleted = 0
+ ORDER BY tr_date DESC) valami
+ UNION (SELECT
+ mox_id AS obj_id,
+ TIMESTAMP(date_add(mox_date, INTERVAL '23:59' HOUR_MINUTE)) AS obj_date,
+ 'money_expense' AS obj_type
+ FROM
+ money_expense
WHERE
- trc_coach_uc_id = " . $user->get_ua_id() . "
- ORDER BY tr_date DESC
- ;
+ mox_user_coach_ua_id = " . $user->get_ua_id() . " AND mox_deleted = 0) ORDER BY obj_date DESC , obj_type ASC;
";
$action_assoc_array = $sql->assoc_array($action_list_query);
- $trainings = array();
- foreach ($action_assoc_array as $action) {
- $new_training = new training();
- $new_training->set_training_data_by_id($action['tr_id']);
- $trainings[] = $new_training;
+ $actions = array();
+ foreach ($action_assoc_array as $action_array) {
+ if ('money_expense' == $action_array['obj_type']) {
+ $action = new $action_array['obj_type']();
+ $action->set_mox_data_by_id($action_array['obj_id']);
+ }
+ elseif ('training' == $action_array['obj_type']) {
+ $action = new $action_array['obj_type']();
+ $action->set_training_data_by_id($action_array['obj_id']);
+ }
+ $actions[] = $action;
}
-
- $smarty->assign('trainings', $trainings);
+ //var_dump($actions);
+
+ $smarty->assign('actions',$actions);
$smarty->display('coach_diary.tpl');
diff --git a/_include/include_create.php b/_include/include_create.php
index e59502c..7859bad 100755
--- a/_include/include_create.php
+++ b/_include/include_create.php
@@ -48,7 +48,7 @@ switch ($this->get_id()) {
$training_type_assoc_array = $sql->assoc_array($training_type_query);
$smarty->assign("training_type_assoc_array", $training_type_assoc_array);
//COACH ARRAY
- $coach_data_query = "SELECT * FROM user_coach;";
+ $coach_data_query = "SELECT * FROM user_coach WHERE ua_deleted = 0;";
$coach_data_assoc_array = $sql->assoc_array($coach_data_query);
@@ -154,8 +154,52 @@ switch ($this->get_id()) {
file_put_contents($path.$file_name, $dump_content);
header("Location: /admin/settings/3");
+ break;
+ case 'camp_type':
+ # ÚJ TÁBOR TÍPUS
+ $smarty->display('camp_type_create.tpl');
+ break;
+ case 'camp':
+ # ÚJ TÁBOR
+
+ //tábor típusok
+ $ct_assoc_array = $sql->assoc_array("SELECT * FROM camp_type WHERE ct_deleted = 0 ORDER BY ct_name ASC");
+ $camp_type_array = array();
+ foreach ($ct_assoc_array as $ct) {
+ $new_ct = new camp_type();
+ $new_ct->set_ct_data_by_id($ct['ct_id']);
+ $camp_type_array[] = $new_ct;
+ }
+ $smarty->assign('camp_type_array', $camp_type_array);
+ //labda típusok hozzáadása
+ $shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle_type WHERE cst_deleted = 0 ORDER BY cst_id ASC");
+ $shuttle_array = array();
+ foreach ($shuttle_assoc_array as $shuttle_type) {
+ $new_cst = new camp_shuttle_type();
+ $new_cst->set_cst_data_by_id($shuttle_type['cst_id']);
+ $shuttle_array[] = $new_cst;
+ }
+ $smarty->assign('shuttle_array', $shuttle_array);
+
+
+ //ottalvós opciók hozzáadása
+ $accomodation_assoc = $sql->assoc_array("SELECT * FROM camp_accomodation_type WHERE cat_deleted = 0 ORDER BY cat_id ASC");
+ $accomodation_array = array();
+ foreach ($accomodation_assoc as $accomodation_type) {
+ $new_cat = new camp_accomodation_type();
+ $new_cat->set_cat_data_by_id($accomodation_type['cat_id']);
+ $accomodation_array[] = $new_cat;
+ }
+ $smarty->assign('accomodation_array', $accomodation_array);
+
+
+ $smarty->display('camp_create.tpl');
+ break;
+ case 'camp_shirt':
+ # CAMP SHIRT létrehozása
+ $smarty->display('camp_shirt_create.tpl');
break;
default:
# code...
diff --git a/_include/include_delete_camp.php b/_include/include_delete_camp.php
new file mode 100644
index 0000000..10bdbe9
--- /dev/null
+++ b/_include/include_delete_camp.php
@@ -0,0 +1,14 @@
+is_id()) {
+ //$delete_query = "DELETE FROM user_kid WHERE uk_id = " . $this->get_id() . ";";
+ //$sql->execute_query($delete_query);
+ $sql->update_table('camp', array('camp_deleted' => 1), array('camp_id' => $this->get_id()));
+ $new_camp = new camp();
+ $new_camp->set_camp_data_by_id($this->get_id());
+ log::register('delete_camp', $new_camp->get_camp_from() . " (" . $new_camp->get_camp_city() . ")");
+ header("Location: /admin/camps");
+}
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_delete_camp_shirt.php b/_include/include_delete_camp_shirt.php
new file mode 100644
index 0000000..7f027a0
--- /dev/null
+++ b/_include/include_delete_camp_shirt.php
@@ -0,0 +1,19 @@
+is_id()) {
+
+ //akiknek ez a shirt_id van beállítva, azoknál null-ra állítjuk
+ $shirt_query = "SELECT ck_id FROM camp_kid WHERE ck_shirt_size_id = " . $this->get_id();
+ $shirt_assoc_array = $sql->assoc_array($shirt_query);
+ foreach ($shirt_assoc_array as $uk_id) {
+ $sql->update_table('camp_kid', array('ck_shirt_size_id' => 'null'), array('ck_id' => $uk_id['ck_id']));
+ }
+
+ $sql->update_table('camp_shirt', array('cshirt_deleted' => 1), array('cshirt_id' => $this->get_id()));
+
+ log::register('delete_camp_shirt', $this->get_id());
+ header("Location: /admin/camp_shirt_type");
+}
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_delete_camp_type.php b/_include/include_delete_camp_type.php
new file mode 100644
index 0000000..4fa395b
--- /dev/null
+++ b/_include/include_delete_camp_type.php
@@ -0,0 +1,12 @@
+is_id()) {
+ //$delete_query = "DELETE FROM user_kid WHERE uk_id = " . $this->get_id() . ";";
+ //$sql->execute_query($delete_query);
+ $sql->update_table('camp_type', array('ct_deleted' => 1), array('ct_id' => $this->get_id()));
+ log::register('delete_ct', $this->get_id());
+ header("Location: /admin/camp_types");
+}
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_deny_apply.php b/_include/include_deny_apply.php
new file mode 100644
index 0000000..c69c804
--- /dev/null
+++ b/_include/include_deny_apply.php
@@ -0,0 +1,21 @@
+is_id()) {
+
+ # JELENTEKEZÉS ELFOGADÁSA
+ camp_apply::apply_response($this->get_id(), 4);
+ $new_apply = new camp_apply();
+ $new_apply->set_capp_data_by_id($this->get_id());
+ header('Location: /admin/camps/' . $new_apply->get_capp_camp_id()->get_camp_id());
+
+
+}
+
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/_include/include_logout.php b/_include/include_logout.php
index 1798276..61fe440 100644
--- a/_include/include_logout.php
+++ b/_include/include_logout.php
@@ -13,6 +13,11 @@ elseif ($from == 'coach') {
$log_c = 'coach_logout';
$cookie = 'coach';
+}
+elseif ($from == 'tabor') {
+ $log_c = 'camp_user_logout';
+ $cookie = 'camp';
+
}
log::register($log_c, $_COOKIE['badminton_'.$cookie.'_user']);
setcookie('badminton_'.$cookie.'_user', 'null', time()-60*60*72, '/');
diff --git a/common.php b/common.php
index b8b93b7..36c30d1 100644
--- a/common.php
+++ b/common.php
@@ -47,6 +47,21 @@ $months = array(
'12' => 'december',
);
+$short_months = array(
+ '01' => 'jan',
+ '02' => 'feb',
+ '03' => 'már',
+ '04' => 'ápr',
+ '05' => 'máj',
+ '06' => 'jún',
+ '07' => 'júl',
+ '08' => 'aug',
+ '09' => 'szept',
+ '10' => 'okt',
+ '11' => 'nov',
+ '12' => 'dec',
+ );
+
$days = array(
'0' => 'v',
'1' => 'h',
@@ -57,6 +72,10 @@ $days = array(
'6' => 'szo',
);
+$error_msg = array(
+ 1 => 'Ezzel az e-mail címmel már regisztráltak!',
+ );
+
//SMARTY BEÁLLÍTÁSA
//require('../Smarty/Smarty.class.php');
require('../Smarty/Smarty.class.php');
@@ -70,8 +89,10 @@ $smarty->setCacheDir('template/cache');
$smarty->setConfigDir('template/configs');
$smarty->assign('months', $months);
+$smarty->assign('short_months', $short_months);
$smarty->assign('days', $days);
$smarty->assign('today', date('Y-m-d'));
+$smarty->assign('error_msg', $error_msg);
//SQL KAPCSOLAT BEÁLLÍTÁSA
if ($_SERVER['HTTP_HOST'] == 'badmintoncoach.hu') $sql = new sql('bc_mysql','root','','badminton_coach');
@@ -128,6 +149,13 @@ elseif ($_GET['page'] == 'coach_preview' && (isset($_COOKIE['badminton_admin_use
//var_dump($user);
}
}
+elseif ($_GET['page'] == 'tabor' && (isset($_COOKIE['badminton_camp_user']))) {
+ $user = new camp_user();
+ $user->set_user_data_by_id($_COOKIE['badminton_camp_user']);
+ $logout = true;
+ $smarty->assign('user_login', $user);
+ //var_dump($user);
+}
$smarty->assign('can_logout', $logout);
diff --git a/event_handler.php b/event_handler.php
index 5214f69..65fa026 100644
--- a/event_handler.php
+++ b/event_handler.php
@@ -5,6 +5,21 @@ if (isset($_POST['action'])) {
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
switch ($_POST['action']) {
+ case 'user_register':
+ # REGISZTRÁCIÓ
+ $check_user_exists = $sql->num_of_rows("SELECT * FROM camp_user WHERE cu_email = '" . $_POST['user_email'] . "';");
+ if ($check_user_exists) {
+ //van már reg ezzel az email címmel
+ setcookie('bc_reg_error', 1);
+ header("Location: /tabor/regisztracio");
+ }
+ else {
+ //sikeres reg. visszairányítjuk a bejelentkező felületre
+ $new_camp_user = camp_user::create_camp_user($_POST['user_email'], $_POST['user_password'], date("Y-m-d H:i:s"));
+ log::register('new_camp_user', $new_camp_user, date("Y-m-d H:i:s"), $new_camp_user);
+ header("Location: /tabor");
+ }
+ break;
case 'login':
# login
/*
@@ -15,10 +30,12 @@ if (isset($_POST['action'])) {
$user_admin_id = null;
$user_kid_id = null;
$user_coach_id = null;
+ $user_camp_id = null;
if ($_REQUEST['page'] == 'admin') $user_admin_id = $login->check_admin_login($_POST['user_name'], $_POST['user_password']);
if ($_REQUEST['page'] == 'view') $user_kid_id = $login->check_kid_login($_POST['user_name'], $_POST['user_password']);
if ($_REQUEST['page'] == 'coach') $user_coach_id = $login->check_coach_login($_POST['user_name'], $_POST['user_password']);
+ if ($_REQUEST['page'] == 'tabor') $user_camp_id = $login->check_camp_login($_POST['user_name'], $_POST['user_password']);
if ($user_admin_id) {
//sikeres bejelentkezés adminként
@@ -38,6 +55,13 @@ if (isset($_POST['action'])) {
log::register('coach_login', $user_coach_id, null, $user_coach_id);
header("Location: " . $actual_link);
}
+ elseif ($user_camp_id) {
+ //sikeres bejelentkezés szülőként
+ var_dump('itt');
+ $login->login_user($user_camp_id, 'badminton_camp_user', 4);
+ log::register('camp_user_login', $user_camp_id, null, $user_camp_id);
+ header("Location: " . $actual_link);
+ }
else {
//die($user_coach_id);
//sikertelen bejelentkezés
@@ -295,7 +319,8 @@ if (isset($_POST['action'])) {
case 'settings_data_edit':
$sql->update_table('setting_value',
array(
- 'setv_'.$_POST['st_name'] => $_POST['set_val']
+ 'setv_'.$_POST['st_name'] => $_POST['set_val'],
+ 'setv_set_date' => date("Y-m-d H:i:s")
),
array(
'setv_id' => $_POST['setv_id']
@@ -303,6 +328,163 @@ if (isset($_POST['action'])) {
);
break;
+ case 'camp_type_create':
+ # tábor típus létrehozása
+ $new_ct_id = camp_type::create_camp_type($_POST['ct_name']);
+ log::register('new_ct', $new_ct_id);
+ header("Location: /admin/camp_types");
+ break;
+ case 'camp_type_update':
+ # tábor típus módosítása
+ unset($_POST['action']);
+ foreach ($_POST as $key => $value) {
+ $key_parts = explode('_', $key);
+ $ct_id = $key_parts[1];
+ //$sql->update_table('region', array('reg_name' => $value), array('reg_id' => $reg_id));
+ camp_type::update_camp_type($ct_id, $value);
+ }
+ log::register('update_ct', 'update all');
+ header("Location: /admin/camp_types");
+ break;
+ case 'camp_create':
+ # tábor létrehozása
+ unset($_POST['action']);
+ //meg kell vizsgálni, hogy a checkboxos mezők léteznek-e
+ $shuttles = array();
+ if (!empty($_POST['shuttles'])) {
+ $shuttles = $_POST['shuttles'];
+ }
+
+ $accoms = array();
+ if (!empty($_POST['accomodations'])) {
+ $accoms = $_POST['accomodations'];
+ }
+
+ camp::create_camp($_POST['camp_city'], $_POST['camp_from'], $_POST['camp_to'], (!empty($_POST['camp_is_open'])?1:0), $_POST['camp_camp_type_ct_id'], $shuttles, $accoms);
+ log::register('new_camp', $_POST['camp_from'] . " (" . $_POST['camp_city'] . ")");
+ break;
+ case 'camp_update':
+ # tábor módosítás
+ $shuttles = array();
+ if (!empty($_POST['shuttles'])) {
+ $shuttles = $_POST['shuttles'];
+ }
+
+ $accoms = array();
+ if (!empty($_POST['accomodations'])) {
+ $accoms = $_POST['accomodations'];
+ }
+
+ camp::update_camp($_POST['camp_city'], $_POST['camp_from'], $_POST['camp_to'], (!empty($_POST['camp_is_open'])?1:0), $_POST['camp_camp_type_ct_id'], $shuttles, $accoms, $_POST['camp_id']);
+ log::register('update_camp', $_POST['camp_from'] . " (" . $_POST['camp_city'] . ")");
+ header('Location: /admin/camps/' . $_POST['camp_id']);
+
+ break;
+ case 'camp_shirt_create':
+ # tábori póló létrehozása
+ //todo: shirt object
+ $new_shirt_id = $sql->insert_into('camp_shirt', array(
+ 'cshirt_name' => $_POST['shirt_name']
+ )
+ );
+ log::register('new_camp_shirt', $new_shirt_id);
+ header("Location: /admin/camp_shirt_type");
+ break;
+ case 'camp_shirt_data_edit':
+ # camp shirt update
+ //todo: shirt object
+ $sql->update_table('camp_shirt', array(
+ 'cshirt_name' => $_POST['shirt_name'],
+ ),
+ array(
+ 'cshirt_id' => $_POST['shirt_id']
+ )
+ );
+ log::register('update_camp_shirt', $_POST['shirt_id']);
+ header("Location: /admin/camp_shirt_type");
+ break;
+ case 'apply_1':
+ //jelentkezés 1. lépés - jelentkező adatai
+
+ $new_camp_kid_id = camp_kid::create_camp_kid(
+ $_POST['ck_name'],
+ $_POST['ck_birth_year'],
+ $_POST['ck_ss_number'],
+ $_POST['ck_email'],
+ $_POST['ck_mobile'],
+ $_POST['ck_shirt_size_id'],
+ array(
+ 'ck_sport_history' => $_POST['ck_sport_history'],
+ 'ck_badminton_history' => $_POST['ck_badminton_history'],
+ 'ck_food_info' => $_POST['ck_food_info'],
+ 'ck_hygiene_info' => $_POST['ck_hygiene_info'],
+ 'ck_health_info' => $_POST['ck_health_info'],
+ 'ck_pharma_info' => $_POST['ck_pharma_info'],
+ 'ck_other_info' => $_POST['ck_other_info'],
+ ),
+ $_POST['ck_list'],
+ $_POST['ck_owner_id']
+ );
+ //létrehozzuk az apply objektumot és berakjuk cookieba az id-t, azzal azonosítjuk a sessiont
+ $new_apply_id = camp_apply::create_camp_apply($new_camp_kid_id);
+ setcookie('badminton_camp_session_id', $new_apply_id, time()+60*60, '/');
+ header('Location: /tabor/jelentkezes/2');
+ break;
+ case 'apply_2':
+ # jelentkezés 2. lépés - kapcsolattartó adatai
+
+ //leellenőrizzük, hogy új kapcsolat típust adott-e meg, ha igen, fetöltjük, és kivesszük az id-t
+ if ($_POST['cc_camp_contact_type_cct_id'] == 'new') {
+ $new_cct_id = $sql->insert_into('camp_contact_type', array('cct_name' => $_POST['cct_add_new'], 'cct_owner' => $_POST['cc_owner_id']));
+ $_POST['cc_camp_contact_type_cct_id'] = $new_cct_id;
+ }
+
+ $new_cc_id = camp_contact::create_camp_contact(
+ $_POST['cc_name'],
+ $_POST['cc_mobile'],
+ $_POST['cc_email'],
+ $_POST['cc_facebook'],
+ $_POST['cc_camp_contact_type_cct_id'],
+ $_POST['cc_owner_id'],
+ $_POST['cc_list']
+ );
+
+ //hozzáadjuk a jelentkezéshez az új contact-ot
+ $sql->insert_into('camp_apply_contact', array(
+ 'cac_camp_apply_capp_id' => $_COOKIE['badminton_camp_session_id'],
+ 'cac_camp_contact_cc_id' => $new_cc_id,
+ 'cac_is_responsible' => (!empty($_POST['cc_is_responsible'])?1:0),
+ )
+ );
+
+ //megnézzük, hogy továbblépünk, vagy vissza a contact megadós oldalra
+ if (1 == $_POST['add_more']) {
+ header('Location: /tabor/jelentkezes/2');
+ }
+ else {
+ //megnézzük, hogy adott-e meg felelős kapcsolattartót
+ //ha nem, akkor a 3-as oldalon kilistázzuk a megadott kapcsolattartókat, és kattintással lehet választani
+ //ha igen, akkor a negyedik oldalra megyünk
+ if (camp_apply::has_responsible_contact($_COOKIE['badminton_camp_session_id'])) {
+ header('Location: /tabor/jelentkezes/4');
+ }
+ else {
+ header('Location: /tabor/jelentkezes/3');
+ }
+
+ }
+
+ break;
+ case 'apply_3':
+ # kiválasztott felelős kapcsolattartó beállítása
+ camp_apply::make_contact_responsible($_COOKIE['badminton_camp_session_id'], $_POST['cc_is_responsible'], true);
+ header("Location: /tabor/jelentkezes/4");
+ break;
+ case 'apply_4':
+ # jelentkezés lezárása
+ camp_apply::update_camp_apply($_POST['camp_apply_id'], 2, $_POST['camp_accomodation'], $_POST['camp_shuttle'], date('Y-m-d H:i:s'), 'null', $_POST['camp_id']);
+ header('Location: /tabor/jelentkezes/5');
+ break;
default:
# code...
break;
diff --git a/index.php b/index.php
index d0dd9fc..2b275fb 100644
--- a/index.php
+++ b/index.php
@@ -31,6 +31,7 @@ setlocale(LC_ALL, 'hu_HU');
+
is_page() && in_array($page->get_page(), array('view', 'preview'))) {
echo ' ';
@@ -44,6 +45,10 @@ setlocale(LC_ALL, 'hu_HU');
echo ' ';
}
+ if ($page->is_page() && ($page->get_page() == 'tabor')) {
+ echo ' ';
+ }
+
?>
diff --git a/template/templates/applies.tpl b/template/templates/applies.tpl
new file mode 100644
index 0000000..7157a83
--- /dev/null
+++ b/template/templates/applies.tpl
@@ -0,0 +1,82 @@
+
Visszaigazolt jelentkezések
+
+
+ #
+ Jelentkező
+ Tábor helye, ideje
+ Jelentkezés ideje
+ Státusz
+ Visszaigazolás dátuma
+
+ {if !count($apply_array)}
+
+ Nincs még visszaigazolt jelentkezése
+
+ {else}
+ {foreach $apply_array as $apply}
+
+
+ {$apply->get_capp_id()}
+
+
+ {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
+
+
+ {$apply->get_capp_camp_id()->get_camp_city()}
+ ({$short_months[$apply->get_capp_camp_id()->get_camp_from()|date_format:"%m"]}. {$apply->get_capp_camp_id()->get_camp_from()|date_format:"%e"}. -
+ {if $apply->get_capp_camp_id()->get_camp_from()|date_format:"%m" != $apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"}
+ {$short_months[$apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"]}.
+ {/if}
+ {$apply->get_capp_camp_id()->get_camp_to()|date_format:"%e"}.)
+
+
+ {$apply->get_capp_date()|substr:0:16}
+
+
+ {$apply->get_capp_status()}
+
+
+ {$apply->get_capp_accept_date()|substr:0:16}
+
+
+ {/foreach}
+ {/if}
+
+
+
+Függőben lévő jelentkezések
+
+
+ #
+ Jelentkező
+ Tábor helye, ideje
+ Jelentkezés ideje
+
+ {if !count($pending_apply_array)}
+
+ Nincs függőben lévő jelentkezése
+
+ {else}
+ {foreach $pending_apply_array as $apply}
+
+
+ {$apply->get_capp_id()}
+
+
+ {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
+
+
+ {$apply->get_capp_camp_id()->get_camp_city()}
+ ({$short_months[$apply->get_capp_camp_id()->get_camp_from()|date_format:"%m"]}. {$apply->get_capp_camp_id()->get_camp_from()|date_format:"%e"}. -
+ {if $apply->get_capp_camp_id()->get_camp_from()|date_format:"%m" != $apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"}
+ {$short_months[$apply->get_capp_camp_id()->get_camp_to()|date_format:"%m"]}.
+ {/if}
+ {$apply->get_capp_camp_id()->get_camp_to()|date_format:"%e"}.)
+
+
+ {$apply->get_capp_date()|substr:0:16}
+
+
+ {/foreach}
+ {/if}
+
\ No newline at end of file
diff --git a/template/templates/apply.tpl b/template/templates/apply.tpl
new file mode 100644
index 0000000..afc869f
--- /dev/null
+++ b/template/templates/apply.tpl
@@ -0,0 +1,188 @@
+
+
Jelentkező adatai
+
+
+
+ Név:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
+
+
+
+
+ Születés éve:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_birth_year()}
+
+
+
+
+ TAJ-szám:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_ss_number()}
+
+
+
+
+ E-mail cím:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_email()}
+
+
+
+
+ Mobilszám:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_mobile()}
+
+
+
+
+ Tollaslabda múlt:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_badminton_history())}
+
+
+
+
+ Sport múlt:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_sport_history()}
+
+
+
+
+ Pólóméret:
+
+
{$apply->get_capp_camp_kid_ck_id()->get_ck_shirt()->get_cshirt_name()}
+
+
+
+
+ Étkezéssel kapcsolatos információk:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_food_info())}
+
+
+
+
+ Tisztálkodással kapcsolatos információk:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_hygiene_info())}
+
+
+
+
+ Egészségügyi információk:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_health_info())}
+
+
+
+
+ Rendszeres vagy alkalmi gyógyszerek:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_pharma_info())}
+
+
+
+
+ Egyéb információk:
+
+
{nl2br($apply->get_capp_camp_kid_ck_id()->get_ck_other_info())}
+
+
+
Tábor adatok
+
+
+
+
+ Tábor típus:
+
+
{$apply->get_capp_accomodation_type()->get_cat_name()}
+
+
+
+
+ Labda típus:
+
+
{$apply->get_capp_shuttle_type()->get_cst_name()}
+
+
+
+
Felelős kapcsolattartó
+
+
+
+
+ Név:
+
+
{$res_cc->get_cc_name()}
+
+
+
+
+ Mobil:
+
+
{$res_cc->get_cc_mobile()}
+
+
+
+
+ E-mail cím:
+
+
{$res_cc->get_cc_email()}
+
+
+
+
+ Facebook:
+
+
{$res_cc->get_cc_facebook()}
+
+
+
+
+ Kapcsolat:
+
+
{$res_cc->get_cc_camp_contact_type()->get_cct_name()}
+
+
+
További kapcsolattartó(k)
+
+{foreach $contacts as $res_cc}
+
+
{$res_cc->get_cc_name()}
+
+
+
+
+ Mobil:
+
+
{$res_cc->get_cc_mobile()}
+
+
+
+
+ E-mail cím:
+
+
{$res_cc->get_cc_email()}
+
+
+
+
+ Facebook:
+
+
{$res_cc->get_cc_facebook()}
+
+
+
+
+ Kapcsolat:
+
+
{$res_cc->get_cc_camp_contact_type()->get_cct_name()}
+
+{/foreach}
+
+
+
diff --git a/template/templates/camp_apply.tpl b/template/templates/camp_apply.tpl
new file mode 100644
index 0000000..24c6e3b
--- /dev/null
+++ b/template/templates/camp_apply.tpl
@@ -0,0 +1,356 @@
+{if $step == 1}
+
+
+
+{elseif $step == 2}
+
+
+
+{elseif $step == 3}
+
+
2/3. Kapcsolattartó adatainak megadása
+Ön nem adott meg felelős kapcsolattartót. Kérjük, a jelentkezéshez válasszon ki 1 felelős kapcsolattartót!
+
+
+
+
+
+
+
+
+
+
+{elseif $step == 4}
+
+
3/3. Tábor kiválasztása
+
+
+
+
+
+
+
+
+
+
+
+
+
+{elseif $step == 5}
+
+Jelentkezését sikeresen rögzítettük!
+A jelentkezés állapotát a 'Korábbi jelentkezések' menüpont alatt tekintheti meg!
+
+{/if}
+
+
+
\ No newline at end of file
diff --git a/template/templates/camp_create.tpl b/template/templates/camp_create.tpl
new file mode 100644
index 0000000..f8aab86
--- /dev/null
+++ b/template/templates/camp_create.tpl
@@ -0,0 +1,63 @@
+
\ No newline at end of file
diff --git a/template/templates/camp_data_update.tpl b/template/templates/camp_data_update.tpl
new file mode 100644
index 0000000..0f90982
--- /dev/null
+++ b/template/templates/camp_data_update.tpl
@@ -0,0 +1,149 @@
+
+
+
+
+Függőben lévő jelentkezések
+
+
+ #
+ Jelentkező
+ Jelentkezés ideje
+ Elfogadás
+ Elutasítás
+
+ {if !count($pending_apply_array)}
+
+ Nincs függőben lévő jelentkezés
+
+ {else}
+ {foreach $pending_apply_array as $apply}
+
+
+ {$apply->get_capp_id()}
+
+
+ {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
+
+
+ {$apply->get_capp_date()|substr:0:16}
+
+
+
+
+
+
+
+
+ {/foreach}
+ {/if}
+
+
+Visszaigazolt jelentkezések
+
+
+ #
+ Jelentkező
+ Jelentkezés ideje
+ Státusz
+ Visszaigazolva
+ Módosítás
+
+ {if !count($apply_array)}
+
+ Nincs még visszaigazolt jelentkezés
+
+ {else}
+ {foreach $apply_array as $apply}
+
+
+ {$apply->get_capp_id()}
+
+
+ {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
+
+
+ {$apply->get_capp_date()|substr:0:16}
+
+
+ {$apply->get_capp_status()}
+
+
+ {$apply->get_capp_accept_date()|substr:0:16}
+
+
+ {if $apply->get_capp_status() == 'Elutasítva'}
+
+ {else}
+
+ {/if}
+
+
+ {/foreach}
+ {/if}
+
\ No newline at end of file
diff --git a/template/templates/camp_list.tpl b/template/templates/camp_list.tpl
new file mode 100644
index 0000000..767ed5a
--- /dev/null
+++ b/template/templates/camp_list.tpl
@@ -0,0 +1,84 @@
+
+
+ {foreach $camp_array as $camp}
+ {if
+ $camp@first ||
+ (
+ $camp_array[$camp@index]->get_camp_to()|substr:5:2 != $camp_array[$camp@index-1]->get_camp_to()|substr:5:2
+ )
+
+ }
+ {if !$camp@first &&
+ $camp_array[$camp@index]->get_camp_to()|substr:5:2 != $camp_array[$camp@index-1]->get_camp_to()|substr:5:2
+ }
+
+ {/if}
+ {$camp_array[$camp@index]->get_camp_to()|substr:0:4}.
+ {$months[$camp_array[$camp@index]->get_camp_to()|substr:5:2]}
+
+
+
+ {/if}
+ {/foreach}
+
+
+
+
\ No newline at end of file
diff --git a/template/templates/camp_shirt_create.tpl b/template/templates/camp_shirt_create.tpl
new file mode 100644
index 0000000..d5b7069
--- /dev/null
+++ b/template/templates/camp_shirt_create.tpl
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/template/templates/camp_shirt_data_edit.tpl b/template/templates/camp_shirt_data_edit.tpl
new file mode 100644
index 0000000..c281b44
--- /dev/null
+++ b/template/templates/camp_shirt_data_edit.tpl
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/template/templates/camp_shirt_list.tpl b/template/templates/camp_shirt_list.tpl
new file mode 100644
index 0000000..db2b374
--- /dev/null
+++ b/template/templates/camp_shirt_list.tpl
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/template/templates/camp_type_create.tpl b/template/templates/camp_type_create.tpl
new file mode 100644
index 0000000..f863388
--- /dev/null
+++ b/template/templates/camp_type_create.tpl
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/template/templates/camp_type_list.tpl b/template/templates/camp_type_list.tpl
new file mode 100644
index 0000000..61f01cb
--- /dev/null
+++ b/template/templates/camp_type_list.tpl
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/template/templates/information.tpl b/template/templates/information.tpl
index d8f9ae2..a5b3e71 100644
--- a/template/templates/information.tpl
+++ b/template/templates/information.tpl
@@ -1,3 +1,5 @@
+
{$setting->get_setv_text()}
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/template/templates/log.tpl b/template/templates/log.tpl
index 96b346c..5c25bba 100644
--- a/template/templates/log.tpl
+++ b/template/templates/log.tpl
@@ -48,6 +48,8 @@
{$log->get_log_user()->get_ua_name()}
{elseif $log->get_log_category()->get_logc_type() == 2}
{$log->get_log_user()->get_uk_name()}
+ {elseif $log->get_log_category()->get_logc_type() == 3}
+ {$log->get_log_user()->get_cu_email()}
{/if}
{$log->get_log_category()->get_logc_title()}
diff --git a/template/templates/login.tpl b/template/templates/login.tpl
index c4ddcac..ef5ed98 100755
--- a/template/templates/login.tpl
+++ b/template/templates/login.tpl
@@ -1,23 +1,12 @@
-
\ No newline at end of file
+
diff --git a/template/templates/nav.tpl b/template/templates/nav.tpl
index 9ee00c7..2c9da11 100755
--- a/template/templates/nav.tpl
+++ b/template/templates/nav.tpl
@@ -7,8 +7,10 @@
{if $page == 'admin' || $page == 'coach' || $page == 'coach_preview'}
{$user_login->get_ua_name()}
- {else}
+ {elseif $page == 'view' || $page == 'preview'}
{$user_login->get_uk_name()}
+ {elseif $page == 'tabor'}
+ {$user_login->get_cu_email()}
{/if}
@@ -23,7 +25,7 @@
{else}
- Bejelentkezés
+ Badminton Coach{if $page == 'tabor'} - tábori jelentkezés{/if}
{/if}
@@ -33,8 +35,10 @@
{if $page == 'admin' || $page == 'coach' || $page == 'coach_preview'}
{$user_login->get_ua_name()}
- {else}
+ {elseif $page == 'view' || $page == 'preview'}
{$user_login->get_uk_name()}
+ {elseif $page == 'tabor'}
+ {$user_login->get_cu_email()}
{/if}
diff --git a/template/templates/register.tpl b/template/templates/register.tpl
new file mode 100644
index 0000000..ddf3ab6
--- /dev/null
+++ b/template/templates/register.tpl
@@ -0,0 +1,38 @@
+
+
+
+
+
\ No newline at end of file