Forked from camilamoreiradev/Popover e Badges - Bootstrap
Created
February 3, 2023 06:44
-
-
Save theprincy/7d1e7d8bf3fff9452ff73b89595d7de3 to your computer and use it in GitHub Desktop.
Aprenda a adicionar popovers e badges nas consultas do Scriptcase.
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
Seguem os eventos e seus respectivos códigos: | |
-> onScriptInit: | |
-------------------------------------------------------------------- | |
sc_include_lib("Jquery"); | |
?> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> | |
<style> | |
.badge-info { | |
background-color: #659be0 !important; | |
} | |
</style> | |
<?php | |
-------------------------------------------------------------------- | |
-> onRecord: | |
-------------------------------------------------------------------- | |
sc_select(rs, "SELECT COUNT(*) AS QTD FROM orders WHERE employeeid = ".{employeeid}); | |
{pedidos} = '<span class="badge badge-info"> '.$rs->fields[0].' </span>'; | |
$cm_titulo = {firstname}." ".{lastname}; | |
$cm_descricao = "<strong>Notas:</strong> ".{notes}; | |
{detalhes} = '<h5> | |
<a href="#" data-trigger="hover" data-toggle="popover" title="<strong>'.$cm_titulo.'</strong>" data-content="'.$cm_descricao.'"> | |
<span class="glyphicon glyphicon-option-vertical"></span> | |
</a> | |
</h5>'; | |
-------------------------------------------------------------------- | |
-> onFooter: | |
-------------------------------------------------------------------- | |
?> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<script> | |
$( document ).ready(function() { | |
setInterval(function(){ | |
$('[data-toggle="popover"]').popover({html: true}); | |
}, 1000); | |
}); | |
</script> | |
<?php | |
-------------------------------------------------------------------- | |
Bom uso pessoal! | |
Obs.: Se possível deixe um comentário abaixo para eu saber se está tendo uso o código e ter motivação para postar mais dicas. ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment