added money delete option

add _developer directorym (ignored)
This commit is contained in:
Ricsi
2017-01-24 22:49:43 +01:00
parent d73e0cce1a
commit bdd04b9cdc
7 changed files with 33 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/template/templates_c
php_errors.log
/_image
/_developer

View File

@@ -5,6 +5,8 @@ RewriteBase /
RewriteRule ^$ index.php?page=view [NC,L]
RewriteRule ^\/?(_developer)\/([a-zA-Z0-9\.\_]*) _developer/$2 [NC]
RewriteRule ^\/?(_css\/)([a-zA-Z0-9_]+)\.css$ _css/$2.css [NC]
RewriteRule ^\/?(_ajax\/)([a-zA-Z0-9_]+)\.php$ _ajax/$2.php [NC,L]

View File

@@ -10,6 +10,7 @@ class money_deposit {
private $mod_user_kid; //OBJECT
private $mod_date;
private $mod_sum;
private $mod_deleted;
public function set_mod_id($_id) {
$this->mod_id = $_id;
@@ -31,6 +32,10 @@ class money_deposit {
$this->mod_sum = $_sum;
}
public function set_mod_deleted($_deleted) {
$this->mod_deleted = $_deleted;
}
public function get_mod_id() {
return $this->mod_id;
}
@@ -51,6 +56,10 @@ class money_deposit {
return $this->mod_sum;
}
public function get_mod_deleted() {
return $this->mod_deleted;
}
public function set_mod_data_by_id($_id) {
global $sql;
$mod_query = "SELECT * FROM money_deposit WHERE mod_id = " . $_id . ";";

View File

@@ -161,6 +161,10 @@ class page {
# ISKOLA TÖRLÉS
include('include_delete_school.php');
break;
case 'delete_money_deposit':
# BEFIZETÉS TÖRLÉS
include('include_delete_money_deposit.php');
break;
case 'logout':
# kijelentkezés
$from = "coach";

View File

@@ -0,0 +1,13 @@
<?php
if ($this->is_id()) {
$sql->update_table('money_deposit', array('mod_deleted' => 1), array('mod_id' => $this->get_id()));
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($this->get_id());
//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() . ')');
header("Location: /admin/money_deposit");
}
?>

View File

@@ -29,7 +29,7 @@ if ($this->is_id()) {
}
else {
# BEFIZETÉS LISTA
$mod_query = "SELECT * FROM money_deposit ORDER BY mod_date DESC LIMIT 50;";
$mod_query = "SELECT * FROM money_deposit WHERE mod_deleted = 0 ORDER BY mod_date DESC LIMIT 50;";
$mod_array = array();
$mod_assoc_array = $sql->assoc_array($mod_query);

View File

@@ -1,5 +1,8 @@
<div class="form_wrapper">
<form method="post">
<div class="buttons">
<a href="/admin/delete_money_deposit/{$mod->get_mod_id()}" class="addbutton delete-big">Befizetés törlése</a>
</div>
<input type="hidden" name="action" value="money_deposit_update">
<input type="hidden" name="mod_id" value="{$mod->get_mod_id()}">