sql delete replaced by delete flag
log list (simple), log categories
minor bug fixes in css
This commit is contained in:
Ricsi
2016-12-30 18:00:05 +01:00
parent 664097a976
commit 5a78b09a38
39 changed files with 557 additions and 92 deletions

View File

@@ -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)) {