This file contains hidden or 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 | |
App::uses('Product', 'Model'); | |
/** | |
* Product Test Case | |
* | |
*/ | |
class ProductTest extends CakeTestCase { | |
/** |
This file contains hidden or 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 | |
App::uses('AppModel', 'Model'); | |
/** | |
* Group Model | |
* | |
* @property User $User | |
*/ | |
class Group extends AppModel { | |
/** |
This file contains hidden or 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 | |
// Conecta ao MySQL usando MySQLi | |
$MySQLi = new mysqli("localhost", "root", "Digue2013", "alternativa"); | |
// Recebe os dados do formulário | |
# $chNFe = $_GET['chNFe']; // Não é usado? | |
$identidade = $_POST['Id']; | |
$COD_BARRAS = $_POST['COD_BARRAS']; | |
$DT_LANCAMENTO = $_POST['DT_LANCAMENTO']; | |
$DT_DEVOLUCAO = $_POST['DT_DEVOLUCAO'] ; |
This file contains hidden or 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
#!/bin/sh | |
USER="root"; | |
PASS="pass"; | |
# Run a mysql command as root | |
mysqlcommand() { | |
echo "$@"; | |
mysql -u"$USER" -p"$PASS" -e "$@"; | |
} |
This file contains hidden or 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 | |
// Conecta ao MySQL usando MySQLi | |
$MySQLi = new mysqli("localhost", "user", "password", "database"); | |
// Recebe os dados do formulário | |
# $chNFe = $_GET['chNFe']; // Não é usado? | |
$identidade = $_POST['Id']; | |
$COD_BARRAS = $_POST['COD_BARRAS']; | |
$DT_LANCAMENTO = $_POST['DT_LANCAMENTO']; | |
$DT_DEVOLUCAO = $_POST['DT_DEVOLUCAO'] ; |
This file contains hidden or 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 | |
// Conecta ao MySQL usando MySQLi | |
$MySQLi = new mysqli("localhost", "user", "password", "database"); | |
// Recebe os dados do formulário | |
$chNFe = $_GET['chNFe']; | |
$identidade = $_POST['Id']; | |
$COD_BARRAS = $_POST['COD_BARRAS']; | |
$DT_LANCAMENTO = $_POST['DT_LANCAMENTO']; | |
$DT_DEVOLUCAO = $_POST['DT_DEVOLUCAO'] ; |
This file contains hidden or 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 | |
// Conecta ao MySQL usando MySQLi | |
$MySQLi = new mysqli("localhost", "user", "password", "database"); | |
// Recebe os dados do formulário | |
$chNFe = $_GET['chNFe']; | |
$identidade = $_POST['Id']; | |
$COD_BARRAS = $_POST['COD_BARRAS']; | |
$DT_LANCAMENTO = $_POST['DT_LANCAMENTO']; | |
$DT_DEVOLUCAO = $_POST['DT_DEVOLUCAO'] ; |
This file contains hidden or 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 | |
$params = array( | |
'conditions' => array( | |
'Noticia.active' => true | |
) | |
); | |
$categoria = $this->request->data['Categoria']['id']; | |
if (!empty($categoria)) { |
This file contains hidden or 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 | |
/** | |
* Aceita extensões .html na URL | |
* | |
* Vide: http://book.cakephp.org/2.0/en/development/routing.html#file-extensions | |
*/ | |
Router::parseExtensions('html'); | |
This file contains hidden or 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
<h1>Produtos mais recentes</h1> | |
<?php foreach ($products as $product): ?> | |
<article id="product-<?php echo $product['Product']['id'] ?>"> | |
<h2><?php echo $product['Product']['name'] ?></h2> | |
<p><?php echo $product['Product']['description'] ?></p> | |
<p>Por apenas <?php echo $this->Number->currency($product['Product']['price'], 'BRL') ?>!</p> | |
</article> | |
<?php endforeach ?> |