Skip to content

Instantly share code, notes, and snippets.

View rodrigophpweb's full-sized avatar

Rodrigo Vieira Eufrasio da Silva rodrigophpweb

  • São Paulo
View GitHub Profile
// Chamando Requisição Ajax
add_action('wp_ajax_myfilter', 'filters_function');
add_action('wp_ajax_nopriv_myfilter', 'filters_function');
function filters_function(){
// Para chamar CPT empresa
$args = array(
'post_type' => 'empresa',
'orderby' => 'title',
'order' => 'ASC'
@rodrigophpweb
rodrigophpweb / chamada.js
Created January 8, 2019 14:35
Script chamar ajax
<script>
jQuery(document).ready(function() {
jQuery('.selecionar').change(function() {
if ($(this).prop('checked')) {
var selecionar = $('.selecionar');
jQuery.ajax({
url:selecionar.attr('action'),
data:selecionar.serialize(),
type:selecionar.attr('method'),
beforeSend:function(xhr){
<div id="response" class="col-lg-9">
<div class="row">
<?php
$atuacao = $_GET['atuacao'];
$categoria = $_GET['categoria'];
// if(is_array($atuacao)){
// exit('é um array');
// }
var_dump($atuacao);
?>
@rodrigophpweb
rodrigophpweb / export_csv.php
Created February 7, 2019 17:34
Função de utilitário para saída de uma consulta mysql para csv com a opção de gravar no arquivo ou enviar de volta para o navegador como um anexo csv.
<?php
function query_to_csv($db_conn, $query, $filename, $attachment = false, $headers = true) {
if($attachment) {
// send response headers to the browser
header( 'Content-Type: text/csv' );
header( 'Content-Disposition: attachment;filename='.$filename);
$fp = fopen('php://output', 'w');
} else {
$fp = fopen($filename, 'w');
@rodrigophpweb
rodrigophpweb / search.php
Created February 21, 2019 23:43
Search date + name
<?php if ($_GET['de'] || $_GET['ate'] || $_GET['s']) : ?>
<?php
$start = date_parse_from_format("j.n.Y", $_GET['de']);
$end = date_parse_from_format("j.n.Y", $_GET['ate']);
$args = array(
'post_type' => array('publicacao', 'apresentacoes', 'informe'),
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 10,
//'s' => $_GET['nome'],
@rodrigophpweb
rodrigophpweb / table.html
Created March 2, 2019 05:50
Tabela com dados
<html>
<head><title>Banco Sofisa</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Banco Sofisa - Relações com Investidores">
<meta name="keywords" content="Banco Sofisa, RI">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="menuSite.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="images/favicon.ico">
<script src="script.js" language="javascript"></script>
@rodrigophpweb
rodrigophpweb / file.csv
Created March 2, 2019 05:51
File in CSV
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 9 columns, instead of 2. in line 5.
post_title,post_name,post_thumbnail,post_date,tax_secao,post_type,post_content,post_excerpt,_wp_attachment_image_alt
Ato Homologatório emitido pelo Banco Central,ato-homologatorio-emitido-pelo-banco-central,https://www.mzweb.com.br/sofisa/web/download_arquivos.asp?id_arquivo=91A39541-E740-4427-8620-F66CBCB458BA,12/11/2013,4t,attachment,,,
Ato Homologatório emitido pelo Banco Central,ato-homologatorio-emitido-pelo-banco-central-2,https://www.mzweb.com.br/sofisa/web/download_arquivos.asp?id_arquivo=94A67F1E-B4C0-432E-9C87-8AC1C368E6C0,12/11/2013,4t,attachment,,,
Reunião Pública Anual 2013,reuniao-publica-anual-2013,https://www.mzweb.com.br/sofisa/web/download_arquivos.asp?id_arquivo=9B8D525F-3DA6-4868-A716-B3EC911FB1F2,12/09/2013,4t,attachment,,,
Posição Consolidada CVM 358 - Novembro/13,posicao-consolidada-cvm-358---novembro13,https://www.mzweb.com.br/sofisa/web/download_arquivos.asp?id_arquivo=F2BF6786-EC93-4F70-A9D3-E1571BC58134,12/04/2013,4t,attachment,,,
Calendário de Eventos Corporativos 2014,calendario-d
<?php
$args = array(
'post_type' => array( 'team' ),
'posts_per_page' => '-1',
'ignore_sticky_posts' => false,
);
$equipe = new WP_Query( $args );
if ( $equipe->have_posts()) :
while ( $equipe->have_posts()) : $equipe->the_post(); ?>
@rodrigophpweb
rodrigophpweb / modal.html
Last active November 21, 2019 21:14
Modal redirect url -> Contact Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Js</title>
</head>
<body>
<ul id="btecnicos">
<!-- Primeiro Ebook -->
<a class="books" id="bk1040" href="#lead" rel="modal:open" data-url="https://ctc.com.br/produtos/wp-content/uploads/2018/09/Manual-de-Boas-Práticas-Meiosi-FEV2019-V5.pdf">
{
"posts": {
"data": [
{
"permalink_url": "https://www.facebook.com/341729352806/posts/10158608413342807/",
"id": "341729352806_10158608413342807"
},
{
"permalink_url": "https://www.facebook.com/senacsaopaulo/videos/522710459064059/",
"id": "341729352806_522710459064059"