updates and restart camps
This commit is contained in:
@@ -10,6 +10,7 @@ class money_expense {
|
||||
private $mox_sum;
|
||||
private $mox_moxc_id = null;
|
||||
private $mox_moxc = null;
|
||||
private $mox_payment_type;
|
||||
private $mox_deleted;
|
||||
|
||||
|
||||
@@ -45,6 +46,9 @@ class money_expense {
|
||||
$this->mox_coach = $_item;
|
||||
}
|
||||
|
||||
public function set_mox_payment_type_pt_id($_payment_type) {
|
||||
$this->mox_payment_type = $_payment_type;
|
||||
}
|
||||
|
||||
public function set_mox_deleted($_item) {
|
||||
$this->mox_deleted = $_item;
|
||||
@@ -54,6 +58,10 @@ class money_expense {
|
||||
return $this->mox_id;
|
||||
}
|
||||
|
||||
public function get_mox_payment_type_pt_id() {
|
||||
return $this->mox_payment_type;
|
||||
}
|
||||
|
||||
public function get_mox_user_coach_ua_id() {
|
||||
return $this->mox_user_coach_ua_id;
|
||||
}
|
||||
@@ -64,7 +72,7 @@ class money_expense {
|
||||
|
||||
public function get_mox_date_day() {
|
||||
$day = date("d", strtotime($this->mox_date));
|
||||
if (substr($day, 0, 1) == '0') return substr($day, 1, 1);
|
||||
if (substr($day, 0, 1) == '0') return substr($day, 1, 1);
|
||||
return date("d", strtotime($this->mox_date));
|
||||
}
|
||||
|
||||
@@ -125,11 +133,17 @@ class money_expense {
|
||||
$new_user->set_user_data_by_id($value);
|
||||
$this->set_mox_coach($new_user);
|
||||
}
|
||||
|
||||
if ($field == "mox_payment_type") {
|
||||
$new_pt = new payment_type();
|
||||
$new_pt->set_pt_data_by_id($value);
|
||||
$this->set_mox_payment_type_pt_id($new_pt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function create_money_expense($_name, $_date, $_item, $_sum, $_moxc_id) {
|
||||
public static function create_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_pt) {
|
||||
global $sql;
|
||||
|
||||
return $sql->insert_into('money_expense', array(
|
||||
@@ -137,19 +151,21 @@ class money_expense {
|
||||
'mox_date' => $_date,
|
||||
'mox_item' => $_item,
|
||||
'mox_sum' => $_sum,
|
||||
'mox_payment_type_pt_id' => $_pt,
|
||||
'mox_money_expense_category_moxc_id' => $_moxc_id
|
||||
));
|
||||
}
|
||||
|
||||
public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id) {
|
||||
public static function update_money_expense($_name, $_date, $_item, $_sum, $_moxc_id, $_id, $_pt) {
|
||||
global $sql;
|
||||
|
||||
$sql->update_table('money_expense',
|
||||
$sql->update_table('money_expense',
|
||||
array(
|
||||
'mox_user_coach_ua_id' => (empty($_name)?'null':self::name_to_ua_id($_name)),
|
||||
'mox_date' => $_date,
|
||||
'mox_item' => $_item,
|
||||
'mox_sum' => $_sum,
|
||||
'mox_payment_type_pt_id' => $_pt,
|
||||
'mox_money_expense_category_moxc_id' => $_moxc_id
|
||||
),
|
||||
array(
|
||||
@@ -162,4 +178,4 @@ class money_expense {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user