Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function SendMoneyFromUser($UserId, $Amount, $Balance, $Val)
- {
- $AmountTo = $Amount - ($Amount * $this->config->item('PercentSendMoney'));
- //Снимаем с юзера сумму
- $this->db->where("Uid", $this->session->UserId);
- $this->db->set($Balance, $Balance . " - " . $Amount, FALSE);
- $this->db->update("db_users");
- //Добавляем юзеру сумму за вычетом комиссии
- $this->db->where("Uid", $UserId);
- $this->db->set($Balance, $Balance . " + " . $AmountTo, FALSE);
- $this->db->update("db_users");
- //Заносим все в историю
- $History = array(
- 'UserId' => $UserId,
- 'DateAdd' => date("d.m.Y H:i", time()),
- 'Text' => "Получен перевод в размере " . $AmountTo . " " . $Val . " от пользователя #" . $this->session->UserId
- );
- $this->db->insert('db_history', $History);
- $History = array(
- 'UserId' => $this->session->UserId,
- 'DateAdd' => date("d.m.Y H:i", time()),
- 'Text' => "Отправлен перевод в размере " . $Amount . " " . $Val . " пользователю #" . $UserId
- );
- if($this->db->insert('db_history', $History)) return TRUE;
- return FALSE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement