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
<table class="with-details" id="financeiro"></table> | |
<table class="with-details" id="estoque"></table> | |
<table class="with-details" id="blablabla"></table> | |
formatFinanceiro(d) { return 'html_retorno'; } | |
formatEstoque(d) { return 'html_retorno'; } | |
formatBlablabla(d) { return 'html_retorno'; } | |
$('table.with-details tbody').on('click', 'tr.more-details', function () { |
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
// appController | |
public function beforeFilter() { | |
/** Auth */ | |
$this->Auth->unauthorizedRedirect = false; | |
$this->Auth->authError = "Sem permissão para acessar."; | |
if ($this->_isAdminMode()) { | |
$this->layout = 'admin'; | |
AuthComponent::$sessionKey = 'Auth.Admin'; | |
$this->Auth->loginAction = array('admin'=>true, 'controller' => 'usuarios', 'action' => 'login'); |
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() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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('AppController', 'Controller'); | |
class FotosController extends AppController { | |
public $base_url = array('admin'=>true, 'controller' => 'fotos', 'action' => 'admin_index'); | |
var $component_name = 'Foto'; | |
public function beforeFilter() { | |
$this->set('title_for_layout', plural($this->component_name)); | |
$this->base_url['action'] = $this->request->params['action']; |
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="row"> | |
<div class="col-md-12"> | |
<div class="panel mb10"> | |
<div class="panel-heading"> | |
<div class="panel-title"> | |
<i class="fa fa-picture-o"></i> <?PHP echo $title_for_layout . ': ' . $empresaLogada['Empresa']['nome_fantasia']; ?> | |
</div> | |
</div> | |
<div class="panel-body"> | |
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 MeuController extends AppController | |
{ | |
public function busca($txt){ | |
$resultados = $this->Model->find('all',array( | |
'fields'=>array('*',"(MATCH(Model.title,Model.content,Model.campo_adicional) AGAINST ('{$txt}')) as relevancia"), | |
'conditions'=>array('relevancia > 0'), | |
'order'=>'relevancia DESC', | |
)); |
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 NoticiasController extends AppController | |
{ | |
public function read() | |
{ | |
$slug = $this->request->param('noticia'); //Pega o slug da notícia vindo do router... | |
$noticia = $this->Noticia->findBySlug($slug); //Pega a notícia baseada no slug | |
$this->set(compact('noticia')); //Envia pra view | |
} |
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
angular.module('App').directive('gallery',function(){ | |
return { | |
templateUrl:'/admin/angular/templates/gallery.html', | |
replace:true, | |
scope:{ | |
gallery:'=' | |
}, | |
controller:['$scope','$http',function(scope,http){ | |
scope.button = 'Selecione uma imagem'; |
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 | |
namespace App\Model\Table\Extra; | |
use Cake\ORM\Query | |
trait DatesTrait{ | |
public function findSeteDias(Query $query,array $options){ | |
$alias = $this->alias(); | |
$query->where([ | |
"{$alias}.data >"=>date('Y-m-d',strtotime("-7 days")), |
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
// NO CAKE 2 | |
// controller\component\searchComponent.php | |
class SearchComponent extends Component { | |
/* | |
* @usage Verify exist parameters to filter | |
* @return array | |
*/ | |
public function getCondition() { | |
NewerOlder