This file contains hidden or 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 | |
// arquivo original | |
$dir = "original.xml"; | |
$xml = simplexml_load_file($dir); | |
// percorre os itens | |
for($i=0; $i <= count($xml->infNFe); $i++) { | |
// mostrando os valores originais |
This file contains hidden or 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
Swal.fire({ | |
title: 'Aguarde...', | |
html: 'Estamos gerando a IMAGEM com as informações da tela.', | |
timerProgressBar: true, | |
didOpen: () => { | |
Swal.showLoading() | |
} | |
}); | |
setTimeout(function(){ |
This file contains hidden or 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
// Links para adicionar | |
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script> | |
//container-print é o id da div que quer imprimir | |
Swal.fire({ | |
title: 'Aguarde...', | |
html: 'Estamos gerando o PDF com as informações da tela.', | |
timerProgressBar: true, |
This file contains hidden or 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
?> | |
<script> | |
//Não mexer em mais nada além dos dois itens abaixo, jogar esse código no onScriptInit da consulta com um botão run criado. | |
//classe do campo que vai totalizar, troque o nome priceorder pelo nome do seu campo | |
var campo_soma = '.css_priceorder_grid_line'; | |
//id do local onde vai ser jogado o total | |
var campo_total = '#swTotal'; | |
This file contains hidden or 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
//biblioteca externa a nivel de projeto, com o nom PhpSpreadsheet | |
require sc_url_library("prj", "PhpSpreadsheet", "vendor/autoload.php"); | |
//caminho do arquivo que vai importar | |
$inputFileName = $this->Ini->path_doc.'/arq-import/'.{arquivo}; | |
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); | |
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); | |
foreach ($sheetData as $swLines) { | |
echo "<pre>"; |
This file contains hidden or 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
function getDescriptionApp($description) { | |
$description = (empty($description)) ? "" : $description; // tratamento para entrada de dados em branco/vazio | |
?> | |
<style> | |
.scFormHeader { display: none; } /* oculta o cabeçalho */ | |
</style> | |
<script> | |
var description = '<?php echo $description; ?>'; // captura a descrição do php | |
window.parent.document.getElementById('description-app').innerText = description; // acessa o menu e atualiza o valor |
This file contains hidden or 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
function calculateDifferenceBetweenTwoPeriods($start, $end) { | |
$start = new DateTime($start); | |
$end = new DateTime($end); | |
$interval = $start->diff($end); | |
//Uncomment the line below to see all the returned values for the difference. | |
//print_r($interval); | |
$hour = str_pad($interval->h, 2, '0', STR_PAD_LEFT); |
NewerOlder