created money expense

This commit is contained in:
Ricsi
2017-02-11 22:42:44 +01:00
parent 73db6b620a
commit 08ed5a85d4
20 changed files with 814 additions and 4 deletions

View File

@@ -0,0 +1,130 @@
<?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_category($_name, $_date, $_item, $_sum, $_moxc_id, $_id) {
global $sql;
$sql->update_table('money_expense_category',
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
)
);
}
}
?>

View File

@@ -0,0 +1,59 @@
<?php
class money_expense_category {
private $moxc_id;
private $moxc_name;
private $moxc_deleted;
public function set_moxc_id($_item) {
$this->moxc_id = $_item;
}
public function set_moxc_name($_item) {
$this->moxc_name = $_item;
}
public function set_moxc_deleted($_item) {
$this->moxc_deleted = $_item;
}
public function get_moxc_id() {
return $this->moxc_id;
}
public function get_moxc_name() {
return $this->moxc_name;
}
public function get_moxc_deleted() {
return $this->moxc_deleted;
}
public function set_moxc_data_by_id($_id) {
global $sql;
$set_data_assoc_array = $sql->assoc_array("select * from money_expense_category where moxc_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_expense_category($_name) {
global $sql;
return $sql->insert_into('money_expense_category', array('moxc_name' => $_name));
}
public static function update_money_expense_category($_name, $_id) {
global $sql;
$sql->update_table('money_expense_category', array('moxc_name' => $_name), array('moxc_id' => $_id));
}
}
?>

View File

@@ -141,6 +141,18 @@ class page {
# BEFIZETÉSEK / USER
include('include_view_deposit.php');
break;
case 'money_expense':
# KIADÁSOK
include('include_money_expense.php');
break;
case 'money_expense_category':
# KIADÁS KATEGÓRIÁK
include('include_money_expense_category.php');
break;
case 'money_update':
# FRISSÍTÉS
include('include_money_update.php');
break;
case 'delete_training_type':
# EDZÉS TÍPUS TÖRLÉS
include('include_delete_training_type.php');
@@ -169,6 +181,14 @@ class page {
# BEFIZETÉS TÖRLÉS
include('include_delete_money_deposit.php');
break;
case 'delete_money_expense_category':
# BEFIZETÉS KATEGÓRIA TÖRLÉS
include('include_delete_money_expense_category.php');
break;
case 'delete_money_expense':
# BEFIZETÉS TÖRLÉS
include('include_delete_money_expense.php');
break;
case 'logout':
# kijelentkezés
$from = "coach";

View File

@@ -501,9 +501,9 @@ class user_kid extends user_parent {
}
}
$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);
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);
return $_de_obj_array;
}

View File

@@ -150,7 +150,8 @@ td.create a {
}
.list_item table.money td.sum {
width: 1%;
width: unset;
text-align: right;
white-space: nowrap;
}
@@ -159,6 +160,11 @@ td.create a {
padding-right: 25px;
}
.list_item table.money td.no_mobile_show {
display: none;
}
.list .name_tag {
text-align: left;
@@ -369,6 +375,19 @@ table.log tr.delete:hover {
width: 30%;
}
.list_item table.money td.no_mobile_show {
display: table-cell;
}
.list_item table.money td.sum {
width: 1%;
white-space: nowrap;
}
.list_item table.money td.quarter_width {
width: 25%;
}
}
@@ -377,6 +396,10 @@ table.log tr.delete:hover {
width: 50% !important;
}
.full_width {
width: 90% !important;
}
.list_item label {
float: left;
padding-right: 5px;
@@ -421,6 +444,8 @@ table.log tr.delete:hover {
width: 100%;
}
}

View File

