updates and restart camps
This commit is contained in:
@@ -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
|
||||
));
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
81
_class/class_page.php
Executable file → Normal file
81
_class/class_page.php
Executable file → Normal file
@@ -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 {
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
66
_class/class_sql.php
Executable file → Normal file
66
_class/class_sql.php
Executable file → Normal file
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -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() . "<br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user