log and other fixes
This commit is contained in:
@@ -93,7 +93,7 @@ class money_deposit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create_money_deposit($_user_id, $_date, $_sum) {
|
public static function create_money_deposit($_user_id, $_date, $_sum) {
|
||||||
global $sql;
|
global $sql;
|
||||||
return $sql->insert_into('money_deposit', array(
|
return $sql->insert_into('money_deposit', array(
|
||||||
'mod_user_kid_uk_id' => $_user_id,
|
'mod_user_kid_uk_id' => $_user_id,
|
||||||
@@ -103,7 +103,7 @@ class money_deposit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update_money_deposit($_user_id, $_date, $_sum, $_mod_id) {
|
public static function update_money_deposit($_user_id, $_date, $_sum, $_mod_id) {
|
||||||
global $sql;
|
global $sql;
|
||||||
$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,
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ class money_expense {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function update_money_expense_category($_name, $_date, $_item, $_sum, $_moxc_id, $_id) {
|
public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id) {
|
||||||
global $sql;
|
global $sql;
|
||||||
|
|
||||||
$sql->update_table('money_expense_category',
|
$sql->update_table('money_expense',
|
||||||
array(
|
array(
|
||||||
'mox_name' => $_name,
|
'mox_name' => $_name,
|
||||||
'mox_date' => $_date,
|
'mox_date' => $_date,
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
if ($this->is_id()) {
|
if ($this->is_id()) {
|
||||||
$sql->update_table('money_expense', array('mox_deleted' => 1), array('mox_id' => $this->get_id()));
|
$sql->update_table('money_expense', array('mox_deleted' => 1), array('mox_id' => $this->get_id()));
|
||||||
log::register('delete_mox', $this->get_id());
|
$mox = new money_expense();
|
||||||
|
$mox->set_mox_data_by_id($this->get_id());
|
||||||
|
log::register('delete_mox', $mox->get_mox_item() . ": " . $mox->get_mox_sum() . " Ft");
|
||||||
header("Location: /admin/money_expense");
|
header("Location: /admin/money_expense");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
if ($this->is_id()) {
|
if ($this->is_id()) {
|
||||||
$sql->update_table('money_expense_category', array('moxc_deleted' => 1), array('moxc_id' => $this->get_id()));
|
$sql->update_table('money_expense_category', array('moxc_deleted' => 1), array('moxc_id' => $this->get_id()));
|
||||||
log::register('delete_moxc', $this->get_id());
|
log::register('delete_moxc', $this->get_id());
|
||||||
|
|
||||||
|
//akiknek ez a moxc_id van beállítva, azoknál null-ra állítjuk
|
||||||
|
$mox_query = "SELECT mox_id FROM money_expense WHERE mox_money_expense_category_moxc_id = " . $this->get_id();
|
||||||
|
$mox_assoc_array = $sql->assoc_array($mox_query);
|
||||||
|
foreach ($mox_assoc_array as $uk_id) {
|
||||||
|
$sql->update_table('money_expense', array('mox_money_expense_category_moxc_id' => 'null'), array('mox_id' => $uk_id['mox_id']));
|
||||||
|
}
|
||||||
|
|
||||||
header("Location: /admin/money_expense_category");
|
header("Location: /admin/money_expense_category");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,13 +273,13 @@ if (isset($_POST['action'])) {
|
|||||||
case 'mox_create':
|
case 'mox_create':
|
||||||
# befizetés létrehozása
|
# befizetés létrehozása
|
||||||
$new_mox_id = money_expense::create_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id']);
|
$new_mox_id = money_expense::create_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id']);
|
||||||
log::register('new_mox', $new_mox_id);
|
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
|
# befizetés módosítása
|
||||||
money_expense::update_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id'], $_POST['mox_id']);
|
money_expense::update_money_expense($_POST['mox_name'], $_POST['mox_date'], $_POST['mox_item'], $_POST['mox_sum'], $_POST['mox_moxc_id'], $_POST['mox_id']);
|
||||||
log::register('update_mox', $_POST['mox_id']);
|
log::register('update_mox', $_POST['mox_item'] . ": " . $_POST['mox_sum'] . " Ft");
|
||||||
header("Location: /admin/money_expense");
|
header("Location: /admin/money_expense");
|
||||||
case 'settings_data_edit':
|
case 'settings_data_edit':
|
||||||
$sql->update_table('setting_value',
|
$sql->update_table('setting_value',
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a href="/admin/delete_money_expense/{$mox->get_mox_id()}" class="addbutton delete-big">Kiadás törlése</a>
|
<a href="/admin/delete_money_expense/{$mox->get_mox_id()}" class="addbutton delete-big">Kiadás törlése</a>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="action" value="mox_create">
|
<input type="hidden" name="action" value="mox_update">
|
||||||
<input type="hidden" name="moxc_id" value="{$mox->get_mox_id()}">
|
<input type="hidden" name="mox_id" value="{$mox->get_mox_id()}">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="mox_name">Név:</label>
|
<label for="mox_name">Név:</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user