130 lines
2.6 KiB
PHP
130 lines
2.6 KiB
PHP
<?php
|
|
|
|
|
|
class money_expense {
|
|
private $mox_id;
|
|
private $mox_name;
|
|
private $mox_date;
|
|
private $mox_item;
|
|
private $mox_sum;
|
|
private $mox_moxc_id = null;
|
|
private $mox_moxc = null;
|
|
private $mox_deleted;
|
|
|
|
|
|
public function set_mox_id($_item) {
|
|
$this->mox_id = $_item;
|
|
}
|
|
|
|
public function set_mox_name($_item) {
|
|
$this->mox_name = $_item;
|
|
}
|
|
|
|
public function set_mox_date($_item) {
|
|
$this->mox_date = $_item;
|
|
}
|
|
|
|
public function set_mox_item($_item) {
|
|
$this->mox_item = $_item;
|
|
}
|
|
|
|
public function set_mox_sum($_item) {
|
|
$this->mox_sum = $_item;
|
|
}
|
|
|
|
public function set_mox_money_expense_category_moxc_id($_item) {
|
|
$this->mox_moxc_id = $_item;
|
|
}
|
|
|
|
public function set_mox_moxc($_item) {
|
|
$this->mox_moxc = $_item;
|
|
}
|
|
|
|
|
|
public function set_mox_deleted($_item) {
|
|
$this->mox_deleted = $_item;
|
|
}
|
|
|
|
public function get_mox_id() {
|
|
return $this->mox_id;
|
|
}
|
|
|
|
public function get_mox_name() {
|
|
return $this->mox_name;
|
|
}
|
|
|
|
public function get_mox_date() {
|
|
return $this->mox_date;
|
|
}
|
|
|
|
public function get_mox_item() {
|
|
return $this->mox_item;
|
|
}
|
|
|
|
public function get_mox_sum() {
|
|
return $this->mox_sum;
|
|
}
|
|
|
|
public function get_mox_moxc() {
|
|
return $this->mox_moxc;
|
|
}
|
|
|
|
public function get_mox_money_expense_category_moxc_id() {
|
|
return $this->mox_moxc_id;
|
|
}
|
|
|
|
public function get_mox_deleted() {
|
|
return $this->mox_deleted;
|
|
}
|
|
|
|
public function set_mox_data_by_id($_id) {
|
|
global $sql;
|
|
$set_data_assoc_array = $sql->assoc_array("select * from money_expense where mox_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 == 'mox_money_expense_category_moxc_id' && $value != null) {
|
|
$new_moxc = new money_expense_category();
|
|
$new_moxc->set_moxc_data_by_id($value);
|
|
$this->set_mox_moxc($new_moxc);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public static function create_money_expense($_name, $_date, $_item, $_sum, $_moxc_id) {
|
|
global $sql;
|
|
|
|
return $sql->insert_into('money_expense', array(
|
|
'mox_name' => $_name,
|
|
'mox_date' => $_date,
|
|
'mox_item' => $_item,
|
|
'mox_sum' => $_sum,
|
|
'mox_money_expense_category_moxc_id' => $_moxc_id
|
|
));
|
|
}
|
|
|
|
public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id) {
|
|
global $sql;
|
|
|
|
$sql->update_table('money_expense',
|
|
array(
|
|
'mox_name' => $_name,
|
|
'mox_date' => $_date,
|
|
'mox_item' => $_item,
|
|
'mox_sum' => $_sum,
|
|
'mox_money_expense_category_moxc_id' => $_moxc_id
|
|
),
|
|
array(
|
|
'mox_id' => $_id
|
|
)
|
|
|
|
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
?>
|