Discover gists
This file contains 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 | |
//<onAfterPageCreation> | |
$this->pageNavigation->setAction(new TAction([$this, 'onReload'], ['pagination'=>1])); | |
if(!empty($param['pagination'])) | |
{ | |
TSession::setValue(__CLASS__.'_pagination_params', $param); | |
} |
This file contains 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 | |
TTransaction::open(self::$database); | |
$conexao = TTransaction::getDatabaseInfo(); | |
echo '<pre>'; | |
print_r($conexao); | |
# RETORNO: |
This file contains 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 | |
$object = new Venda($key); | |
$TotalVenda = (double) VendaItem::where('venda_id','=',$object->id)->sumBy('total'); | |
$object->total_venda = number_format($TotalVenda,2,',','.'); | |
$this->form->setData($object); |
This file contains 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 | |
public static function CalcularTotalItem($param = null) | |
{ | |
try | |
{ | |
$preco = (double) str_replace(',', '.', str_replace('.', '', $param['item_venda_preco'])); | |
$quant = (double) str_replace(',', '.', str_replace('.', '', $param['item_venda_quant'])); | |
if ($item_pedido_compra_preco > 0 and $item_pedido_compra_quant > 0) |
This file contains 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 | |
$nome_campo->style = ' | |
background-color: #000000 !important; | |
opacity: 100%; | |
color: #FFFFFF !important; | |
font-weight: bold; | |
font-size: 16px; | |
text-align: center; | |
'; |
This file contains 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 | |
public static function BuscarProduto($param = null) | |
{ | |
try | |
{ | |
TTransaction::open(self::$database); | |
$Produto = Produto::find((int) $param['key']); |
This file contains 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
from requests_oauthlib import OAuth2Session | |
from flask import Flask, request, redirect, session, url_for | |
from flask.json import jsonify | |
import os | |
app = Flask(__name__) | |
# This information is obtained upon registration of a new GitHub | |
client_id = "<your client key>" |
This file contains 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
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active { | |
border-top: 3px solid #004c6f !important; | |
border-left: 1px solid #004c6f !important; | |
} |
This file contains 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 | |
$celular = str_replace(['(',')','-',' '], ['','','',''], $param['celular']); | |
if (strlen($celular) < 9) | |
{ | |
new TMessage('warning','O Tamanho do Número do Celular é Inválido'); | |
return; | |
} |
This file contains 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 | |
# DATA e HORA INICIAL | |
$data_inicial = new DateTime($param['data_inicial']); | |
# ADICIONA + 1 HORA | |
$data_final = $data_inicial->modify('+1 hour'); | |
# ADICIONAR + 1 SEMANA | |
$data_final = $data_inicial->modify('+1 week'); |
NewerOlder