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 | |
function __format($campo='',$mascara=''){ | |
//remove qualquer formatação que ainda exista | |
$sLimpo = preg_replace("(/[' '-./ t]/)",'',$campo); | |
// pega o tamanho da string e da mascara | |
$tCampo = strlen($sLimpo); | |
$tMask = strlen($mascara); | |
if ( $tCampo > $tMask ) { | |
$tMaior = $tCampo; |
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 | |
class ArrayToXML | |
{ | |
/** | |
* The main function for converting to an XML document. | |
* Pass in a multi dimensional array and this recrusively loops through and builds up an XML document. | |
* | |
* @param array $data | |
* @param string $rootNodeName - what you want the root node to be - defaultsto data. | |
* @param SimpleXMLElement $xml - should only be used recursively |
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
$(document).ready(function(){ | |
var keys = []; | |
var konami = '38,38,40,40,37,39,37,39,66,65'; | |
$(document) | |
.keydown( | |
function(e) { | |
keys.push( e.keyCode ); | |
if ( keys.toString().indexOf( konami ) >= 0 ){ | |
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 | |
$arquivo = fopen('testes.txt', 'r'); | |
if(!$arquivo){ | |
echo 'Não foi possível abrir o arquivo'; | |
} | |
else{ | |
while(!feof($arquivo)){ | |
$linha = fgets($arquivo); | |
echo rtrim($linha) . "<br>"; |
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 | |
$feed = file_get_contents('http://feeds2.feedburner.com/ThiagoBelem/Blog'); | |
$rss = new SimpleXmlElement($feed); | |
foreach($rss->channel->item as $entrada) { | |
echo '<p><a href="' . $entrada->link . '" title="' . $entrada->title . '">' . $entrada->title . '</a></p>'; | |
} | |
?> |
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 | |
$songs = array( | |
'1' => array('artist'=>'The Smashing Pumpkins', 'songname'=>'Soma'), | |
'2' => array('artist'=>'The Decemberists', 'songname'=>'The Island'), | |
'3' => array('artist'=>'Fleetwood Mac', 'songname' =>'Second-hand News') | |
); | |
function subval_sort($a,$subkey) { | |
foreach($a as $k=>$v) { | |
$b[$k] = strtolower($v[$subkey]); |
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
algoritmo "exercicio5" | |
Var | |
N1,N2: inteiro | |
Media,Produto,Quociente,Diferenca,Resto: real | |
inicio | |
escreval ("escreva dois numeros") | |
leia (N1) | |
leia (N2) | |
Media<-(N1+N2)/2 |
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 | |
class NfesController extends ArmazenamentoAppController{ | |
public $components = array( | |
'Emissor.NFePHP', | |
'Emissor.MailNFePHP', | |
); | |
public function enviaTeste(){ |
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
<!--VIEW--> | |
<div class="notas all"> | |
<?php | |
echo $this->Html->script(array('mask')); | |
echo $this->Html->script(array('jquery.contextMenu')); | |
echo $this->Html->css(array('jquery.contextMenu')); | |
?> | |
<script> | |
function Mask(){ | |
$(".CPF").mask("999.999.999-99"); |
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
<div class="btn-group"> | |
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> | |
Ações | |
<span class="caret"></span> | |
</a> | |
<ul class="dropdown-menu"> | |
<?php if(in_array($nota['Nfe']['infProt_cStat'], $cStat)){ ?> | |
<li class="xml"><a href="/sistema/emissor/notas/consulta/<?php echo $nota['Nfe']['id'] ?>" class="context">Atualizar</a></li> | |
<?php } ?> | |
<li class="danfe"><a href="/sistema/emissor/notas/danfe/<?php echo $nota['Nfe']['id'] ?>" class="context">DANFE</a></li> |
OlderNewer