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
<div class="pag-aconteceu"> | |
<div class="grid_9"> | |
<h1>Aconteceu</h1> | |
</div> | |
<div class="grid_3 busca-aconteceu"> | |
<p>Buscar</p> | |
<form class="formulario"> | |
<div class="campo grid_2 alpha omega"> |
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
/*@var $this myCustomInputFilter extends InputFilter*/ | |
/* Cnpj */ | |
$this->add([ | |
'type' => 'Zend\InputFilter\InputFilter', | |
'vCnpj' => [ | |
'name' => 'vCnpj', | |
'required' => true, | |
], | |
]); |
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 | |
$ch = curl_init('https://www.squidfacil.com.br/uploads/produtos/fotos/grande/7115-acnotebook-cooler-slim-duplo-1354105751.jpg'); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); | |
$raw = curl_exec($ch); | |
/* Debugs */ | |
echo '<pre>'; |
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 User\Form; | |
use Doctrine\ORM\EntityManager; | |
use DoctrineModule\Stdlib\Hydrator\DoctrineObject as DoctrineHydrator; | |
use User\Entity\User; | |
use Zend\Form\Form; | |
use Zend\InputFilter\InputFilterProviderInterface; |
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
function faboiola($x, $y) { | |
$n = count($x); | |
$soma_x = array_sum($x); | |
$soma_y = array_sum($y); | |
$soma_n_x = 0; $xy_sum = 0; | |
for($i = 0; $i < $n; $i++) { | |
$xy_sum+=($x[$i]*$y[$i]); $soma_n_x+=($x[$i]*$x[$i]); | |
} | |
$m = (($n * $xy_sum) - ($soma_x * $soma_y)) / (($n * $soma_n_x) - ($soma_x * $soma_x)); $b = ($soma_y - ($m * $soma_x)) / $n; | |
return array("m"=>$m, "b"=>$b); |
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 | |
/* Funções que variam de projeto para projeto */ | |
class Site extends CNucleo { | |
public $template = 'template_padrao'; | |
public function control_home() { | |
$txthome = $this->listar('tbl_txthome', '', 1, 1)->registros; |
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 | |
//Este bloco vai no controller | |
public function imagemAleatoria() | |
{ | |
$imagens = array( | |
array('url' => 'http://link1.com', 'imagem' => 'caminho/da/imagem/imagem1.jpg'), | |
array('url' => 'http://link2.com', 'imagem' => 'caminho/da/imagem/imagem2.jpg'), | |
array('url' => 'http://link3.com', 'imagem' => 'caminho/da/imagem/imagem3.jpg'), | |
array('url' => 'http://link4.com', 'imagem' => 'caminho/da/imagem/imagem4.jpg'), |
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
$(document).ready(function(){ | |
// Quando descrição tem muito caracter | |
$(".compare .atributo").each(function(){ | |
if ( $(this).html().length > 30 ){ | |
$(this).addClass("char-G"); | |
} | |
}); |
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
public function control_quem_somos() { | |
$sobre = $this->listar('tbl_sobre', '', 1, 4)->registros; | |
$this->renderizar('quem-somos', array( | |
'sobre' => $sobre, | |
)); | |
} | |
public function control_about_us(){ | |
return $this->control_quem_somos(); | |
} |
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 | |
public function control_eventos_anteriores($req, $parametro) { | |
$tabela = 'tbl_eventos'; | |
$where = ' where ativo = "Sim" and DATE(data) < DATE(NOW()) '; | |
$order = ' data DESC'; | |
$urlPaginacao = $this->url(array('eventos-anterioes', 'pagina')); | |
$qtdExibir = 6; | |
$pagina = 1; //Página padrão caso não seja definida | |
switch ($req) { |
OlderNewer