Skip to content

Instantly share code, notes, and snippets.

View pipethedev's full-sized avatar
🎯
Focusing

Ileri⚡️ pipethedev

🎯
Focusing
View GitHub Profile
<?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']);
<?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']);
<?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']);
<?php
class Customer{
private $db;
public function __construct(){
$this->db = new Database;
}
public function addCustomer($data){
<?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>
<?PHP
class Node {
public $data;
public $next;
public $br = '<br>';
public function __construct($data, $next = null){
$this->data = $data;
$this->next = $next;
}
# -*- coding: utf-8 -*-
class Node:
def __init__(self, forward=None):
self.data = data
self.forward = forward
<?PHP
namespace App\Controllers ;
use Psr\Container\ContainerInterface;
abstract class Controller{
protected $c;
<?PHP
use App\Controllers\ApiController;
$app->group('', function(){
$this->get('/getAll', ApiController::class . ':getUser');
$this->get('/getAll/{id}', ApiController::class . ':getSingle');
<?PHP
$app = new \Slim\App([
'settings' => [
'displayErrorDetails' => true,
]
]);