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 | |
if($_SERVER['REQUEST_METHOD'] == 'POST'){ | |
//Instancia a classe PDO | |
$pdo = new PDO("mysql:host=localhost;dbname=exemplo", "root", ""); | |
//Recupera o nome da empresa | |
$company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_ENCODED); |
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 ContaBancaria{ | |
private $saldo; | |
public function __construct($saldo){ | |
$this->saldo = $saldo; | |
} |
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 | |
//Define a interface, para usar melhor o polimorfismo | |
interface Shipping{ | |
public function calculate(); | |
} | |
//Cria uma classe abstrata, vai define alguns valores padrões | |
abstract class AbstractShipping implements Shipping{ | |
protected $weight; |
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(){ | |
jQuery('#ac-ts-1').click(function(){ | |
var accordion = jQuery('#accordion-ts'); | |
if(accordion.hasClass('accordi-off')){ | |
accordion.removeClass('accordi-off').addClass("accordi-on"); | |
}else{ | |
accordion.removeClass('accordi-on').addClass("accordi-off"); | |
} | |
}); | |
}); |
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(){ | |
accordionEffect("#ac-ts-1", "#accordi-on1"); | |
accordionEffect("#ac-ts-2", "#accordi-on2"); | |
accordionEffect(".ac-ts-3", "#accordi-on3", "ts3-"); | |
}); | |
/** | |
Define uma função abstrair o efeito accordion | |
@var bclick = Elemento que receberá o click | |
@var target = Elemento que irá sofrer o efeito |
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 | |
$destino = 'webmasters@site.com.br'; | |
$assunto = 'Formulario de contato'; | |
$cabecalho = 'From: email@seusite.com.br'."\n\r"; | |
$cabecalho = 'Reply-to: '.$_POST['email']; | |
$mensagem = 'Forma a mensagem com os dados vindo do formularui'; |
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 | |
$date = date("d/m/Y h:i"); | |
$ip = $_SERVER["REMOTE_ADDR"]; | |
$navegador = $_SERVER['HTTP_USER_AGENT']; | |
$nome = $_POST["nome"]; | |
$email = $_POST["email"]; | |
$telefone = $_POST["telefone"]; | |
$mensagem = $_POST["mensagem"]; |
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(); |
OlderNewer