updates and restart camps
This commit is contained in:
@@ -8,9 +8,8 @@ class money_deposit {
|
|||||||
private $mod_id;
|
private $mod_id;
|
||||||
private $mod_user_kid_uk_id; //ID
|
private $mod_user_kid_uk_id; //ID
|
||||||
private $mod_user_kid; //OBJECT
|
private $mod_user_kid; //OBJECT
|
||||||
private $mod_date;
|
private $mod_money_income_mi_id; //ID
|
||||||
private $mod_sum;
|
private $mod_money_income; //OBJECT
|
||||||
private $mod_payment_type;
|
|
||||||
private $mod_deleted;
|
private $mod_deleted;
|
||||||
|
|
||||||
public function set_mod_id($_id) {
|
public function set_mod_id($_id) {
|
||||||
@@ -25,16 +24,12 @@ class money_deposit {
|
|||||||
$this->mod_user_kid = $_user_kid;
|
$this->mod_user_kid = $_user_kid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_mod_date($_date) {
|
public function set_mod_money_income_mi_id($_money_income_mi_id) {
|
||||||
$this->mod_date = $_date;
|
$this->mod_money_income_mi_id = $_money_income_mi_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_mod_sum($_sum) {
|
public function set_mod_money_income($_money_income) {
|
||||||
$this->mod_sum = $_sum;
|
$this->mod_money_income = $_money_income;
|
||||||
}
|
|
||||||
|
|
||||||
public function set_mod_payment_type_pt_id($_payment_type) {
|
|
||||||
$this->mod_payment_type = $_payment_type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_mod_deleted($_deleted) {
|
public function set_mod_deleted($_deleted) {
|
||||||
@@ -53,32 +48,12 @@ class money_deposit {
|
|||||||
return $this->mod_user_kid;
|
return $this->mod_user_kid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_mod_payment_type_pt_id() {
|
public function get_mod_money_income_mi_id() {
|
||||||
return $this->mod_payment_type;
|
return $this->mod_money_income_mi_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_mod_money_income() {
|
||||||
public function get_mod_date($_formatted = false) {
|
return $this->mod_money_income;
|
||||||
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_deleted() {
|
public function get_mod_deleted() {
|
||||||
@@ -98,37 +73,48 @@ class money_deposit {
|
|||||||
$new_user->set_user_data_by_id($value);
|
$new_user->set_user_data_by_id($value);
|
||||||
$this->set_mod_user_kid($new_user);
|
$this->set_mod_user_kid($new_user);
|
||||||
}
|
}
|
||||||
if ($field == "mod_payment_type") {
|
if ($field == "mod_money_income_mi_id") {
|
||||||
$new_pt = new payment_type();
|
$new_mi = new money_income();
|
||||||
$new_pt->set_pt_data_by_id($value);
|
$new_mi->set_mi_data_by_id($value);
|
||||||
$this->set_mod_payment_type_pt_id($new_pt);
|
$this->set_mod_money_income($new_mi);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create_money_deposit($_user_id, $_date, $_sum, $_pt) {
|
public static function create_money_deposit($_user_id, $_date, $_sum, $_pt) {
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('money_deposit', array(
|
|
||||||
'mod_user_kid_uk_id' => $_user_id,
|
$income_id = $sql->insert_into('money_income', array(
|
||||||
'mod_date' => $_date,
|
'mi_date' => $_date,
|
||||||
'mod_payment_type_pt_id' => $_pt,
|
'mi_payment_type_pt_id' => $_pt,
|
||||||
'mod_sum' => $_sum
|
'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;
|
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(
|
$sql->update_table('money_deposit', array(
|
||||||
'mod_user_kid_uk_id' => $_user_id,
|
'mod_user_kid_uk_id' => $_user_id,
|
||||||
'mod_date' => $_date,
|
|
||||||
'mod_payment_type_pt_id' => $_pt,
|
|
||||||
'mod_sum' => $_sum
|
|
||||||
), array(
|
), array(
|
||||||
'mod_id' => $_mod_id
|
'mod_id' => $_mod_id
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class money_expense {
|
|||||||
private $mox_sum;
|
private $mox_sum;
|
||||||
private $mox_moxc_id = null;
|
private $mox_moxc_id = null;
|
||||||
private $mox_moxc = null;
|
private $mox_moxc = null;
|
||||||
|
private $mox_payment_type;
|
||||||
private $mox_deleted;
|
private $mox_deleted;
|
||||||
|
|
||||||
|
|
||||||
@@ -45,6 +46,9 @@ class money_expense {
|
|||||||
$this->mox_coach = $_item;
|
$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) {
|
public function set_mox_deleted($_item) {
|
||||||
$this->mox_deleted = $_item;
|
$this->mox_deleted = $_item;
|
||||||
@@ -54,6 +58,10 @@ class money_expense {
|
|||||||
return $this->mox_id;
|
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() {
|
public function get_mox_user_coach_ua_id() {
|
||||||
return $this->mox_user_coach_ua_id;
|
return $this->mox_user_coach_ua_id;
|
||||||
}
|
}
|
||||||
@@ -125,11 +133,17 @@ class money_expense {
|
|||||||
$new_user->set_user_data_by_id($value);
|
$new_user->set_user_data_by_id($value);
|
||||||
$this->set_mox_coach($new_user);
|
$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;
|
global $sql;
|
||||||
|
|
||||||
return $sql->insert_into('money_expense', array(
|
return $sql->insert_into('money_expense', array(
|
||||||
@@ -137,11 +151,12 @@ class money_expense {
|
|||||||
'mox_date' => $_date,
|
'mox_date' => $_date,
|
||||||
'mox_item' => $_item,
|
'mox_item' => $_item,
|
||||||
'mox_sum' => $_sum,
|
'mox_sum' => $_sum,
|
||||||
|
'mox_payment_type_pt_id' => $_pt,
|
||||||
'mox_money_expense_category_moxc_id' => $_moxc_id
|
'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;
|
global $sql;
|
||||||
|
|
||||||
$sql->update_table('money_expense',
|
$sql->update_table('money_expense',
|
||||||
@@ -150,6 +165,7 @@ class money_expense {
|
|||||||
'mox_date' => $_date,
|
'mox_date' => $_date,
|
||||||
'mox_item' => $_item,
|
'mox_item' => $_item,
|
||||||
'mox_sum' => $_sum,
|
'mox_sum' => $_sum,
|
||||||
|
'mox_payment_type_pt_id' => $_pt,
|
||||||
'mox_money_expense_category_moxc_id' => $_moxc_id
|
'mox_money_expense_category_moxc_id' => $_moxc_id
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|||||||
140
_class/class_money_income.php
Normal file
140
_class/class_money_income.php
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class money_income {
|
||||||
|
private $mi_id;
|
||||||
|
private $mi_date;
|
||||||
|
private $mi_item;
|
||||||
|
private $mi_sum;
|
||||||
|
private $mi_mic_id = null;
|
||||||
|
private $mi_mic = null;
|
||||||
|
private $mi_payment_type;
|
||||||
|
private $mi_deleted;
|
||||||
|
|
||||||
|
|
||||||
|
public function set_mi_id($_item) {
|
||||||
|
$this->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
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
59
_class/class_money_income_category.php
Normal file
59
_class/class_money_income_category.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class money_income_category {
|
||||||
|
private $mic_id;
|
||||||
|
private $mic_name;
|
||||||
|
private $mic_deleted;
|
||||||
|
|
||||||
|
public function set_mic_id($_item) {
|
||||||
|
$this->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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
19
_class/class_page.php
Executable file → Normal file
19
_class/class_page.php
Executable file → Normal file
@@ -164,6 +164,14 @@ class page {
|
|||||||
# KIADÁS KATEGÓRIÁK
|
# KIADÁS KATEGÓRIÁK
|
||||||
include('include_money_expense_category.php');
|
include('include_money_expense_category.php');
|
||||||
break;
|
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':
|
case 'money_update':
|
||||||
# FRISSÍTÉS
|
# FRISSÍTÉS
|
||||||
include('include_money_update.php');
|
include('include_money_update.php');
|
||||||
@@ -259,6 +267,14 @@ class page {
|
|||||||
# BEFIZETÉS TÖRLÉS
|
# BEFIZETÉS TÖRLÉS
|
||||||
include('include_delete_money_expense.php');
|
include('include_delete_money_expense.php');
|
||||||
break;
|
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':
|
case 'delete_backup':
|
||||||
# MENTÉS TÖRLÉS
|
# MENTÉS TÖRLÉS
|
||||||
include('include_delete_backup.php');
|
include('include_delete_backup.php');
|
||||||
@@ -283,6 +299,9 @@ class page {
|
|||||||
# CSOPORT TÖRLÉS
|
# CSOPORT TÖRLÉS
|
||||||
include('include_delete_user_group.php');
|
include('include_delete_user_group.php');
|
||||||
break;
|
break;
|
||||||
|
case 'diary_report':
|
||||||
|
include('include_diary_report.php');
|
||||||
|
break;
|
||||||
case 'logout':
|
case 'logout':
|
||||||
# kijelentkezés
|
# kijelentkezés
|
||||||
$from = "admin";
|
$from = "admin";
|
||||||
|
|||||||
0
_class/class_sql.php
Executable file → Normal file
0
_class/class_sql.php
Executable file → Normal file
@@ -468,7 +468,7 @@ class user_kid extends user_parent {
|
|||||||
$sql->update_table('user_kid', $_user_value_array, array('uk_id' => $_user_id));
|
$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
|
//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
|
//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
|
//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') {
|
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());
|
$_de->set_de_balance($_de->get_de_balance()+$_de->get_de_transaction());
|
||||||
//$balance += $_de->get_de_money_deposit()->get_mod_sum();
|
//$balance += $_de->get_de_money_deposit()->get_mod_sum();
|
||||||
//echo $_de->get_de_date() . " plussz " . $_de->get_de_money_deposit()->get_mod_sum() . "<br><br>";
|
//echo $_de->get_de_date() . " plussz " . $_de->get_de_money_deposit()->get_mod_sum() . "<br><br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
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);
|
||||||
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;
|
return $_de_obj_array;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
_image/income.png
Normal file
BIN
_image/income.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
23
_include/include_create.php
Executable file → Normal file
23
_include/include_create.php
Executable file → Normal file
@@ -133,6 +133,9 @@ switch ($this->get_id()) {
|
|||||||
$moxc_array[] = $new_moxc;
|
$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->assign('moxc_array', $moxc_array);
|
||||||
$smarty->display('money_expense_create.tpl');
|
$smarty->display('money_expense_create.tpl');
|
||||||
break;
|
break;
|
||||||
@@ -140,6 +143,26 @@ switch ($this->get_id()) {
|
|||||||
# ÚJ KIADÁS KATEGÓRIA
|
# ÚJ KIADÁS KATEGÓRIA
|
||||||
$smarty->display('money_expense_category_create.tpl');
|
$smarty->display('money_expense_category_create.tpl');
|
||||||
break;
|
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':
|
case 'backup':
|
||||||
# BACKUP
|
# BACKUP
|
||||||
//létrehozzá, és hozzáfűzi az ID-t a dátumhoz
|
//létrehozzá, és hozzáfűzi az ID-t a dátumhoz
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($this->is_id()) {
|
if ($this->is_id()) {
|
||||||
$sql->update_table('money_deposit', array('mod_deleted' => 1), array('mod_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 = new money_deposit();
|
||||||
$new_mod->set_mod_data_by_id($this->get_id());
|
$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('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");
|
header("Location: /admin/money_deposit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
_include/include_delete_money_income.php
Normal file
12
_include/include_delete_money_income.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($this->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");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
18
_include/include_delete_money_income_category.php
Normal file
18
_include/include_delete_money_income_category.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($this->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");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -92,10 +92,12 @@ FROM
|
|||||||
pr_user_kid_uk_id = ".$user->get_uk_id()."
|
pr_user_kid_uk_id = ".$user->get_uk_id()."
|
||||||
AND tr_deleted = 0) UNION (SELECT
|
AND tr_deleted = 0) UNION (SELECT
|
||||||
mod_id,
|
mod_id,
|
||||||
timestamp(mod_date),
|
timestamp(mi_date),
|
||||||
if(mod_id is not null, 'money_deposit', null) as object_type
|
if(mod_id is not null, 'money_deposit', null) as object_type
|
||||||
FROM
|
FROM
|
||||||
money_deposit
|
money_deposit
|
||||||
|
JOIN
|
||||||
|
money_income ON mi_id = mod_money_income_mi_id
|
||||||
WHERE
|
WHERE
|
||||||
mod_user_kid_uk_id = ".$user->get_uk_id()."
|
mod_user_kid_uk_id = ".$user->get_uk_id()."
|
||||||
and mod_deleted = 0)) actions
|
and mod_deleted = 0)) actions
|
||||||
|
|||||||
158
_include/include_diary_report.php
Normal file
158
_include/include_diary_report.php
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
<?php
|
||||||
|
$res = array();
|
||||||
|
$users_q = "SELECT * FROM user_kid WHERE uk_deleted = 0 AND uk_is_active = 1 ORDER BY uk_name ASC";
|
||||||
|
$users = $sql->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');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -32,7 +32,7 @@ if ($this->is_id()) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# BEFIZETÉS LISTA
|
# 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_array = array();
|
||||||
$mod_assoc_array = $sql->assoc_array($mod_query);
|
$mod_assoc_array = $sql->assoc_array($mod_query);
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ if ($this->is_id()) {
|
|||||||
$moxc_array[] = $new_moxc;
|
$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("moxc_array", $moxc_array);
|
||||||
|
$smarty->assign('pt_assoc_array', $pt_assoc_array);
|
||||||
$smarty->assign("mox", $new_mox);
|
$smarty->assign("mox", $new_mox);
|
||||||
$smarty->display("money_expense_data_edit.tpl");
|
$smarty->display("money_expense_data_edit.tpl");
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
# HA NINCS ID, AKKOR KIADÁS KATEGÓRIA LISTA
|
# HA NINCS ID, AKKOR BEVÉTEL KATEGÓRIA LISTA
|
||||||
# HA VAN ID, AKKOR KIADÁS KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
|
# HA VAN ID, AKKOR BEVÉTEL KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->is_id()) {
|
if ($this->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 = new money_expense_category();
|
||||||
$new_moxc->set_moxc_data_by_id($this->get_id());
|
$new_moxc->set_moxc_data_by_id($this->get_id());
|
||||||
@@ -18,7 +18,7 @@ if ($this->is_id()) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
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_query = "SELECT * FROM money_expense_category WHERE moxc_deleted = 0 ORDER BY moxc_name ASC;";
|
||||||
$moxc_array = array();
|
$moxc_array = array();
|
||||||
$moxc_assoc_array = $sql->assoc_array($moxc_query);
|
$moxc_assoc_array = $sql->assoc_array($moxc_query);
|
||||||
|
|||||||
52
_include/include_money_income.php
Normal file
52
_include/include_money_income.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
# HA NINCS ID, AKKOR BEVÉTEL LISTA
|
||||||
|
# HA VAN ID, AKKOR BEVÉTEL ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->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");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
37
_include/include_money_income_category.php
Normal file
37
_include/include_money_income_category.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
# HA NINCS ID, AKKOR BEVÉTEL KATEGÓRIA LISTA
|
||||||
|
# HA VAN ID, AKKOR BEVÉTEL KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->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");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -10,12 +10,31 @@ if ($this->is_id()) {
|
|||||||
# todo: stat_group-ok és stat_value-k
|
# todo: stat_group-ok és stat_value-k
|
||||||
|
|
||||||
if (1 == $this->get_id()) {
|
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 = "
|
$balance_query = "
|
||||||
select
|
select
|
||||||
(select
|
(select
|
||||||
sum(mod_sum)
|
sum(mi_sum)
|
||||||
from
|
from
|
||||||
money_deposit where mod_deleted = 0) - (select
|
money_income where mi_deleted = 0) - (select
|
||||||
sum(mox_sum)
|
sum(mox_sum)
|
||||||
from
|
from
|
||||||
money_expense where mox_deleted = 0) as diff
|
money_expense where mox_deleted = 0) as diff
|
||||||
@@ -24,6 +43,10 @@ if ($this->is_id()) {
|
|||||||
|
|
||||||
$balance = $sql->single_variable($balance_query);
|
$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->assign('balance',$balance);
|
||||||
$smarty->display('stat_balance.tpl');
|
$smarty->display('stat_balance.tpl');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,36 +304,60 @@ if (isset($_POST['action'])) {
|
|||||||
break;
|
break;
|
||||||
case 'money_deposit_update':
|
case 'money_deposit_update':
|
||||||
# befizetés módosítás
|
# 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 = new user_kid();
|
||||||
$tmp_user->set_user_data_by_id($_POST['mod_user_kid_uk_id']);
|
$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'] . ')');
|
log::register('update_money_deposit', $tmp_user->get_uk_name() . ': ' . $_POST['mod_sum']. ' Ft (' . $_POST['mod_date'] . ')');
|
||||||
header("Location: /admin/money_deposit");
|
header("Location: /admin/money_deposit");
|
||||||
break;
|
break;
|
||||||
case 'moxc_create':
|
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']);
|
$new_moxc_id = money_expense_category::create_money_expense_category($_POST['moxc_name']);
|
||||||
log::register('new_moxc', $new_moxc_id);
|
log::register('new_moxc', $new_moxc_id);
|
||||||
header("Location: /admin/money_expense_category");
|
header("Location: /admin/money_expense_category");
|
||||||
break;
|
break;
|
||||||
case 'moxc_update':
|
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']);
|
money_expense_category::update_money_expense_category($_POST['moxc_name'], $_POST['moxc_id']);
|
||||||
log::register('update_moxc', $_POST['moxc_id']);
|
log::register('update_moxc', $_POST['moxc_id']);
|
||||||
header("Location: /admin/money_expense_category");
|
header("Location: /admin/money_expense_category");
|
||||||
break;
|
break;
|
||||||
case 'mox_create':
|
case 'mox_create':
|
||||||
# befizetés létrehozása
|
# 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']);
|
$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");
|
log::register('new_mox', $_POST['mox_item'] . ": " . $_POST['mox_sum'] . " Ft");
|
||||||
header("Location: /admin/money_expense");
|
header("Location: /admin/money_expense");
|
||||||
break;
|
break;
|
||||||
case 'mox_update':
|
case 'mox_update':
|
||||||
# befizetés módosítása
|
# 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']);
|
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");
|
log::register('update_mox', $_POST['mox_item'] . ": " . $_POST['mox_sum'] . " Ft");
|
||||||
header("Location: /admin/money_expense");
|
header("Location: /admin/money_expense");
|
||||||
break;
|
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':
|
case 'settings_data_edit':
|
||||||
$sql->update_table('setting_value',
|
$sql->update_table('setting_value',
|
||||||
array(
|
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);
|
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'] . ")");
|
log::register('new_camp', $_POST['camp_from'] . " (" . $_POST['camp_city'] . ")");
|
||||||
|
header("Location: /admin/camps");
|
||||||
break;
|
break;
|
||||||
case 'camp_update':
|
case 'camp_update':
|
||||||
# tábor módosítás
|
# tábor módosítás
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ setlocale(LC_ALL, 'hu_HU');
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -33,7 +34,6 @@ setlocale(LC_ALL, 'hu_HU');
|
|||||||
<meta name="msapplication-TileImage" content="/_image/ms-icon-144x144.png">
|
<meta name="msapplication-TileImage" content="/_image/ms-icon-144x144.png">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<?php
|
<?php
|
||||||
@@ -75,7 +75,7 @@ setlocale(LC_ALL, 'hu_HU');
|
|||||||
<title>
|
<title>
|
||||||
<?php
|
<?php
|
||||||
if ($page->is_page() && ($page->get_page() == 'tabor')) {
|
if ($page->is_page() && ($page->get_page() == 'tabor')) {
|
||||||
echo "Tollaslabda táborok 2017. nyár";
|
echo "Tollaslabda táborok 2018. nyár";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "Badminton Coach";
|
echo "Badminton Coach";
|
||||||
|
|||||||
27
template/templates/diary_report.tpl
Normal file
27
template/templates/diary_report.tpl
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{foreach $res as $key => $resi}
|
||||||
|
|
||||||
|
{foreach $resi as $key_ => $resii}
|
||||||
|
{if $resii->get_de_training()|is_a:'training'}
|
||||||
|
{$key}<br>
|
||||||
|
{$resii->get_de_training()->get_tr_date()}<br>
|
||||||
|
{$resii->get_de_training()->get_tr_type_name_by_id()}<br>
|
||||||
|
{$resii->get_de_training()->get_tr_duration()} perc<br>
|
||||||
|
{if $resii->get_de_has_discount()}
|
||||||
|
{if $resii->get_de_discount_id() == 1}
|
||||||
|
Próba kedvezmény<br>
|
||||||
|
{elseif $resii->get_de_discount_id() == 2}
|
||||||
|
Havi 8+ kedvezmény<br>
|
||||||
|
{elseif $resii->get_de_discount_id() == 3}
|
||||||
|
Duplázó kedvezmény<br>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{else}
|
||||||
|
Fizetős<br>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
{/foreach}
|
||||||
|
{/foreach}
|
||||||
@@ -8,16 +8,16 @@
|
|||||||
<div class="list half_width">
|
<div class="list half_width">
|
||||||
{foreach $mod_array as $mod}
|
{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}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/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}
|
{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}
|
||||||
<span onclick="block_action('block_{$mod->get_mod_date()|substr:0:4}{$mod->get_mod_date()|substr:5:2}');" class="date_separator clickable">{$mod_array[$mod@index]->get_mod_date()|substr:0:4}.
|
<span onclick="block_action('block_{$mod->get_mod_money_income()->get_mi_date()|substr:0:4}{$mod->get_mod_money_income()->get_mi_date()|substr:5:2}');" class="date_separator clickable">{$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||||
{$months[$mod_array[$mod@index]->get_mod_date()|substr:5:2]}
|
{$months[$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2]}
|
||||||
<img src="/_image/open_folder.png">
|
<img src="/_image/open_folder.png">
|
||||||
</span>
|
</span>
|
||||||
<div id="block_{$mod->get_mod_date()|substr:0:4}{$mod->get_mod_date()|substr:5:2}" class="month_block">
|
<div id="block_{$mod->get_mod_money_income()->get_mi_date()|substr:0:4}{$mod->get_mod_money_income()->get_mi_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
<a href="/admin/money_deposit/{$mod->get_mod_id()}">
|
<a href="/admin/money_deposit/{$mod->get_mod_id()}">
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<table class="money">
|
<table class="money">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="icon">
|
<td class="icon">
|
||||||
{if $mod->get_mod_payment_type_pt_id() == 1}
|
{if $mod->get_mod_money_income()->get_mi_payment_type_pt_id() == 1}
|
||||||
<img src="/_image/deposit.png">
|
<img src="/_image/deposit.png">
|
||||||
{else}
|
{else}
|
||||||
<img src="/_image/transaction.png">
|
<img src="/_image/transaction.png">
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
{$mod->get_mod_user_kid()->get_uk_name()}
|
{$mod->get_mod_user_kid()->get_uk_name()}
|
||||||
</td>
|
</td>
|
||||||
<td class="date">
|
<td class="date">
|
||||||
{$mod->get_mod_date(true)}
|
{$mod->get_mod_money_income()->get_mi_date(true)}
|
||||||
</td>
|
</td>
|
||||||
<td class="sum">
|
<td class="sum">
|
||||||
{$mod->get_mod_sum()|number_format:0:'':' '} Ft
|
{$mod->get_mod_money_income()->get_mi_sum()|number_format:0:'':' '} Ft
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="desc" for="mod_payment_type">Befizetés típusa:</label>
|
<label class="desc" for="mod_payment_type">Fizetés típusa:</label>
|
||||||
<div>
|
<div>
|
||||||
<select name="mod_payment_type" id="mod_payment_type">
|
<select name="mod_payment_type" id="mod_payment_type">
|
||||||
{foreach $pt_assoc_array as $pt_array}
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="action" value="money_deposit_update">
|
<input type="hidden" name="action" value="money_deposit_update">
|
||||||
<input type="hidden" name="mod_id" value="{$mod->get_mod_id()}">
|
<input type="hidden" name="mod_id" value="{$mod->get_mod_id()}">
|
||||||
|
<input type="hidden" name="mi_id" value="{$mod->get_mod_money_income_mi_id()}">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="desc" id="title1" for="mod_user_kid_uk_id">Befizető:</label>
|
<label class="desc" id="title1" for="mod_user_kid_uk_id">Befizető:</label>
|
||||||
@@ -18,11 +19,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="desc" for="mod_payment_type">Típus:</label>
|
<label class="desc" for="mod_payment_type">Fizetés típusa:</label>
|
||||||
<div>
|
<div>
|
||||||
<select name="mod_payment_type" id="mod_payment_type">
|
<select name="mod_payment_type" id="mod_payment_type">
|
||||||
{foreach $pt_assoc_array as $pt_array}
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mod->get_mod_payment_type_pt_id()} selected{/if}>
|
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mod->get_mod_money_income()->get_mi_payment_type_pt_id()} selected{/if}>
|
||||||
{$pt_array.pt_name}
|
{$pt_array.pt_name}
|
||||||
</option>
|
</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@@ -32,12 +33,12 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="desc" id="title1" for="mod_date">Dátum:</label>
|
<label class="desc" id="title1" for="mod_date">Dátum:</label>
|
||||||
<div><input type="text" name="mod_date" id="mod_date" value="{$mod->get_mod_date()}" required></div>
|
<div><input type="text" name="mod_date" id="mod_date" value="{$mod->get_mod_money_income()->get_mi_date()}" required></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="desc" id="title1" for="mod_sum">Összeg:</label>
|
<label class="desc" id="title1" for="mod_sum">Összeg:</label>
|
||||||
<div><input type="text" name="mod_sum" id="mod_sum" value="{$mod->get_mod_sum()}" required></div>
|
<div><input type="text" name="mod_sum" id="mod_sum" value="{$mod->get_mod_money_income()->get_mi_sum()}" required></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
<table class="money">
|
<table class="money">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="icon">
|
<td class="icon">
|
||||||
<img src="/_image/expense.png">
|
{if $mox->get_mox_payment_type_pt_id() == 1}
|
||||||
|
<img src="/_image/expense.png">
|
||||||
|
{else}
|
||||||
|
<img src="/_image/transaction.png">
|
||||||
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td class="quarter_width">
|
<td class="quarter_width">
|
||||||
{$mox->get_mox_date()}
|
{$mox->get_mox_date()}
|
||||||
|
|||||||
@@ -16,6 +16,19 @@
|
|||||||
<div><input type="text" name="mox_item" id="mox_item" required></div>
|
<div><input type="text" name="mox_item" id="mox_item" required></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" for="mox_payment_type">Fizetés típusa:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mox_payment_type" id="mox_payment_type">
|
||||||
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
|
<option value="{$pt_array.pt_id}">
|
||||||
|
{$pt_array.pt_name}
|
||||||
|
</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="mox_összeg">Összeg:</label>
|
<label for="mox_összeg">Összeg:</label>
|
||||||
<div><input type="text" name="mox_sum" id="mox_sum" required></div>
|
<div><input type="text" name="mox_sum" id="mox_sum" required></div>
|
||||||
|
|||||||
@@ -21,6 +21,19 @@
|
|||||||
<div><input type="text" name="mox_item" id="mox_item" value="{$mox->get_mox_item()}" required></div>
|
<div><input type="text" name="mox_item" id="mox_item" value="{$mox->get_mox_item()}" required></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" for="mox_payment_type">Fizetés típusa:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mox_payment_type" id="mox_payment_type">
|
||||||
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
|
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mox->get_mox_payment_type_pt_id()} selected{/if}>
|
||||||
|
{$pt_array.pt_name}
|
||||||
|
</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="mox_összeg">Összeg:</label>
|
<label for="mox_összeg">Összeg:</label>
|
||||||
<div><input type="text" name="mox_sum" id="mox_sum" value="{$mox->get_mox_sum()}" required></div>
|
<div><input type="text" name="mox_sum" id="mox_sum" value="{$mox->get_mox_sum()}" required></div>
|
||||||
|
|||||||
91
template/templates/money_income.tpl
Normal file
91
template/templates/money_income.tpl
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
<div class="buttons">
|
||||||
|
|
||||||
|
<a href="/admin/create/money_income" class="addbutton add-big">Új bevétel</a>
|
||||||
|
<a href="/admin/money_income_category" class="addbutton add-big">Bevétel kategóriák kezelése</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list full_width">
|
||||||
|
{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}
|
||||||
|
</div>
|
||||||
|
{/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}
|
||||||
|
<span onclick="block_action('block_{$mi->get_mi_date()|substr:0:4}{$mi->get_mi_date()|substr:5:2}');" class="date_separator clickable">{$mi_array[$mi@index]->get_mi_date()|substr:0:4}.
|
||||||
|
{$months[$mi_array[$mi@index]->get_mi_date()|substr:5:2]}
|
||||||
|
<img src="/_image/open_folder.png">
|
||||||
|
</span>
|
||||||
|
<div id="block_{$mi->get_mi_date()|substr:0:4}{$mi->get_mi_date()|substr:5:2}" class="month_block">
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
<a href="/admin/money_income/{$mi->get_mi_id()}">
|
||||||
|
<div class="list_item">
|
||||||
|
<table class="money">
|
||||||
|
<tr>
|
||||||
|
<td class="icon">
|
||||||
|
{if $mi->get_mi_payment_type_pt_id() == 1}
|
||||||
|
<img src="/_image/income.png">
|
||||||
|
{else}
|
||||||
|
<img src="/_image/transaction.png">
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td class="quarter_width">
|
||||||
|
{$mi->get_mi_date()}
|
||||||
|
</td>
|
||||||
|
<td class="no_mobile_show quarter_width">
|
||||||
|
{if $mi->get_mi_money_income_category_mic_id()}{$mi->get_mi_mic()->get_mic_name()}{else}<span class="italic">nincs megadva</span>{/if}
|
||||||
|
</td>
|
||||||
|
<td class="quarter_width">
|
||||||
|
{$mi->get_mi_item()}
|
||||||
|
</td>
|
||||||
|
<td class="sum">
|
||||||
|
{$mi->get_mi_sum()|number_format:0:'':' '} Ft
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{if $mi@last}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function open_block(block_id) {
|
||||||
|
$("#"+block_id).slideDown("slow");
|
||||||
|
}
|
||||||
|
|
||||||
|
function close_block(block_id) {
|
||||||
|
$("#"+block_id).slideUp("slow");
|
||||||
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
18
template/templates/money_income_category.tpl
Normal file
18
template/templates/money_income_category.tpl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<div class="buttons">
|
||||||
|
|
||||||
|
<a href="/admin/create/money_income_category" class="addbutton add-big">Új bevétel kategória</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list">
|
||||||
|
{foreach $mic_assoc_array as $mic}
|
||||||
|
<a href="/admin/money_income_category/{$mic->get_mic_id()}">
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/income.png">
|
||||||
|
{$mic->get_mic_name()}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
17
template/templates/money_income_category_create.tpl
Normal file
17
template/templates/money_income_category_create.tpl
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<div class="form_wrapper">
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="action" value="mic_create">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" id="title1" for="mic_name">Bevétel kategória neve:</label>
|
||||||
|
<div><input type="text" name="mic_name" id="mic_name" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<input class="button black" type="submit" value="Létrehozás">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
21
template/templates/money_income_category_data_edit.tpl
Normal file
21
template/templates/money_income_category_data_edit.tpl
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<div class="form_wrapper">
|
||||||
|
<form method="post">
|
||||||
|
<div class="buttons">
|
||||||
|
<a href="/admin/delete_money_income_category/{$mic->get_mic_id()}" class="addbutton delete-big">Kategória törlése</a>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="action" value="mic_update">
|
||||||
|
<input type="hidden" name="mic_id" value="{$mic->get_mic_id()}">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" id="title1" for="mic_name">Kiadás kategória neve:</label>
|
||||||
|
<div><input type="text" name="mic_name" id="mic_name" value="{$mic->get_mic_name()}" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<input class="button black" type="submit" value="Mentés">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
51
template/templates/money_income_create.tpl
Normal file
51
template/templates/money_income_create.tpl
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<div class="form_wrapper">
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="action" value="mi_create">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_date">Dátum:</label>
|
||||||
|
<div><input type="text" name="mi_date" id="mi_date" placeholder="ÉÉÉÉ-HH-NN" value="{$today}" required></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="mi_item">Tétel:</label>
|
||||||
|
<div><input type="text" name="mi_item" id="mi_item" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" for="mi_payment_type">Fizetés típusa:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mi_payment_type" id="mi_payment_type">
|
||||||
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
|
<option value="{$pt_array.pt_id}">
|
||||||
|
{$pt_array.pt_name}
|
||||||
|
</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_sum">Összeg:</label>
|
||||||
|
<div><input type="text" name="mi_sum" id="mi_sum" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_item">Kategória:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mi_mic_id">
|
||||||
|
<option value='null'>- nincs beállítva -</option>
|
||||||
|
{foreach $mic_array as $mic}
|
||||||
|
<option value='{$mic->get_mic_id()}'>{$mic->get_mic_name()}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<input class="button black" type="submit" value="Létrehozás">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
56
template/templates/money_income_data_edit.tpl
Normal file
56
template/templates/money_income_data_edit.tpl
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<div class="form_wrapper">
|
||||||
|
<form method="post">
|
||||||
|
<div class="buttons">
|
||||||
|
<a href="/admin/delete_money_income/{$mi->get_mi_id()}" class="addbutton delete-big">Bevétel törlése</a>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="action" value="mi_update">
|
||||||
|
<input type="hidden" name="mi_id" value="{$mi->get_mi_id()}">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_date">Dátum:</label>
|
||||||
|
<div><input type="text" name="mi_date" id="mi_date" placeholder="ÉÉÉÉ-HH-NN" value="{$mi->get_mi_date()}" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_item">Tétel:</label>
|
||||||
|
<div><input type="text" name="mi_item" id="mi_item" value="{$mi->get_mi_item()}" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="desc" for="mi_payment_type">Fizetés típusa:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mi_payment_type" id="mi_payment_type">
|
||||||
|
{foreach $pt_assoc_array as $pt_array}
|
||||||
|
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mi->get_mi_payment_type_pt_id()} selected{/if}>
|
||||||
|
{$pt_array.pt_name}
|
||||||
|
</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_összeg">Összeg:</label>
|
||||||
|
<div><input type="text" name="mi_sum" id="mi_sum" value="{$mi->get_mi_sum()}" required></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mi_item">Kategória:</label>
|
||||||
|
<div>
|
||||||
|
<select name="mi_mic_id">
|
||||||
|
<option value='null'>- nincs beállítva -</option>
|
||||||
|
{foreach $mic_array as $mic}
|
||||||
|
<option value='{$mic->get_mic_id()}'{if $mic->get_mic_id() == $mi->get_mi_money_income_category_mic_id()} selected{/if}>{$mic->get_mic_name()}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<input class="button black" type="submit" value="Mentés">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
2
template/templates/nav.tpl
Executable file → Normal file
2
template/templates/nav.tpl
Executable file → Normal file
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
{else}
|
{else}
|
||||||
|
|
||||||
<li class="login"><a href="/{$page}">{if $page == 'tabor' || $page == 'taborvezeto'}Tollaslabda táborok 2017. nyár{else}Badminton Coach{/if}</a></li>
|
<li class="login"><a href="/{$page}">{if $page == 'tabor' || $page == 'taborvezeto'}Tollaslabda táborok 2018. nyár{else}Badminton Coach{/if}</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,41 @@
|
|||||||
<a href="#">
|
<a href="#">
|
||||||
<div class="list_item">
|
<div class="list_item">
|
||||||
<img src="/_image/stat.png">
|
<img src="/_image/stat.png">
|
||||||
Egyenleg: {$balance|number_format:0:'':' '} Ft
|
Készpénz bevétel: {$in_cash|number_format:0:'':' '} Ft
|
||||||
</div>
|
</div>
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Készpénz kiadás: {$out_cash|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Készpénz egyenleg: {($in_cash - $out_cash)|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list" style="margin-top: 30px;">
|
||||||
|
<a href="#">
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Utalás bevétel: {$in_transfer|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Utalás kiadás: {$out_transfer|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Utalás egyenleg: {($in_transfer - $out_transfer)|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list" style="margin-top: 30px;">
|
||||||
|
<a href="#">
|
||||||
|
<div class="list_item">
|
||||||
|
<img src="/_image/stat.png">
|
||||||
|
Egyenleg: {(($in_cash + $in_transfer)-($out_cash + $out_transfer))|number_format:0:'':' '} Ft
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
!$action@first &&
|
!$action@first &&
|
||||||
$actions[$action@index-1]->get_de_money_deposit()|is_a:'money_deposit' &&
|
$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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,44 +85,44 @@
|
|||||||
|
|
||||||
{if !$action@first &&
|
{if !$action@first &&
|
||||||
$actions[$action@index-1]->get_de_training()|is_a:'training' &&
|
$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 &&
|
!$action@first &&
|
||||||
$actions[$action@index-1]->get_de_money_deposit()|is_a:'money_deposit' &&
|
$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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<span onclick="block_action('block_{$action->get_de_money_deposit()->get_mod_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:0:4}.
|
<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_date()|substr:5:2]}
|
{$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_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_date()|substr:5:2})} edzés)
|
({$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">
|
<img src="/_image/open_folder.png">
|
||||||
</span>
|
</span>
|
||||||
<div id="block_{$action->get_de_money_deposit()->get_mod_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_date()|substr:5:2}" class="month_block">
|
<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}
|
{elseif $action@first}
|
||||||
|
|
||||||
<span onclick="block_action('block_{$action->get_de_money_deposit()->get_mod_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_date()|substr:5:2}');" class="date_separator clickable">{$actions[$action@index]->get_de_money_deposit()->get_mod_date()|substr:0:4}.
|
<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_date()|substr:5:2]}
|
{$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_date()|substr:0:4},{$action->get_de_money_deposit()->get_mod_date()|substr:5:2})} edzés)
|
({$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">
|
<img src="/_image/open_folder.png">
|
||||||
</span>
|
</span>
|
||||||
<div id="block_{$action->get_de_money_deposit()->get_mod_date()|substr:0:4}{$action->get_de_money_deposit()->get_mod_date()|substr:5:2}" class="month_block">
|
<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}
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="list_item line_height14 bigger_space money_deposit">
|
<div class="list_item line_height14 bigger_space money_deposit">
|
||||||
<span class="size20 bold">
|
<span class="size20 bold">
|
||||||
{$action->get_de_money_deposit()->get_mod_date()|substr:0:4}.
|
{$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_date()|substr:5:2]}
|
{$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_date_day()}.
|
{$action->get_de_money_deposit()->get_mod_money_income()->get_mi_date_day()}.
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
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
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="side_block">
|
<div class="side_block">
|
||||||
|
|||||||
Reference in New Issue
Block a user