user-level megszuntetese; uj oszlopok a befizeteshez
This commit is contained in:
@@ -8,7 +8,10 @@ class money_income {
|
||||
private $mi_sum;
|
||||
private $mi_mic_id = null;
|
||||
private $mi_mic = null;
|
||||
private $mi_payment_type;
|
||||
private $mi_payment_type; // id
|
||||
|
||||
private $mi_payment_type_obj; // guess what? object!
|
||||
|
||||
private $mi_deleted;
|
||||
|
||||
|
||||
@@ -40,6 +43,10 @@ class money_income {
|
||||
$this->mi_payment_type = $_payment_type;
|
||||
}
|
||||
|
||||
public function set_mi_payment_type_pt_obj($_payment_type) {
|
||||
$this->mi_payment_type_obj = $_payment_type;
|
||||
}
|
||||
|
||||
public function set_mi_deleted($_item) {
|
||||
$this->mi_deleted = $_item;
|
||||
}
|
||||
@@ -78,6 +85,10 @@ class money_income {
|
||||
return $this->mi_payment_type;
|
||||
}
|
||||
|
||||
public function get_mi_payment_type_pt_obj() {
|
||||
return $this->mi_payment_type_obj;
|
||||
}
|
||||
|
||||
public function get_mi_deleted() {
|
||||
return $this->mi_deleted;
|
||||
}
|
||||
@@ -95,10 +106,10 @@ class money_income {
|
||||
$new_mic->set_mic_data_by_id($value);
|
||||
$this->set_mi_mic($new_mic);
|
||||
}
|
||||
if ($field == "mi_payment_type") {
|
||||
if ($field == "mi_payment_type_pt_id") {
|
||||
$new_pt = new payment_type();
|
||||
$new_pt->set_pt_data_by_id($value);
|
||||
$this->set_mi_payment_type_pt_id($new_pt);
|
||||
$this->set_mi_payment_type_pt_obj($new_pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -456,14 +456,6 @@ class user_kid extends user_parent {
|
||||
if (!isset($_user_value_array['uk_is_active'])) $_user_value_array['uk_is_active'] = 0;
|
||||
if (!isset($_user_value_array['uk_lease'])) $_user_value_array['uk_lease'] = 0;
|
||||
|
||||
$l_ids = array();
|
||||
if (isset($_user_value_array['level']) && is_array($_user_value_array['level'])) {
|
||||
foreach ($_user_value_array['level'] as $key => $l_id) {
|
||||
$l_ids[] = $l_id;
|
||||
}
|
||||
unset($_user_value_array['level']);
|
||||
}
|
||||
|
||||
$kidId = $sql->insert_into('user_kid', $_user_value_array);
|
||||
|
||||
/*
|
||||
@@ -478,16 +470,6 @@ class user_kid extends user_parent {
|
||||
}
|
||||
*/
|
||||
|
||||
if (!empty($l_ids)) {
|
||||
foreach ($l_ids as $key => $l_id) {
|
||||
$sql->insert_into('user_kid_lease', array(
|
||||
'ukl_user_kid_uk_id' => $kidId,
|
||||
'ukl_lease_l_id' => $l_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $kidId;
|
||||
}
|
||||
|
||||
@@ -568,25 +550,6 @@ class user_kid extends user_parent {
|
||||
if (!isset($_user_value_array['uk_balance_expires'])) $_user_value_array['uk_balance_expires'] = 0;
|
||||
if (!isset($_user_value_array['uk_lease'])) $_user_value_array['uk_lease'] = 0;
|
||||
|
||||
$l_ids = array();
|
||||
if (isset($_user_value_array['level']) && is_array($_user_value_array['level'])) {
|
||||
foreach ($_user_value_array['level'] as $key => $l_id) {
|
||||
$l_ids[] = $l_id;
|
||||
}
|
||||
unset($_user_value_array['level']);
|
||||
}
|
||||
|
||||
$sql->execute_query("DELETE FROM user_kid_lease WHERE ukl_user_kid_uk_id = {$_user_id}");
|
||||
if (!empty($l_ids)) {
|
||||
foreach ($l_ids as $key => $l_id) {
|
||||
$sql->insert_into('user_kid_lease', array(
|
||||
'ukl_user_kid_uk_id' => $_user_id,
|
||||
'ukl_lease_l_id' => $l_id,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$sql->update_table('user_kid', $_user_value_array, array('uk_id' => $_user_id));
|
||||
}
|
||||
|
||||
|
||||
@@ -216,12 +216,19 @@ a.addbutton.noti {
|
||||
min-width: 90px;
|
||||
}
|
||||
|
||||
.list_item table.money td.kid-name {
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
.list_item table.money td.lease-name {
|
||||
width: 225px;
|
||||
}
|
||||
|
||||
.list_item table.money td.date {
|
||||
text-align: right;
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
|
||||
.list_item table.money td.no_mobile_show {
|
||||
display: none;
|
||||
}
|
||||
@@ -428,7 +435,7 @@ table.email.log tr:hover {
|
||||
|
||||
.date_separator img {
|
||||
width: 20px;
|
||||
float: right;
|
||||
height: 13px;
|
||||
margin-top: 4px;
|
||||
margin-right: 10px;
|
||||
border: 0;
|
||||
|
||||
@@ -35,16 +35,12 @@ switch ($this->get_id()) {
|
||||
//training type array
|
||||
//$tt_assoc_array = $sql->assoc_array("SELECT * FROM training_type WHERE trt_deleted = 0 ORDER by trt_name ASC;");
|
||||
|
||||
//lease assoc array
|
||||
$l_assoc_array = $sql->assoc_array("SELECT * FROM lease WHERE l_deleted = 0 ORDER BY l_name ASC;");
|
||||
|
||||
$smarty->assign('region_assoc_array', $region_assoc_array);
|
||||
$smarty->assign('shirt_size_assoc_array', $shirt_size_assoc_array);
|
||||
$smarty->assign('school_assoc_array', $schools);
|
||||
$smarty->assign('school_city_assoc_array', $school_cities);
|
||||
$smarty->assign('parent_assoc_array', $parent_assoc_array);
|
||||
//$smarty->assign('tt_assoc_array', $tt_assoc_array);
|
||||
$smarty->assign('l_assoc_array', $l_assoc_array);
|
||||
$smarty->assign('today', date("Y-m-d"));
|
||||
|
||||
$smarty->display('user_data_create.tpl');
|
||||
|
||||
@@ -38,9 +38,6 @@ if ($this->is_id()) {
|
||||
//training type array
|
||||
//$tt_assoc_array = $sql->assoc_array("SELECT * FROM training_type WHERE trt_deleted = 0 ORDER by trt_name ASC;");
|
||||
|
||||
//lease assoc array
|
||||
$l_assoc_array = $sql->assoc_array("SELECT * FROM lease WHERE l_deleted = 0 ORDER BY l_name ASC;");
|
||||
|
||||
//smarty thingz
|
||||
$smarty->assign('school_assoc_array', $schools);
|
||||
$smarty->assign('school_city_assoc_array', $school_cities);
|
||||
@@ -49,7 +46,6 @@ if ($this->is_id()) {
|
||||
$smarty->assign('shirt_size_assoc_array', $shirt_size_assoc_array);
|
||||
$smarty->assign('parent_assoc_array', $parent_assoc_array);
|
||||
//$smarty->assign('tt_assoc_array', $tt_assoc_array);
|
||||
$smarty->assign('l_assoc_array', $l_assoc_array);
|
||||
$smarty->display('user_data_'.$tpl.'.tpl');
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -37,7 +37,7 @@ if ($this->is_id()) {
|
||||
}
|
||||
else {
|
||||
# BEFIZETÉS LISTA
|
||||
$mod_query = "SELECT * FROM money_deposit JOIN money_income ON mod_money_income_mi_id = mi_id WHERE mod_deleted = 0 ORDER BY mi_date DESC, mi_id DESC;";
|
||||
$mod_query = "SELECT * FROM money_deposit JOIN money_income ON mod_money_income_mi_id = mi_id WHERE mod_deleted = 0 ORDER BY mi_date DESC, mi_id DESC LIMIT 5;";
|
||||
$mod_array = array();
|
||||
$mod_assoc_array = $sql->assoc_array($mod_query);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ if ($this->is_id()) {
|
||||
$exeptions[] = $user->get_uk_id();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
$rest_user_query = "
|
||||
SELECT
|
||||
uk_id
|
||||
@@ -93,44 +93,7 @@ if ($this->is_id()) {
|
||||
GROUP BY uk_id
|
||||
ORDER BY uk_name;
|
||||
";
|
||||
*/
|
||||
$rest_user_query = "
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT DISTINCT
|
||||
uk_id, uk_name
|
||||
FROM
|
||||
user_kid
|
||||
-- LEFT JOIN user_kid_training_type ON uktt_user_kid_uk_id = uk_id
|
||||
LEFT JOIN user_kid_lease ON ukl_user_kid_uk_id = uk_id
|
||||
LEFT JOIN lease_training_type ON ltt_lease_l_id = ukl_lease_l_id
|
||||
WHERE
|
||||
(uk_deleted = 0 AND uk_is_active = 1)
|
||||
AND (ltt_training_type_trt_id = {$training->get_tr_training_type_trt_id()}
|
||||
OR uk_lease = 0) UNION SELECT DISTINCT
|
||||
uk_id, uk_name
|
||||
FROM
|
||||
user_kid
|
||||
LEFT JOIN money_deposit ON mod_user_kid_uk_id = uk_id
|
||||
AND mod_expire_date > NOW()
|
||||
AND mod_deleted = 0
|
||||
LEFT JOIN lease ON l_id = mod_lease_l_id
|
||||
LEFT JOIN lease_training_type ON ltt_lease_l_id = l_id
|
||||
WHERE
|
||||
uk_deleted = 0 AND uk_is_active = 1
|
||||
AND ((uk_lease = 1 AND mod_id IS NOT NULL
|
||||
AND ltt_training_type_trt_id = {$training->get_tr_training_type_trt_id()})
|
||||
OR (uk_lease = 0 AND mod_lease_l_id IS NULL)) UNION SELECT DISTINCT
|
||||
uk_id, uk_name
|
||||
FROM
|
||||
presence
|
||||
JOIN user_kid ON pr_user_kid_uk_id = uk_id
|
||||
WHERE
|
||||
pr_training_tr_id = {$training->get_tr_id()}) AS res
|
||||
ORDER BY uk_name
|
||||
;
|
||||
";
|
||||
|
||||
|
||||
//var_dump($rest_user_query);
|
||||
$rest_user_assoc_array = $sql->assoc_array($rest_user_query);
|
||||
|
||||
@@ -303,7 +303,7 @@ if (isset($_POST['action'])) {
|
||||
// új befizetés létrehozása
|
||||
$sets_date = (isset($_POST['mod_sets_expire_date']) && $_POST['mod_sets_expire_date']) ? $_POST['mod_sets_expire_date'] : false;
|
||||
|
||||
$new_mod_id = money_deposit::create_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_lease_l_id'], $_POST['mod_expire_date'], 1, $sets_date);
|
||||
$new_mod_id = money_deposit::create_money_deposit($_POST['mod_user_kid_uk_id'], $_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_lease_l_id'], $_POST['mod_expire_date'], $_POST['mod_payment_type'], $sets_date);
|
||||
$tmp_user = new user_kid();
|
||||
$tmp_user->set_user_data_by_id($_POST['mod_user_kid_uk_id']);
|
||||
log::register('new_money_deposit', $tmp_user->get_uk_name().': '.$_POST['mod_sum'].' Ft ('.$_POST['mod_date'].')');
|
||||
@@ -318,7 +318,7 @@ if (isset($_POST['action'])) {
|
||||
break;
|
||||
case 'money_deposit_update':
|
||||
// befizetés módosítás
|
||||
money_deposit::update_money_deposit($_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_id'], 1, $_POST['mi_id']);
|
||||
money_deposit::update_money_deposit($_POST['mod_date'], $_POST['mod_sum'], $_POST['mod_id'], $_POST['mod_payment_type'], $_POST['mi_id']);
|
||||
$tmp_user = new user_kid();
|
||||
$tmp_user->set_user_data_by_id($_POST['mod_user_kid_uk_id']);
|
||||
$tmp_user->update_balance();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="list half_width">
|
||||
<div class="list full_width">
|
||||
{foreach $mod_array as $mod}
|
||||
|
||||
{if !$mod@first && $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_money_income()->get_mi_date()|substr:5:2}
|
||||
@@ -15,12 +15,21 @@
|
||||
{/if}
|
||||
|
||||
{if $mod@first || $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2 != $mod_array[$mod@index-1]->get_mod_money_income()->get_mi_date()|substr:5:2}
|
||||
<span onclick="block_action('block_{$mod->get_mod_money_income()->get_mi_date()|substr:0:4}{$mod->get_mod_money_income()->get_mi_date()|substr:5:2}');" class="date_separator clickable">{$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||
<div onclick="block_action('block_{$mod->get_mod_money_income()->get_mi_date()|substr:0:4}{$mod->get_mod_money_income()->get_mi_date()|substr:5:2}');" style="display: flex; justify-content: space-between; align-items: center;" class="date_separator clickable">
|
||||
<div style="display: flex; justify-content: flex-start; gap: 120px;">
|
||||
<div>
|
||||
{$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4}.
|
||||
{$months[$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2]}
|
||||
<img src="/_image/open_folder.png">
|
||||
</div>
|
||||
<div>Bérlettípus</div>
|
||||
<div>Befizetés módja</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: flex-start; gap: 30px;">
|
||||
{assign var="sum" value=money_deposit::get_month_mod_sum($mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4, $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2)}
|
||||
<span class="mod_sum">{if sum != null}{$sum|number_format:0:'':' '}{else}0{/if} Ft</span>
|
||||
</span>
|
||||
<div>{if sum != null}{$sum|number_format:0:'':' '}{else}0{/if} Ft</div>
|
||||
<img src="/_image/open_folder.png">
|
||||
</div>
|
||||
</div>
|
||||
<div id="block_{$mod->get_mod_money_income()->get_mi_date()|substr:0:4}{$mod->get_mod_money_income()->get_mi_date()|substr:5:2}" class="month_block">
|
||||
|
||||
{/if}
|
||||
@@ -35,9 +44,11 @@
|
||||
<img src="/_image/transaction.png">
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<td class="kid-name">
|
||||
{$mod->get_mod_user_kid()->get_uk_name()} {if $mod->is_expired()}(Lejárt: {$mod->get_mod_expire_date()}){/if}
|
||||
</td>
|
||||
<td class="lease-name">{$mod->get_mod_lease_l_id()->get_l_name()}</td>
|
||||
<td class="payment-type">{$mod->get_mod_money_income()->get_mi_payment_type_pt_obj()->get_pt_name()}</td>
|
||||
<td class="date">
|
||||
{$mod->get_mod_money_income()->get_mi_date(true)}
|
||||
</td>
|
||||
|
||||
@@ -50,6 +50,19 @@
|
||||
<div><input type="text" name="mod_sum" id="mod_sum" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="mod_payment_type">Befizetés módja:</label>
|
||||
<div>
|
||||
<select name="mod_payment_type" id="mod_payment_type">
|
||||
{foreach $pt_assoc_array as $pt_array}
|
||||
<option value="{$pt_array.pt_id}">
|
||||
{$pt_array.pt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="mod_sum">Lejár:</label>
|
||||
<input type="hidden" name="mod_expire_date" id="mod_expire_date">
|
||||
|
||||
@@ -19,19 +19,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div>
|
||||
<label class="desc" for="mod_payment_type">Fizetés típusa:</label>
|
||||
<div>
|
||||
<select name="mod_payment_type" id="mod_payment_type">
|
||||
{foreach $pt_assoc_array as $pt_array}
|
||||
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mod->get_mod_money_income()->get_mi_payment_type_pt_id()} selected{/if}>
|
||||
{$pt_array.pt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div> *}
|
||||
|
||||
<div>
|
||||
<label class="desc" id="title1" for="mod_date">Dátum:</label>
|
||||
<div><input type="text" name="mod_date" id="mod_date" value="{$mod->get_mod_money_income()->get_mi_date()}" required></div>
|
||||
@@ -56,6 +43,19 @@
|
||||
<div><input type="text" name="mod_sum" id="mod_sum" value="{$mod->get_mod_money_income()->get_mi_sum()}" required></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="desc" for="mod_payment_type">Fizetés típusa:</label>
|
||||
<div>
|
||||
<select name="mod_payment_type" id="mod_payment_type">
|
||||
{foreach $pt_assoc_array as $pt_array}
|
||||
<option value="{$pt_array.pt_id}"{if $pt_array.pt_id == $mod->get_mod_money_income()->get_mi_payment_type_pt_id()} selected{/if}>
|
||||
{$pt_array.pt_name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="mod_sum">Lejár:</label>
|
||||
<div id="expire_date" style="padding-top: 6px;">{$mod->get_mod_expire_date()}</div>
|
||||
|
||||
@@ -95,17 +95,6 @@
|
||||
{/foreach}
|
||||
</div> *}
|
||||
|
||||
<div>
|
||||
<label for="level">Szint:</label>
|
||||
{foreach $l_assoc_array as $l}
|
||||
<div>
|
||||
<input type="checkbox" name="level[]" value="{$l['l_id']}">
|
||||
<span style="position: relative; bottom: 2px;">{$l['l_name']}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_email">E-mail cím:</label>
|
||||
<div><input type="email" name="uk_email" id="uk_email"></div>
|
||||
|
||||
@@ -130,17 +130,6 @@
|
||||
{/foreach}
|
||||
</div> *}
|
||||
|
||||
<div>
|
||||
<label for="level">Szint:</label>
|
||||
{foreach $l_assoc_array as $l}
|
||||
<div>
|
||||
<input type="checkbox" name="level[]" value="{$l['l_id']}"{if user_kid::has_lease_type($user_data.uk_id, $l['l_id'])} checked{/if}>
|
||||
<span style="position: relative; bottom: 3px;">{$l['l_name']}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="desc" for="uk_email">E-mail cím:</label>
|
||||
<div><input type="email" name="uk_email" id="uk_email" value="{$user_data.uk_email}"></div>
|
||||
|
||||
Reference in New Issue
Block a user