Skip to content

Instantly share code, notes, and snippets.

View mvnp's full-sized avatar
🏠
Working from home

Marcos Pereira mvnp

🏠
Working from home
View GitHub Profile
$(document).on('blur', '.edit_descr > span', function(event){
event.preventDefault();
var descricao = $(this).text();
var metodo_id = $(this).data("metodo_id");
if(descricao && metodo_id){
if(confirm("Deseja realmente atualizar a descrição desta função no sistema?") == true){
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
@mvnp
mvnp / SQL
Created August 23, 2017 01:39
SELECT f.FUNC_NOME, p.PERG_PERG, r.RSPND_RESP_AVALO, e.PDOS_AVALR_ID,
(SELECT f.FUNC_NOME FROM funcionarios f WHERE f.ID = e.PDOS_AVALR_ID) AS NOME_AVALIADOR
FROM responder r
INNER JOIN perguntas p on r.RSPND_PERG_ID = p.ID
INNER JOIN funcionarios f on r.RSPND_AVALO_ID = f.ID
INNER JOIN pesquisados e on r.RSPND_PESQ_ID = e.ID
SELECT DISTINCT * from (agenda join TIPOAGENDA ON TIPOAGENDA.tipoagenda_id=AGENDA.tipoagenda)
where year(agenda_data)= year(now())
and ADDDATE(agenda_data, INTERVAL 1 MONTH)=ADDDATE(now(), INTERVAL 1 MONTH)
order by agenda_data ASC
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome4 extends CI_Controller {
/**
* Gera a tabela de valores sem os nomes das naturezas e
* foi inserido as colunas de PACOTE e NATUREZA no início
* e implementado a possível ordenação por orden alfabética
* de naturezas ou possível ordenação por ordem alfabética
* de pacotes ...
foreach ($planilha as $info) : ?>
<?php $count = 0; $total = 0; $remove = 0; ?>
<?php if($count == 0 OR ($count % 13 == 0)) : $count++; ?>
<tr>
<?php for ($i = 0; $i < 13; $i++) : ?>
<?php $remove = $info[0]['ORCD_VLR']; ?>
<?php if($i == 0) : ?>
<td><?php echo $info[$i]['PCT_DESCRICAO'] ?></td>
<td><?php echo $info[$i]['NAT_DESCRICAO'] ?></td>
<?php else : ?>
@mvnp
mvnp / Erro
Last active June 18, 2017 01:50
<?php
class Carrinho {
private $pref = 'media_';
private function existe($id) {
if(!isset($_SESSION[$this->pref.'produto'])) {
$_SESSION[$this->pref.'produto']=array();
}
<?php
$servername = "localhost";
$username = "username";
$password = "password";
try {
$conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.esconde{display:none!important}
</style>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
<!DOCTYPE html>
<html lang="pt-br en">
<head>
<meta charset="UTF-8">
<title>Carrinho de compras</title>
<style>
.limpar {
border: 1px solid #963131;
padding: 5px 10px;
background-color: #e47e7e;