This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Transaction{ | |
| private $db; | |
| public function __construct(){ | |
| $this->db = new Database; | |
| } | |
| public function addTransaction($data){ | |
| $this->db->query('INSERT INTO transactions (id, customer_id, product, amount, currency, status) VALUES (:id, :customer_id, :product, :amount, :currency, :status)'); | |
| //Binding | |
| $this->db->bind(':id', $data['id']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Transaction{ | |
| private $db; | |
| public function __construct(){ | |
| $this->db = new Database; | |
| } | |
| public function addTransaction($data){ | |
| $this->db->query('INSERT INTO transactions (id, customer_id, product, amount, currency, status) VALUES (:id, :customer_id, :product, :amount, :currency, :status)'); | |
| //Binding | |
| $this->db->bind(':id', $data['id']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Transaction{ | |
| private $db; | |
| public function __construct(){ | |
| $this->db = new Database; | |
| } | |
| public function addTransaction($data){ | |
| $this->db->query('INSERT INTO transactions (id, customer_id, product, amount, currency, status) VALUES (:id, :customer_id, :product, :amount, :currency, :status)'); | |
| //Binding | |
| $this->db->bind(':id', $data['id']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Customer{ | |
| private $db; | |
| public function __construct(){ | |
| $this->db = new Database; | |
| } | |
| public function addCustomer($data){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| require_once __DIR__ .'/rb.php'; | |
| //Using RB ORM | |
| R::setup('mysql:host=localhost;dbname=payment', 'root', ''); | |
| $customers = R::getAll("SELECT * FROM transaction "); | |
| ?> | |
| <table class="table table-striped"> | |
| <thead> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| class Node { | |
| public $data; | |
| public $next; | |
| public $br = '<br>'; | |
| public function __construct($data, $next = null){ | |
| $this->data = $data; | |
| $this->next = $next; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| class Node: | |
| def __init__(self, forward=None): | |
| self.data = data | |
| self.forward = forward |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| namespace App\Controllers ; | |
| use Psr\Container\ContainerInterface; | |
| abstract class Controller{ | |
| protected $c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| use App\Controllers\ApiController; | |
| $app->group('', function(){ | |
| $this->get('/getAll', ApiController::class . ':getUser'); | |
| $this->get('/getAll/{id}', ApiController::class . ':getSingle'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| $app = new \Slim\App([ | |
| 'settings' => [ | |
| 'displayErrorDetails' => true, | |
| ] | |
| ]); |