function formatarCnpj($cnpj_cpf)
{
if (strlen(preg_replace("/\D/", '', $cnpj_cpf)) === 11) {
$response = preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
} else {
$response = preg_replace("/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/", "\$1.\$2.\$3/\$4-\$5", $cnpj_cpf);
}
return $response;
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
server { | |
listen %ip%:%web_port%; | |
server_name %domain_idn% %alias_idn%; | |
root %docroot%; | |
index index.php index.html index.htm; | |
access_log /var/log/nginx/domains/%domain%.log combined; | |
access_log /var/log/nginx/domains/%domain%.bytes bytes; | |
error_log /var/log/nginx/domains/%domain%.error.log error; | |
location ~* ^/(app|vendor) { |
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 | |
class ChatController extends ControllerBase | |
{ | |
public function indexAction() | |
{ | |
// Logged User | |
$userId = $this->session->get('user')['user_id']; | |
// Load conversations |
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
{% extends 'base.volt' %} | |
{% block css %} | |
{{ stylesheet_link('css/chat.css') }} | |
{% endblock %} | |
{% block content %} | |
<div id="page-wrapper"> | |
<div class="container" style="padding-top: 20px;"> | |
<div class="row"> |
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 | |
require 'vendor/autoload.php'; | |
// BuzzHttp | |
use Buzz\Browser; | |
use Buzz\Client\Curl; | |
// GuzzleHttp | |
use GuzzleHttp\Client; |
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 | |
// PayPal Library | |
use PayPal\Api\Amount; | |
use PayPal\Api\Details; | |
use PayPal\Api\Item; | |
use PayPal\Api\ItemList; | |
use PayPal\Api\Payer; | |
use PayPal\Api\Payment; |