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
//Function que cria o Dialog | |
function inputDialog(textop, callback){ | |
apprise(textop, {'input': true,'textOk':'Enviar'}, function(r) { | |
callback(r); | |
}); | |
} | |
//Plugin necessário (junto com o jQuery) | |
function apprise(string,args,callback) | |
{var default_args={'confirm':false,'verify':false,'input':false,'animate':false,'textOk':'Ok','textCancel':'Cancel','textYes':'Yes','textNo':'No'} |
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
sudo apt-get install apache2 apache2-mpm-prefork apache2.2-bin apache2.2-common libaio1 libapache2-mod-php5 libaprutil1-dbd-sqlite3 libaprutil1-ldap libc-client2007e libdbd-mysql-perl libdbi-perl libhtml-template-perl libmcrypt4 libming1 libmysqlclient18 libnet-daemon-perl libplrpc-perl librecode0 libterm-readkey-perl libtidy-0.99-0 mlock mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 php-pear php5 php5-cli php5-common php5-curl php5-gd php5-imagick php5-imap php5-intl php5-mcrypt php5-memcache php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xsl pslib1 |
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
function getEndereco(cep,i) { | |
if(cep !== ""){ | |
$.getScript("https://www.nfservice.com.br/sistema/vendas/clientefornecedor/cep/"+cep, function(){ | |
if (resultadoCEP["resultado"]) { | |
$("#Endereco"+i+"Logradouro").val(unescape(resultadoCEP["tipo_logradouro"]) + " " + unescape(resultadoCEP["logradouro"])); | |
$("#Endereco"+i+"Bairro").val(unescape(resultadoCEP["bairro"])); | |
$("#Endereco"+i+"Cidade").val(unescape(resultadoCEP["cidade"])); | |
var arg =unescape(resultadoCEP["uf"]); | |
$("#Endereco"+i+"Uf > option").each(function(){ | |
if($(this).text()==arg) $(this).parent("select").val($(this).val()) |
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
$.ajax({ | |
// url para o arquivo json.php | |
url : "json.php", | |
// dataType json | |
dataType : "json", | |
// função para de sucesso | |
success : function(data){ | |
// vamos gerar um html e guardar nesta variável | |
var 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
<?php echo $this->Form->create('Veiculo'); ?> | |
<fieldset> | |
<legend><?php echo __('Novo Veículo'); ?></legend> | |
<?php | |
echo $this->Form->input('user_id', array('type' => 'hidden', 'value' => $this->Session->read('Auth.User.id'))); | |
echo $this->Form->input('group_id', array('type' => 'hidden', 'value' => $this->Session->read('choosed'))); | |
echo $this->Form->input('veiculo', array('size' => '150', 'label' => 'Veículo')); | |
echo $this->Form->input('placa'); | |
echo $this->Form->input('rntc', array('size' => '20', 'label' => 'RNTC')); | |
echo $this->Form->input('antt', array('size' => '20', 'label' => 'Código ANTT')); |
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
You need DECIMAL(4, 2) by the looks of things. DECIMAL(2, 2) only allows a range of -0.99 to 0.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
find . -name *.* -type f | xargs sed -i s/"extends ppController"/"extends VendasAppController"/ * |
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 | |
public function add() { | |
if ($this->request->is('post')) { | |
$this->Tabela->create(); | |
if ($this->Tabela->save($this->request->data)) { | |
$this->Session->setFlash(__('A Tabela foi cadastrada.')); | |
$this->redirect(array('action' => 'index')); | |
} else { | |
$this->Session->setFlash(__('A Tabela não pôde ser cadastrada. Favor tentar novamente.')); | |
} |
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 | |
$log = $this->Model->getDataSource()->getLog(false, false); | |
debug($log); | |
?> |
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
datahora = '2013-01-02 15:12:20'; | |
datahora = datahora.split(' '); | |
data = datahora[0] | |
hora = datahora[1] | |
data = data.split('-').reverse().join('/'); | |
datahora = data+' '+hora; |