Skip to content

Instantly share code, notes, and snippets.

View dmsysop's full-sized avatar

Douglas M. dmsysop

  • Gazin Tech
  • Umuarama / Maringá - PR
  • X @dmsysop
View GitHub Profile
/* Set the defaults for DataTables initialisation */
jQuery.extend(true, jQuery.fn.dataTable.defaults, {
"sDom": '<"dt-panelmenu clearfix"lfr>t<"dt-panelfooter clearfix"ip>', //sem TableTools
// "sDom": 'T<"dt-panelmenu clearfix"lfr>t<"dt-panelfooter clearfix"ip>', //com TableTools
"sPaginationType": "bootstrap",
"oLanguage": {
"sEmptyTable": "Nenhum registro encontrado",
"sInfo": "Exibindo _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty": "Exibindo 0 até 0 de 0 registros",
if (!isset($this->data[$this->alias]['slug']) || empty($this->data[$this->alias]['slug'])) {
$this->data[$this->alias]['slug'] = Inflector::slug(strtolower($this->removeAcentos($this->data[$this->alias]['nome'])), '-');
} else {
$this->data[$this->alias]['slug'] = Inflector::slug(strtolower($this->removeAcentos($this->data[$this->alias]['slug'])), '-');
}
$conditions = array(
'Pagina.menu' => 1,
'Pagina.habilitar' => 1,
'Pagina.pai' => null,
'Pagina.slug NOT IN ' => $slug
);
$fields = array('titulo', 'slug', 'preview');
$order = 'Pagina.lft ASC';
public function beforeSave($options = array()) {
if (!isset($this->data[$this->alias]['soft_delete'])) {
$this->data[$this->alias]['soft_delete'] = 0;
} else {
//na duvida, faz um exit(debug($this->data));
$this->data[$this->alias]['soft_delete'] = $this->data[$this->alias]['valor_que_enviar'];
}
return true;
/* BUSCA PAGINATE */
$this->Profissional->recursive = -1;
$joins = array();
$joins[] = array(
'table' => 'profissionais_subcategorias',
'alias' => 'ProfissionaisSubcategorias',
'type' => 'INNER',
'foreignKey' => false,
'conditions' => array(
'ProfissionaisSubcategorias.profissional_id = Profissional.id'
echo $this->Form->input('cnpj', array(
'between' => '<div class="col-sm-3">',
'class' => 'gui-input',
'id' => 'cnpj',
'label' => 'CNPJ')
);
echo $this->Html->scriptBlock("
//No Controller
$conditions = array('AnunciantesCategoria.anunciante_id' => $id);
$fields = array('AnunciantesCategoria.id');
$AnunciantesCategoriaId = $this->AnunciantesCategoria->find('all', compact('conditions', 'fields'));
foreach ($AnunciantesCategoriaId as $k => $v) {
$selecionadas[] = $v['AnunciantesCategoria']['id'];
}
$fields = array('Categoria.id', 'Categoria.nome');
public function AdminFileInputNew($position = null, $input = null, $field = null) {
$position = !isset($position) ? 0 : $position;
$field = !isset($field) ? 'arquivo' : $field;
$input = !isset($input) ? 'Imagem' : $input;
$fileInput = '
<script type="text/javascript" src="' . $this->params->base . '/media/js/fileinput.js"></script>
<div class="form-group">
<label class="col-sm-2 control-label">' . ucfirst($input) . ':</label>
import { Directive, HostListener, Input, ElementRef, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
@Directive({
selector: "[cep]", //selector de atributo
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => CepDirective),
multi: true
}
{
"clinicas": [
{
"Clinica": {
"id": "13",
"nome": "Instituto Maring\u00e1 de Imagem ",
"slug": "instituto-maringa-de-imagem",
"arquivo": "logo site 220x220.png",
"descricao": " \r\n ",
"website": "http:\/\/www.institutoimagem.med.br\/",