<?php

if ($this->is_id()) {
	$sql->update_table('money_expense_category', array('moxc_deleted' => 1), array('moxc_id' => $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");
}


?>