From a249c20433d0885166984a9de2dd808969f46863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Rich=C3=A1rd?= Date: Thu, 3 May 2018 20:27:35 +0200 Subject: [PATCH] updates and restart camps --- _class/class_money_deposit.php | 88 ++++------ _class/class_money_expense.php | 26 ++- _class/class_money_income.php | 140 ++++++++++++++++ _class/class_money_income_category.php | 59 +++++++ _class/class_page.php | 81 +++++---- _class/class_sql.php | 66 ++++---- _class/class_user_kid.php | 12 +- _image/income.png | Bin 0 -> 8827 bytes _include/include_create.php | 23 +++ _include/include_delete_money_deposit.php | 11 +- _include/include_delete_money_income.php | 12 ++ .../include_delete_money_income_category.php | 18 ++ _include/include_diary.php | 30 ++-- _include/include_diary_report.php | 158 ++++++++++++++++++ _include/include_money_deposit.php | 2 +- _include/include_money_expense.php | 14 +- _include/include_money_expense_category.php | 16 +- _include/include_money_income.php | 52 ++++++ _include/include_money_income_category.php | 37 ++++ _include/include_stats.php | 37 +++- event_handler.php | 39 ++++- index.php | 4 +- template/templates/diary_report.tpl | 27 +++ template/templates/money_deposit.tpl | 16 +- template/templates/money_deposit_create.tpl | 2 +- template/templates/money_deposit_update.tpl | 9 +- template/templates/money_expense.tpl | 14 +- template/templates/money_expense_create.tpl | 19 ++- .../templates/money_expense_data_edit.tpl | 19 ++- template/templates/money_income.tpl | 91 ++++++++++ template/templates/money_income_category.tpl | 18 ++ .../money_income_category_create.tpl | 17 ++ .../money_income_category_data_edit.tpl | 21 +++ template/templates/money_income_create.tpl | 51 ++++++ template/templates/money_income_data_edit.tpl | 56 +++++++ template/templates/nav.tpl | 12 +- template/templates/stat_balance.tpl | 37 +++- template/templates/user_diary.tpl | 54 +++--- 38 files changed, 1153 insertions(+), 235 deletions(-) create mode 100644 _class/class_money_income.php create mode 100644 _class/class_money_income_category.php mode change 100755 => 100644 _class/class_page.php mode change 100755 => 100644 _class/class_sql.php create mode 100644 _image/income.png mode change 100755 => 100644 _include/include_create.php create mode 100644 _include/include_delete_money_income.php create mode 100644 _include/include_delete_money_income_category.php create mode 100644 _include/include_diary_report.php create mode 100644 _include/include_money_income.php create mode 100644 _include/include_money_income_category.php create mode 100644 template/templates/diary_report.tpl create mode 100644 template/templates/money_income.tpl create mode 100644 template/templates/money_income_category.tpl create mode 100644 template/templates/money_income_category_create.tpl create mode 100644 template/templates/money_income_category_data_edit.tpl create mode 100644 template/templates/money_income_create.tpl create mode 100644 template/templates/money_income_data_edit.tpl mode change 100755 => 100644 template/templates/nav.tpl diff --git a/_class/class_money_deposit.php b/_class/class_money_deposit.php index d45d171..d2cdd3d 100644 --- a/_class/class_money_deposit.php +++ b/_class/class_money_deposit.php @@ -8,9 +8,8 @@ class money_deposit { private $mod_id; private $mod_user_kid_uk_id; //ID private $mod_user_kid; //OBJECT - private $mod_date; - private $mod_sum; - private $mod_payment_type; + private $mod_money_income_mi_id; //ID + private $mod_money_income; //OBJECT private $mod_deleted; public function set_mod_id($_id) { @@ -25,16 +24,12 @@ class money_deposit { $this->mod_user_kid = $_user_kid; } - public function set_mod_date($_date) { - $this->mod_date = $_date; + public function set_mod_money_income_mi_id($_money_income_mi_id) { + $this->mod_money_income_mi_id = $_money_income_mi_id; } - public function set_mod_sum($_sum) { - $this->mod_sum = $_sum; - } - - public function set_mod_payment_type_pt_id($_payment_type) { - $this->mod_payment_type = $_payment_type; + public function set_mod_money_income($_money_income) { + $this->mod_money_income = $_money_income; } public function set_mod_deleted($_deleted) { @@ -53,32 +48,12 @@ class money_deposit { return $this->mod_user_kid; } - public function get_mod_payment_type_pt_id() { - return $this->mod_payment_type; + public function get_mod_money_income_mi_id() { + return $this->mod_money_income_mi_id; } - - public function get_mod_date($_formatted = false) { - return !$_formatted ? $this->mod_date : date("Y. m. d.", strtotime($this->mod_date)); - } - - public function get_mod_date_day() { - $day = date("d", strtotime($this->mod_date)); - if (substr($day, 0, 1) == '0') return substr($day, 1, 1); - return date("d", strtotime($this->mod_date)); - } - - public function get_mod_date_day_of_week() { - return date("w", strtotime($this->mod_date)); - } - - public function get_mod_sum($formatted = null) { - if (!$formatted) { - return $this->mod_sum; - } - else { - return number_format($this->mod_sum, 0, '', ' '); - } + public function get_mod_money_income() { + return $this->mod_money_income; } public function get_mod_deleted() { @@ -98,37 +73,48 @@ class money_deposit { $new_user->set_user_data_by_id($value); $this->set_mod_user_kid($new_user); } - if ($field == "mod_payment_type") { - $new_pt = new payment_type(); - $new_pt->set_pt_data_by_id($value); - $this->set_mod_payment_type_pt_id($new_pt); + if ($field == "mod_money_income_mi_id") { + $new_mi = new money_income(); + $new_mi->set_mi_data_by_id($value); + $this->set_mod_money_income($new_mi); } - } - } public static function create_money_deposit($_user_id, $_date, $_sum, $_pt) { global $sql; - return $sql->insert_into('money_deposit', array( - 'mod_user_kid_uk_id' => $_user_id, - 'mod_date' => $_date, - 'mod_payment_type_pt_id' => $_pt, - 'mod_sum' => $_sum + + $income_id = $sql->insert_into('money_income', array( + 'mi_date' => $_date, + 'mi_payment_type_pt_id' => $_pt, + 'mi_sum' => $_sum, + 'mi_item' => 'Edzésdíj', + 'mi_money_income_category_mic_id' => 4, ) ); + + return $sql->insert_into('money_deposit', array( + 'mod_user_kid_uk_id' => $_user_id, + 'mod_money_income_mi_id' => $income_id, + )); } - public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id, $_pt) { + public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id, $_pt, $_mi_id) { global $sql; + $sql->update_table('money_income', array( + //'mod_user_kid_uk_id' => $_user_id, + 'mi_date' => $_date, + 'mi_payment_type_pt_id' => $_pt, + 'mi_sum' => $_sum + ), array( + 'mi_id' => $_mi_id + )); + $sql->update_table('money_deposit', array( 'mod_user_kid_uk_id' => $_user_id, - 'mod_date' => $_date, - 'mod_payment_type_pt_id' => $_pt, - 'mod_sum' => $_sum ), array( 'mod_id' => $_mod_id - )); + )); } diff --git a/_class/class_money_expense.php b/_class/class_money_expense.php index 84558e7..bc6f5d3 100644 --- a/_class/class_money_expense.php +++ b/_class/class_money_expense.php @@ -10,6 +10,7 @@ class money_expense { private $mox_sum; private $mox_moxc_id = null; private $mox_moxc = null; + private $mox_payment_type; private $mox_deleted; @@ -45,6 +46,9 @@ class money_expense { $this->mox_coach = $_item; } + public function set_mox_payment_type_pt_id($_payment_type) { + $this->mox_payment_type = $_payment_type; + } public function set_mox_deleted($_item) { $this->mox_deleted = $_item; @@ -54,6 +58,10 @@ class money_expense { return $this->mox_id; } + public function get_mox_payment_type_pt_id() { + return $this->mox_payment_type; + } + public function get_mox_user_coach_ua_id() { return $this->mox_user_coach_ua_id; } @@ -64,7 +72,7 @@ class money_expense { public function get_mox_date_day() { $day = date("d", strtotime($this->mox_date)); - if (substr($day, 0, 1) == '0') return substr($day, 1, 1); + if (substr($day, 0, 1) == '0') return substr($day, 1, 1); return date("d", strtotime($this->mox_date)); } @@ -125,11 +133,17 @@ class money_expense { $new_user->set_user_data_by_id($value); $this->set_mox_coach($new_user); } + + if ($field == "mox_payment_type") { + $new_pt = new payment_type(); + $new_pt->set_pt_data_by_id($value); + $this->set_mox_payment_type_pt_id($new_pt); + } } } - public static function create_money_expense($_name, $_date, $_item, $_sum, $_moxc_id) { + public static function create_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_pt) { global $sql; return $sql->insert_into('money_expense', array( @@ -137,19 +151,21 @@ class money_expense { 'mox_date' => $_date, 'mox_item' => $_item, 'mox_sum' => $_sum, + 'mox_payment_type_pt_id' => $_pt, 'mox_money_expense_category_moxc_id' => $_moxc_id )); } - public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id) { + public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id, $_pt) { global $sql; - $sql->update_table('money_expense', + $sql->update_table('money_expense', array( 'mox_user_coach_ua_id' => (empty($_name)?'null':self::name_to_ua_id($_name)), 'mox_date' => $_date, 'mox_item' => $_item, 'mox_sum' => $_sum, + 'mox_payment_type_pt_id' => $_pt, 'mox_money_expense_category_moxc_id' => $_moxc_id ), array( @@ -162,4 +178,4 @@ class money_expense { } -?> \ No newline at end of file +?> diff --git a/_class/class_money_income.php b/_class/class_money_income.php new file mode 100644 index 0000000..619ab8e --- /dev/null +++ b/_class/class_money_income.php @@ -0,0 +1,140 @@ +mi_id = $_item; + } + + public function set_mi_date($_item) { + $this->mi_date = $_item; + } + + public function set_mi_item($_item) { + $this->mi_item = $_item; + } + + public function set_mi_sum($_item) { + $this->mi_sum = $_item; + } + + public function set_mi_money_income_category_mic_id($_item) { + $this->mi_mic_id = $_item; + } + + public function set_mi_mic($_item) { + $this->mi_mic = $_item; + } + + public function set_mi_payment_type_pt_id($_payment_type) { + $this->mi_payment_type = $_payment_type; + } + + public function set_mi_deleted($_item) { + $this->mi_deleted = $_item; + } + + public function get_mi_id() { + return $this->mi_id; + } + + public function get_mi_date($_formatted = false) { + return !$_formatted ? $this->mi_date : date("Y. m. d.", strtotime($this->mi_date)); + } + + public function get_mi_date_day() { + $day = date("d", strtotime($this->mi_date)); + if (substr($day, 0, 1) == '0') return substr($day, 1, 1); + return date("d", strtotime($this->mi_date)); + } + + public function get_mi_item() { + return $this->mi_item; + } + + public function get_mi_sum() { + return $this->mi_sum; + } + + public function get_mi_mic() { + return $this->mi_mic; + } + + public function get_mi_money_income_category_mic_id() { + return $this->mi_mic_id; + } + + public function get_mi_payment_type_pt_id() { + return $this->mi_payment_type; + } + + public function get_mi_deleted() { + return $this->mi_deleted; + } + + public function set_mi_data_by_id($_id) { + global $sql; + $set_data_assoc_array = $sql->assoc_array("select * from money_income where mi_id = " . $_id); + $set_data_array = $set_data_assoc_array[0]; + foreach ($set_data_array as $field => $value) { + $function_name = "set_" . $field; + $this->$function_name($value); //alapadatok beállítása + + if ($field == 'mi_money_income_category_mic_id' && $value != null) { + $new_mic = new money_income_category(); + $new_mic->set_mic_data_by_id($value); + $this->set_mi_mic($new_mic); + } + if ($field == "mi_payment_type") { + $new_pt = new payment_type(); + $new_pt->set_pt_data_by_id($value); + $this->set_mi_payment_type_pt_id($new_pt); + } + } + + } + + public static function create_money_income($_date, $_item, $_sum, $_mic_id, $_pt) { + global $sql; + + return $sql->insert_into('money_income', array( + 'mi_date' => $_date, + 'mi_item' => $_item, + 'mi_sum' => $_sum, + 'mi_money_income_category_mic_id' => $_mic_id, + 'mi_payment_type_pt_id' => $_pt + )); + } + + public static function update_money_income($_date, $_item, $_sum, $_mic_id, $_id, $_pt) { + global $sql; + + $sql->update_table('money_income', + array( + 'mi_date' => $_date, + 'mi_item' => $_item, + 'mi_sum' => $_sum, + 'mi_money_income_category_mic_id' => $_mic_id, + 'mi_payment_type_pt_id' => $_pt + ), + array( + 'mi_id' => $_id + ) + + + ); + } +} + + +?> diff --git a/_class/class_money_income_category.php b/_class/class_money_income_category.php new file mode 100644 index 0000000..27cd7c7 --- /dev/null +++ b/_class/class_money_income_category.php @@ -0,0 +1,59 @@ +mic_id = $_item; + } + + public function set_mic_name($_item) { + $this->mic_name = $_item; + } + + public function set_mic_deleted($_item) { + $this->mic_deleted = $_item; + } + + public function get_mic_id() { + return $this->mic_id; + } + + public function get_mic_name() { + return $this->mic_name; + } + + public function get_mic_deleted() { + return $this->mic_deleted; + } + + public function set_mic_data_by_id($_id) { + global $sql; + $set_data_assoc_array = $sql->assoc_array("select * from money_income_category where mic_id = " . $_id); + $set_data_array = $set_data_assoc_array[0]; + foreach ($set_data_array as $field => $value) { + $function_name = "set_" . $field; + $this->$function_name($value); //alapadatok beállítása + + } + + } + + public static function create_money_income_category($_name) { + global $sql; + + return $sql->insert_into('money_income_category', array('mic_name' => $_name)); + } + + public static function update_money_income_category($_name, $_id) { + global $sql; + + $sql->update_table('money_income_category', array('mic_name' => $_name), array('mic_id' => $_id)); + } + +} + + +?> diff --git a/_class/class_page.php b/_class/class_page.php old mode 100755 new mode 100644 index f8e9c66..e799ba5 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -9,10 +9,10 @@ class page { - + private $page = null; private $subpage = null; - private $id = null; + private $id = null; function __construct() { if (isset($_GET['page'])) $this->set_page($_GET['page']); @@ -48,7 +48,7 @@ class page { $menu_assoc_array = $sql->assoc_array($menus_query); $smarty->assign('menus', $menu_assoc_array); } - + $smarty->assign('page', $this->get_page()); $smarty->display('nav.tpl'); } @@ -142,16 +142,16 @@ class page { break; case 'log': # NAPLÓ - include('include_log.php'); + include('include_log.php'); break; case 'money_deposit': # BEFIZETÉSEK - include('include_money_deposit.php'); + include('include_money_deposit.php'); break; case 'lock_training': # EDZÉS ZÁROLÁS, FELOLDÁS include('include_lock_training.php'); - break; + break; case 'view_deposit': # BEFIZETÉSEK / USER include('include_view_deposit.php'); @@ -164,6 +164,14 @@ class page { # KIADÁS KATEGÓRIÁK include('include_money_expense_category.php'); break; + case 'money_income_category': + # BEVÉTEL KATEGÓRIÁK + include('include_money_income_category.php'); + break; + case 'money_income': + # BEVÉTELEK + include('include_money_income.php'); + break; case 'money_update': # FRISSÍTÉS include('include_money_update.php'); @@ -181,15 +189,15 @@ class page { break; case 'download_backup': # BIZTONSÁGI MENTÉS LETÖLTÉS - include('include_download_backup.php'); + include('include_download_backup.php'); break; case 'camps': # TÁBOROK - include('include_camps.php'); + include('include_camps.php'); break; case 'camp_types': # TÁBOR TÍPUSOK - include('include_camp_types.php'); + include('include_camp_types.php'); break; case 'camp_shirt_type': # TÁBOR PÓLÓ TÍPUSOK @@ -201,27 +209,27 @@ class page { break; case 'deny_apply': # TÁBOR JELENTKEZÉS ELUTASÍTÁSA - include('include_deny_apply.php'); + include('include_deny_apply.php'); break; case 'remove_apply': # TÁBOR JELENTKEZÉS ELTÁVOLÍTÁSA A LISTÁBÓL - include('include_remove_apply.php'); + include('include_remove_apply.php'); break; case 'apply': # TÁBORI JELENTKEZŐ ADATAINAK MEGTEKINTÉSE - include('include_apply.php'); + include('include_apply.php'); break; case 'camp_user': # táborvezetők - include('include_user_camp_leader.php'); + include('include_user_camp_leader.php'); break; case 'camp_details': # turnusok - include('include_camp_details.php'); + include('include_camp_details.php'); break; case 'user_groups': # csoportok - include('include_user_groups.php'); + include('include_user_groups.php'); break; case 'delete_training_type': # EDZÉS TÍPUS TÖRLÉS @@ -259,6 +267,14 @@ class page { # BEFIZETÉS TÖRLÉS include('include_delete_money_expense.php'); break; + case 'delete_money_income_category': + # BEVÉTEL KATEGÓRIA TÖRLÉS + include('include_delete_money_income_category.php'); + break; + case 'delete_money_income': + # BEVÉTEL TÖRLÉS + include('include_delete_money_income.php'); + break; case 'delete_backup': # MENTÉS TÖRLÉS include('include_delete_backup.php'); @@ -283,6 +299,9 @@ class page { # CSOPORT TÖRLÉS include('include_delete_user_group.php'); break; + case 'diary_report': + include('include_diary_report.php'); + break; case 'logout': # kijelentkezés $from = "admin"; @@ -304,15 +323,15 @@ class page { case 'logout': # kijelentkezés $from = "view"; - include('include_logout.php'); + include('include_logout.php'); break; case 'overview': # áttekintő oldal adatokkal - include('include_overview.php'); + include('include_overview.php'); break; case 'diary': # napló, edzéslista - include('include_diary.php'); + include('include_diary.php'); break; case 'information': # információk @@ -328,11 +347,11 @@ class page { switch ($this->get_subpage()) { case 'overview': # áttekintő oldal adatokkal - include('include_overview.php'); + include('include_overview.php'); break; case 'diary': # napló, edzéslista - include('include_diary.php'); + include('include_diary.php'); break; case 'information': # információk @@ -348,12 +367,12 @@ class page { switch ($this->get_subpage()) { case 'diary': # napló, edzéslista - include('include_coach_diary.php'); + include('include_coach_diary.php'); break; case 'logout': # kijelentkezés $from = "coach"; - include('include_logout.php'); + include('include_logout.php'); break; default: include('include_coach_diary.php'); @@ -365,7 +384,7 @@ class page { switch ($this->get_subpage()) { case 'diary': # napló, edzéslista - include('include_coach_diary.php'); + include('include_coach_diary.php'); break; default: include('include_coach_diary.php'); @@ -377,15 +396,15 @@ class page { switch ($this->get_subpage()) { case 'informaciok': # tábori információk - include('include_camp_information.php'); + include('include_camp_information.php'); break; case 'jelentkezes': # jelentkezés - include('include_camp_apply.php'); + include('include_camp_apply.php'); break; case 'jelentkezesek': # jelentkezések - include('include_camp_applies.php'); + include('include_camp_applies.php'); break; case 'move_next': # továbblépés mentés nélkül @@ -394,11 +413,11 @@ class page { case 'logout': # kijelentkezés $from = "tabor"; - include('include_logout.php'); + include('include_logout.php'); break; case 'delete_apply': # jelentkezés törlése - include('include_delete_apply.php'); + include('include_delete_apply.php'); break; default: include('include_camp_information.php'); @@ -410,11 +429,11 @@ class page { switch ($this->get_subpage()) { case 'taborok': # turnusok - include('include_camp_details.php'); + include('include_camp_details.php'); break; case 'jelentkezes': # turnusok - include('include_apply.php'); + include('include_apply.php'); break; case 'logout': # kijelentkezés @@ -494,4 +513,4 @@ class page { -?> \ No newline at end of file +?> diff --git a/_class/class_sql.php b/_class/class_sql.php old mode 100755 new mode 100644 index a92db84..17f0207 --- a/_class/class_sql.php +++ b/_class/class_sql.php @@ -86,76 +86,76 @@ class sql extends mysqli { } function export_database($tables=false, $backup_name=false ) - { + { $name = "badminton_coach"; $this->query("SET NAMES 'utf8'"); - $queryTables = $this->query('SHOW TABLES'); - while($row = $queryTables->fetch_row()) - { - $target_tables[] = $row[0]; - } - if($tables !== false) - { - $target_tables = array_intersect( $target_tables, $tables); + $queryTables = $this->query('SHOW TABLES'); + while($row = $queryTables->fetch_row()) + { + $target_tables[] = $row[0]; + } + if($tables !== false) + { + $target_tables = array_intersect( $target_tables, $tables); } foreach($target_tables as $table) { - $result = $this->query('SELECT * FROM '.$table); - $fields_amount = $result->field_count; - $rows_num=$this->affected_rows; - $res = $this->query('SHOW CREATE TABLE '.$table); + $result = $this->query('SELECT * FROM '.$table); + $fields_amount = $result->field_count; + $rows_num=$this->affected_rows; + $res = $this->query('SHOW CREATE TABLE '.$table); $TableMLine = $res->fetch_row(); $content = (!isset($content) ? '' : $content) . "\n\n".$TableMLine[1].";\n\n"; - for ($i = 0, $st_counter = 0; $i < $fields_amount; $i++, $st_counter=0) + for ($i = 0, $st_counter = 0; $i < $fields_amount; $i++, $st_counter=0) { - while($row = $result->fetch_row()) + while($row = $result->fetch_row()) { //when started (and every after 100 command cycle): - if ($st_counter%100 == 0 || $st_counter == 0 ) + if ($st_counter%100 == 0 || $st_counter == 0 ) { $content .= "\nINSERT INTO ".$table." VALUES"; } $content .= "\n("; - for($j=0; $j<$fields_amount; $j++) - { - $row[$j] = str_replace("\n","\\n", addslashes($row[$j]) ); + for($j=0; $j<$fields_amount; $j++) + { + $row[$j] = str_replace("\n","\\n", addslashes($row[$j]) ); if (isset($row[$j])) { - $content .= '"'.$row[$j].'"' ; + $content .= '"'.$row[$j].'"' ; } - else - { + else + { $content .= '""'; - } + } if ($j<($fields_amount-1)) { $content.= ','; - } + } } $content .=")"; //every after 100 command cycle [or at last line] ....p.s. but should be inserted 1 cycle eariler - if ( (($st_counter+1)%100==0 && $st_counter!=0) || $st_counter+1==$rows_num) - { + if ( (($st_counter+1)%100==0 && $st_counter!=0) || $st_counter+1==$rows_num) + { $content .= ";"; - } - else + } + else { $content .= ","; - } + } $st_counter=$st_counter+1; } } $content .="\n\n\n"; } //$backup_name = $backup_name ? $backup_name : $name."___(".date('H-i-s')."_".date('d-m-Y').")__rand".rand(1,11111111).".sql"; $backup_name = $backup_name ? $backup_name : $name.".sql"; - //header('Content-Type: application/octet-stream'); - //header("Content-Transfer-Encoding: Binary"); - //header("Content-disposition: attachment; filename=\"".$backup_name."\""); + //header('Content-Type: application/octet-stream'); + //header("Content-Transfer-Encoding: Binary"); + //header("Content-disposition: attachment; filename=\"".$backup_name."\""); return $content; } } -?> \ No newline at end of file +?> diff --git a/_class/class_user_kid.php b/_class/class_user_kid.php index a727a0d..93ad3b1 100644 --- a/_class/class_user_kid.php +++ b/_class/class_user_kid.php @@ -468,7 +468,7 @@ class user_kid extends user_parent { $sql->update_table('user_kid', $_user_value_array, array('uk_id' => $_user_id)); } - public function calculate_balance(&$_de_obj_array, $_user_obj = null) { + public function calculate_balance(&$_de_obj_array, $_user_obj = null, $update = true) { //kiszámolja az egyenleget a diary entry-k alapján, amik tömbben érkeznek //a tömbben feltölti a pénzmozgást, és minden lépésben befrissíti az egyenleget //az update-elt tömböt adja vissza @@ -508,17 +508,17 @@ class user_kid extends user_parent { } } elseif ($_de->get_de_type() == 'money_deposit') { - $_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_sum()); + $_de->set_de_transaction($_de->get_de_money_deposit()->get_mod_money_income()->get_mi_sum()); $_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction()); //$balance += $_de->get_de_money_deposit()->get_mod_sum(); //echo $_de->get_de_date() . " plussz " . $_de->get_de_money_deposit()->get_mod_sum() . "

"; } } - - - if (isset($_de)) $sql->update_table('user_kid', (array('uk_balance' => $_de->get_de_balance())), array('uk_id' => (is_object($_user_obj)?$_user_obj->get_uk_id():$this->get_uk_id())), false); - else $sql->update_table('user_kid', (array('uk_balance' => 0)), array('uk_id' => (is_object($_user_obj)?$_user_obj->get_uk_id():$this->get_uk_id())), false); + if ($update) { + if (isset($_de)) $sql->update_table('user_kid', (array('uk_balance' => $_de->get_de_balance())), array('uk_id' => (is_object($_user_obj)?$_user_obj->get_uk_id():$this->get_uk_id())), false); + else $sql->update_table('user_kid', (array('uk_balance' => 0)), array('uk_id' => (is_object($_user_obj)?$_user_obj->get_uk_id():$this->get_uk_id())), false); + } return $_de_obj_array; } diff --git a/_image/income.png b/_image/income.png new file mode 100644 index 0000000000000000000000000000000000000000..1041b1a5b263f6e5fcfbc488daf9297e5ab774c4 GIT binary patch literal 8827 zcmYj%c|6qL_x~6>Stm=`2_gHIeTigOC`u%2gd`c;jO_31gp55&qJ(T&2F1+SrlMrY zScb7>55t)Gy{7l~^M3sPnYpiX&w1W+&%O7YbC-YYY|PkL&a!|&AU5+WCf7h98lXr6 zVqyUPTpqsm27$zl%}tCPpp(CEGe37RZF;w|($zWKCA}hcES#O0nrX-#%hW11zkhm{ zWGIp>IskFd;Nzr^mzF)2EfbHYf$(!F&%Wp9F*2n0VpgEb^t=KF+lZdqESmOvIJ!49 zUAb}nU~^NaRK=Pyrsqg$YbrX*;5?j-B&q*VjN7(Ra2aE7bwpnVO_MMU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V82`JAeL>YM6VH;yfJdzSIF(__wBClidcFAf%DXG1)&Jr1lp;8oNg0+}kA$h@w zbZHn<_k!ed2N9E7dQv+`lZM6;nHZ0iLgq!c!reDFjHXE_?ezAe_k?HJ&PCcb$CMXk zB$qNo%y<1F0dwH0$@{30BC3TCD^9EF?*0;C>@;!dn{m^O#3OJ>%KANA8Pc`=J4>-c2_* zioR)>CXo6GHmhoB>g5lXm~wnnz6^Bm)sto*ZLNX5)?3i>P;fmHx8k$BiDGdc)fe5l zWiX1bm9SYPlw3HyV>T%3@J1n!{vES#jcQ7txCl-3_0$K88lF2LJ)G|%Apgj{yZ|p5 z_QvMnpROW8L#Z2QIlgK^Md4V&XMRBcxFF`q3kHNSIFR*f{~kIUe(q7at^oV-@E?w& zQ~=Gow*Xw&D$Vn)wO7X)ha(M4G!=zF}fV{{I`3W}>8RzVS;ii(EM z=G)UzB;V!=SF!(`?IsGKg&|9!PF><8$q0d{%&M_Gi^h*vazjef@&$riGB#KuW?(yf ze4HmO!##s$nQQ1)(vM+JT?y^W*{_^GX>$nfwUGoZ3$`6`HSsd{_QU2nNYj_@nh~`| zxF#A^7L>Ee_La>1u@QdlO7QjLyq`&w6mv-dFfqQY_oq*FU5#Z4UF7=P_2aeQ3Zd%tzn9X+Txi({m zFZHs#%#p9msE5a$`i`MzF8mwahgI;HOsn`Qs?O`M%}@yPyTyck)mB9X)fwf|KZ=a7AdqPx&qUf s_#_Uh2G3_P%UKOhY5!MuafU)$c(RMY>HJy&9+iO1O>Iox8Q+Qhe?Lnlx&QzG literal 0 HcmV?d00001 diff --git a/_include/include_create.php b/_include/include_create.php old mode 100755 new mode 100644 index 203e844..f0b0b66 --- a/_include/include_create.php +++ b/_include/include_create.php @@ -133,6 +133,9 @@ switch ($this->get_id()) { $moxc_array[] = $new_moxc; } + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); + + $smarty->assign('pt_assoc_array', $pt_assoc_array); $smarty->assign('moxc_array', $moxc_array); $smarty->display('money_expense_create.tpl'); break; @@ -140,6 +143,26 @@ switch ($this->get_id()) { # ÚJ KIADÁS KATEGÓRIA $smarty->display('money_expense_category_create.tpl'); break; + case 'money_income_category': + # ÚJ BEVÉTEL KATEGÓRIA + $smarty->display('money_income_category_create.tpl'); + break; + case 'money_income': + # ÚJ KIADÁS + $mic_assoc_array = $sql->assoc_array('SELECT * FROM money_income_category WHERE mic_deleted = 0 AND mic_id != 4 ORDER BY mic_name ASC;'); + $mic_array = array(); + foreach ($mic_assoc_array as $key => $mic) { + $new_mic = new money_income_category(); + $new_mic->set_mic_data_by_id($mic['mic_id']); + $mic_array[] = $new_mic; + } + + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); + + $smarty->assign('pt_assoc_array', $pt_assoc_array); + $smarty->assign('mic_array', $mic_array); + $smarty->display('money_income_create.tpl'); + break; case 'backup': # BACKUP //létrehozzá, és hozzáfűzi az ID-t a dátumhoz diff --git a/_include/include_delete_money_deposit.php b/_include/include_delete_money_deposit.php index 6667180..9b176a0 100644 --- a/_include/include_delete_money_deposit.php +++ b/_include/include_delete_money_deposit.php @@ -1,13 +1,14 @@ is_id()) { - $sql->update_table('money_deposit', array('mod_deleted' => 1), array('mod_id' => $this->get_id())); - $new_mod = new money_deposit(); - $new_mod->set_mod_data_by_id($this->get_id()); + $sql->update_table('money_deposit', array('mod_deleted' => 1), array('mod_id' => $this->get_id())); + $new_mod = new money_deposit(); + $new_mod->set_mod_data_by_id($this->get_id()); + $sql->update_table('money_income', array('mi_deleted' => 1), array('mi_id' => $new_mod->get_mod_money_income_mi_id())); //log::register('update_money_deposit', $tmp_user->get_uk_name() . ': ' . $_POST['mod_sum']. ' Ft (' . $_POST['mod_date'] . ')'); - log::register('delete_money_deposit', $new_mod->get_mod_user_kid()->get_uk_name() . ': ' . $new_mod->get_mod_sum() . ' Ft (' . $new_mod->get_mod_date() . ')'); + log::register('delete_money_deposit', $new_mod->get_mod_user_kid()->get_uk_name() . ': ' . $new_mod->get_mod_money_income()->get_mi_sum() . ' Ft (' . $new_mod->get_mod_money_income()->get_mi_date() . ')'); header("Location: /admin/money_deposit"); } -?> \ No newline at end of file +?> diff --git a/_include/include_delete_money_income.php b/_include/include_delete_money_income.php new file mode 100644 index 0000000..0035ac6 --- /dev/null +++ b/_include/include_delete_money_income.php @@ -0,0 +1,12 @@ +is_id()) { + $sql->update_table('money_income', array('mi_deleted' => 1), array('mi_id' => $this->get_id())); + $mi = new money_income(); + $mi->set_mi_data_by_id($this->get_id()); + log::register('delete_mi', $mi->get_mi_item() . ": " . $mi->get_mi_sum() . " Ft"); + header("Location: /admin/money_income"); +} + + +?> diff --git a/_include/include_delete_money_income_category.php b/_include/include_delete_money_income_category.php new file mode 100644 index 0000000..f83f0f2 --- /dev/null +++ b/_include/include_delete_money_income_category.php @@ -0,0 +1,18 @@ +is_id()) { + $sql->update_table('money_income_category', array('mic_deleted' => 1), array('mic_id' => $this->get_id())); + log::register('delete_mic', $this->get_id()); + + //akiknek ez a mic_id van beállítva, azoknál null-ra állítjuk + $mi_query = "SELECT mi_id FROM money_income WHERE mi_money_income_category_mic_id = " . $this->get_id(); + $mi_assoc_array = $sql->assoc_array($mi_query); + foreach ($mi_assoc_array as $uk_id) { + $sql->update_table('money_income', array('mi_money_income_category_mic_id' => 'null'), array('mi_id' => $uk_id['mi_id'])); + } + + header("Location: /admin/money_income_category"); +} + + +?> diff --git a/_include/include_diary.php b/_include/include_diary.php index 66c9d23..5a4dec6 100644 --- a/_include/include_diary.php +++ b/_include/include_diary.php @@ -3,11 +3,11 @@ $action_list_query = " - SELECT + SELECT object_id, timestamp(object_date) as object_date, object_type, - (SELECT + (SELECT count(distinct date(tr_date)) FROM presence @@ -18,12 +18,12 @@ AND MONTH(tr_date) = MONTH(object_date) AND tr_date <= object_date AND pr_user_kid_uk_id = ".$user->get_uk_id()." - AND tr_date > (select + AND tr_date > (select if(max(trd) is null, '1900-01-01', max(trd)) from - (select + (select tr_date trd from presence @@ -31,7 +31,7 @@ join user_kid ON uk_id = pr_user_kid_uk_id where pr_user_kid_uk_id = ".$user->get_uk_id()." - and tr_date >= (SELECT + and tr_date >= (SELECT tr_date from presence @@ -44,7 +44,7 @@ limit 1) order by tr_date ASC limit 2) as elso_ket_edzes)) as 'training_per_month', - (SELECT + (SELECT count(pr_id) FROM presence @@ -54,12 +54,12 @@ DATE(tr_date) = DATE(object_date) AND tr_date <= object_date AND pr_user_kid_uk_id = ".$user->get_uk_id().") as 'training_per_day', - (select + (select if(sum(if(trd = object_date, 1, 0)) > 0, 1, 0) from - (select + (select tr_date trd from presence @@ -67,7 +67,7 @@ join user_kid ON uk_id = pr_user_kid_uk_id where pr_user_kid_uk_id = ".$user->get_uk_id()." - and tr_date >= (SELECT + and tr_date >= (SELECT tr_date from presence @@ -81,7 +81,7 @@ order by tr_date ASC limit 2) elso2edzes) as 'first_two' FROM - ((SELECT + ((SELECT pr_training_tr_id as object_id, timestamp(tr_date) as object_date, if(pr_training_tr_id is not null, 'training', null) as object_type @@ -90,12 +90,14 @@ FROM JOIN training ON tr_id = pr_training_tr_id WHERE pr_user_kid_uk_id = ".$user->get_uk_id()." - AND tr_deleted = 0) UNION (SELECT + AND tr_deleted = 0) UNION (SELECT mod_id, - timestamp(mod_date), + timestamp(mi_date), if(mod_id is not null, 'money_deposit', null) as object_type FROM money_deposit + JOIN + money_income ON mi_id = mod_money_income_mi_id WHERE mod_user_kid_uk_id = ".$user->get_uk_id()." and mod_deleted = 0)) actions @@ -134,7 +136,7 @@ order by object_date ASC; $smarty->assign('actions', $de_array); //$smarty->assign('balance', $balance); $smarty->display('user_diary.tpl'); - -?> \ No newline at end of file + +?> diff --git a/_include/include_diary_report.php b/_include/include_diary_report.php new file mode 100644 index 0000000..0dbb91f --- /dev/null +++ b/_include/include_diary_report.php @@ -0,0 +1,158 @@ +assoc_array($users_q); + +foreach ($users as $key => $user) { + # code... + + + $action_list_query = " + SELECT + object_id, + timestamp(object_date) as object_date, + object_type, + (SELECT + count(distinct date(tr_date)) + FROM + presence + JOIN + training ON tr_id = pr_training_tr_id + WHERE + YEAR(tr_date) = YEAR(object_date) + AND MONTH(tr_date) = MONTH(object_date) + AND tr_date <= object_date + AND pr_user_kid_uk_id = ".$user['uk_id']." + AND tr_date > (select + if(max(trd) is null, + '1900-01-01', + max(trd)) + from + (select + tr_date trd + from + presence + join training ON tr_id = pr_training_tr_id + join user_kid ON uk_id = pr_user_kid_uk_id + where + pr_user_kid_uk_id = ".$user['uk_id']." + and tr_date >= (SELECT + tr_date + from + presence + join training ON tr_id = pr_training_tr_id + join user_kid ON uk_id = pr_user_kid_uk_id + where + pr_user_kid_uk_id = ".$user['uk_id']." + and date(tr_date) = uk_first_training + ORDER BY tr_date ASC + limit 1) + order by tr_date ASC + limit 2) as elso_ket_edzes)) as 'training_per_month', + (SELECT + count(pr_id) + FROM + presence + JOIN + training ON tr_id = pr_training_tr_id + WHERE + DATE(tr_date) = DATE(object_date) + AND tr_date <= object_date + AND pr_user_kid_uk_id = ".$user['uk_id'].") as 'training_per_day', + (select + if(sum(if(trd = object_date, 1, 0)) > 0, + 1, + 0) + from + (select + tr_date trd + from + presence + join training ON tr_id = pr_training_tr_id + join user_kid ON uk_id = pr_user_kid_uk_id + where + pr_user_kid_uk_id = ".$user['uk_id']." + and tr_date >= (SELECT + tr_date + from + presence + join training ON tr_id = pr_training_tr_id + join user_kid ON uk_id = pr_user_kid_uk_id + where + pr_user_kid_uk_id = ".$user['uk_id']." + and date(tr_date) = uk_first_training + ORDER BY tr_date ASC + limit 1) + order by tr_date ASC + limit 2) elso2edzes) as 'first_two' +FROM + ((SELECT + pr_training_tr_id as object_id, + timestamp(tr_date) as object_date, + if(pr_training_tr_id is not null, 'training', null) as object_type + FROM + presence + JOIN training ON tr_id = pr_training_tr_id + WHERE + pr_user_kid_uk_id = ".$user['uk_id']." + AND tr_deleted = 0) UNION (SELECT + mod_id, + timestamp(mi_date), + if(mod_id is not null, 'money_deposit', null) as object_type + FROM + money_deposit + JOIN + money_income ON mi_id = mod_money_income_mi_id + WHERE + mod_user_kid_uk_id = ".$user['uk_id']." + and mod_deleted = 0)) actions +order by object_date ASC; + "; + + $action_assoc_array = $sql->assoc_array($action_list_query); + + $actions = array(); + $de_array = array(); + foreach ($action_assoc_array as $action) { + + if ($action['object_type'] == 'training') { + $new_training = new training; + $new_training->set_training_data_by_id($action['object_id']); + //$actions[] = $new_training; + $new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], $new_training); + } + elseif ($action['object_type'] == 'money_deposit') { + $new_mod = new money_deposit; + $new_mod->set_mod_data_by_id($action['object_id']); + //$actions[] = $new_mod; + $new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], null, $new_mod); + } + + $de_array[] = $new_diary_entry; + + //var_dump($de_array); + + } + $user_obj = new user_kid(); + $user_obj->set_user_data_by_id($user['uk_id']); + $user_obj->calculate_balance($de_array, $user_obj, false); + $res[$user['uk_name']] = $de_array; +} + + + + //itt csak hivatkozással adjuk át a tömböt, a calculate_balance kiszámolja, belerakja és visszadja + //$user->calculate_balance($de_array, $user); + //var_dump($de_array); + //$smarty->assign('actions', $actions); + $de_array = array_reverse($de_array); + $smarty->assign('actions', $de_array); + $smarty->assign('res', $res); + //$smarty->assign('balance', $balance); + + //$smarty->display('user_diary.tpl'); + $smarty->display('diary_report.tpl'); + + + +?> diff --git a/_include/include_money_deposit.php b/_include/include_money_deposit.php index e260d3b..ccc1c83 100644 --- a/_include/include_money_deposit.php +++ b/_include/include_money_deposit.php @@ -32,7 +32,7 @@ if ($this->is_id()) { } else { # BEFIZETÉS LISTA - $mod_query = "SELECT * FROM money_deposit WHERE mod_deleted = 0 ORDER BY mod_date DESC, mod_id DESC;"; + $mod_query = "SELECT * FROM money_deposit JOIN money_income ON mod_money_income_mi_id = mi_id WHERE mod_deleted = 0 ORDER BY mi_date DESC, mi_id DESC;"; $mod_array = array(); $mod_assoc_array = $sql->assoc_array($mod_query); diff --git a/_include/include_money_expense.php b/_include/include_money_expense.php index 020bc48..6f871a0 100644 --- a/_include/include_money_expense.php +++ b/_include/include_money_expense.php @@ -9,7 +9,7 @@ if ($this->is_id()) { # ADOTT KIADÁS ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA - + $new_mox = new money_expense(); $new_mox->set_mox_data_by_id($this->get_id()); @@ -21,14 +21,16 @@ if ($this->is_id()) { $new_moxc = new money_expense_category(); $new_moxc->set_moxc_data_by_id($mox['moxc_id']); $moxc_array[] = $new_moxc; - } + } + + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); $smarty->assign("moxc_array", $moxc_array); - + $smarty->assign('pt_assoc_array', $pt_assoc_array); $smarty->assign("mox", $new_mox); $smarty->display("money_expense_data_edit.tpl"); - + } else { # KIADÁS LISTA @@ -40,11 +42,11 @@ else { $new_mox = new money_expense(); $new_mox->set_mox_data_by_id($mod['mox_id']); $mox_array[] = $new_mox; - } + } $smarty->assign("mox_array", $mox_array); $smarty->display("money_expense.tpl"); } -?> \ No newline at end of file +?> diff --git a/_include/include_money_expense_category.php b/_include/include_money_expense_category.php index 3b9d745..ee3aaa1 100644 --- a/_include/include_money_expense_category.php +++ b/_include/include_money_expense_category.php @@ -1,24 +1,24 @@ is_id()) { - # ADOTT KIADÁS KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA + # ADOTT BEVÉTEL KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA $new_moxc = new money_expense_category(); $new_moxc->set_moxc_data_by_id($this->get_id()); $smarty->assign("moxc", $new_moxc); - $smarty->display("money_expense_category_data_edit.tpl"); - + $smarty->display("money_expense_category_data_edit.tpl"); + } else { - # KIADÁS KATEGÓRIA LISTA + # BEVÉTEL KATEGÓRIA LISTA $moxc_query = "SELECT * FROM money_expense_category WHERE moxc_deleted = 0 ORDER BY moxc_name ASC;"; $moxc_array = array(); $moxc_assoc_array = $sql->assoc_array($moxc_query); @@ -27,11 +27,11 @@ else { $new_moxc = new money_expense_category(); $new_moxc->set_moxc_data_by_id($mox['moxc_id']); $moxc_array[] = $new_moxc; - } + } $smarty->assign("moxc_assoc_array", $moxc_array); $smarty->display("money_expense_category.tpl"); } -?> \ No newline at end of file +?> diff --git a/_include/include_money_income.php b/_include/include_money_income.php new file mode 100644 index 0000000..8546cde --- /dev/null +++ b/_include/include_money_income.php @@ -0,0 +1,52 @@ +is_id()) { + # ADOTT BEVÉTEL ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA + + $new_mi = new money_income(); + $new_mi->set_mi_data_by_id($this->get_id()); + + $mic_query = "SELECT * FROM money_income_category WHERE mic_deleted = 0 AND mic_id != 4 ORDER BY mic_name ASC;"; + $mic_array = array(); + $mic_assoc_array = $sql->assoc_array($mic_query); + + foreach ($mic_assoc_array as $mi) { + $new_mic = new money_income_category(); + $new_mic->set_mic_data_by_id($mi['mic_id']); + $mic_array[] = $new_mic; + } + + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); + + + $smarty->assign("mic_array", $mic_array); + $smarty->assign('pt_assoc_array', $pt_assoc_array); + $smarty->assign("mi", $new_mi); + $smarty->display("money_income_data_edit.tpl"); + +} +else { + # BEVÉTEL LISTA + $mi_query = "SELECT * FROM money_income WHERE mi_deleted = 0 AND mi_money_income_category_mic_id != 4 ORDER BY mi_date DESC, mi_id DESC;"; + $mi_array = array(); + $mi_assoc_array = $sql->assoc_array($mi_query); + + foreach ($mi_assoc_array as $mod) { + $new_mi = new money_income(); + $new_mi->set_mi_data_by_id($mod['mi_id']); + $mi_array[] = $new_mi; + } + + $smarty->assign("mi_array", $mi_array); + $smarty->display("money_income.tpl"); + +} + +?> diff --git a/_include/include_money_income_category.php b/_include/include_money_income_category.php new file mode 100644 index 0000000..f6ad6d7 --- /dev/null +++ b/_include/include_money_income_category.php @@ -0,0 +1,37 @@ +is_id()) { + # ADOTT BEVÉTEL KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA + + $new_mic = new money_income_category(); + $new_mic->set_mic_data_by_id($this->get_id()); + + $smarty->assign("mic", $new_mic); + $smarty->display("money_income_category_data_edit.tpl"); + +} +else { + # BEVÉTEL KATEGÓRIA LISTA + $mic_query = "SELECT * FROM money_income_category WHERE mic_deleted = 0 AND mic_id != 4 ORDER BY mic_name ASC;"; + $mic_array = array(); + $mic_assoc_array = $sql->assoc_array($mic_query); + + foreach ($mic_assoc_array as $mi) { + $new_mic = new money_income_category(); + $new_mic->set_mic_data_by_id($mi['mic_id']); + $mic_array[] = $new_mic; + } + + $smarty->assign("mic_assoc_array", $mic_array); + $smarty->display("money_income_category.tpl"); + +} + +?> diff --git a/_include/include_stats.php b/_include/include_stats.php index 223b386..4a27b1c 100644 --- a/_include/include_stats.php +++ b/_include/include_stats.php @@ -10,12 +10,31 @@ if ($this->is_id()) { # todo: stat_group-ok és stat_value-k if (1 == $this->get_id()) { + /* adatok: + bevétel kp + utalás + kiadás kp + utalás + összebevétel + összkiadás + totál balance + */ + $in_cash_query = "SELECT sum(mi_sum) FROM money_income WHERE mi_deleted = 0 AND mi_payment_type_pt_id = 1"; + $in_transfer_query = "SELECT sum(mi_sum) FROM money_income WHERE mi_deleted = 0 AND mi_payment_type_pt_id = 2"; + + $out_cash_query = "SELECT sum(mox_sum) FROM money_expense WHERE mox_deleted = 0 AND mox_payment_type_pt_id = 1"; + $out_transfer_query = "SELECT sum(mox_sum) FROM money_expense WHERE mox_deleted = 0 AND mox_payment_type_pt_id = 2"; + + $in_cash = $sql->single_variable($in_cash_query); + $out_cash = $sql->single_variable($out_cash_query); + + $in_transfer = $sql->single_variable($in_transfer_query); + $out_transfer = $sql->single_variable($out_transfer_query); + $balance_query = " - select - (select - sum(mod_sum) + select + (select + sum(mi_sum) from - money_deposit where mod_deleted = 0) - (select + money_income where mi_deleted = 0) - (select sum(mox_sum) from money_expense where mox_deleted = 0) as diff @@ -24,6 +43,10 @@ if ($this->is_id()) { $balance = $sql->single_variable($balance_query); + $smarty->assign('in_cash',$in_cash); + $smarty->assign('out_cash',$out_cash); + $smarty->assign('in_transfer',$in_transfer); + $smarty->assign('out_transfer',$out_transfer); $smarty->assign('balance',$balance); $smarty->display('stat_balance.tpl'); } @@ -31,7 +54,7 @@ if ($this->is_id()) { } else { - + # STAT LISTA $stat_query = "SELECT * FROM statistics WHERE stat_deleted = 0 ORDER BY stat_order ASC;"; @@ -46,11 +69,11 @@ else { $smarty->assign('stats',$stats); $smarty->display('stat_list.tpl'); - + } -?> \ No newline at end of file +?> diff --git a/event_handler.php b/event_handler.php index 1982306..0959625 100644 --- a/event_handler.php +++ b/event_handler.php @@ -304,36 +304,60 @@ if (isset($_POST['action'])) { break; case 'money_deposit_update': # befizetés módosítás - money_deposit::update_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_id'], $_POST['mod_payment_type']); + money_deposit::update_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_id'], $_POST['mod_payment_type'], $_POST['mi_id']); $tmp_user = new user_kid(); $tmp_user->set_user_data_by_id($_POST['mod_user_kid_uk_id']); log::register('update_money_deposit', $tmp_user->get_uk_name() . ': ' . $_POST['mod_sum']. ' Ft (' . $_POST['mod_date'] . ')'); header("Location: /admin/money_deposit"); break; case 'moxc_create': - # befizetés kategória létrehozása + # kiadás kategória létrehozása $new_moxc_id = money_expense_category::create_money_expense_category($_POST['moxc_name']); log::register('new_moxc', $new_moxc_id); header("Location: /admin/money_expense_category"); break; case 'moxc_update': - # befizetés kategória módosítása + # kiadás kategória módosítása money_expense_category::update_money_expense_category($_POST['moxc_name'], $_POST['moxc_id']); log::register('update_moxc', $_POST['moxc_id']); header("Location: /admin/money_expense_category"); break; case 'mox_create': - # befizetés létrehozása - $new_mox_id = money_expense::create_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id']); + # kiadás létrehozása + $new_mox_id = money_expense::create_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id'], $_POST['mox_payment_type']); log::register('new_mox', $_POST['mox_item'] . ": " . $_POST['mox_sum'] . " Ft"); header("Location: /admin/money_expense"); break; case 'mox_update': - # befizetés módosítása - money_expense::update_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id'], $_POST['mox_id']); + # kiadás módosítása + money_expense::update_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id'], $_POST['mox_id'], $_POST['mox_payment_type']); log::register('update_mox', $_POST['mox_item'] . ": " . $_POST['mox_sum'] . " Ft"); header("Location: /admin/money_expense"); break; + case 'mic_create': + # bevétel kategória létrehozása + $new_mic_id = money_income_category::create_money_income_category($_POST['mic_name']); + log::register('new_mic', $new_mic_id); + header("Location: /admin/money_income_category"); + break; + case 'mi_create': + # bevétel létrehozása + $new_mi_id = money_income::create_money_income($_POST['mi_date'], $_POST['mi_item'], $_POST['mi_sum'], $_POST['mi_mic_id'], $_POST['mi_payment_type']); + log::register('new_mi', $_POST['mi_item'] . ": " . $_POST['mi_sum'] . " Ft"); + header("Location: /admin/money_income"); + break; + case 'mic_update': + # bevétel kategória módosítása + money_income_category::update_money_income_category($_POST['mic_name'], $_POST['mic_id']); + log::register('update_mic', $_POST['mic_id']); + header("Location: /admin/money_income_category"); + break; + case 'mi_update': + # bevétel módosítása + money_income::update_money_income($_POST['mi_date'], $_POST['mi_item'], $_POST['mi_sum'], $_POST['mi_mic_id'], $_POST['mi_id'], $_POST['mi_payment_type']); + log::register('update_mi', $_POST['mi_item'] . ": " . $_POST['mi_sum'] . " Ft"); + header("Location: /admin/money_income"); + break; case 'settings_data_edit': $sql->update_table('setting_value', array( @@ -381,6 +405,7 @@ if (isset($_POST['action'])) { camp::create_camp($_POST['camp_city'], $_POST['camp_from'], $_POST['camp_to'], $_POST['camp_leader'], $_POST['camp_helpers'], (!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'] . ")"); + header("Location: /admin/camps"); break; case 'camp_update': # tábor módosítás diff --git a/index.php b/index.php index 64929cd..a775481 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,7 @@ setlocale(LC_ALL, 'hu_HU'); ?> + @@ -33,7 +34,6 @@ setlocale(LC_ALL, 'hu_HU'); - is_page() && ($page->get_page() == 'tabor')) { - echo "Tollaslabda táborok 2017. nyár"; + echo "Tollaslabda táborok 2018. nyár"; } else { echo "Badminton Coach"; diff --git a/template/templates/diary_report.tpl b/template/templates/diary_report.tpl new file mode 100644 index 0000000..6afcc02 --- /dev/null +++ b/template/templates/diary_report.tpl @@ -0,0 +1,27 @@ +{foreach $res as $key => $resi} + + {foreach $resi as $key_ => $resii} + {if $resii->get_de_training()|is_a:'training'} + {$key}
+ {$resii->get_de_training()->get_tr_date()}
+ {$resii->get_de_training()->get_tr_type_name_by_id()}
+ {$resii->get_de_training()->get_tr_duration()} perc
+ {if $resii->get_de_has_discount()} + {if $resii->get_de_discount_id() == 1} + Próba kedvezmény
+ {elseif $resii->get_de_discount_id() == 2} + Havi 8+ kedvezmény
+ {elseif $resii->get_de_discount_id() == 3} + Duplázó kedvezmény
+ {/if} + + {else} + Fizetős
+ {/if} + + {/if} + +
+ + {/foreach} +{/foreach} diff --git a/template/templates/money_deposit.tpl b/template/templates/money_deposit.tpl index c3c798a..2f6ab27 100644 --- a/template/templates/money_deposit.tpl +++ b/template/templates/money_deposit.tpl @@ -8,16 +8,16 @@

{foreach $mod_array as $mod} - {if !$mod@first && $mod_array[$mod@index]->get_mod_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_date()|substr:5:2} + {if !$mod@first && $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_money_income()->get_mi_date()|substr:5:2}
{/if} - {if $mod@first || $mod_array[$mod@index]->get_mod_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_date()|substr:5:2} - {$mod_array[$mod@index]->get_mod_date()|substr:0:4}. - {$months[$mod_array[$mod@index]->get_mod_date()|substr:5:2]} + {if $mod@first || $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_money_income()->get_mi_date()|substr:5:2} + {$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4}. + {$months[$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2]} -
+
{/if} @@ -25,7 +25,7 @@ diff --git a/template/templates/money_deposit_create.tpl b/template/templates/money_deposit_create.tpl index 45f93a1..78a492e 100644 --- a/template/templates/money_deposit_create.tpl +++ b/template/templates/money_deposit_create.tpl @@ -14,7 +14,7 @@
- +
+
@@ -18,11 +19,11 @@
- +
+
-
+
diff --git a/template/templates/money_expense.tpl b/template/templates/money_expense.tpl index 49006b6..eafec93 100644 --- a/template/templates/money_expense.tpl +++ b/template/templates/money_expense.tpl @@ -13,7 +13,7 @@ {/if} {if $mox@first || $mox_array[$mox@index]->get_mox_date()|substr:5:2 != $mox_array[$mox@index-1]->get_mox_date()|substr:5:2} - {$mox_array[$mox@index]->get_mox_date()|substr:0:4}. + {$mox_array[$mox@index]->get_mox_date()|substr:0:4}. {$months[$mox_array[$mox@index]->get_mox_date()|substr:5:2]} @@ -25,7 +25,11 @@
- {if $mod->get_mod_payment_type_pt_id() == 1} + {if $mod->get_mod_money_income()->get_mi_payment_type_pt_id() == 1} {else} @@ -35,10 +35,10 @@ {$mod->get_mod_user_kid()->get_uk_name()} - {$mod->get_mod_date(true)} + {$mod->get_mod_money_income()->get_mi_date(true)} - {$mod->get_mod_sum()|number_format:0:'':' '} Ft + {$mod->get_mod_money_income()->get_mi_sum()|number_format:0:'':' '} Ft
- +
- + {if $mox->get_mox_payment_type_pt_id() == 1} + + {else} + + {/if} {$mox->get_mox_date()} @@ -45,7 +49,7 @@ {$mox->get_mox_sum()|number_format:0:'':' '} Ft
@@ -85,8 +89,8 @@ $( document ).ready(function() { var div_list = $( ".list" ).find( divs ); open_block(div_list[0].id); - + }); - \ No newline at end of file + diff --git a/template/templates/money_expense_create.tpl b/template/templates/money_expense_create.tpl index 484b701..aff9771 100644 --- a/template/templates/money_expense_create.tpl +++ b/template/templates/money_expense_create.tpl @@ -16,6 +16,19 @@
+
+ +
+ +
+
+
@@ -27,12 +40,12 @@
- +
@@ -40,4 +53,4 @@
-
\ No newline at end of file + diff --git a/template/templates/money_expense_data_edit.tpl b/template/templates/money_expense_data_edit.tpl index 6063161..920d2f4 100644 --- a/template/templates/money_expense_data_edit.tpl +++ b/template/templates/money_expense_data_edit.tpl @@ -21,6 +21,19 @@
+
+ +
+ +
+
+
@@ -32,12 +45,12 @@
- +
@@ -45,4 +58,4 @@
-
\ No newline at end of file + diff --git a/template/templates/money_income.tpl b/template/templates/money_income.tpl new file mode 100644 index 0000000..76bde24 --- /dev/null +++ b/template/templates/money_income.tpl @@ -0,0 +1,91 @@ + + +
+ {foreach $mi_array as $mi} + + {if !$mi@first && $mi_array[$mi@index]->get_mi_date()|substr:5:2 != $mi_array[$mi@index-1]->get_mi_date()|substr:5:2} +
+ {/if} + + {if $mi@first || $mi_array[$mi@index]->get_mi_date()|substr:5:2 != $mi_array[$mi@index-1]->get_mi_date()|substr:5:2} + {$mi_array[$mi@index]->get_mi_date()|substr:0:4}. + {$months[$mi_array[$mi@index]->get_mi_date()|substr:5:2]} + + + + {/if} + + {/foreach} + + + + + diff --git a/template/templates/money_income_category.tpl b/template/templates/money_income_category.tpl new file mode 100644 index 0000000..35e07ef --- /dev/null +++ b/template/templates/money_income_category.tpl @@ -0,0 +1,18 @@ + + +
+ {foreach $mic_assoc_array as $mic} + +
+ + {$mic->get_mic_name()} +
+
+ {/foreach} + +
+ diff --git a/template/templates/money_income_category_create.tpl b/template/templates/money_income_category_create.tpl new file mode 100644 index 0000000..86b2b0a --- /dev/null +++ b/template/templates/money_income_category_create.tpl @@ -0,0 +1,17 @@ +
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+
diff --git a/template/templates/money_income_category_data_edit.tpl b/template/templates/money_income_category_data_edit.tpl new file mode 100644 index 0000000..db6bd87 --- /dev/null +++ b/template/templates/money_income_category_data_edit.tpl @@ -0,0 +1,21 @@ +
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
+
diff --git a/template/templates/money_income_create.tpl b/template/templates/money_income_create.tpl new file mode 100644 index 0000000..039a84f --- /dev/null +++ b/template/templates/money_income_create.tpl @@ -0,0 +1,51 @@ +
+
+ + +
+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
diff --git a/template/templates/money_income_data_edit.tpl b/template/templates/money_income_data_edit.tpl new file mode 100644 index 0000000..211762e --- /dev/null +++ b/template/templates/money_income_data_edit.tpl @@ -0,0 +1,56 @@ +
+
+ + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
diff --git a/template/templates/nav.tpl b/template/templates/nav.tpl old mode 100755 new mode 100644 index 2701e24..c1f36d7 --- a/template/templates/nav.tpl +++ b/template/templates/nav.tpl @@ -18,16 +18,16 @@ {foreach $menus as $menu}
  • - + {$menu.spage_title}
  • {/foreach} - - + + {else} - - + + {/if} @@ -69,4 +69,4 @@ function myFunction() { x.className = "topnav"; } } - \ No newline at end of file + diff --git a/template/templates/stat_balance.tpl b/template/templates/stat_balance.tpl index 69621f8..ec513af 100644 --- a/template/templates/stat_balance.tpl +++ b/template/templates/stat_balance.tpl @@ -7,8 +7,41 @@
    - Egyenleg: {$balance|number_format:0:'':' '} Ft + Készpénz bevétel: {$in_cash|number_format:0:'':' '} Ft
    +
    + + Készpénz kiadás: {$out_cash|number_format:0:'':' '} Ft +
    +
    + + Készpénz egyenleg: {($in_cash - $out_cash)|number_format:0:'':' '} Ft +
    + - \ No newline at end of file + + + diff --git a/template/templates/user_diary.tpl b/template/templates/user_diary.tpl index 510d44c..1b7b72a 100644 --- a/template/templates/user_diary.tpl +++ b/template/templates/user_diary.tpl @@ -11,12 +11,12 @@ !$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_date()|substr:5:2 + $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 } - {$actions[$action@index]->get_de_training()->get_tr_date()|substr:0:4}. + {$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)
    @@ -27,7 +27,7 @@
    {elseif $action@first} - {$actions[$action@index]->get_de_training()->get_tr_date()|substr:0:4}. + {$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)
    @@ -41,15 +41,15 @@
    - {$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()} + {$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()}
    - {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 + {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 {if $action->get_de_training()->is_coach()} {foreach $action->get_de_training()->get_tr_coaches_name() as $coach_name} {if $coach_name@first}({/if}{$coach_name}{if $coach_name@last}){else}, {/if} @@ -74,7 +74,7 @@
    - + {if $action->get_de_balance()>0}+{/if}{$action->get_de_balance()|number_format:0:'':' '} Ft
    {$discount}
    @@ -85,44 +85,44 @@ {if !$action@first && $actions[$action@index-1]->get_de_training()|is_a:'training' && - $actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:5:2 != $actions[$action@index-1]->get_de_training()->get_tr_date()|substr:5:2 + $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_date()|substr:5:2 != $actions[$action@index-1]->get_de_money_deposit()->get_mod_date()|substr:5:2 + $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 }
    - {$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:0:4}. - {$months[$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:5:2]} - ({$user_login->get_training_number_in_month({$action->get_de_money_deposit()->get_mod_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_date()|substr:5:2})} edzés) + {$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) -
    +
    {elseif $action@first} - {$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:0:4}. - {$months[$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:5:2]} - ({$user_login->get_training_number_in_month({$action->get_de_money_deposit()->get_mod_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_date()|substr:5:2})} edzés) + {$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) -
    +
    {/if}
    - {$action->get_de_money_deposit()->get_mod_date()|substr:0:4}. - {$months[$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:5:2]} - {$action->get_de_money_deposit()->get_mod_date_day()}. + {$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()}.
    - befizetés: {$action->get_de_money_deposit()->get_mod_sum(true)} Ft + befizetés: {$action->get_de_money_deposit()->get_mod_money_income()->get_mi_sum(true)} Ft
    @@ -171,8 +171,8 @@ $( document ).ready(function() { var div_list = $( ".list" ).find( divs ); open_block(div_list[0].id); - + }); - \ No newline at end of file +