2295
| <![CDATA[<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Em tramitação (Dentro do Prazo)', 0],
['Em tramitação (Fora do Prazo)', 0],
['Atendido (Dentro do Prazo)', 38],
['Atendido (Fora do Prazo)', 40],
['Indeferido (Fora do Prazo)', 0],
['Indeferido (Dentro do Prazo)', 0],
['Prorrogado (Fora do Prazo)', 0],
['Prorrogado (Dentro do Prazo)', 0],
]);
// Set chart options
var options = {
chart: false,
colors: [ '#fab12e','#ed7104', '#13dd17', '#1c8419', '#f72239', '#bc3e4b', '#1b75aa', '#04598c' ],
tooltip: { isHtml: true },
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>]]>
|
2337
| <![CDATA[<script>
var token = 'h7uWQmTYHTcXEuh5EMGg4qBFMwzryDNB6v6sei2O';
function abrirModal(id) {
$('.modal-content').toggleClass('sk-loading');
$('#modal').modal('show');
$('#answers').html('');
$.ajax({
type:'POST',
url: "https://www.pocodantas.pb.gov.br/AjaxGetanswers",
data: {_token: token, id: id},
beforeSend: function(){
$('.modal-content').toggleClass('sk-loading');
},
success: function (data) {
$('.modal-content').toggleClass('sk-loading');
$('.modal-title').html('Solicitação de Protocolo: ' + data.request.protocol);
$('#soliModal').html(data.request.request);
let count = 0;
$.each(data.answers, function(key, value){
count += 1;
var html = `
<div id="resCount${count}" class="text-left" style="font-weight: bold; color: #333;">Resposta ${count}: </div>
<div id="model-text" class="answer">${value.answer}</div>
<div>
${value.archives.length <= 0 ? '' : `
<div class="mt-3">
<div class="mb-3">
<span style="color: #333; font-weight: bold;">Arquivos:</span>
</div>
<div id="archives${count}">
</div>
</div>
`}
</div>
<div class="text-center" style="font-weight: bold; color: #333;">Data da Resposta: <br> <span class="${textColor(data.request.status_id)}">${new Date(value.created_at).toLocaleDateString()}</span></div>
<hr>
`;
$('#answers').append(html);
if(value.archives.length > 0 ){
$.each(value.archives, function (key, value) {
var archives = `
<a href="${value.path}" target="_blank" class="text-dark mr-2 mt-3" data-toggle="tooltip" title="${value.name}"><i class="fa fa-download fa-2x"></i></a>
`;
$('#archives'+count).append(archives);
})
}
});
$('.modal-content').toggleClass('sk-loading');
},
error: function (data, textStatus, errorThrown) {
$('.modal-content').toggleClass('sk-loading');
}
});
}
function textColor(status) {
switch (status) {
case 1:
return 'text-warning';
case 2:
return 'text-success';
case 3:
return 'text-danger';
case 4:
return 'text-primary';
default:
}
}
$('#btn-list').on('click', function () {
$('.table-solicitations').toggleClass('d-none');
});
$(function () {
$('#solicitations').DataTable({
'paging' : true,
'lengthChange': false,
'searching' : false,
'ordering' : false,
'info' : false,
'autoWidth' : false,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
}
});
});
</script>]]>
|