This file contains 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 OrderProcessor | |
{ | |
public function processOrder($orderId, $items, $customerEmail) | |
{ | |
// Check if product exists | |
foreach ($items as $item) { | |
$sql = "SELECT quantity FROM products WHERE id = " . $item['id']; | |
$result = mysqli_query($GLOBALS['db_connection'], $sql); |
This file contains 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 UserManager | |
{ | |
private $db; | |
public function __construct($db) | |
{ | |
$this->db = $db; | |
} |
This file contains 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 | |
/** | |
* Custom banner handler for cache | |
*/ | |
add_action('init', 'adrotate_request_handler'); | |
function adrotate_request_handler() { | |
if ( isset($_GET['adrotate_action']) && $_GET['adrotate_action'] == 'show' ) { | |
// You can use adrotate_group or adrotate_ad | |
// First param — ad group ID |