@@ -119,6 +119,23 @@ switch ($this->get_id()) {
$smarty->assign('user_kids', $user_kids);
$smarty->display('money_deposit_create.tpl');
break;
case 'money_expense':
# ÚJ KIADÁS
$moxc_assoc_array = $sql->assoc_array('SELECT * FROM money_expense_category WHERE moxc_deleted = 0 ORDER BY moxc_name ASC;');
$moxc_array = array();
foreach ($moxc_assoc_array as $key => $moxc) {
$new_moxc = new money_expense_category();
$new_moxc->set_moxc_data_by_id($moxc['moxc_id']);
$moxc_array[] = $new_moxc;
}
$smarty->assign('moxc_array', $moxc_array);
$smarty->display('money_expense_create.tpl');
break;
case 'money_expense_category':
# ÚJ KIADÁS KATEGÓRIA
$smarty->display('money_expense_category_create.tpl');
break;
default:
# code...

View File

@@ -0,0 +1,10 @@
<?php
if ($this->is_id()) {
$sql->update_table('money_expense', array('mox_deleted' => 1), array('mox_id' => $this->get_id()));
log::register('delete_mox', $this->get_id());
header("Location: /admin/money_expense");
}
?>

View File

@@ -0,0 +1,10 @@
<?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());
header("Location: /admin/money_expense_category");
}
?>

View File

@@ -0,0 +1,50 @@
<?php
# HA NINCS ID, AKKOR KIADÁS LISTA
# HA VAN ID, AKKOR KIADÁS ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
if ($this->is_id()) {
# ADOTT KIADÁS ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
$new_mox = new money_expense();
$new_mox->set_mox_data_by_id($this->get_id());
$moxc_query = "SELECT * FROM money_expense_category WHERE moxc_deleted = 0 ORDER BY moxc_name ASC;";
$moxc_array = array();
$moxc_assoc_array = $sql->assoc_array($moxc_query);
foreach ($moxc_assoc_array as $mox) {
$new_moxc = new money_expense_category();
$new_moxc->set_moxc_data_by_id($mox['moxc_id']);
$moxc_array[] = $new_moxc;
}
$smarty->assign("moxc_array", $moxc_array);
$smarty->assign("mox", $new_mox);
$smarty->display("money_expense_data_edit.tpl");
}
else {
# KIADÁS LISTA
$mox_query = "SELECT * FROM money_expense WHERE mox_deleted = 0 ORDER BY mox_date DESC, mox_id DESC;";
$mox_array = array();
$mox_assoc_array = $sql->assoc_array($mox_query);
foreach ($mox_assoc_array as $mod) {
$new_mox = new money_expense();
$new_mox->set_mox_data_by_id($mod['mox_id']);
$mox_array[] = $new_mox;
}
$smarty->assign("mox_array", $mox_array);
$smarty->display("money_expense.tpl");
}
?>

View File

@@ -0,0 +1,37 @@
<?php
# HA NINCS ID, AKKOR KIADÁS KATEGÓRIA LISTA
# HA VAN ID, AKKOR KIADÁS KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
if ($this->is_id()) {
# ADOTT KIADÁS KATEGÓRIA ADATINAK MEGTEKINTÉSE/MÓDOSÍTÁSA
$new_moxc = new money_expense_category();
$new_moxc->set_moxc_data_by_id($this->get_id());
$smarty->assign("moxc", $new_moxc);
$smarty->display("money_expense_category_data_edit.tpl");
}
else {
# KIADÁS KATEGÓRIA LISTA
$moxc_query = "SELECT * FROM money_expense_category WHERE moxc_deleted = 0 ORDER BY moxc_name ASC;";
$moxc_array = array();
$moxc_assoc_array = $sql->assoc_array($moxc_query);
foreach ($moxc_assoc_array as $mox) {
$new_moxc = new money_expense_category();
$new_moxc->set_moxc_data_by_id($mox['moxc_id']);
$moxc_array[] = $new_moxc;
}
$smarty->assign("moxc_assoc_array", $moxc_array);
$smarty->display("money_expense_category.tpl");
}
?>

View File

