| Line 363... |
Line 363... |
| 363 |
</div>
|
363 |
</div>
|
| 364 |
</div>
|
364 |
</div>
|
| 365 |
</div>
|
365 |
</div>
|
| 366 |
|
366 |
|
| 367 |
<script type="text/javascript">
|
367 |
<script type="text/javascript">
|
| 368 |
// Store current authId for break time loading
|
368 |
// Store current authId and agentName for break time loading
|
| 369 |
var currentModalAuthId = null;
|
369 |
var currentModalAuthId = null;
|
| 370 |
var currentModalDate = null;
|
370 |
var currentModalDate = null;
|
| - |
|
371 |
var currentModalAgentName = null;
|
| 371 |
|
372 |
|
| 372 |
document.addEventListener('DOMContentLoaded', function () {
|
373 |
document.addEventListener('DOMContentLoaded', function () {
|
| 373 |
var elems = document.querySelectorAll('.lakh');
|
374 |
var elems = document.querySelectorAll('.lakh');
|
| 374 |
for (var i = 0; i < elems.length; i++) {
|
375 |
for (var i = 0; i < elems.length; i++) {
|
| 375 |
var val = parseInt(elems[i].textContent.trim());
|
376 |
var val = parseInt(elems[i].textContent.trim());
|
| Line 404... |
Line 405... |
| 404 |
document.getElementById('oosDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
|
405 |
document.getElementById('oosDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
|
| 405 |
});
|
406 |
});
|
| 406 |
}
|
407 |
}
|
| 407 |
|
408 |
|
| 408 |
function showCalledPartnerDetails(authId, rbmName) {
|
409 |
function showCalledPartnerDetails(authId, rbmName) {
|
| 409 |
// Store authId for break time tab
|
410 |
// Store authId and agentName for break time tab
|
| 410 |
currentModalAuthId = authId;
|
411 |
currentModalAuthId = authId;
|
| 411 |
currentModalDate = null;
|
412 |
currentModalDate = null;
|
| - |
|
413 |
currentModalAgentName = rbmName;
|
| 412 |
|
414 |
|
| 413 |
document.getElementById('calledModalLabel').textContent = 'Activity - ' + rbmName;
|
415 |
document.getElementById('calledModalLabel').textContent = 'Activity - ' + rbmName;
|
| 414 |
document.getElementById('calledDetailsContent').innerHTML = '<p>Loading...</p>';
|
416 |
document.getElementById('calledDetailsContent').innerHTML = '<p>Loading...</p>';
|
| 415 |
document.getElementById('breakTimeDetailsContent').innerHTML = '<p>Click to load break time data.</p>';
|
417 |
document.getElementById('breakTimeDetailsContent').innerHTML = '<p>Click to load break time data.</p>';
|
| 416 |
|
418 |
|
| 417 |
// Reset to Called tab
|
419 |
// Reset to Called tab
|
| 418 |
$('#called-tab').tab('show');
|
420 |
$('#called-tab').tab('show');
|
| 419 |
|
421 |
|
| 420 |
$('#calledModal').modal('show');
|
422 |
$('#calledModal').modal('show');
|
| 421 |
|
423 |
|
| 422 |
fetch('/indent/rbm_call_target/called_details?authId=' + authId)
|
424 |
fetch('/indent/rbm_call_target/called_details?authId=' + authId + '&agentName=' + encodeURIComponent(rbmName))
|
| 423 |
.then(function (response) {
|
425 |
.then(function (response) {
|
| 424 |
return response.json();
|
426 |
return response.json();
|
| 425 |
})
|
427 |
})
|
| 426 |
.then(function (data) {
|
428 |
.then(function (data) {
|
| 427 |
if (data && data.length > 0) {
|
429 |
if (data && data.length > 0) {
|
| 428 |
var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th style="width: 200px;">Party Name</th><th>Code</th><th style="width: 350px;">Remark</th><th>Call Status</th><th>Call Duration</th><th>Call Date/Time</th><th>Recording</th></tr></thead><tbody>';
|
430 |
var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th style="width: 200px;">Party Name</th><th>Code</th><th style="width: 350px;">Remark</th><th>Call Status</th><th>Call Duration</th><th>Call Date/Time</th><th>Recording</th></tr></thead><tbody>';
|
| 429 |
for (var i = 0; i < data.length; i++) {
|
431 |
for (var i = 0; i < data.length; i++) {
|
| - |
|
432 |
var rowStyle = '';
|
| 430 |
var recordingHtml = '-';
|
433 |
var recordingHtml = '-';
|
| - |
|
434 |
|
| - |
|
435 |
// Check if this is a break log entry
|
| - |
|
436 |
if (data[i].breakLog) {
|
| - |
|
437 |
rowStyle = 'style="background-color: #f8d7da; color: #721c24; font-weight: bold;"';
|
| - |
|
438 |
html += '<tr ' + rowStyle + '><td>' + (i + 1) + '</td><td colspan="5"><i class="fa fa-coffee"></i> ' + (data[i].breakStatus || 'On Break') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>-</td></tr>';
|
| - |
|
439 |
} else {
|
| 431 |
if (data[i].recordingUrl) {
|
440 |
if (data[i].recordingUrl) {
|
| 432 |
recordingHtml = '<audio controls style="width: 150px; height: 30px;"><source src="' + data[i].recordingUrl + '" type="audio/mpeg">Your browser does not support audio.</audio>';
|
441 |
recordingHtml = '<audio controls style="width: 150px; height: 30px;"><source src="' + data[i].recordingUrl + '" type="audio/mpeg">Your browser does not support audio.</audio>';
|
| - |
|
442 |
}
|
| - |
|
443 |
html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].remark + '- ' + (data[i].message || '-') + '</td><td>' + (data[i].callStatus || '-') + '</td><td>' + (data[i].callDuration || '-') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>' + recordingHtml + '</td></tr>';
|
| 433 |
}
|
444 |
}
|
| 434 |
html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].remark + '- ' + (data[i].message || '-') + '</td><td>' + (data[i].callStatus || '-') + '</td><td>' + (data[i].callDuration || '-') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>' + recordingHtml + '</td></tr>';
|
- |
|
| 435 |
}
|
445 |
}
|
| 436 |
html += '</tbody></table>';
|
446 |
html += '</tbody></table>';
|
| 437 |
document.getElementById('calledDetailsContent').innerHTML = html;
|
447 |
document.getElementById('calledDetailsContent').innerHTML = html;
|
| 438 |
} else {
|
448 |
} else {
|
| 439 |
document.getElementById('calledDetailsContent').innerHTML = '<p>No called partners found.</p>';
|
449 |
document.getElementById('calledDetailsContent').innerHTML = '<p>No called partners found.</p>';
|
| Line 465... |
Line 475... |
| 465 |
|
475 |
|
| 466 |
var url = '/indent/rbm_call_target/break_time_details?authId=' + currentModalAuthId;
|
476 |
var url = '/indent/rbm_call_target/break_time_details?authId=' + currentModalAuthId;
|
| 467 |
if (currentModalDate) {
|
477 |
if (currentModalDate) {
|
| 468 |
url += '&date=' + currentModalDate;
|
478 |
url += '&date=' + currentModalDate;
|
| 469 |
}
|
479 |
}
|
| - |
|
480 |
if (currentModalAgentName) {
|
| - |
|
481 |
url += '&agentName=' + encodeURIComponent(currentModalAgentName);
|
| - |
|
482 |
}
|
| 470 |
|
483 |
|
| 471 |
fetch(url)
|
484 |
fetch(url)
|
| 472 |
.then(function (response) {
|
485 |
.then(function (response) {
|
| 473 |
return response.json();
|
486 |
return response.json();
|
| 474 |
})
|
487 |
})
|
| Line 507... |
Line 520... |
| 507 |
html += '<td>' + (detail.duration || '-') + '</td>';
|
520 |
html += '<td>' + (detail.duration || '-') + '</td>';
|
| 508 |
html += '</tr>';
|
521 |
html += '</tr>';
|
| 509 |
}
|
522 |
}
|
| 510 |
html += '</tbody></table>';
|
523 |
html += '</tbody></table>';
|
| 511 |
} else {
|
524 |
} else {
|
| 512 |
html += '<p class="text-muted">No break time data available. Data is collected at 12 PM, 4 PM, and 8 PM daily.</p>';
|
525 |
html += '<p class="text-muted">No break time data available. Data is collected at 12 PM, 3 PM, 6 PM, and 9 PM daily.</p>';
|
| 513 |
}
|
526 |
}
|
| 514 |
|
527 |
|
| 515 |
document.getElementById('breakTimeDetailsContent').innerHTML = html;
|
528 |
document.getElementById('breakTimeDetailsContent').innerHTML = html;
|
| 516 |
})
|
529 |
})
|
| 517 |
.catch(function (err) {
|
530 |
.catch(function (err) {
|
| Line 534... |
Line 547... |
| 534 |
if (!authId) {
|
547 |
if (!authId) {
|
| 535 |
alert('Please select an RBM');
|
548 |
alert('Please select an RBM');
|
| 536 |
return;
|
549 |
return;
|
| 537 |
}
|
550 |
}
|
| 538 |
|
551 |
|
| 539 |
// Store authId and date for break time tab
|
552 |
// Store authId, date and agentName for break time tab
|
| 540 |
currentModalAuthId = authId;
|
553 |
currentModalAuthId = authId;
|
| 541 |
currentModalDate = selectedDate;
|
554 |
currentModalDate = selectedDate;
|
| - |
|
555 |
currentModalAgentName = rbmName;
|
| 542 |
|
556 |
|
| 543 |
document.getElementById('calledModalLabel').textContent = 'Activity - ' + rbmName + ' (' + selectedDate + ')';
|
557 |
document.getElementById('calledModalLabel').textContent = 'Activity - ' + rbmName + ' (' + selectedDate + ')';
|
| 544 |
document.getElementById('calledDetailsContent').innerHTML = '<p>Loading...</p>';
|
558 |
document.getElementById('calledDetailsContent').innerHTML = '<p>Loading...</p>';
|
| 545 |
document.getElementById('breakTimeDetailsContent').innerHTML = '<p>Click to load break time data.</p>';
|
559 |
document.getElementById('breakTimeDetailsContent').innerHTML = '<p>Click to load break time data.</p>';
|
| 546 |
|
560 |
|
| 547 |
// Reset to Called tab
|
561 |
// Reset to Called tab
|
| 548 |
$('#called-tab').tab('show');
|
562 |
$('#called-tab').tab('show');
|
| 549 |
|
563 |
|
| 550 |
$('#calledModal').modal('show');
|
564 |
$('#calledModal').modal('show');
|
| 551 |
|
565 |
|
| 552 |
fetch('/indent/rbm_call_target/called_details?authId=' + authId + '&date=' + selectedDate)
|
566 |
fetch('/indent/rbm_call_target/called_details?authId=' + authId + '&date=' + selectedDate + '&agentName=' + encodeURIComponent(rbmName))
|
| 553 |
.then(function (response) {
|
567 |
.then(function (response) {
|
| 554 |
return response.json();
|
568 |
return response.json();
|
| 555 |
})
|
569 |
})
|
| 556 |
.then(function (data) {
|
570 |
.then(function (data) {
|
| 557 |
if (data && data.length > 0) {
|
571 |
if (data && data.length > 0) {
|
| 558 |
var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th style="width: 200px;">Party Name</th><th>Code</th><th style="width: 350px;">Remark</th><th>Call Status</th><th>Call Duration</th><th>Call Date/Time</th><th>Recording</th></tr></thead><tbody>';
|
572 |
var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th style="width: 200px;">Party Name</th><th>Code</th><th style="width: 350px;">Remark</th><th>Call Status</th><th>Call Duration</th><th>Call Date/Time</th><th>Recording</th></tr></thead><tbody>';
|
| 559 |
for (var i = 0; i < data.length; i++) {
|
573 |
for (var i = 0; i < data.length; i++) {
|
| - |
|
574 |
var rowStyle = '';
|
| 560 |
var recordingHtml = '-';
|
575 |
var recordingHtml = '-';
|
| - |
|
576 |
|
| - |
|
577 |
// Check if this is a break log entry
|
| - |
|
578 |
if (data[i].breakLog) {
|
| - |
|
579 |
rowStyle = 'style="background-color: #f8d7da; color: #721c24; font-weight: bold;"';
|
| - |
|
580 |
html += '<tr ' + rowStyle + '><td>' + (i + 1) + '</td><td colspan="5"><i class="fa fa-coffee"></i> ' + (data[i].breakStatus || 'On Break') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>-</td></tr>';
|
| - |
|
581 |
} else {
|
| 561 |
if (data[i].recordingUrl) {
|
582 |
if (data[i].recordingUrl) {
|
| 562 |
recordingHtml = '<audio controls style="width: 150px; height: 30px;"><source src="' + data[i].recordingUrl + '" type="audio/mpeg">Your browser does not support audio.</audio>';
|
583 |
recordingHtml = '<audio controls style="width: 150px; height: 30px;"><source src="' + data[i].recordingUrl + '" type="audio/mpeg">Your browser does not support audio.</audio>';
|
| - |
|
584 |
}
|
| - |
|
585 |
html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].remark + '- ' + (data[i].message || '-') + '</td><td>' + (data[i].callStatus || '-') + '</td><td>' + (data[i].callDuration || '-') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>' + recordingHtml + '</td></tr>';
|
| 563 |
}
|
586 |
}
|
| 564 |
html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].remark + '- ' + (data[i].message || '-') + '</td><td>' + (data[i].callStatus || '-') + '</td><td>' + (data[i].callDuration || '-') + '</td><td>' + (data[i].callDateTime || '-') + '</td><td>' + recordingHtml + '</td></tr>';
|
- |
|
| 565 |
}
|
587 |
}
|
| 566 |
html += '</tbody></table>';
|
588 |
html += '</tbody></table>';
|
| 567 |
document.getElementById('calledDetailsContent').innerHTML = html;
|
589 |
document.getElementById('calledDetailsContent').innerHTML = html;
|
| 568 |
} else {
|
590 |
} else {
|
| 569 |
document.getElementById('calledDetailsContent').innerHTML = '<p>No called partners found for selected date.</p>';
|
591 |
document.getElementById('calledDetailsContent').innerHTML = '<p>No called partners found for selected date.</p>';
|