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 diff ($inicio, $fim, $tipo){ | |
| if (!$fim || $fim < $inicio) { | |
| return "A data final deve ser maior que a inicial."; | |
| } elseif ($inicio < "1970-01-01") { | |
| return "A data final deve ser maior que 01/01/1970."; | |
| } else { | |
| if (strlen($inicio) > 10) { | |
| $time_inicio = mktime(substr($inicio,-8,2),substr($inicio,-5,2),substr($inicio,-2), substr($inicio,5,2), substr($inicio,8,2), substr($inicio,0,4)); | |
| } else { |
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
| public function pesquisacheques(){ | |
| $this->LancamentoConta->Cheque->recursive = 2; | |
| $this->request->data = $this->request->query; | |
| unset($this->request->data['submit']); | |
| $arraycerta = array(); | |
| $pi = false; | |
| foreach($this->request->data as $key => $value){ | |
| if($key == 'valor_de' || $key == 'valor_ate'){ | |
| if(!$pi){ | |
| if(!empty($value)){ |
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 cep($cep) { | |
| $this->autoRender=false; | |
| $resultado = file_get_contents('http://republicavirtual.com.br/web_cep.php?cep='.urlencode($cep).'&formato=javascript'); | |
| if(!$resultado){ | |
| $resultado = "&resultado=0&resultado_txt=erro+ao+buscar+cep"; | |
| } | |
| return $resultado; | |
| } |
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 admin_cadastrar() { | |
| $this->set('title_for_layout', 'Novo Evento'); | |
| if ($this->request->is('post')) { | |
| $this->Evento->create(); | |
| $destino = WWW_ROOT.'files/evento/fotos/'.$this->Evento->id.'/'; | |
| $arquivo = $destino.$this->request->data['Evento']['fotos']['name']; | |
| $ext = strtolower(end(explode('.',$arquivo))); |
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
| SELECT * FROM `produtos` WHERE NOT EXISTS(SELECT id FROM almoxarifado_produtos WHERE produto_id = produtos.id); |
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
| insert into dues_storage (f1, f2, f3, cd) | |
| select f1, f2, f3, current_date() from dues where id = 5; |
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
| insert into almoxarifado_produtos (produto_id, almoxarifado_id, quantidade, created, modified, group_id, user_id) | |
| SELECT id, almoxarifado_id, 0, '2013-10-04 10:00:00', '2013-10-04 10:00:00', group_id, user_id FROM `produtos` WHERE NOT EXISTS(SELECT id FROM almoxarifado_produtos WHERE produto_id = produtos.id); |
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
| DELETE n1 FROM lancamento_contas n1, lancamento_contas n2 WHERE n1.id > n2.id AND n1.nroduplicata = n2.nroduplicata AND n1.group_id = n2.group_id |
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
| UPDATE parametros SET `natoppadrao` = (SELECT id FROM cfop WHERE cfop.cfop = (SELECT tiponotas.cfop FROM tiponotas WHERE tiponotas.id = parametros.natoppadrao) AND cfop.group_id = parametros.group_id) |
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
| <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
| <script> | |
| $(function(){ | |
| $.get('https://api.mercadolibre.com/sites/MLB/categories', function(categories){ | |
| for (var i in categories) { | |
| $('#categories').append('<option value="'+categories[i].id+'">'+categories[i].name+'</option>'); | |
| } | |
| }); | |
| }); |