@@ -0,0 +1,146 @@
<?php
$users = $sql->assoc_array('select * from user_kid order by uk_name asc;');
foreach ($users as $key => $value) {
$user = new user_kid();
$user->set_user_data_by_id($value['uk_id']);
# EDZÉS LISTA
$action_list_query = "
SELECT
object_id,
timestamp(object_date) as object_date,
object_type,
(SELECT
count(distinct date(tr_date))
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
YEAR(tr_date) = YEAR(object_date)
AND MONTH(tr_date) = MONTH(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$user->get_uk_id()."
AND tr_date > (select
if(max(trd) is null,
'1900-01-01',
max(trd))
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) as elso_ket_edzes)) as 'training_per_month',
(SELECT
count(pr_id)
FROM
presence
JOIN
training ON tr_id = pr_training_tr_id
WHERE
DATE(tr_date) = DATE(object_date)
AND tr_date <= object_date
AND pr_user_kid_uk_id = ".$user->get_uk_id().") as 'training_per_day',
(select
if(sum(if(trd = object_date, 1, 0)) > 0,
1,
0)
from
(select
tr_date trd
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and tr_date >= (SELECT
tr_date
from
presence
join training ON tr_id = pr_training_tr_id
join user_kid ON uk_id = pr_user_kid_uk_id
where
pr_user_kid_uk_id = ".$user->get_uk_id()."
and date(tr_date) = uk_first_training
ORDER BY tr_date ASC
limit 1)
order by tr_date ASC
limit 2) elso2edzes) as 'first_two'
FROM
((SELECT
pr_training_tr_id as object_id,
timestamp(tr_date) as object_date,
if(pr_training_tr_id is not null, 'training', null) as object_type
FROM
presence
JOIN training ON tr_id = pr_training_tr_id
WHERE
pr_user_kid_uk_id = ".$user->get_uk_id()."
AND tr_deleted = 0) UNION (SELECT
mod_id,
timestamp(mod_date),
if(mod_id is not null, 'money_deposit', null) as object_type
FROM
money_deposit
WHERE
mod_user_kid_uk_id = ".$user->get_uk_id()."
and mod_deleted = 0)) actions
order by object_date ASC;
";
$action_assoc_array = $sql->assoc_array($action_list_query);
$actions = array();
$de_array = array();
foreach ($action_assoc_array as $action) {
if ($action['object_type'] == 'training') {
$new_training = new training();
$new_training->set_training_data_by_id($action['object_id']);
//$actions[] = $new_training;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], $new_training);
}
elseif ($action['object_type'] == 'money_deposit') {
$new_mod = new money_deposit();
$new_mod->set_mod_data_by_id($action['object_id']);
//$actions[] = $new_mod;
$new_diary_entry = new diary_entry($action['object_id'], $action['object_date'], $action['object_type'], $action['training_per_month'], $action['training_per_day'], $action['first_two'], null, $new_mod);
}
$de_array[] = $new_diary_entry;
}
//itt csak hivatkozással adjuk át a tömböt, a calculate_balance kiszámolja, belerakja és visszadja
$user->calculate_balance($de_array, $user);
//var_dump($de_array);
//$smarty->assign('actions', $actions);
}
?>

View File

