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 | |
$autoload = require_once(__DIR__ . '/vendor/autoload.php'); | |
require_once __DIR__ . '/vendor/stavarengo/php-sigep/exemplos/bootstrap-exemplos.php'; | |
$params = include __DIR__ . '/vendor/stavarengo/php-sigep/exemplos/helper-criar-pre-lista.php'; | |
// Logo da empresa remetente | |
$logoFile = __DIR__ . '/vendor/stavarengo/php-sigep/exemplos/logo-etiqueta.png'; |
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 | |
function get_user_id_custom_field($field, $value){ | |
global $wpdb; | |
$prepare = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = %s ", $field, $value); | |
$row = $wpdb->get_row($prepare); | |
return isset($row->user_id) ? $row->user_id : 0; | |
} |
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 | |
namespace Transactional; | |
abstract class Notification | |
{ | |
protected $customer; | |
protected $order | |
public function __construct($customer, $order) |
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 | |
session_start(); | |
require_once "functions/product.php"; | |
require_once "functions/cart.php"; | |
require_once "functions/order.php"; | |
$pdoConnection = require_once "connection.php"; | |
//Simular os dados vindo do formulário do cliente | |
$customer = array(); | |
$customer['name'] = 'Miguel'; |
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
jQuery(function(){ | |
var items = []; | |
var key = 0; | |
var nav = jQuery(".itens-topo a"); | |
nav.each(function(){ | |
var target = jQuery(this).attr('href'); | |
var section = jQuery(target); | |
if(section.length) { |
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 ImageDOM | |
{ | |
private $content; | |
private $images; | |
private $src; | |
private $alt; | |
private $style; | |
private $strip; |
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 | |
$content = 'jbajdbfkjsd <img src="endereco/imagem1.jpg" /> | |
<img src="endereco/imagem2.jpg" /> | |
<img src="endereco/imagem3.jpg" /> | |
<img src="endereco/imagem4.jpg"/> | |
'; | |
preg_match_all('/<img[^>]*>/i',$content, $matches); |
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 | |
$content = 'jbajdbfkjsd <img src="endereco/imagem1.jpg" /> | |
<img src="endereco/imagem2.jpg" /> | |
<img src="endereco/imagem3.jpg" /> | |
<img src="endereco/imagem4.jpg"/> | |
'; | |
preg_match_all('/src="([^"]*)"/mis',$content, $matches); |
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
//Pega todos os elementos q estão com .items | |
let links = document.querySelectorAll('.items'); | |
//Pecorre esse elemento | |
links.forEach(link => { | |
//Atribui ação a esse elemento | |
link.addEventListener('click', e => { | |
e.preventDefault(); | |
//pega todos os nomes da classe desse elemento | |
let names = link.className.split(' '); |
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 | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class Post extends Model | |
{ | |