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 | |
/** | |
* | |
* Classe para Paginação de Resultado | |
* @author David | |
* | |
*/ | |
class Paginacao{ | |
private $pagina; | |
private $total; |
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 | |
/* | |
Exemplo de inserir as informações do carrinho no banco de dados | |
*/ | |
//Inicia a Sessão | |
session_start(); | |
//Include de conexao | |
require_once('config/conexao.php'); |
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 ControllerFeedGoogleSitemap extends Controller { | |
//Adicinado as URLs | |
private $urlFriendly = array( | |
'common/home' => 'home', | |
'checkout/cart' => 'carrinho', | |
'account/register' => 'cadastre-se', | |
'account/wishlist' => 'lista-de-desejo', | |
'checkout/checkout' => 'checkout', | |
'account/logout' => 'sair', |
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 | |
/*********************************************************** | |
* Interface que defini ações de um Banco de dados | |
* ********************************************************* | |
*/ | |
Interface DataBase{ | |
public function open(); | |
public function execute($query); | |
public function close(); |
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 FretePagSeguro{ | |
private $cepOrigem; | |
private $cepDestino; | |
private $peso; | |
private $preco; | |
private $url = 'https://pagseguro.uol.com.br/desenvolvedor/simulador_de_frete_calcular.jhtml?postalCodeFrom=%s&weight=%s&value=%s&postalCodeTo=%s'; | |
private $sedex; | |
private $pac; |
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 | |
//Arra | |
$arr = array( | |
array(1256, 4576, 12566), | |
array('dwdwdw', 'ggggggggg', 'deefefefef') | |
); | |
//Cria uma função para callback | |
function associateMerge($arrayOne, $arrayTwo){ |
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 | |
$pdo = new PDO("mysql:host=localhost;dbname=vendas", "root", ""); | |
$stmt = $pdo->prepare("SELECT * FROM produtos"); | |
$stmt->execute(); | |
$rows = $stmt->fetchAll(PDO:FETCH_ASSOC); | |
$total = 0; | |
foreach($rows as $produto){ |
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 | |
//atribur a session a variavel carrinho | |
$cart = $_SESSION['carrinho']; | |
//seleciona apenas o IDS do carrinho | |
$ids = array_keys($cart); | |
//Seleciona os produtos com os ids | |
$query = mysql_query("SELECT * FROM produtos WHERE id IN(".implode(',', $ids).")"); | |
//Inicia a variavel com 0 | |
$total = 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 | |
session_start(); | |
if(!isset($_SESSION['carrinho'])){ | |
$_SESSION['carrinho'] = array(); | |
} | |
//adiciona produto | |
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
<!doctype html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<header></header> | |
OlderNewer