diff --git a/_ajax/get_parent_data.php b/_ajax/get_parent_data.php index bf04e13..74985fb 100755 --- a/_ajax/get_parent_data.php +++ b/_ajax/get_parent_data.php @@ -11,7 +11,6 @@ if ($_POST['parent_id'] == 'null') { $parent_query = "SELECT * FROM user_parent WHERE up_id = " . $_POST['parent_id']; $parent_assoc_array = $sql->assoc_array($parent_query); - $ret_array = array( $parent_assoc_array[0]['up_email'], $parent_assoc_array[0]['up_phone'], @@ -20,4 +19,4 @@ $ret_array = array( echo json_encode($ret_array); -?> \ No newline at end of file +?> diff --git a/_class/class_money_deposit.php b/_class/class_money_deposit.php index 69a3789..d45d171 100644 --- a/_class/class_money_deposit.php +++ b/_class/class_money_deposit.php @@ -10,6 +10,7 @@ class money_deposit { private $mod_user_kid; //OBJECT private $mod_date; private $mod_sum; + private $mod_payment_type; private $mod_deleted; public function set_mod_id($_id) { @@ -32,6 +33,10 @@ class money_deposit { $this->mod_sum = $_sum; } + public function set_mod_payment_type_pt_id($_payment_type) { + $this->mod_payment_type = $_payment_type; + } + public function set_mod_deleted($_deleted) { $this->mod_deleted = $_deleted; } @@ -48,6 +53,10 @@ 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_date($_formatted = false) { return !$_formatted ? $this->mod_date : date("Y. m. d.", strtotime($this->mod_date)); @@ -55,7 +64,7 @@ class money_deposit { public function get_mod_date_day() { $day = date("d", strtotime($this->mod_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->mod_date)); } @@ -89,25 +98,33 @@ 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); + } + } } - public static function create_money_deposit($_user_id, $_date, $_sum) { + 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 ) ); } - public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id) { + public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id, $_pt) { global $sql; $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 @@ -118,4 +135,4 @@ class money_deposit { } -?> \ No newline at end of file +?> diff --git a/_class/class_payment_type.php b/_class/class_payment_type.php new file mode 100644 index 0000000..a23e532 --- /dev/null +++ b/_class/class_payment_type.php @@ -0,0 +1,41 @@ +pt_id = $_id; + } + + public function get_pt_id() { + return $this->pt_id; + } + + public function set_pt_name($_name) { + $this->pt_name = $_name; + } + + public function get_pt_name() { + return $this->pt_name; + } + + public function set_pt_data_by_id($_id) { + global $sql; + $mod_query = "SELECT * FROM payment_type WHERE pt_id = " . $_id . ";"; + $mod_assoc_array = $sql->assoc_array($mod_query); + foreach ($mod_assoc_array[0] as $field => $value) { + $function_name = "set_" . $field; + $this->$function_name($value); //alapadatok beállítása + } + + } + +} + +?> diff --git a/_image/transaction.png b/_image/transaction.png new file mode 100644 index 0000000..092568d Binary files /dev/null and b/_image/transaction.png differ diff --git a/_include/include_create.php b/_include/include_create.php index be3edb5..203e844 100755 --- a/_include/include_create.php +++ b/_include/include_create.php @@ -50,7 +50,7 @@ switch ($this->get_id()) { //COACH ARRAY $coach_data_query = "SELECT * FROM user_coach WHERE ua_deleted = 0;"; $coach_data_assoc_array = $sql->assoc_array($coach_data_query); - + $coach_array = array(); foreach ($coach_data_assoc_array as $coach_data) { @@ -116,7 +116,10 @@ switch ($this->get_id()) { $smarty->assign('user_kid_id', $_POST['mod_user_kid_uk_id']); } + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); + $smarty->assign('user_kids', $user_kids); + $smarty->assign('pt_assoc_array', $pt_assoc_array); $smarty->display('money_deposit_create.tpl'); break; @@ -142,7 +145,7 @@ switch ($this->get_id()) { //létrehozzá, és hozzáfűzi az ID-t a dátumhoz //visszatér a backup oldalra //backup classből hívogat, statikusan - + $new_bu_id = $sql->insert_into('backup', array('bu_date' => date('Y-m-d H:i:s'))); $sql->update_table('backup', array('bu_name' => date('Ymd_Hi') . '_' . $new_bu_id), array('bu_id' => $new_bu_id)); //log @@ -171,7 +174,7 @@ switch ($this->get_id()) { $camp_type_array[] = $new_ct; } $smarty->assign('camp_type_array', $camp_type_array); - + //labda típusok hozzáadása $shuttle_assoc_array = $sql->assoc_array("SELECT * FROM camp_shuttle_type WHERE cst_deleted = 0 ORDER BY cst_id ASC"); @@ -215,4 +218,4 @@ switch ($this->get_id()) { } -?> \ No newline at end of file +?> diff --git a/_include/include_information.php b/_include/include_information.php index 46a562f..fefc4f6 100644 --- a/_include/include_information.php +++ b/_include/include_information.php @@ -2,17 +2,16 @@ # INFORMÁCIÓK - $info_query = "SELECT setv_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = 'Információk'"; + $info_query = "SELECT set_id FROM setting_value JOIN setting ON setv_setting_set_id = set_id WHERE set_name = 'Információk'"; $setv_id = $sql->single_variable($info_query); $new_setval = new setting_value(); $new_setval->set_setting_value_data_by_id($setv_id); - $smarty->assign('setting', $new_setval); $smarty->display('information.tpl'); -?> \ No newline at end of file +?> diff --git a/_include/include_money_deposit.php b/_include/include_money_deposit.php index e536380..e260d3b 100644 --- a/_include/include_money_deposit.php +++ b/_include/include_money_deposit.php @@ -21,11 +21,14 @@ if ($this->is_id()) { $user_kids[] = $new_kid; } + $pt_assoc_array = $sql->assoc_array('SELECT * FROM payment_type ORDER BY pt_id ASC;'); + $smarty->assign('user_kids', $user_kids); $smarty->assign("mod", $mod); + $smarty->assign('pt_assoc_array', $pt_assoc_array); $smarty->display("money_deposit_update.tpl"); - + } else { # BEFIZETÉS LISTA @@ -37,11 +40,11 @@ else { $new_mod = new money_deposit(); $new_mod->set_mod_data_by_id($mod['mod_id']); $mod_array[] = $new_mod; - } + } $smarty->assign("mod_array", $mod_array); $smarty->display("money_deposit.tpl"); } -?> \ No newline at end of file +?> diff --git a/event_handler.php b/event_handler.php index eb25d81..1982306 100644 --- a/event_handler.php +++ b/event_handler.php @@ -99,7 +99,7 @@ if (isset($_POST['action'])) { $kid->update_filters(); //filter update end log::register('update_member', $uid); - //header("Location: " . $actual_link); + header("Location: " . $actual_link); break; default: @@ -296,7 +296,7 @@ if (isset($_POST['action'])) { break; case 'money_deposit_create': # új befizetés létrehozása - $new_mod_id = money_deposit::create_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum']); + $new_mod_id = money_deposit::create_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_payment_type']); $tmp_user = new user_kid(); $tmp_user->set_user_data_by_id($_POST['mod_user_kid_uk_id']); log::register('new_money_deposit', $tmp_user->get_uk_name() . ': ' . $_POST['mod_sum']. ' Ft (' . $_POST['mod_date'] . ')'); @@ -304,7 +304,7 @@ 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']); + money_deposit::update_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_id'], $_POST['mod_payment_type']); $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'] . ')'); @@ -345,6 +345,7 @@ if (isset($_POST['action'])) { ) ); + header("Location: /admin/settings/".$_POST['set_id']); break; case 'camp_type_create': # tábor típus létrehozása diff --git a/index.php b/index.php index 1d9ea5b..64929cd 100644 --- a/index.php +++ b/index.php @@ -33,7 +33,7 @@ setlocale(LC_ALL, 'hu_HU'); - + 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}. + {$mod_array[$mod@index]->get_mod_date()|substr:0:4}. {$months[$mod_array[$mod@index]->get_mod_date()|substr:5:2]} @@ -25,7 +25,11 @@ - +
- + {if $mod->get_mod_payment_type_pt_id() == 1} + + {else} + + {/if} {$mod->get_mod_user_kid()->get_uk_name()} @@ -37,7 +41,7 @@ {$mod->get_mod_sum()|number_format:0:'':' '} Ft
@@ -77,8 +81,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_deposit_create.tpl b/template/templates/money_deposit_create.tpl index 4f2d19e..45f93a1 100644 --- a/template/templates/money_deposit_create.tpl +++ b/template/templates/money_deposit_create.tpl @@ -13,6 +13,19 @@ +
+ +
+ +
+
+
@@ -23,7 +36,7 @@
- +
@@ -31,4 +44,4 @@
-
\ No newline at end of file + diff --git a/template/templates/money_deposit_update.tpl b/template/templates/money_deposit_update.tpl index bf22175..66fa63f 100644 --- a/template/templates/money_deposit_update.tpl +++ b/template/templates/money_deposit_update.tpl @@ -17,6 +17,19 @@ +
+ +
+ +
+
+
@@ -27,7 +40,7 @@
- +
@@ -35,4 +48,4 @@
-
\ No newline at end of file + diff --git a/template/templates/parent_create.tpl b/template/templates/parent_create.tpl index 56e1db9..d76b552 100644 --- a/template/templates/parent_create.tpl +++ b/template/templates/parent_create.tpl @@ -1,7 +1,7 @@
- +
@@ -18,8 +18,8 @@
- -
+ +
@@ -29,4 +29,4 @@
-
\ No newline at end of file + diff --git a/template/templates/setting_data_edit.tpl b/template/templates/setting_data_edit.tpl index 095d621..ccdc81d 100644 --- a/template/templates/setting_data_edit.tpl +++ b/template/templates/setting_data_edit.tpl @@ -1,6 +1,6 @@ - + {if $setting->get_setv_setting()->get_set_setting_type_st_id() == 1}
@@ -14,7 +14,7 @@
- +
@@ -37,19 +37,19 @@
{foreach $backups as $backup} - {if + {if $backup@first || ( - $backups[$backup@index]->get_bu_date()|substr:5:2 != $backups[$backup@index-1]->get_bu_date()|substr:5:2 + $backups[$backup@index]->get_bu_date()|substr:5:2 != $backups[$backup@index-1]->get_bu_date()|substr:5:2 ) - + } - {if !$backup@first && + {if !$backup@first && $backups[$backup@index]->get_bu_date()|substr:5:2 != $backups[$backup@index-1]->get_bu_date()|substr:5:2 }
{/if} - {$backups[$backup@index]->get_bu_date()|substr:0:4}. + {$backups[$backup@index]->get_bu_date()|substr:0:4}. {$months[$backups[$backup@index]->get_bu_date()|substr:5:2]} @@ -57,7 +57,7 @@ {/if}
- {$backup->get_bu_date()|date_format:"%Y.%m.%d %H:%M"} #{$backup->get_bu_id()} + {$backup->get_bu_date()|date_format:"%Y.%m.%d %H:%M"} #{$backup->get_bu_id()}
@@ -114,8 +114,10 @@ $( document ).ready(function() { $( ".list" ).find( divs ).hide(); var div_list = $( ".list" ).find( divs ); - open_block(div_list[0].id); - + if (div_list[0] !== undefined) { + open_block(div_list[0].id); + } + }); @@ -133,4 +135,4 @@ function open_kid_menu(uk_id) { } - \ No newline at end of file +