Skip to content

Instantly share code, notes, and snippets.

@JacquesInnocent
Created September 15, 2017 13:07
Show Gist options
  • Save JacquesInnocent/03a0e94a61450e6405217077f850aaa9 to your computer and use it in GitHub Desktop.
Save JacquesInnocent/03a0e94a61450e6405217077f850aaa9 to your computer and use it in GitHub Desktop.
Customer transaction details and identity.
<?php
class BankAccount {
private $balance = 100000;
public function DisplayBalance () {
return 'Balance:'.$this->balance;
}
public function Deposit ($amount){
$this->balance + $amount;
echo 'Your new balance is: ';$this->balance;
}
public function Withdraw ($amount)
{
if (($this->balance) < $amount) {
echo 'Transaction Declined';
} else {
$this->balance = $this->balance - $amount;
}
$user = new BankAccount;
$user->Withdraw(10000);
echo $user->DisplayBalance();
$user->Deposit(20000);
echo $user->DisplayBalance();
}}
class UserIP {
public function UserIP() {
$ip_address = $_SERVER['REMOTE_ADDR'];
echo 'User IP Address is: ';$ip_address;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment