Skip to content

Instantly share code, notes, and snippets.

View juareznjunior's full-sized avatar

Juarez Gonçalves Nery Junior juareznjunior

View GitHub Profile
(function($){
$.widget('ui.datagrid',{
options: {
limit:5
,offset:0
,mapper:[]
,height:200
,jsonStore:{params:{},url:''}
,pagination: true
,toolBarButtons:false
jQuery(function($) {
var $conteudo = $('#conteudo')
,menu = {
mnuinicio: {
mouseover: 'images/sitev5_12b.jpg'
,mouseout: 'images/sitev5_12.jpg'
,click: function() {
$conteudo.load('inicio.php');
}
}
@juareznjunior
juareznjunior / gist:669067
Created November 9, 2010 13:28
jquery.ui.table
.ui-table {width:100%}
.ui-table thead tr,
.ui-table tfoot tr,
.ui-table-header { background: #cccccc url(images/ui-bg_glass_75_cccccc_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #000000; outline: none;text-shadow:1px 1px 1px white}
.ui-table th,.ui-table td {font-weight:bold;text-align:left;padding:0.5em 0.3em;border:1px solid #ffffff;border-width:0 0 1px 1px}
.ui-table thead th {border-width:0 0 1px 1px;text-align:center}
.ui-table thead > tr > th:first-child,.ui-table tfoot > tr > th:first-child {border-width: 0 0 1px}
.ui-table tbody > tr > td:first-child {border-width: 0 0 1px 0}
.ui-table tbody td {font-weight:normal}
.ui-table .text-center,.ui-table .text-center * {text-align:center}
@juareznjunior
juareznjunior / jquery.ui.datagrid.js
Created March 24, 2011 17:53
jQuery UI DataGrid - beta version - create by @juareznjunior
(function($){
$.widget('ui.datagrid',{
// plugin options
options: {
limit:5
,mapper:[]
,height:200
,jsonStore:{
// ajax params
params: {}
<?php
$select = array(
'qtd_movimentos'=>'count( distinct(m.identificacao) )::numeric as qtd_movimentos'
,'valor_movimentos'=>'sum(m.valor) as valor_movimentos'
,'qtd_autorizada'=>'sum (m.qtd_autorizada) as qtd_autorizada'
);
$fields = array('qtd_autorizada');
array_filter(array_keys($select),function($var) use ($fields,&$select) {
@juareznjunior
juareznjunior / view_livros
Created March 25, 2011 13:09
view_livros
SELECT
mer.a_codmer
,upper(mer.a_desmer::text) AS a_desmer
,mer.a_preven
,upper(mer.a_nomaut::text) AS a_nomaut
,upper(sel.a_nomsel::text) AS a_nomsel
,sel.a_codsel
,upper(are.a_nomare::text) AS a_nomare
,mer.a_periodo
,mer.a_codref
<?php
$start = microtime(true);
class Post {
private $_data = array(
'id'=>NULL
,'title'=>NULL
,'status'=>NULL
,'blog'=>NULL
WITH lista AS (
SELECT
periodo
,cod_crm
,cod_espec
,cod_benef
,dtconsulta::date
,first_value(dtconsulta::date) OVER(PARTITION BY(cod_crm,cod_espec,cod_benef) ORDER BY dtconsulta DESC) last_dtconsulta
,count(CASE WHEN periodo = 201001 THEN 1 ELSE NULL END) OVER(PARTITION BY periodo,cod_crm,cod_espec) qtd_consultas
FROM
<?php
class Request extends Kohana_Request {
public function useHMVC() {
$this->headers['X-Request-Type'] = 'GET/HMVC';
return $this;
}
public function isHMVC() {
return (bool) (isset($this->headers['X-Request-Type']) AND 'GET/HMVC' === $this->headers['X-Request-Type']);
var loadDivs = function() {
// private
var param = location.search.split("?")
,i18n = {
'br': 'br'
,'en': 'en'
,'es': 'es'
};