milestone fix; maybe not perfect
This commit is contained in:
@@ -10,7 +10,11 @@ class milestone
|
|||||||
private $ms_training_mst_id = null;
|
private $ms_training_mst_id = null;
|
||||||
private $ms_competition_msc_id = null;
|
private $ms_competition_msc_id = null;
|
||||||
private $ms_camp_msca_id = null;
|
private $ms_camp_msca_id = null;
|
||||||
|
private $ms_ranking_msr_id = null;
|
||||||
private $ms_user_kid_uk_id;
|
private $ms_user_kid_uk_id;
|
||||||
|
private $ms_sums; //text
|
||||||
|
|
||||||
|
private $season;
|
||||||
|
|
||||||
public function set_ms_data_by_id($_ms_id) {
|
public function set_ms_data_by_id($_ms_id) {
|
||||||
global $sql;
|
global $sql;
|
||||||
@@ -44,18 +48,27 @@ class milestone
|
|||||||
$new_msca->set_msca_data_by_id($value);
|
$new_msca->set_msca_data_by_id($value);
|
||||||
$this->set_ms_camp_msca_id($new_msca);
|
$this->set_ms_camp_msca_id($new_msca);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($field == 'ms_ranking_msr_id' && $value != null) {
|
||||||
|
$new_msr = new milestone_ranking();
|
||||||
|
$new_msr->set_msr_data_by_id($value);
|
||||||
|
$this->set_ms_ranking_msr_id($new_msr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create_ms($_mt, $_uk, $_mst = null, $_msc = null, $_msca = null)
|
public static function create_ms($_mt, $_season, $_uk, $_mst = null, $_msc = null, $_msca = null, $_msr = null, $_sums = null)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('milestone', array(
|
return $sql->insert_into('milestone', array(
|
||||||
'ms_type_mt_id' => $_mt,
|
'ms_type_mt_id' => $_mt,
|
||||||
'ms_training_mst_id' => $_mst,
|
'ms_training_mst_id' => $_mst,
|
||||||
'ms_competition_msc_id' => $_msc,
|
'ms_competition_msc_id' => $_msc,
|
||||||
|
'ms_ranking_msr_id' => $_msr,
|
||||||
'ms_camp_msca_id' => $_msca,
|
'ms_camp_msca_id' => $_msca,
|
||||||
'ms_user_kid_uk_id' => $_uk,
|
'ms_user_kid_uk_id' => $_uk,
|
||||||
|
'ms_season' => $_season,
|
||||||
|
'ms_sums' => $_sums,
|
||||||
), false);
|
), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +106,26 @@ class milestone
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_ms_season()
|
||||||
|
{
|
||||||
|
return $this->ms_season;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $ms_season
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_ms_season($ms_season)
|
||||||
|
{
|
||||||
|
$this->ms_season = $ms_season;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -173,6 +206,26 @@ class milestone
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_ms_ranking_msr_id()
|
||||||
|
{
|
||||||
|
return $this->ms_ranking_msr_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $ms_ranking_msr_id
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_ms_ranking_msr_id($ms_ranking_msr_id)
|
||||||
|
{
|
||||||
|
$this->ms_ranking_msr_id = $ms_ranking_msr_id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -193,6 +246,26 @@ class milestone
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_ms_sums()
|
||||||
|
{
|
||||||
|
return $this->ms_sums;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $ms_sums
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_ms_sums($ms_sums)
|
||||||
|
{
|
||||||
|
$this->ms_sums = $ms_sums;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public static function upload_file($file)
|
public static function upload_file($file)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
@@ -209,27 +282,46 @@ class milestone
|
|||||||
$sql->execute_query('DELETE milestone_training FROM milestone_training JOIN milestone ON ms_training_mst_id = mst_id WHERE ms_user_kid_uk_id = ' . $kid);
|
$sql->execute_query('DELETE milestone_training FROM milestone_training JOIN milestone ON ms_training_mst_id = mst_id WHERE ms_user_kid_uk_id = ' . $kid);
|
||||||
$sql->execute_query('DELETE milestone_competition FROM milestone_competition JOIN milestone ON ms_competition_msc_id = msc_id WHERE ms_user_kid_uk_id = ' . $kid);
|
$sql->execute_query('DELETE milestone_competition FROM milestone_competition JOIN milestone ON ms_competition_msc_id = msc_id WHERE ms_user_kid_uk_id = ' . $kid);
|
||||||
$sql->execute_query('DELETE milestone_camp FROM milestone_camp JOIN milestone ON ms_camp_msca_id= msca_id WHERE ms_user_kid_uk_id = ' . $kid);
|
$sql->execute_query('DELETE milestone_camp FROM milestone_camp JOIN milestone ON ms_camp_msca_id= msca_id WHERE ms_user_kid_uk_id = ' . $kid);
|
||||||
|
$sql->execute_query('DELETE milestone_ranking FROM milestone_ranking JOIN milestone ON ms_ranking_msr_id= msr_id WHERE ms_user_kid_uk_id = ' . $kid);
|
||||||
|
|
||||||
$content = file($_FILES['fileToUpload']['tmp_name']); //makes array
|
$content = file($_FILES['fileToUpload']['tmp_name']); //makes array
|
||||||
|
|
||||||
|
|
||||||
for ($i=0; $i < count($content); $i++) {
|
for ($i=0; $i < count($content); $i++) {
|
||||||
$line = $content[$i];
|
$line = $content[$i];
|
||||||
|
//var_dump($line);
|
||||||
if (empty(trim($line))) { //ha üres sor volt
|
if ($i === 0 || empty(trim($line))) { //ha üres sor volt
|
||||||
if (empty(trim($content[$i+1]))) {
|
if (empty(trim($line))) {
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
if (empty(trim($content[$i]))) {
|
||||||
//a következő sor is üres, átugroható
|
//a következő sor is üres, átugroható
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$firstLineParts = explode(' ', trim($content[$i+1]));
|
$firstLineParts = explode(' ', trim($content[$i]));
|
||||||
|
|
||||||
$typeLetter = $firstLineParts[0];
|
$typeLetter = $firstLineParts[0];
|
||||||
$month = $firstLineParts[1] . '-01';
|
//$month = $firstLineParts[1] . '-01';
|
||||||
++$i;
|
|
||||||
|
|
||||||
//$ms = new milestone();
|
//$ms = new milestone();
|
||||||
$mst_id = 'null';
|
$mst_id = 'null';
|
||||||
$msc_id = 'null';
|
$msc_id = 'null';
|
||||||
$msca_id = 'null';
|
$msca_id = 'null';
|
||||||
|
$msr_id = 'null';
|
||||||
|
$actual_season = 'null';
|
||||||
|
|
||||||
|
if ('s' == $typeLetter) {
|
||||||
|
$season = $firstLineParts[1];
|
||||||
|
$sums = "";
|
||||||
|
$j = $i + 1;
|
||||||
|
while(isset($content[$j]) && !empty(trim($content[$j]))) {
|
||||||
|
$sums .= trim($content[$j]) . '\n';
|
||||||
|
++$i;
|
||||||
|
$j = $i + 1;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$type = $sql->single_variable('SELECT mt_id FROM milestone_type WHERE mt_short_name = "' . $typeLetter . '";');
|
$type = $sql->single_variable('SELECT mt_id FROM milestone_type WHERE mt_short_name = "' . $typeLetter . '";');
|
||||||
|
|
||||||
if (null === $type) {
|
if (null === $type) {
|
||||||
@@ -254,7 +346,7 @@ class milestone
|
|||||||
$j = $i + 1;
|
$j = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mst_id = milestone_training::create_mst($mst_date, $mst_count, $month, $mst_trainings);
|
$mst_id = milestone_training::create_mst($mst_date, $mst_count, $mst_trainings);
|
||||||
//var_dump($mst_trainings);
|
//var_dump($mst_trainings);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -289,7 +381,7 @@ class milestone
|
|||||||
$matches = 'null';
|
$matches = 'null';
|
||||||
}
|
}
|
||||||
|
|
||||||
$msc_id = milestone_competition::create_msc($msc_date, $msc_name, $msc_category, $msc_location, $msc_place, $month, $matches);
|
$msc_id = milestone_competition::create_msc($msc_date, $msc_name, $msc_category, $msc_location, $msc_place, $matches);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
@@ -301,7 +393,27 @@ class milestone
|
|||||||
++$i;
|
++$i;
|
||||||
$msca_place = trim($content[$i]);
|
$msca_place = trim($content[$i]);
|
||||||
|
|
||||||
$msca_id = milestone_camp::create_msca($msca_date, $msca_place, $month);
|
$msca_id = milestone_camp::create_msca($msca_date, $msca_place);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
# ranking
|
||||||
|
|
||||||
|
//get season after 'r'
|
||||||
|
$msr_season = trim(substr($content[$i], 2));
|
||||||
|
|
||||||
|
++$i;
|
||||||
|
$msr_date = trim($content[$i]);
|
||||||
|
|
||||||
|
++$i;
|
||||||
|
$rankings = '';
|
||||||
|
do {
|
||||||
|
$rankings .= trim($content[$i]) . '\n';
|
||||||
|
++$i;
|
||||||
|
} while (isset($content[$i]) && !empty(trim($content[$i])));
|
||||||
|
|
||||||
|
$msr_id = milestone_ranking::create_msr($msr_date, $rankings, $msr_season);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -311,7 +423,7 @@ class milestone
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $type) {
|
if (null !== $type) {
|
||||||
self::create_ms($type, $kid, $mst_id, $msc_id, $msca_id);
|
self::create_ms($type, $season, $kid, $mst_id, $msc_id, $msca_id, $msr_id, $sums);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,12 @@ class milestone_camp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create_msca($_date, $_place, $_month)
|
public static function create_msca($_date, $_place)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('milestone_camp', array(
|
return $sql->insert_into('milestone_camp', array(
|
||||||
'msca_date' => $_date,
|
'msca_date' => $_date,
|
||||||
'msca_place' => $_place,
|
'msca_place' => $_place,
|
||||||
'msca_month' => $_month,
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class milestone_competition
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create_msc($_date, $_name, $_category, $_location, $_place, $_month, $_matches = NULL)
|
public static function create_msc($_date, $_name, $_category, $_location, $_place, $_matches = NULL)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('milestone_competition', array(
|
return $sql->insert_into('milestone_competition', array(
|
||||||
@@ -36,7 +36,6 @@ class milestone_competition
|
|||||||
'msc_category' => $_category,
|
'msc_category' => $_category,
|
||||||
'msc_location' => $_location,
|
'msc_location' => $_location,
|
||||||
'msc_place' => $_place,
|
'msc_place' => $_place,
|
||||||
'msc_month' => $_month,
|
|
||||||
'msc_matches' => $_matches,
|
'msc_matches' => $_matches,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
117
_class/class_milestone_ranking.php
Normal file
117
_class/class_milestone_ranking.php
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MILESTONE RANKING
|
||||||
|
*/
|
||||||
|
class milestone_ranking
|
||||||
|
{
|
||||||
|
private $msr_id;
|
||||||
|
private $msr_season;
|
||||||
|
private $msr_date;
|
||||||
|
private $msr_rankings;
|
||||||
|
|
||||||
|
|
||||||
|
public function set_msr_data_by_id($_msr_id) {
|
||||||
|
global $sql;
|
||||||
|
$msr_assoc_array = $sql->assoc_array("select * from milestone_ranking where msr_id = " . $_msr_id);
|
||||||
|
$msr_array = $msr_assoc_array[0];
|
||||||
|
//alapadatok
|
||||||
|
foreach ($msr_array as $field => $value) {
|
||||||
|
$function_name = "set_" . $field;
|
||||||
|
$this->$function_name($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function create_msr($_date, $_rankings, $_season = 'null')
|
||||||
|
{
|
||||||
|
global $sql;
|
||||||
|
return $sql->insert_into('milestone_ranking', array(
|
||||||
|
'msr_date' => $_date,
|
||||||
|
'msr_rankings' => $_rankings,
|
||||||
|
'msr_season' => $_season,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_msr_id()
|
||||||
|
{
|
||||||
|
return $this->msr_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $msr_id
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_msr_id($msr_id)
|
||||||
|
{
|
||||||
|
$this->msr_id = $msr_id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_msr_season()
|
||||||
|
{
|
||||||
|
return $this->msr_season;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $msr_season
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_msr_season($msr_season)
|
||||||
|
{
|
||||||
|
$this->msr_season = $msr_season;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_msr_date()
|
||||||
|
{
|
||||||
|
return $this->msr_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $msr_date
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_msr_date($msr_date)
|
||||||
|
{
|
||||||
|
$this->msr_date = $msr_date;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function get_msr_rankings()
|
||||||
|
{
|
||||||
|
return $this->msr_rankings;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $msr_rankings
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function set_msr_rankings($msr_rankings)
|
||||||
|
{
|
||||||
|
$this->msr_rankings = $msr_rankings;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -23,13 +23,12 @@ class milestone_training
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create_mst($_date, $_count, $_month, $_trainings = NULL)
|
public static function create_mst($_date, $_count, $_trainings = NULL)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('milestone_training', array(
|
return $sql->insert_into('milestone_training', array(
|
||||||
'mst_date' => $_date,
|
'mst_date' => $_date,
|
||||||
'mst_count' => $_count,
|
'mst_count' => $_count,
|
||||||
'mst_month' => $_month,
|
|
||||||
'mst_trainings' => $_trainings,
|
'mst_trainings' => $_trainings,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ class training {
|
|||||||
private $tr_deleted;
|
private $tr_deleted;
|
||||||
private $coaches = array();
|
private $coaches = array();
|
||||||
|
|
||||||
|
private $helpers = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function set_tr_id($_tr_id) {
|
public function set_tr_id($_tr_id) {
|
||||||
$this->tr_id = $_tr_id;
|
$this->tr_id = $_tr_id;
|
||||||
@@ -97,13 +100,18 @@ class training {
|
|||||||
|
|
||||||
public function set_tr_coaches() {
|
public function set_tr_coaches() {
|
||||||
//beállítja a tr_coaches array-be a coach-okat
|
//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;
|
global $sql;
|
||||||
$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());
|
$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();
|
$this->tr_coaches = array();
|
||||||
foreach ($coach_ids as $trc) {
|
foreach ($coach_ids as $trc) {
|
||||||
$this->tr_coaches[] = $trc['trc_coach_uc_id'];
|
$this->tr_coaches[] = $trc['trc_coach_uc_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$helper_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 = 1 AND trc_training_tr_id = " . $this->get_tr_id());
|
||||||
|
$this->tr_helpers = array();
|
||||||
|
foreach ($helper_ids as $trc) {
|
||||||
|
$this->tr_helpers[] = $trc['trc_coach_uc_id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_training_data_by_id($_tr_id) {
|
public function set_training_data_by_id($_tr_id) {
|
||||||
@@ -123,6 +131,12 @@ class training {
|
|||||||
return !empty($this->tr_coaches);
|
return !empty($this->tr_coaches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function is_helper() {
|
||||||
|
//megadja, hogy van-e beállítva segédedző az edzéshez
|
||||||
|
//TRUE HA IGEN, FALSE EGYÉBKÉNT
|
||||||
|
return !empty($this->tr_helpers);
|
||||||
|
}
|
||||||
|
|
||||||
public function get_tr_coaches_name() {
|
public function get_tr_coaches_name() {
|
||||||
//tömböt ad vissza az edzők neveivel
|
//tömböt ad vissza az edzők neveivel
|
||||||
global $sql;
|
global $sql;
|
||||||
@@ -133,6 +147,16 @@ class training {
|
|||||||
return $coach_names;
|
return $coach_names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_tr_helpers_name() {
|
||||||
|
//tömböt ad vissza a segédedzők neveivel
|
||||||
|
global $sql;
|
||||||
|
$helper_names = array();
|
||||||
|
foreach ($this->tr_helpers as $ua_id) {
|
||||||
|
$helper_names[] = $sql->single_variable('SELECT ua_name FROM user_coach WHERE ua_id = ' . $ua_id);
|
||||||
|
}
|
||||||
|
return $helper_names;
|
||||||
|
}
|
||||||
|
|
||||||
public static function create_training($_training_value_array, $_every_week) {
|
public static function create_training($_training_value_array, $_every_week) {
|
||||||
global $sql;
|
global $sql;
|
||||||
//megnézzük, hogy minden hétre be kell-e rakni
|
//megnézzük, hogy minden hétre be kell-e rakni
|
||||||
|
|||||||
@@ -80,3 +80,20 @@ div.list div.actual_balance:hover {
|
|||||||
.list_item.camp:hover {
|
.list_item.camp:hover {
|
||||||
background-color: #69de4c;
|
background-color: #69de4c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.list_item.ranking {
|
||||||
|
background-color: #f6f6bf;
|
||||||
|
border-left: 2px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list_item.ranking:hover {
|
||||||
|
background-color: #eded8b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.short {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|||||||
BIN
_image/ranking.png
Normal file
BIN
_image/ranking.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -17,6 +17,7 @@ if ($this->is_id()) {
|
|||||||
log::register(($locked?'training_open':'training_close'), $this->get_id());
|
log::register(($locked?'training_open':'training_close'), $this->get_id());
|
||||||
//SEND NOTIFICATION
|
//SEND NOTIFICATION
|
||||||
|
|
||||||
|
/*
|
||||||
if (!$locked) {
|
if (!$locked) {
|
||||||
//get kids from training
|
//get kids from training
|
||||||
$kid_ids = $sql->assoc_array('SELECT pr_user_kid_uk_id FROM presence WHERE pr_training_tr_id = ' . $this->get_id());
|
$kid_ids = $sql->assoc_array('SELECT pr_user_kid_uk_id FROM presence WHERE pr_training_tr_id = ' . $this->get_id());
|
||||||
@@ -132,6 +133,7 @@ if ($this->is_id()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
header('Location: /admin/presence/' . $this->get_id());
|
header('Location: /admin/presence/' . $this->get_id());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ foreach ($ms_assoc_array as $key => $ms) {
|
|||||||
|
|
||||||
$smarty->assign('ms_array', $ms_array);
|
$smarty->assign('ms_array', $ms_array);
|
||||||
|
|
||||||
|
|
||||||
$smarty->display('user_profile.tpl');
|
$smarty->display('user_profile.tpl');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -568,10 +568,10 @@ if (isset($_POST['action'])) {
|
|||||||
case 'upload_milestone':
|
case 'upload_milestone':
|
||||||
$statusCode = milestone::upload_file($_FILES['fileToUpload']);
|
$statusCode = milestone::upload_file($_FILES['fileToUpload']);
|
||||||
if (0 !== $statusCode) {
|
if (0 !== $statusCode) {
|
||||||
header('Location: /admin/milestones/'.$statusCode);
|
//header('Location: /admin/milestones/'.$statusCode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Location: /admin/milestones/success');
|
//header('Location: /admin/milestones/success');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'training_template_create':
|
case 'training_template_create':
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<div>{$training->get_tr_duration()} perc</div>
|
<div>{$training->get_tr_duration()} perc</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $trc_coaches}
|
{if $trc_coaches || $trc_helpers}
|
||||||
<div class="list_item">
|
<div class="list_item">
|
||||||
<label class="desc" id="title1" for="coaches">
|
<label class="desc" id="title1" for="coaches">
|
||||||
<img src="/_image/coach.png">
|
<img src="/_image/coach.png">
|
||||||
|
|||||||
210
template/templates/user_diary_with_helpers.tpl
Normal file
210
template/templates/user_diary_with_helpers.tpl
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
<div class="list">
|
||||||
|
|
||||||
|
{if count($actions) == 0}
|
||||||
|
<div class="row">
|
||||||
|
<div class="list_item line_height14 bigger_space money_deposit">
|
||||||
|
Áthozat: <span class="bold">{$balance_transfer} Ft</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{foreach $actions as $action}
|
||||||
|
|
||||||
|
{if $action@first}
|
||||||
|
<div style="margin-bottom: 30px;">
|
||||||
|
<div class="list_item line_height14 bigger_space actual_balance">
|
||||||
|
<span class="size20 bold">
|
||||||
|
Aktuális egyenleg: {$action->get_de_balance()|number_format:0:'':' '} Ft
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $action->get_de_training()|is_a:'training'}
|
||||||
|
|
||||||
|
{if !$action@first &&
|
||||||
|
$actions[$action@index-1]->get_de_training()|is_a:'training' &&
|
||||||
|
$actions[$action@index]->get_de_training()->get_tr_date()|substr:5:2 != $actions[$action@index-1]->get_de_training()->get_tr_date()|substr:5:2
|
||||||
|
|
||||||
|
||
|
||||||
|
|
||||||
|
!$action@first &&
|
||||||
|
$actions[$action@index-1]->get_de_money_deposit()|is_a:'money_deposit' &&
|
||||||
|
$actions[$action@index]->get_de_training()->get_tr_date()|substr:5:2 != $actions[$action@index-1]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<span onclick="block_action('block_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_training()->get_tr_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_training()->get_tr_date()|substr:5:2]}
|
||||||
|
({$user_login->get_training_number_in_month({$action->get_de_training()->get_tr_date()|substr:0:4},{$action->get_de_training()->get_tr_date()|substr:5:2})} edzés)
|
||||||
|
<div class="diary_header">
|
||||||
|
<span class="balance_text" id="balance_text_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}">Egyenleg</span>
|
||||||
|
<img src="/_image/open_folder.png">
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<div id="block_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
|
{elseif $action@first}
|
||||||
|
<span onclick="block_action('block_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_training()->get_tr_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_training()->get_tr_date()|substr:5:2]}
|
||||||
|
({$user_login->get_training_number_in_month({$action->get_de_training()->get_tr_date()|substr:0:4},{$action->get_de_training()->get_tr_date()|substr:5:2})} edzés)
|
||||||
|
<div class="diary_header">
|
||||||
|
<span class="balance_text" id="balance_text_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}">Egyenleg</span>
|
||||||
|
<img src="/_image/open_folder.png">
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<div id="block_{$action->get_de_training()->get_tr_date()|substr:0:4}{$action->get_de_training()->get_tr_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
<div class="row">
|
||||||
|
<div class="list_item line_height14 bigger_space">
|
||||||
|
<span class="size20 bold">
|
||||||
|
{$action->get_de_training()->get_tr_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_training()->get_tr_date()|substr:5:2]}
|
||||||
|
{$action->get_de_training()->get_tr_date_day()}.
|
||||||
|
{$days[$action->get_de_training()->get_tr_date_day_of_week()]}
|
||||||
|
{$action->get_de_training()->get_tr_date_time()}
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
{if $action->get_de_training()->get_tr_training_type_trt_id()}{$action->get_de_training()->get_tr_type_name_by_id()} edzés{/if}
|
||||||
|
{$action->get_de_training()->get_tr_duration()} p
|
||||||
|
{strip}
|
||||||
|
{if $action->get_de_training()->is_coach() || $action->get_de_training()->is_helper()}
|
||||||
|
{foreach $action->get_de_training()->get_tr_coaches_name() as $coach_name}
|
||||||
|
{assign var="hasCoach" value="true"}
|
||||||
|
{if $coach_name@first}({/if}{$coach_name}{if !$coach_name@last}, {/if}
|
||||||
|
{/foreach}
|
||||||
|
{if !$action->get_de_training()->is_helper() && $action->get_de_training()->is_coach()}){/if}
|
||||||
|
{if $action->get_de_training()->is_helper() && !$action->get_de_training()->is_coach()}({/if}
|
||||||
|
{foreach $action->get_de_training()->get_tr_helpers_name() as $coach_name}
|
||||||
|
<i>{if $coach_name@first && $action->get_de_training()->is_coach()}, {/if}{$coach_name}{if !$coach_name@last}, {else}){/if}</i>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
{/strip}
|
||||||
|
|
||||||
|
{assign var="discount" value=""}
|
||||||
|
{if $action->get_de_has_discount()}
|
||||||
|
{if $action->get_de_discount_id() == 1}
|
||||||
|
{assign var="discount" value="Próba kedvezmény"}
|
||||||
|
{elseif $action->get_de_discount_id() == 2}
|
||||||
|
{assign var="discount" value="Havi 10+ kedvezmény"}
|
||||||
|
{elseif $action->get_de_discount_id() == 3}
|
||||||
|
{assign var="discount" value="Duplázó kedvezmény"}
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<div class="extra_row">
|
||||||
|
<span class="bold">Egyenleg: {if $action->get_de_balance()>0}+{/if}{$action->get_de_balance()|number_format:0:'':' '} Ft</span>
|
||||||
|
{if $discount != ""}<br>{$discount}{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side_block">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="bold" style="font-size: 20px;">{if $action->get_de_balance()>0}+{/if}{$action->get_de_balance()|number_format:0:'':' '} Ft</span><br>{$discount}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{elseif $action->get_de_money_deposit()|is_a:'money_deposit'}
|
||||||
|
|
||||||
|
|
||||||
|
{if !$action@first &&
|
||||||
|
$actions[$action@index-1]->get_de_training()|is_a:'training' &&
|
||||||
|
$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2 != $actions[$action@index-1]->get_de_training()->get_tr_date()|substr:5:2
|
||||||
|
|
||||||
|
||
|
||||||
|
|
||||||
|
!$action@first &&
|
||||||
|
$actions[$action@index-1]->get_de_money_deposit()|is_a:'money_deposit' &&
|
||||||
|
$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2 != $actions[$action@index-1]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<span onclick="block_action('block_{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2]}
|
||||||
|
({$user_login->get_training_number_in_month({$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2})} edzés)
|
||||||
|
<img src="/_image/open_folder.png">
|
||||||
|
</span>
|
||||||
|
<div id="block_{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
|
{elseif $action@first}
|
||||||
|
|
||||||
|
<span onclick="block_action('block_{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2]}
|
||||||
|
({$user_login->get_training_number_in_month({$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2})} edzés)
|
||||||
|
<img src="/_image/open_folder.png">
|
||||||
|
</span>
|
||||||
|
<div id="block_{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
<div class="row">
|
||||||
|
<div class="list_item line_height14 bigger_space money_deposit">
|
||||||
|
<span class="size20 bold">
|
||||||
|
{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||||
|
{$months[$actions[$action@index]->get_de_money_deposit()->get_mod_money_income()->get_mi_date()|substr:5:2]}
|
||||||
|
{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date_day()}.
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
befizetés: {$action->get_de_money_deposit()->get_mod_money_income()->get_mi_sum(true)} Ft
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="side_block">
|
||||||
|
{assign var="discount" value=""}
|
||||||
|
<span class="bold" style="font-size: 20px;">{if $action->get_de_balance()>0}+{/if}{$action->get_de_balance()|number_format:0:'':' '} Ft</span><br>{$discount}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $action@last}
|
||||||
|
<div class="row">
|
||||||
|
<div class="list_item line_height14 bigger_space money_deposit">
|
||||||
|
Áthozat: <span class="bold">{$balance_transfer} Ft</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function open_block(block_id) {
|
||||||
|
$("#"+block_id).slideDown("slow");
|
||||||
|
$("#balance_text_"+block_id.substr(-6)).addClass('active_header');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function close_block(block_id) {
|
||||||
|
$("#"+block_id).slideUp("slow");
|
||||||
|
$("#balance_text_"+block_id.substr(-6)).removeClass('active_header');
|
||||||
|
}
|
||||||
|
|
||||||
|
function block_action(block_id) {
|
||||||
|
if ($("#"+block_id).is(':hidden')) {
|
||||||
|
open_block(block_id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
close_block(block_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
var divs = $( "div[class=month_block]" );
|
||||||
|
$( ".list" ).find( divs ).hide();
|
||||||
|
var div_list = $( ".list" ).find( divs );
|
||||||
|
|
||||||
|
open_block(div_list[0].id);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -3,20 +3,28 @@
|
|||||||
{if
|
{if
|
||||||
$ms@first ||
|
$ms@first ||
|
||||||
(
|
(
|
||||||
$ms_array[$ms@index]->get_ms_month()|substr:5:2 != $ms_array[$ms@index-1]->get_ms_month()|substr:5:2
|
$ms_array[$ms@index]->get_ms_season() != $ms_array[$ms@index-1]->get_ms_season()
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
{if !$ms@first &&
|
{if !$ms@first &&
|
||||||
$ms_array[$ms@index]->get_ms_month()|substr:5:2 != $ms_array[$ms@index-1]->get_ms_month()|substr:5:2
|
$ms_array[$ms@index]->get_ms_season() != $ms_array[$ms@index-1]->get_ms_season()
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<span onclick="block_action('block_{$ms->get_ms_month()|substr:0:4}{$ms->get_ms_month()|substr:5:2}');" class="date_separator clickable">{$ms_array[$ms@index]->get_ms_month()|substr:0:4}.
|
|
||||||
{$months[$ms_array[$ms@index]->get_ms_month()|substr:5:2]}
|
|
||||||
|
<span onclick="block_action('block_{$ms_array[$ms@index]->get_ms_season()}');" class="date_separator clickable">
|
||||||
|
<div class="full full_block_{$ms_array[$ms@index]->get_ms_season()}">
|
||||||
|
{nl2br($ms_array[$ms@index]->get_ms_sums())}
|
||||||
|
</div>
|
||||||
|
<div class="short short_block_{$ms_array[$ms@index]->get_ms_season()}">
|
||||||
|
{assign var=someVar value="\n"|explode:$ms_array[$ms@index]->get_ms_sums()}
|
||||||
|
{$someVar[0]}
|
||||||
|
</div>
|
||||||
<img src="/_image/open_folder.png">
|
<img src="/_image/open_folder.png">
|
||||||
</span>
|
</span>
|
||||||
<div id="block_{$ms->get_ms_month()|substr:0:4}{$ms->get_ms_month()|substr:5:2}" class="month_block">
|
<div id="block_{$ms_array[$ms@index]->get_ms_season()}" class="month_block">
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $ms->get_ms_training_mst_id() != null}
|
{if $ms->get_ms_training_mst_id() != null}
|
||||||
@@ -53,6 +61,15 @@
|
|||||||
{$ms->get_ms_camp_msca_id()->get_msca_place()}<br>
|
{$ms->get_ms_camp_msca_id()->get_msca_place()}<br>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
{elseif $ms->get_ms_ranking_msr_id() != null}
|
||||||
|
<a>
|
||||||
|
<div class="list_item ranking">
|
||||||
|
<img src="/_image/ranking.png">
|
||||||
|
<strong><span class="bold" style="display: block;">Ranglista</span></strong><br>
|
||||||
|
{$ms->get_ms_ranking_msr_id()->get_msr_date()}<br>
|
||||||
|
{nl2br($ms->get_ms_ranking_msr_id()->get_msr_rankings())}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
@@ -67,10 +84,16 @@
|
|||||||
|
|
||||||
function open_block(block_id) {
|
function open_block(block_id) {
|
||||||
$("#"+block_id).slideDown("slow");
|
$("#"+block_id).slideDown("slow");
|
||||||
|
$(".full_"+block_id).hide();
|
||||||
|
$(".short_"+block_id).show();
|
||||||
|
$(".short_"+block_id).css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
|
|
||||||
function close_block(block_id) {
|
function close_block(block_id) {
|
||||||
$("#"+block_id).slideUp("slow");
|
$("#"+block_id).slideUp("slow");
|
||||||
|
$(".full_"+block_id).show();
|
||||||
|
$(".short_"+block_id).hide();
|
||||||
|
$(".full_"+block_id).css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
|
|
||||||
function block_action(block_id) {
|
function block_action(block_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user