20161230
sql delete replaced by delete flag log list (simple), log categories minor bug fixes in css
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
ini_set('include_path', '../_class/');
|
||||
include('class_sql.php');
|
||||
include('class_log.php');
|
||||
/*
|
||||
foreach ($_POST as $key => $value) {
|
||||
trigger_error($_SERVER['HTTP_HOST'], E_USER_NOTICE);
|
||||
@@ -12,9 +13,11 @@ else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
|
||||
|
||||
if ($_POST['checked'] == "true") {
|
||||
$sql->insert_into('presence', array('pr_user_kid_uk_id' => $_POST['user_id'], 'pr_training_tr_id' => $_POST['tr_id']));
|
||||
log::register('new_presence', 'Edzés: ' . $_POST['tr_id'] . ', gyerek: ' . $_POST['user_id'], null, $_POST['admin_id']);
|
||||
}
|
||||
else {
|
||||
$sql->execute_query('delete from presence where pr_user_kid_uk_id = ' . $_POST['user_id'] . ' AND pr_training_tr_id = ' . $_POST['tr_id']);
|
||||
log::register('delete_presence', 'Edzés: ' . $_POST['tr_id'] . ', gyerek: ' . $_POST['user_id'], null, $_POST['admin_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
150
_class/class_log.php
Normal file
150
_class/class_log.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
class log {
|
||||
private $log_id;
|
||||
private $log_log_category_logc_id; //EZ CSAK AZ ID
|
||||
private $log_category; //EZ A LOG_CATEGORY OBJEKTUM
|
||||
private $log_date;
|
||||
private $log_user_id; //EZ CSAK AZ ID
|
||||
private $log_user; //EZ A USER OBJEKTUM
|
||||
private $log_text;
|
||||
|
||||
|
||||
public static function register($_category_name, $_text, $_date = null, $_user_id = null) {
|
||||
global $sql, $user;
|
||||
$category_id = $sql->single_variable("SELECT logc_id FROM log_category WHERE logc_name = '" . $_category_name . "';");
|
||||
|
||||
if (is_object($user)) {
|
||||
//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';
|
||||
}
|
||||
|
||||
$sql->insert_into('log', array(
|
||||
'log_log_category_logc_id' => $category_id,
|
||||
'log_user_id' => (!$_user_id?$user->$function_name():$_user_id),
|
||||
'log_date' => (!$_date?date("Y-m-d H:i:s"):$_date),
|
||||
'log_text' => $_text
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function set_log_id($_id) {
|
||||
$this->log_id = $_id;
|
||||
}
|
||||
|
||||
public function set_log_log_category_logc_id($_log_category_logc_id) {
|
||||
$this->log_log_category_logc_id = $_log_category_logc_id;
|
||||
}
|
||||
|
||||
public function set_log_category($_category) {
|
||||
$this->log_category = $_category;
|
||||
}
|
||||
|
||||
public function set_log_date($_date) {
|
||||
$this->log_date = $_date;
|
||||
}
|
||||
|
||||
public function set_log_user_id($_user_id) {
|
||||
$this->log_user_id = $_user_id;
|
||||
}
|
||||
|
||||
public function set_log_user($_user) {
|
||||
$this->log_user = $_user;
|
||||
}
|
||||
|
||||
public function set_log_text($_text) {
|
||||
$this->log_text = $_text;
|
||||
}
|
||||
|
||||
public function set_log_table($_table) {
|
||||
$this->log_table = $_table;
|
||||
}
|
||||
|
||||
public function set_log_field($_field) {
|
||||
$this->log_field = $_field;
|
||||
}
|
||||
|
||||
public function set_log_selector($_selector) {
|
||||
$this->log_selector = $_selector;
|
||||
}
|
||||
|
||||
public function get_log_id() {
|
||||
return $this->log_id;
|
||||
}
|
||||
|
||||
public function get_log_log_category_logc_id() {
|
||||
return $this->log_log_category_logc_id;
|
||||
}
|
||||
|
||||
public function get_log_category() {
|
||||
return $this->log_category;
|
||||
}
|
||||
|
||||
public function get_log_date() {
|
||||
return $this->log_date;
|
||||
}
|
||||
|
||||
public function get_log_user_id() {
|
||||
return $this->log_user_id;
|
||||
}
|
||||
|
||||
public function get_log_user() {
|
||||
return $this->log_user;
|
||||
}
|
||||
|
||||
public function get_log_text() {
|
||||
global $sql;
|
||||
//ha nincs TABLE beállítva, akkor visszaadja az üzenetet
|
||||
if (!$this->get_log_category()->get_logc_table()) return $this->log_text;
|
||||
else return $sql->single_variable("SELECT " . $this->get_log_category()->get_logc_field() . " FROM " . $this->get_log_category()->get_logc_table() . " WHERE " . $this->get_log_category()->get_logc_selector() . " = " . $this->log_text);
|
||||
}
|
||||
|
||||
public function get_log_table() {
|
||||
return $this->log_table;
|
||||
}
|
||||
|
||||
public function get_log_field() {
|
||||
return $this->log_field;
|
||||
}
|
||||
|
||||
public function get_log_selector() {
|
||||
return $this->log_selector;
|
||||
}
|
||||
|
||||
public function get_log_img() {
|
||||
if (strstr($this->get_log_category()->get_logc_name(), 'new')) return 'tick';
|
||||
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'))) return 'login';
|
||||
}
|
||||
|
||||
public function set_log_data_by_id($_log_id) {
|
||||
global $sql, $user;
|
||||
$log_data_assoc_array = $sql->assoc_array("select * from log where log_id = " . $_log_id);
|
||||
$log_data_array = $log_data_assoc_array[0];
|
||||
foreach ($log_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value);
|
||||
if ($field == 'log_log_category_logc_id') {
|
||||
//beállítja a log_category objektumot
|
||||
$log_cat = new log_category();
|
||||
$log_cat->set_logc_data_by_id($value);
|
||||
$this->set_log_category($log_cat);
|
||||
}
|
||||
|
||||
if ($field == 'log_user_id') {
|
||||
//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();
|
||||
$new_user->set_user_data_by_id($value);
|
||||
$this->set_log_user($new_user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
79
_class/class_log_category.php
Normal file
79
_class/class_log_category.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
class log_category {
|
||||
private $logc_id;
|
||||
private $logc_name;
|
||||
private $logc_title;
|
||||
private $logc_type;
|
||||
private $logc_table;
|
||||
private $logc_field;
|
||||
private $logc_selector;
|
||||
|
||||
public function set_logc_id($_id) {
|
||||
$this->logc_id = $_id;
|
||||
}
|
||||
|
||||
public function set_logc_name($_name) {
|
||||
$this->logc_name = $_name;
|
||||
}
|
||||
|
||||
public function set_logc_title($_title) {
|
||||
$this->logc_title = $_title;
|
||||
}
|
||||
|
||||
public function set_logc_type($_type) {
|
||||
$this->logc_type = $_type;
|
||||
}
|
||||
|
||||
public function set_logc_table($_table) {
|
||||
$this->logc_table = $_table;
|
||||
}
|
||||
|
||||
public function set_logc_field($_field) {
|
||||
$this->logc_field = $_field;
|
||||
}
|
||||
|
||||
public function set_logc_selector($_selector) {
|
||||
$this->logc_selector = $_selector;
|
||||
}
|
||||
|
||||
public function get_logc_id() {
|
||||
return $this->logc_id;
|
||||
}
|
||||
|
||||
public function get_logc_name() {
|
||||
return $this->logc_name;
|
||||
}
|
||||
|
||||
public function get_logc_title() {
|
||||
return $this->logc_title;
|
||||
}
|
||||
|
||||
public function get_logc_type() {
|
||||
return $this->logc_type;
|
||||
}
|
||||
|
||||
public function get_logc_table() {
|
||||
return $this->logc_table;
|
||||
}
|
||||
|
||||
public function get_logc_field() {
|
||||
return $this->logc_field;
|
||||
}
|
||||
|
||||
public function get_logc_selector() {
|
||||
return $this->logc_selector;
|
||||
}
|
||||
|
||||
public function set_logc_data_by_id($_logc_id) {
|
||||
global $sql, $user;
|
||||
$logc_data_assoc_array = $sql->assoc_array("select * from log_category where logc_id = " . $_logc_id);
|
||||
$logc_data_array = $logc_data_assoc_array[0];
|
||||
foreach ($logc_data_array as $field => $value) {
|
||||
$function_name = "set_" . $field;
|
||||
$this->$function_name($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -125,6 +125,10 @@ class page {
|
||||
# DIÁKOLIMPIA KÖRZETEK
|
||||
include('include_regions.php');
|
||||
break;
|
||||
case 'log':
|
||||
# NAPLÓ
|
||||
include('include_log.php');
|
||||
break;
|
||||
case 'lock_training':
|
||||
# EDZÉS ZÁROLÁS, FELOLDÁS
|
||||
include('include_lock_training.php');
|
||||
|
||||
@@ -15,6 +15,7 @@ class training {
|
||||
private $tr_user_coach_uc_id;
|
||||
private $tr_duration;
|
||||
private $tr_locked;
|
||||
private $tr_deleted;
|
||||
private $coaches = array();
|
||||
|
||||
|
||||
@@ -38,6 +39,10 @@ class training {
|
||||
$this->tr_locked = $_tr_locked;
|
||||
}
|
||||
|
||||
public function set_tr_deleted($_tr_deleted) {
|
||||
$this->tr_deleted = $_tr_deleted;
|
||||
}
|
||||
|
||||
public function get_tr_id() {
|
||||
return $this->tr_id;
|
||||
}
|
||||
@@ -70,6 +75,10 @@ class training {
|
||||
return $this->tr_locked;
|
||||
}
|
||||
|
||||
public function get_tr_deleted() {
|
||||
return $this->tr_deleted;
|
||||
}
|
||||
|
||||
public function get_tr_type_name_by_id() {
|
||||
global $sql;
|
||||
return $sql->single_variable("SELECT trt_name FROM training_type WHERE trt_id = " . $this->get_tr_training_type_trt_id());
|
||||
@@ -79,7 +88,7 @@ class training {
|
||||
//beállítja a tr_coaches array-be a coach-okat
|
||||
//EZ CSAK AZ EDZŐKET ÁLLÍTJA BE, A SEGÉDEDZŐKET NEM
|
||||
global $sql;
|
||||
$coach_ids = $sql->assoc_array("SELECT trc_coach_uc_id FROM training_coach WHERE trc_helper = 0 AND trc_training_tr_id = " . $this->get_tr_id());
|
||||
$coach_ids = $sql->assoc_array("SELECT trc_coach_uc_id FROM training_coach JOIN user_coach ON ua_id = trc_coach_uc_id WHERE ua_deleted = 0 AND trc_helper = 0 AND trc_training_tr_id = " . $this->get_tr_id());
|
||||
$this->tr_coaches = array();
|
||||
foreach ($coach_ids as $trc) {
|
||||
$this->tr_coaches[] = $trc['trc_coach_uc_id'];
|
||||
@@ -131,6 +140,7 @@ class training {
|
||||
'tr_duration' => $_training_value_array['tr_duration']
|
||||
)
|
||||
);
|
||||
log::register('new_training', $new_tr_id);
|
||||
//itt rakjuk be a coach-okat
|
||||
if (isset($_training_value_array['coaches'])) {
|
||||
foreach ($_training_value_array['coaches'] as $coach_id) {
|
||||
@@ -163,7 +173,8 @@ class training {
|
||||
if (isset($coaches)) {
|
||||
foreach ($coaches as $coach_id) {
|
||||
# beilleszt minden edzőt ehhez az edzéshez
|
||||
$sql->insert_into('training_coach', array('trc_training_tr_id' => $new_tr_id, 'trc_coach_uc_id' => $coach_id));
|
||||
$new_tr_id = $sql->insert_into('training_coach', array('trc_training_tr_id' => $new_tr_id, 'trc_coach_uc_id' => $coach_id));
|
||||
log::register('new_training', $new_tr_id);
|
||||
}
|
||||
}
|
||||
if (isset($helpers)) {
|
||||
|
||||
@@ -33,6 +33,7 @@ class user_kid extends user_parent {
|
||||
private $user_region;
|
||||
private $user_contact;
|
||||
private $user_other;
|
||||
private $user_deleted;
|
||||
|
||||
public function set_uk_id($_uid) {
|
||||
$this->user_id = $_uid;
|
||||
@@ -88,6 +89,9 @@ class user_kid extends user_parent {
|
||||
public function set_uk_other($_uk_other) {
|
||||
$this->user_other = $_uk_other;
|
||||
}
|
||||
public function set_uk_deleted($_uk_deleted) {
|
||||
$this->user_deleted = $_uk_deleted;
|
||||
}
|
||||
|
||||
public function get_uk_id() {
|
||||
return $this->user_id;
|
||||
@@ -164,6 +168,9 @@ class user_kid extends user_parent {
|
||||
public function get_uk_other() {
|
||||
return $this->user_other;
|
||||
}
|
||||
public function get_uk_deleted() {
|
||||
return $this->user_deleted;
|
||||
}
|
||||
|
||||
|
||||
public function get_uk_presence($_training_id) {
|
||||
|
||||
@@ -17,6 +17,7 @@ class user_parent {
|
||||
private $up_email;
|
||||
private $up_phone;
|
||||
private $up_facebook;
|
||||
private $up_deleted;
|
||||
private $logged_in;
|
||||
|
||||
|
||||
@@ -48,6 +49,10 @@ class user_parent {
|
||||
$this->up_facebook = $_facebook;
|
||||
}
|
||||
|
||||
public function set_up_deleted($_deleted) {
|
||||
$this->up_deleted = $_deleted;
|
||||
}
|
||||
|
||||
public function get_up_id() {
|
||||
return $this->up_id;
|
||||
}
|
||||
@@ -76,6 +81,12 @@ class user_parent {
|
||||
return $this->up_facebook;
|
||||
}
|
||||
|
||||
public function get_up_deleted() {
|
||||
return $this->up_deleted;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function set_login($_login) {
|
||||
//bool-t kap paraméterül
|
||||
$this->logged_in = $_login;
|
||||
|
||||
@@ -162,6 +162,52 @@ td.create a {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
table.log {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.log td {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
table.log img {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
table.log tr.login {
|
||||
background-color: #e4d7d7;
|
||||
}
|
||||
|
||||
table.log tr.lock, table.log tr.edit {
|
||||
background-color: #fbff68;
|
||||
}
|
||||
|
||||
table.log tr.tick {
|
||||
background-color: #91ff68;
|
||||
}
|
||||
|
||||
table.log tr.delete {
|
||||
background-color: #ff9797;
|
||||
}
|
||||
|
||||
table.log tr.login:hover {
|
||||
background-color: #aaa;
|
||||
}
|
||||
|
||||
table.log tr.lock:hover, table.log tr.edit:hover {
|
||||
background-color: #ff0;
|
||||
}
|
||||
|
||||
table.log tr.tick:hover {
|
||||
background-color: #36ae09;
|
||||
}
|
||||
|
||||
table.log tr.delete:hover {
|
||||
background-color: #f02a2a;
|
||||
}
|
||||
|
||||
@media (min-width: 680px) {
|
||||
|
||||
|
||||
@@ -171,10 +217,14 @@ main #main_content {
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.list .list_item, .list .name_tag, .list .name_tag_checked {
|
||||
.list {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.list .list_item, .list .name_tag, .list .name_tag_checked {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.list_item label {
|
||||
float: left;
|
||||
padding-right: 5px;
|
||||
@@ -182,7 +232,7 @@ main #main_content {
|
||||
}
|
||||
|
||||
.list .date_separator {
|
||||
width: 40%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
//ini_set('include_path', '/opt/lampp/htdocs/badminton_coach/_class');
|
||||
//include('class_sql.php');
|
||||
echo "juhuuu";
|
||||
foreach ($_POST as $key => $value) {
|
||||
trigger_error($key, E_USER_NOTICE);
|
||||
}
|
||||
if ($_POST['checked'] == true) {
|
||||
//$sql = new sql('localhost','root','','badminton_coach');
|
||||
$sql->insert_into('presence', array('pr_user_kid_uk_id' => $_POST['user_id'], 'pr_training_tr_id' => $_POST['tr_id']));
|
||||
}
|
||||
else {
|
||||
$sql->execute_query('delete from presence where pr_user_kid_uk_id = ' . $_POST['user_id'] . ' AND pr_training_tr_id = ' . $_POST['tr_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -14,7 +14,7 @@ else {
|
||||
|
||||
# VÁROS LISTA
|
||||
|
||||
$scc_query = "SELECT * FROM school_city ORDER BY scc_city ASC";
|
||||
$scc_query = "SELECT * FROM school_city WHERE scc_deleted = 0 ORDER BY scc_city ASC";
|
||||
$scc_assoc_array = $sql->assoc_array($scc_query);
|
||||
|
||||
$smarty->assign('scc_assoc_array',$scc_assoc_array);
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($this->is_id()) {
|
||||
else {
|
||||
# TAG LISTA
|
||||
|
||||
$user_list_query = "SELECT * FROM user_coach ORDER BY ua_name ASC;";
|
||||
$user_list_query = "SELECT * FROM user_coach WHERE ua_deleted = 0 ORDER BY ua_name ASC;";
|
||||
$user_list_assoc_array = $sql->assoc_array($user_list_query);
|
||||
//végigmegyünk a tömbbön, objektumot csinálunk belőlük, és átadjuk egy array-ben a template-nek
|
||||
$user_array = array();
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM school_city WHERE scc_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM school_city WHERE scc_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//akiknek ez a city_id van beállítva, azoknál null-ra állítjuk
|
||||
$school_city_query = "SELECT uk_id FROM user_kid WHERE uk_school_city_scc_id = " . $this->get_id();
|
||||
$school_city_assoc_array = $sql->assoc_array($school_city_query);
|
||||
foreach ($school_city_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_school_city_scc_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('school_city', array('scc_deleted' => 1), array('scc_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_city', $this->get_id());
|
||||
header("Location: /admin/cities");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM user_coach WHERE ua_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM user_coach WHERE ua_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
$sql->update_table('user_coach', array('ua_deleted' => 1), array('ua_id' => $this->get_id()));
|
||||
log::register('delete_coach', $this->get_id());
|
||||
header("Location: /admin/coaches");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM user_kid WHERE uk_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM user_kid WHERE uk_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
$sql->update_table('user_kid', array('uk_deleted' => 1), array('uk_id' => $this->get_id()));
|
||||
log::register('delete_member', $this->get_id());
|
||||
header("Location: /admin/members");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,25 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM user_parent WHERE up_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM user_parent WHERE up_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//kigayűjtük azokat a gyerek ID-kat (a törölteket is!), akiknél ez a szülő van beállítva első vagy második helyen
|
||||
$parent_1_query = "SELECT uk_id FROM user_kid WHERE uk_parent_1 = " . $this->get_id();
|
||||
$parent1_assoc_array = $sql->assoc_array($parent_1_query);
|
||||
foreach ($parent1_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_parent_1' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$parent_2_query = "SELECT uk_id FROM user_kid WHERE uk_parent_2 = " . $this->get_id();
|
||||
$parent2_assoc_array = $sql->assoc_array($parent_2_query);
|
||||
foreach ($parent2_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_parent_2' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('user_parent', array('up_deleted' => 1), array('up_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_parent', $this->get_id());
|
||||
header("Location: /admin/parents");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM region WHERE reg_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM region WHERE reg_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//akiknek ez a school_id van beállítva, azoknál null-ra állítjuk
|
||||
$region_query = "SELECT uk_id FROM user_kid WHERE uk_region_reg_id = " . $this->get_id();
|
||||
$region_assoc_array = $sql->assoc_array($region_query);
|
||||
foreach ($region_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_region_reg_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('region', array('reg_deleted' => 1), array('reg_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_region', $this->get_id());
|
||||
header("Location: /admin/regions");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM school WHERE sc_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM school WHERE sc_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//akiknek ez a school_id van beállítva, azoknál null-ra állítjuk
|
||||
$school_query = "SELECT uk_id FROM user_kid WHERE uk_school_sc_id = " . $this->get_id();
|
||||
$school_assoc_array = $sql->assoc_array($school_query);
|
||||
foreach ($school_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_school_sc_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('school', array('sc_deleted' => 1), array('sc_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_school', $this->get_id());
|
||||
header("Location: /admin/schools");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM shirt WHERE shirt_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM shirt WHERE shirt_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//akiknek ez a shirt_id van beállítva, azoknál null-ra állítjuk
|
||||
$shirt_query = "SELECT uk_id FROM user_kid WHERE uk_shirt_size_ss_id = " . $this->get_id();
|
||||
$shirt_assoc_array = $sql->assoc_array($shirt_query);
|
||||
foreach ($shirt_assoc_array as $uk_id) {
|
||||
$sql->update_table('user_kid', array('uk_shirt_size_ss_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('shirt', array('shirt_deleted' => 1), array('shirt_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_shirt', $this->get_id());
|
||||
header("Location: /admin/shirts");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
|
||||
if ($this->is_id()) {
|
||||
//először ki kell törölni a coachokat
|
||||
$delete_coach_query = "DELETE FROM training_coach WHERE trc_training_tr_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_coach_query);
|
||||
$delete_query = "DELETE FROM training WHERE tr_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_coach_query = "DELETE FROM training_coach WHERE trc_training_tr_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_coach_query);
|
||||
//$delete_query = "DELETE FROM training WHERE tr_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
$sql->update_table('training', array('tr_deleted' => 1), array('tr_id' => $this->get_id()));
|
||||
|
||||
log::register('delete_training', $this->get_id());
|
||||
header("Location: /admin/trainings");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
<?php
|
||||
|
||||
if ($this->is_id()) {
|
||||
$delete_query = "DELETE FROM training_type WHERE trt_id = " . $this->get_id() . ";";
|
||||
$sql->execute_query($delete_query);
|
||||
//$delete_query = "DELETE FROM training_type WHERE trt_id = " . $this->get_id() . ";";
|
||||
//$sql->execute_query($delete_query);
|
||||
|
||||
//ahol ez a trt_id van beállítva, ott null-ra állítjuk
|
||||
$training_query = "SELECT tr_id FROM training WHERE tr_training_type_trt_id = " . $this->get_id();
|
||||
$training_assoc_array = $sql->assoc_array($training_query);
|
||||
foreach ($training_assoc_array as $tr_id) {
|
||||
$sql->update_table('training', array('tr_training_type_trt_id' => 'null'), array('tr_id' => $tr_id['tr_id']));
|
||||
}
|
||||
|
||||
$sql->update_table('training_type', array('trt_deleted' => 1), array('trt_id' => $this->get_id()));
|
||||
|
||||
|
||||
log::register('delete_training_type', $this->get_id());
|
||||
header("Location: /admin/training_types");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ else {
|
||||
JOIN training ON tr_id = pr_training_tr_id
|
||||
WHERE
|
||||
pr_user_kid_uk_id = ".$user->get_uk_id()."
|
||||
AND tr_deleted = 0
|
||||
ORDER BY tr_date DESC;
|
||||
";
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ if ($this->is_id()) {
|
||||
'tr_id' => $this->get_id()
|
||||
)
|
||||
);
|
||||
log::register(($locked?'training_open':'training_close'), $this->get_id());
|
||||
header('Location: /admin/presence/' . $this->get_id());
|
||||
}
|
||||
|
||||
|
||||
23
_include/include_log.php
Normal file
23
_include/include_log.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
|
||||
if ($this->is_id()) {
|
||||
# LOG DEATAILS
|
||||
}
|
||||
else {
|
||||
# LOG LIST
|
||||
$log_query = "SELECT * FROM log ORDER BY log_date DESC LIMIT 50;";
|
||||
$log_assoc_array = $sql->assoc_array($log_query);
|
||||
$log_array = array();
|
||||
foreach ($log_assoc_array as $log_list_array) {
|
||||
$current_log = new log();
|
||||
$current_log->set_log_data_by_id($log_list_array['log_id']);
|
||||
$log_array[] = $current_log;
|
||||
}
|
||||
|
||||
$smarty->assign('log_array', $log_array);
|
||||
$smarty->display('log.tpl');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,5 +1,13 @@
|
||||
<?php
|
||||
|
||||
if ($from == 'coach') {
|
||||
$log_c = 'admin_logout';
|
||||
}
|
||||
elseif ($from == 'parent') {
|
||||
$log_c = 'kid_logout';
|
||||
|
||||
}
|
||||
log::register($log_c, $_COOKIE['badminton_'.$from.'_user']);
|
||||
setcookie('badminton_'.$from.'_user', 'null', time()-60*60*72, '/');
|
||||
unset($_COOKIE['badminton_'.$from.'_user']);
|
||||
header('Location: http://' . $_SERVER['HTTP_HOST']);
|
||||
|
||||
@@ -8,19 +8,19 @@ if ($this->is_id()) {
|
||||
$user_data_query = "SELECT * FROM user_kid WHERE uk_id = " . $this->get_id();
|
||||
$user_data_assoc_array = $sql->assoc_array($user_data_query);
|
||||
//pólóméret array
|
||||
$shirt_size_query = "SELECT * FROM shirt;";
|
||||
$shirt_size_query = "SELECT * FROM shirt WHERE shirt_deleted = 0;";
|
||||
$shirt_size_assoc_array = $sql->assoc_array($shirt_size_query);
|
||||
//szülő array
|
||||
$parent_query = "SELECT * FROM user_parent ORDER BY up_name ASC;";
|
||||
$parent_query = "SELECT * FROM user_parent WHERE up_deleted = 0 ORDER BY up_name ASC;";
|
||||
$parent_assoc_array = $sql->assoc_array($parent_query);
|
||||
//SCHOOL ARRAY
|
||||
$school_query = "SELECT * FROM school ORDER BY sc_name ASC;";
|
||||
$school_query = "SELECT * FROM school WHERE sc_deleted = 0 ORDER BY sc_name ASC;";
|
||||
$school_assoc_array = $sql->assoc_array($school_query);
|
||||
//SCHOOL CITY ARRAY
|
||||
$school_city_query = "SELECT * FROM school_city ORDER BY scc_city ASC;";
|
||||
$school_city_query = "SELECT * FROM school_city WHERE scc_deleted = 0 ORDER BY scc_city ASC;";
|
||||
$school_city_assoc_array = $sql->assoc_array($school_city_query);
|
||||
//REGION ARRAY
|
||||
$region_query = "SELECT * FROM region ORDER BY reg_name ASC;";
|
||||
$region_query = "SELECT * FROM region WHERE reg_deleted = 0 ORDER BY reg_name ASC;";
|
||||
$region_assoc_array = $sql->assoc_array($region_query);
|
||||
//smarty thingz
|
||||
$smarty->assign('school_assoc_array', $school_assoc_array);
|
||||
@@ -34,7 +34,7 @@ if ($this->is_id()) {
|
||||
else {
|
||||
# TAG LISTA
|
||||
|
||||
$user_list_query = "SELECT * FROM user_kid ORDER BY uk_name ASC;";
|
||||
$user_list_query = "SELECT * FROM user_kid WHERE uk_deleted = 0 ORDER BY uk_name ASC;";
|
||||
$user_list_assoc_array = $sql->assoc_array($user_list_query);
|
||||
//végigmegyünk a tömbbön, objektumot csinálunk belőlük, és átadjuk egy array-ben a template-nek
|
||||
$user_array = array();
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($this->is_id()) {
|
||||
else {
|
||||
# SZÜLŐ LISTA
|
||||
|
||||
$parent_query = "SELECT * FROM user_parent ORDER BY up_name ASC;";
|
||||
$parent_query = "SELECT * FROM user_parent WHERE up_deleted = 0 ORDER BY up_name ASC;";
|
||||
$parent_assoc_array = $sql->assoc_array($parent_query);
|
||||
$parent_array = array();
|
||||
foreach ($parent_assoc_array as $parent) {
|
||||
|
||||
@@ -34,7 +34,7 @@ if ($this->is_id()) {
|
||||
$tr_ids = array();
|
||||
for ($i=1; $i <=4 ; $i++) {
|
||||
$actual_date = date("Y-m-d H:i:s" , strtotime($training->get_tr_date() . " - " . $i . " weeks"));
|
||||
$tr_ids_query = "SELECT * FROM training WHERE tr_date = '" . $actual_date . "' and tr_training_type_trt_id = " . $training->get_tr_training_type_trt_id() . ";";
|
||||
$tr_ids_query = "SELECT * FROM training WHERE tr_deleted = 0 AND tr_date = '" . $actual_date . "' and tr_training_type_trt_id = " . $training->get_tr_training_type_trt_id() . ";";
|
||||
$tr_id = $sql->single_variable($tr_ids_query);
|
||||
if ($tr_id) $tr_ids[] = $tr_id;
|
||||
}
|
||||
@@ -43,8 +43,11 @@ if ($this->is_id()) {
|
||||
SELECT `pr_user_kid_uk_id` , count( `pr_id` ) AS 'presence'
|
||||
FROM `presence`
|
||||
JOIN user_kid ON uk_id = pr_user_kid_uk_id
|
||||
JOIN training ON tr_id = pr_training_tr_id
|
||||
WHERE `pr_training_tr_id`
|
||||
IN ( " . implode(',', $tr_ids) . " )
|
||||
AND `uk_deleted` = 0
|
||||
AND `tr_deleted` = 0
|
||||
GROUP BY `pr_user_kid_uk_id`
|
||||
ORDER BY count( `pr_id` ) DESC, uk_name ASC;
|
||||
";
|
||||
@@ -66,8 +69,8 @@ if ($this->is_id()) {
|
||||
$exeptions[] = $user->get_uk_id();
|
||||
}
|
||||
|
||||
if (!empty($exeptions)) $rest_user_query = "SELECT * FROM user_kid WHERE uk_id NOT IN (" . implode(',', $exeptions) . ") ORDER BY uk_name ASC;"; //ha vannak kiemelt userek
|
||||
else $rest_user_query = "SELECT * FROM user_kid ORDER BY uk_name;"; //ha nincsenek kiemelt userek
|
||||
if (!empty($exeptions)) $rest_user_query = "SELECT * FROM user_kid WHERE uk_id NOT IN (" . implode(',', $exeptions) . ") AND uk_deleted = 0 ORDER BY uk_name ASC;"; //ha vannak kiemelt userek
|
||||
else $rest_user_query = "SELECT * FROM user_kid WHERE uk_deleted = 0 ORDER BY uk_name;"; //ha nincsenek kiemelt userek
|
||||
$rest_user_assoc_array = $sql->assoc_array($rest_user_query);
|
||||
foreach ($rest_user_assoc_array as $rest_user) {
|
||||
$user = new user_kid();
|
||||
@@ -78,7 +81,7 @@ if ($this->is_id()) {
|
||||
|
||||
|
||||
//TRAINING-COACH ARRAY
|
||||
$trc_query = "SELECT * FROM training_coach WHERE trc_helper = 0 AND trc_training_tr_id = " . $this->get_id();
|
||||
$trc_query = "SELECT * FROM training_coach JOIN user_coach ON ua_id = trc_coach_uc_id WHERE trc_helper = 0 AND ua_deleted = 0 AND trc_training_tr_id = " . $this->get_id();
|
||||
$trc_coaches = array();
|
||||
$trc_assoc_array = $sql->assoc_array($trc_query);
|
||||
foreach ($trc_assoc_array as $trc_data) {
|
||||
@@ -88,7 +91,7 @@ if ($this->is_id()) {
|
||||
}
|
||||
|
||||
//TRAINING-HELPER ARRAY
|
||||
$trc_query = "SELECT * FROM training_coach WHERE trc_helper = 1 AND trc_training_tr_id = " . $this->get_id();
|
||||
$trc_query = "SELECT * FROM training_coach JOIN user_coach ON ua_id = trc_coach_uc_id WHERE trc_helper = 1 AND ua_deleted = 0 AND trc_training_tr_id = " . $this->get_id();
|
||||
$trc_helpers = array();
|
||||
$trc_assoc_array = $sql->assoc_array($trc_query);
|
||||
foreach ($trc_assoc_array as $trc_data) {
|
||||
@@ -111,9 +114,11 @@ if ($this->is_id()) {
|
||||
FROM `presence`
|
||||
JOIN user_kid ON uk_id = pr_user_kid_uk_id
|
||||
WHERE `pr_training_tr_id` = ".$this->get_id()."
|
||||
AND uk_deleted = 0
|
||||
ORDER BY uk_name ASC;
|
||||
";
|
||||
|
||||
|
||||
$presence_assoc_array = $sql->assoc_array($presence_query);
|
||||
foreach ($presence_assoc_array as $presence) {
|
||||
$s_user = new user_kid();
|
||||
@@ -125,7 +130,7 @@ if ($this->is_id()) {
|
||||
|
||||
$smarty->assign('training', $training);
|
||||
$smarty->assign('trainings', $tr_ids);
|
||||
$smarty->assign('headcount', $headcount);
|
||||
$smarty->assign('headcount', count($presence_assoc_array));
|
||||
$smarty->assign("trc_coaches", $trc_coaches);
|
||||
$smarty->assign("trc_helpers", $trc_helpers);
|
||||
$smarty->assign('presence_assoc_array', $presence_assoc_array);
|
||||
@@ -139,7 +144,7 @@ if ($this->is_id()) {
|
||||
}
|
||||
|
||||
else {
|
||||
$traning_list_query = "SELECT * FROM training ORDER BY tr_date DESC;";
|
||||
$traning_list_query = "SELECT * FROM training WHERE tr_deleted = 0 ORDER BY tr_date DESC;";
|
||||
$training_list_assoc_array = $sql->assoc_array($traning_list_query);
|
||||
|
||||
$training_array = array();
|
||||
|
||||
@@ -14,7 +14,7 @@ else {
|
||||
|
||||
# RÉGIÓ LISTA
|
||||
|
||||
$reg_query = "SELECT * FROM region ORDER BY reg_name ASC";
|
||||
$reg_query = "SELECT * FROM region WHERE reg_deleted = 0 ORDER BY reg_name ASC";
|
||||
$reg_assoc_array = $sql->assoc_array($reg_query);
|
||||
|
||||
$smarty->assign('reg_assoc_array',$reg_assoc_array);
|
||||
|
||||
@@ -14,7 +14,7 @@ else {
|
||||
|
||||
# ISKOLA LISTA
|
||||
|
||||
$tr_type_query = "SELECT * FROM school ORDER BY sc_name ASC";
|
||||
$tr_type_query = "SELECT * FROM school WHERE sc_deleted = 0 ORDER BY sc_name ASC";
|
||||
$tr_type_assoc_array = $sql->assoc_array($tr_type_query);
|
||||
|
||||
$smarty->assign('school_assoc_array',$tr_type_assoc_array);
|
||||
|
||||
@@ -17,7 +17,7 @@ else {
|
||||
|
||||
# PÓLÓ LISTA
|
||||
|
||||
$shirt_query = "SELECT * FROM shirt ORDER BY shirt_name ASC";
|
||||
$shirt_query = "SELECT * FROM shirt WHERE shirt_deleted = 0 ORDER BY shirt_name ASC";
|
||||
$shirt_assoc_array = $sql->assoc_array($shirt_query);
|
||||
|
||||
$smarty->assign('shirt_assoc_array',$shirt_assoc_array);
|
||||
|
||||
@@ -14,7 +14,7 @@ else {
|
||||
|
||||
# EDZÉS TÍPUS LISTA
|
||||
|
||||
$tr_type_query = "SELECT * FROM training_type ORDER BY trt_name ASC";
|
||||
$tr_type_query = "SELECT * FROM training_type WHERE trt_deleted = 0 ORDER BY trt_name ASC";
|
||||
$tr_type_assoc_array = $sql->assoc_array($tr_type_query);
|
||||
|
||||
$smarty->assign('tr_type_assoc_array',$tr_type_assoc_array);
|
||||
|
||||
@@ -11,11 +11,11 @@ if ($this->is_id()) {
|
||||
$training_data_assoc_array = $sql->assoc_array($training_data_query);
|
||||
$smarty->assign('training_data', $training_data_assoc_array[0]);
|
||||
//TRAINING TYPE ARRAY
|
||||
$training_type_query = "SELECT * FROM training_type ORDER BY trt_name ASC;";
|
||||
$training_type_query = "SELECT * FROM training_type WHERE trt_deleted = 0 ORDER BY trt_name ASC;";
|
||||
$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 ORDER BY ua_id ASC;";
|
||||
$coach_data_query = "SELECT * FROM user_coach WHERE ua_deleted = 0 ORDER BY ua_id ASC;";
|
||||
$coach_data_assoc_array = $sql->assoc_array($coach_data_query);
|
||||
$coach_array = array();
|
||||
foreach ($coach_data_assoc_array as $coach_data) {
|
||||
@@ -46,7 +46,7 @@ if ($this->is_id()) {
|
||||
|
||||
else {
|
||||
|
||||
$traning_list_query = "SELECT * FROM training ORDER BY tr_date DESC;";
|
||||
$traning_list_query = "SELECT * FROM training WHERE tr_deleted = 0 ORDER BY tr_date DESC;";
|
||||
$training_list_assoc_array = $sql->assoc_array($traning_list_query);
|
||||
|
||||
$training_array = array();
|
||||
|
||||
@@ -17,11 +17,13 @@ if (isset($_POST['action'])) {
|
||||
if ($user_coach_id) {
|
||||
//sikeres bejelentkezés
|
||||
$login->login_user($user_coach_id, 'badminton_coach_user', 1);
|
||||
log::register('admin_login', $user_coach_id, null, $user_coach_id);
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
elseif ($user_kid_id) {
|
||||
//sikeres bejelentkezés
|
||||
$login->login_user($user_kid_id, 'badminton_parent_user', 2);
|
||||
log::register('kid_login', $user_kid_id, null, $user_kid_id);
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
else {
|
||||
@@ -47,6 +49,7 @@ if (isset($_POST['action'])) {
|
||||
$uid = $_POST['uk_id'];
|
||||
unset($_POST['uk_id']);
|
||||
user_kid::update_user($_POST, $uid);
|
||||
log::register('update_member', $uid);
|
||||
header("Location: " . $actual_link);
|
||||
break;
|
||||
|
||||
@@ -62,6 +65,7 @@ if (isset($_POST['action'])) {
|
||||
//var_dump($_POST);
|
||||
//die("aaa");
|
||||
$new_user_id = user_kid::create_user($_POST);
|
||||
log::register('new_member', $new_user_id);
|
||||
header("Location: /admin/edit_member/" . $new_user_id);
|
||||
break;
|
||||
|
||||
@@ -71,7 +75,8 @@ if (isset($_POST['action'])) {
|
||||
if (!isset($_POST['up_email'])) $_POST['up_email'] = null;
|
||||
if (!isset($_POST['up_phone'])) $_POST['up_phone'] = null;
|
||||
if (!isset($_POST['up_facebook'])) $_POST['up_facebook'] = null;
|
||||
user_parent::create_parent($_POST['up_name'], $_POST['up_email'], $_POST['up_facebook'], $_POST['up_phone']);
|
||||
$new_parent_id = user_parent::create_parent($_POST['up_name'], $_POST['up_email'], $_POST['up_facebook'], $_POST['up_phone']);
|
||||
log::register('new_parent', $new_parent_id);
|
||||
header("Location: /admin/parents");
|
||||
break;
|
||||
|
||||
@@ -84,7 +89,8 @@ if (isset($_POST['action'])) {
|
||||
if (!isset($_POST['up_phone'])) $_POST['up_phone'] = null;
|
||||
if (!isset($_POST['up_facebook'])) $_POST['up_facebook'] = null;
|
||||
user_parent::update_parent($_POST, $up_id);
|
||||
//header("Location: /admin/parents/" . $up_id);
|
||||
log::register('update_parent', $up_id);
|
||||
header("Location: /admin/parents/" . $up_id);
|
||||
break;
|
||||
|
||||
case 'training_data_edit':
|
||||
@@ -94,6 +100,7 @@ if (isset($_POST['action'])) {
|
||||
unset($_POST['action']);
|
||||
//var_dump($_POST);
|
||||
training::update_training($_POST, $tr_id);
|
||||
log::register('update_training', $tr_id);
|
||||
header("Location: " . $actual_link);
|
||||
break;
|
||||
|
||||
@@ -113,6 +120,7 @@ if (isset($_POST['action'])) {
|
||||
# edzés típus létrehozása
|
||||
unset($_POST['action']);
|
||||
$new_trt_id = training_type::create_training_type($_POST);
|
||||
log::register('new_training_type', $new_trt_id);
|
||||
header("Location: /admin/training_types");
|
||||
|
||||
break;
|
||||
@@ -123,8 +131,9 @@ if (isset($_POST['action'])) {
|
||||
$key_parts = explode('_', $key);
|
||||
$trt_id = $key_parts[1];
|
||||
$sql->update_table('training_type', array('trt_name' => $value), array('trt_id' => $trt_id));
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
log::register('update_training_type', 'update all');
|
||||
header("Location: " . $actual_link);
|
||||
break;
|
||||
case 'coach_create':
|
||||
# edző létrehozása
|
||||
@@ -135,7 +144,8 @@ if (isset($_POST['action'])) {
|
||||
$psw = "null";
|
||||
}
|
||||
|
||||
user::create_user($_POST['ua_name'], $psw);
|
||||
$new_coach_id = user::create_user($_POST['ua_name'], $psw);
|
||||
log::register('new_coach', $new_coach_id);
|
||||
header("Location: /admin/coaches");
|
||||
break;
|
||||
case 'coach_data_edit':
|
||||
@@ -150,15 +160,17 @@ if (isset($_POST['action'])) {
|
||||
$psw = "null";
|
||||
}
|
||||
user::update_user($_POST['ua_name'], $psw, $_POST['ua_id']);
|
||||
log::register('update_coach', $_POST['ua_id']);
|
||||
header("Location: /admin/coaches");
|
||||
break;
|
||||
case 'shirt_create':
|
||||
# póló létrehozása
|
||||
//todo: shirt object
|
||||
$sql->insert_into('shirt', array(
|
||||
$new_shirt_id = $sql->insert_into('shirt', array(
|
||||
'shirt_name' => $_POST['shirt_name']
|
||||
)
|
||||
);
|
||||
log::register('new_shirt', $new_shirt_id);
|
||||
header("Location: /admin/shirts");
|
||||
break;
|
||||
case 'shirt_data_edit':
|
||||
@@ -171,15 +183,17 @@ if (isset($_POST['action'])) {
|
||||
'shirt_id' => $_POST['shirt_id']
|
||||
)
|
||||
);
|
||||
log::register('update_shirt', $_POST['shirt_id']);
|
||||
header("Location: /admin/shirts");
|
||||
break;
|
||||
case 'city_create':
|
||||
# település létrehozása
|
||||
//todo: település object
|
||||
$sql->insert_into('school_city', array(
|
||||
$new_city_id = $sql->insert_into('school_city', array(
|
||||
'scc_city' => $_POST['scc_city'],
|
||||
)
|
||||
);
|
||||
log::register('new_city', $new_city_id);
|
||||
header("Location: /admin/cities");
|
||||
break;
|
||||
case 'city_update':
|
||||
@@ -189,16 +203,18 @@ if (isset($_POST['action'])) {
|
||||
$key_parts = explode('_', $key);
|
||||
$scc_id = $key_parts[1];
|
||||
$sql->update_table('school_city', array('scc_city' => $value), array('scc_id' => $scc_id));
|
||||
header("Location: /admin/cities");
|
||||
}
|
||||
log::register('update_city', 'update all');
|
||||
header("Location: /admin/cities");
|
||||
break;
|
||||
case 'region_create':
|
||||
# körzet létrehozása
|
||||
//todo: körzet object
|
||||
$sql->insert_into('region', array(
|
||||
$new_reg_id = $sql->insert_into('region', array(
|
||||
'reg_name' => $_POST['reg_name'],
|
||||
)
|
||||
);
|
||||
log::register('new_region', $new_reg_id);
|
||||
header("Location: /admin/regions");
|
||||
break;
|
||||
case 'region_update':
|
||||
@@ -208,16 +224,18 @@ if (isset($_POST['action'])) {
|
||||
$key_parts = explode('_', $key);
|
||||
$reg_id = $key_parts[1];
|
||||
$sql->update_table('region', array('reg_name' => $value), array('reg_id' => $reg_id));
|
||||
header("Location: /admin/regions");
|
||||
}
|
||||
log::register('update_region', 'update all');
|
||||
header("Location: /admin/regions");
|
||||
break;
|
||||
case 'school_create':
|
||||
# iskola létrehozása
|
||||
//todo: iskola object
|
||||
$sql->insert_into('school', array(
|
||||
$new_school_id = $sql->insert_into('school', array(
|
||||
'sc_name' => $_POST['sc_name'],
|
||||
)
|
||||
);
|
||||
log::register('new_school', $new_school_id);
|
||||
header("Location: /admin/schools");
|
||||
break;
|
||||
case 'school_update':
|
||||
@@ -227,8 +245,9 @@ if (isset($_POST['action'])) {
|
||||
$key_parts = explode('_', $key);
|
||||
$sc_id = $key_parts[1];
|
||||
$sql->update_table('school', array('sc_name' => $value), array('sc_id' => $sc_id));
|
||||
header("Location: /admin/schools");
|
||||
}
|
||||
log::register('update_school', 'update all');
|
||||
header("Location: /admin/schools");
|
||||
break;
|
||||
default:
|
||||
# code...
|
||||
|
||||
21
template/templates/log.tpl
Normal file
21
template/templates/log.tpl
Normal file
@@ -0,0 +1,21 @@
|
||||
<div style="overflow-x:auto;">
|
||||
<table class="log">
|
||||
{foreach $log_array as $log}
|
||||
<tr class="{$log->get_log_img()}">
|
||||
<td><img src="/_image/{$log->get_log_img()}.png"></td>
|
||||
<td>#{$log->get_log_id()}</td>
|
||||
<td>{$log->get_log_date()}</td>
|
||||
<td>
|
||||
{if $log->get_log_category()->get_logc_type() == 1}
|
||||
{$log->get_log_user()->get_ua_name()}
|
||||
{elseif $log->get_log_category()->get_logc_type() == 2}
|
||||
{$log->get_log_user()->get_uk_name()}
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$log->get_log_category()->get_logc_title()}</td>
|
||||
<td>{$log->get_log_text()}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -67,10 +67,11 @@
|
||||
{$headcount} fő
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" id="tr_id" value="{$tr_id}">
|
||||
<input type="hidden" id="admin_id" value="{$user_login->get_ua_id()}">
|
||||
|
||||
<br><br><br>
|
||||
|
||||
@@ -143,10 +144,12 @@ $('.name_tag').click(function() {
|
||||
}
|
||||
//alert(checked);
|
||||
|
||||
var admin_id = $("#admin_id").val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/_ajax/update_presence.php',
|
||||
data: { checked : checked, user_id : user_id, tr_id : tr_id },
|
||||
data: { checked : checked, user_id : user_id, tr_id : tr_id, admin_id : admin_id},
|
||||
success: function(data) {
|
||||
|
||||
}
|
||||
@@ -177,10 +180,12 @@ $('.name_tag_checked').click(function() {
|
||||
}
|
||||
//alert(checked);
|
||||
|
||||
var admin_id = $("#admin_id").val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/_ajax/update_presence.php',
|
||||
data: { checked : checked, user_id : user_id, tr_id : tr_id },
|
||||
data: { checked : checked, user_id : user_id, tr_id : tr_id, admin_id : admin_id},
|
||||
success: function(data) {
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{$training->get_tr_date_day()}.
|
||||
{$days[$training->get_tr_date_day_of_week()]}
|
||||
{$training->get_tr_date_time()}
|
||||
({$training->get_tr_type_name_by_id()})
|
||||
{if $training->get_tr_training_type_trt_id()}({$training->get_tr_type_name_by_id()}){/if}
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
|
||||
@@ -32,18 +32,20 @@
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="coaches">Edző(k):</label>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="bold">Név</td>
|
||||
<td class="bold">E</td>
|
||||
<td class="bold">SE</td>
|
||||
</tr>
|
||||
{foreach $coach_array as $coach}
|
||||
<div>
|
||||
<span class="coach">{$coach->get_ua_name()}</span>
|
||||
<div>
|
||||
<input type="checkbox" name="coaches[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_coach_at_training($tr_id)} checked{/if}>
|
||||
<span class="coach_type_text">e.</span>
|
||||
<input type="checkbox" name="helpers[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_helper_at_training($tr_id)} checked{/if}>
|
||||
<span class="coach_type_text">se.</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<tr>
|
||||
<td class="coach">{$coach->get_ua_name()}</td>
|
||||
<td><input type="checkbox" name="coaches[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_coach_at_training($tr_id)} checked{/if}></td>
|
||||
<td><input type="checkbox" name="helpers[]" value="{$coach->get_ua_id()}" class="coach_type"{if $coach->is_helper_at_training($tr_id)} checked{/if}></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{$training->get_tr_date_day()}.
|
||||
{$days[$training->get_tr_date_day_of_week()]}
|
||||
{$training->get_tr_date_time()}
|
||||
({$training->get_tr_type_name_by_id()})
|
||||
{if $training->get_tr_training_type_trt_id()}({$training->get_tr_type_name_by_id()}){/if}
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{$training->get_tr_date_time()}
|
||||
</span>
|
||||
<br>
|
||||
{$training->get_tr_type_name_by_id()} edzés
|
||||
{if $training->get_tr_training_type_trt_id()}{$training->get_tr_type_name_by_id()} edzés{/if}
|
||||
{$training->get_tr_duration()} p
|
||||
{if $training->is_coach()}
|
||||
{foreach $training->get_tr_coaches_name() as $coach_name}
|
||||
|
||||
Reference in New Issue
Block a user