-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrenderer.js
44 lines (30 loc) · 1.06 KB
/
renderer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const ipc = require('electron').ipcRenderer;
function loadCurrentDayRdvs(){
const currentDayRdvs = ipc.sendSync('getCurrentDayRdvs')
const CurrentDayRdvsItems = currentDayRdvs.reduce((html,r)=>{
table = document.getElementById("tableCurrentDay") ;
addHtmlTableRow(table , r)
return html
},'');
const currentRdvList = document.getElementById('CurrentDayList');
currentRdvList.innerHTML = CurrentDayRdvsItems;
}
document.addEventListener("DOMContentLoaded", function(){
loadCurrentDayRdvs();
// ipc.on('updatedPatients',loadPatients)
});
function addHtmlTableRow(table ,RDV)
{
var newRow = table.insertRow(-1);
var cell1 = newRow.insertCell(0);
var cell2 = newRow.insertCell(1);
var cell3 = newRow.insertCell(2);
var cell4 = newRow.insertCell(3);
var cell5 = newRow.insertCell(4);
cell1.innerHTML = RDV['patient.Nom'];
cell2.innerHTML = RDV['patient.Prenom'];
cell3.innerHTML = RDV.Date.split(' ')[0];
cell4.innerHTML = RDV.Date.split(' ')[1];
cell5.innerHTML = RDV.Objet;
}
module.exports = {loadCurrentDayRdvs}