mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Next contact
This commit is contained in:
parent
b4dcf4a6f1
commit
13086b596c
@ -739,6 +739,41 @@ if (!empty($network_interfaces)) {
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
setInterval(() => {
|
||||||
|
last = $('.progress_text').text().split(' ')[0]*1;
|
||||||
|
width = $(".progress").width() / $('.progress').parent().width() * 100;
|
||||||
|
width_interval = <?php echo (100 / $agent['intervalo']); ?>;
|
||||||
|
if (last % 10 == 0) {
|
||||||
|
$.post({
|
||||||
|
url: "ajax.php",
|
||||||
|
data: {
|
||||||
|
page: 'operation/agentes/ver_agente',
|
||||||
|
id_agente: <?php echo $id_agente; ?>,
|
||||||
|
refresh_contact: 1
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
try {
|
||||||
|
val = JSON.parse(data);
|
||||||
|
$('.progress_text').text(val['last_contact']+' s');
|
||||||
|
$('.progress').width(val['progress']+"%");
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
$('.progress_text').text((last -1) + " s");
|
||||||
|
if (width < 100) {
|
||||||
|
$('.progress').width((width+width_interval) + "%");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$('.progress_text').text((last -1) + " s");
|
||||||
|
if (width < 100) {
|
||||||
|
$('.progress').width((width+width_interval) + "%");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
|
||||||
$("#agent_data_main").find("thead").click (function () {
|
$("#agent_data_main").find("thead").click (function () {
|
||||||
close_table('#agent_data_main');
|
close_table('#agent_data_main');
|
||||||
})
|
})
|
||||||
|
@ -62,6 +62,31 @@ if (is_ajax()) {
|
|||||||
$agent_alias = get_parameter('alias', '');
|
$agent_alias = get_parameter('alias', '');
|
||||||
$agents_inserted = get_parameter('agents_inserted', []);
|
$agents_inserted = get_parameter('agents_inserted', []);
|
||||||
$id_group = (int) get_parameter('id_group');
|
$id_group = (int) get_parameter('id_group');
|
||||||
|
|
||||||
|
$refresh_contact = get_parameter('refresh_contact', 0);
|
||||||
|
|
||||||
|
if ($refresh_contact) {
|
||||||
|
$id_agente = get_parameter('id_agente', 0);
|
||||||
|
if ($id_agente > 0) {
|
||||||
|
$d = db_get_row(
|
||||||
|
'tagente',
|
||||||
|
'id_agente',
|
||||||
|
$id_agente
|
||||||
|
);
|
||||||
|
|
||||||
|
$progress = agents_get_next_contact($id_agente);
|
||||||
|
|
||||||
|
echo json_encode(
|
||||||
|
[
|
||||||
|
'progress' => $progress,
|
||||||
|
'last_contact' => ($d['intervalo'] * (100 - $progress) / 100),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($get_agents_group_json) {
|
if ($get_agents_group_json) {
|
||||||
$id_group = (int) get_parameter('id_group');
|
$id_group = (int) get_parameter('id_group');
|
||||||
$recursion = (bool) get_parameter('recursion');
|
$recursion = (bool) get_parameter('recursion');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user