@@ -258,6 +258,30 @@ if (isset($_POST['action'])) {
log::register('update_money_deposit', $tmp_user->get_uk_name() . ': ' . $_POST['mod_sum']. ' Ft (' . $_POST['mod_date'] . ')');
header("Location: /admin/money_deposit");
break;
case 'moxc_create':
# befizetés kategória létrehozása
$new_moxc_id = money_expense_category::create_money_expense_category($_POST['moxc_name']);
log::register('new_moxc', $new_moxc_id);
header("Location: /admin/money_expense_category");
break;
case 'moxc_update':
# befizetés kategória módosítása
money_expense_category::update_money_expense_category($_POST['moxc_name'], $_POST['moxc_id']);
log::register('update_moxc', $_POST['moxc_id']);
header("Location: /admin/money_expense_category");
break;
case 'mox_create':
# 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']);
log::register('new_mox', $new_mox_id);
header("Location: /admin/money_expense");
break;
case 'mox_update':
# 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']);
log::register('update_mox', $_POST['mox_id']);
header("Location: /admin/money_expense");
break;
default:
# code...
break;

View File

@@ -42,7 +42,7 @@ setlocale(LC_ALL, 'hu_HU');
?>
<title>Badminton Coach v 0.1</title>
<title>Badminton Coach</title>
</head>
<body>

View File

@@ -0,0 +1,90 @@
<div class="buttons">
<a href="/admin/create/money_expense" class="addbutton add-big">Új kiadás</a>
<a href="/admin/money_expense_category" class="addbutton add-big">Kiadás kategóriák kezelése</a>
</div>
<div class="list full_width">
{foreach $mox_array as $mox}
{if !$mox@first && $mox_array[$mox@index]->get_mox_date()|substr:5:2 != $mox_array[$mox@index-1]->get_mox_date()|substr:5:2}
</div>
{/if}
{if $mox@first || $mox_array[$mox@index]->get_mox_date()|substr:5:2 != $mox_array[$mox@index-1]->get_mox_date()|substr:5:2}
<span class="date_separator">{$mox_array[$mox@index]->get_mox_date()|substr:0:4}.
{$months[$mox_array[$mox@index]->get_mox_date()|substr:5:2]}
<img src="/_image/open_folder.png" onclick="block_action('block_{$mox->get_mox_date()|substr:0:4}{$mox->get_mox_date()|substr:5:2}');">
</span>
<div id="block_{$mox->get_mox_date()|substr:0:4}{$mox->get_mox_date()|substr:5:2}" class="month_block">
{/if}
<a href="/admin/money_expense/{$mox->get_mox_id()}">
<div class="list_item">
<table class="money">
<tr>
<td class="icon">
<img src="/_image/expense.png">
</td>
<td class="quarter_width">
{$mox->get_mox_date()}
</td>
<td class="no_mobile_show quarter_width">
{if $mox->get_mox_money_expense_category_moxc_id()}{$mox->get_mox_moxc()->get_moxc_name()}{else}<span class="italic">nincs megadva</span>{/if}
</td>
<td class="no_mobile_show quarter_width">
{$mox->get_mox_name()}
</td>
<td class="quarter_width">
{$mox->get_mox_item()}
</td>
<td class="sum">
{$mox->get_mox_sum()|number_format:0:'':' '} Ft
</td>
</tr>
</table>
</div>
</a>
{if $mox@last}
</div>
{/if}
{/foreach}
</div>
<script>
function open_block(block_id) {
$("#"+block_id).slideDown("slow");
}
function close_block(block_id) {
$("#"+block_id).slideUp("slow");
}
function block_action(block_id) {
if ($("#"+block_id).is(':hidden')) {
open_block(block_id);
}
else {
close_block(block_id);
}
}
$( document ).ready(function() {
var divs = $( "div[class=month_block]" );
$( ".list" ).find( divs ).hide();
var div_list = $( ".list" ).find( divs );
open_block(div_list[0].id);
});
</script>

View File

@@ -0,0 +1,18 @@
<div class="buttons">
<a href="/admin/create/money_expense_category" class="addbutton add-big">Új kiadás kategória</a>
</div>
<div class="list">
{foreach $moxc_assoc_array as $moxc}
<a href="/admin/money_expense_category/{$moxc->get_moxc_id()}">
<div class="list_item">
<img src="/_image/expense.png">
{$moxc->get_moxc_name()}
</div>
</a>
{/foreach}
</div>

View File

@@ -0,0 +1,17 @@
<div class="form_wrapper">
<form method="post">
<input type="hidden" name="action" value="moxc_create">
<div>
<label class="desc" id="title1" for="moxc_name">Kiadás kategória neve:</label>
<div><input type="text" name="moxc_name" id="moxc_name" required></div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Létrehozás">
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,21 @@
<div class="form_wrapper">
<form method="post">
<div class="buttons">
<a href="/admin/delete_money_expense_category/{$moxc->get_moxc_id()}" class="addbutton delete-big">Kategória törlése</a>
</div>
<input type="hidden" name="action" value="moxc_update">
<input type="hidden" name="moxc_id" value="{$moxc->get_moxc_id()}">
<div>
<label class="desc" id="title1" for="moxc_name">Kiadás kategória neve:</label>
<div><input type="text" name="moxc_name" id="moxc_name" value="{$moxc->get_moxc_name()}" required></div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,44 @@
<div class="form_wrapper">
<form method="post">
<input type="hidden" name="action" value="mox_create">
<div>
<label for="mox_name">Név:</label>
<div><input type="text" name="mox_name" id="mox_name"></div>
</div>
<div>
<label for="mox_date">Dátum:</label>
<div><input type="text" name="mox_date" id="mox_date" placeholder="ÉÉÉÉ-HH-NN" required></div>
</div>
<div>
<label for="mox_item">Tétel:</label>
<div><input type="text" name="mox_item" id="mox_item" required></div>
</div>
<div>
<label for="mox_összeg">Összeg:</label>
<div><input type="text" name="mox_sum" id="mox_sum" required></div>
</div>
<div>
<label for="mox_item">Kategória:</label>
<div>
<select name="mox_moxc_id">
<option value='null'>- nincs beállítva -</option>
{foreach $moxc_array as $moxc}
<option value='{$moxc->get_moxc_id()}'>{$moxc->get_moxc_name()}</select>
{/foreach}
</select>
</div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Létrehozás">
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,48 @@
<div class="form_wrapper">
<form method="post">
<div class="buttons">
<a href="/admin/delete_money_expense/{$mox->get_mox_id()}" class="addbutton delete-big">Kiadás törlése</a>
</div>
<input type="hidden" name="action" value="mox_create">
<input type="hidden" name="moxc_id" value="{$mox->get_mox_id()}">
<div>
<label for="mox_name">Név:</label>
<div><input type="text" name="mox_name" id="mox_name" value="{$mox->get_mox_name()}"></div>
</div>
<div>
<label for="mox_date">Dátum:</label>
<div><input type="text" name="mox_date" id="mox_date" placeholder="ÉÉÉÉ-HH-NN" value="{$mox->get_mox_date()}" required></div>
</div>
<div>
<label for="mox_item">Tétel:</label>
<div><input type="text" name="mox_item" id="mox_item" value="{$mox->get_mox_item()}" required></div>
</div>
<div>
<label for="mox_összeg">Összeg:</label>
<div><input type="text" name="mox_sum" id="mox_sum" value="{$mox->get_mox_sum()}" required></div>
</div>
<div>
<label for="mox_item">Kategória:</label>
<div>
<select name="mox_moxc_id">
<option value='null'>- nincs beállítva -</option>
{foreach $moxc_array as $moxc}
<option value='{$moxc->get_moxc_id()}'{if $moxc->get_moxc_id() == $mox->get_mox_money_expense_category_moxc_id()} selected{/if}>{$moxc->get_moxc_name()}</select>
{/foreach}
</select>
</div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form>
</div>

View File

@@ -0,0 +1,44 @@
<div class="form_wrapper">
<form method="post">
<input type="hidden" name="action" value="mox_create">
<div>
<label for="mox_name">Név:</label>
<div><input type="text" name="mox_name" id="mox_name" value="{$mox->get_mox_name()}"></div>
</div>
<div>
<label for="mox_date">Dátum:</label>
<div><input type="text" name="mox_date" id="mox_date" placeholder="ÉÉÉÉ-HH-NN" value="{$mox->get_mox_date()}" required></div>
</div>
<div>
<label for="mox_item">Tétel:</label>
<div><input type="text" name="mox_item" id="mox_item" value="{$mox->get_mox_item()}" required></div>
</div>
<div>
<label for="mox_összeg">Összeg:</label>
<div><input type="text" name="mox_sum" id="mox_sum" value="{$mox->get_mox_sum()}" required></div>
</div>
<div>
<label for="mox_item">Kategória:</label>
<div>
<select name="mox_moxc_id">
<option value='null'>- nincs beállítva -</option>
{foreach $moxc_array as $moxc}
<option value='{$moxc->get_moxc_id()}'>{$moxc->get_moxc_name()}{if $moxc->get_moxc_id() == $mox->get_mox_moxc_id()} selected{/if}</select>
{/foreach}
</select>
</div>
</div>
<div>
<div>
<input class="button black" type="submit" value="Mentés">
</div>
</div>
</form>
</div>