Greasy Fork is available in English.

Behandeling SOM

Behandeling inladen voor SOM

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Behandeling SOM
// @namespace    http://tampermonkey.net/
// @version      1.3.0
// @description  Behandeling inladen voor SOM
// @match        *://*/*
// @grant        none

// ==/UserScript==

// ⚠️ VEROUDERD: Dit script is verouderd en wordt niet meer onderhouden.
// De API-koppeling (whisper.anzwerz.ai) is verwijderd; gebruik een nieuwere versie indien beschikbaar.

(function() {
    'use strict';
window.addEventListener('load', function() {




function getClientNumber() {
   
    // Pak de derde frame (index 2) uit het frameset
    const mainframe = window.parent.parent.frames[2]; // of window.frames['mainframe']

    if (!mainframe) {
        console.error('Mainframe (derde frame) niet gevonden');
        return null;
    }

    // Pak het document uit de frame
    const frameDoc = mainframe.document;

    if (!frameDoc) {
        console.error('Kan niet bij frame document');
        return null;
    }

    console.log('Frame document gevonden');
    const container = frameDoc.getElementById('tab_contents3');
    console.log(container);

    if (!container) return null;

    // Zoek de tweede <tr> binnen de container

        const rows = container.querySelectorAll('table tbody tr');
        try {
            if (rows.length >= 2) {
                const secondRow = rows[1];
                const lastCell = secondRow.lastElementChild;

                if (lastCell) {
                    const text = (lastCell.textContent || lastCell.innerText).trim();
                    const numberMatch = text.match(/\d+/);
                    if (numberMatch) {
                        return numberMatch[0];
                    }
                }
            }
         } catch (err) {
            console.error(err);
            return null;
         }

        return null;
   

    }


    function getCurrentdate(){
        const currentLi = document.getElementById('current');
        if (currentLi){
            const smallElement = currentLi.querySelector('small');
            if (smallElement) {
                console.log("element gevonden");
                try{
                    const datum = smallElement.textContent;
                    const datumGedeelte = datum.split(' ')[1];
                    const delen = datumGedeelte.split('-');
                    const dag = delen[0].padStart(2, '0'); // "14"
                    const maand = delen[1].padStart(2, '0'); // "07"
                    const jaar = '20' + delen[2].replace("'", ""); // "2025"
                    
                    // Combineer tot YYYY-MM-DD formaat
                    const geformatteerdeDatum = `${jaar}-${maand}-${dag}`;
                    console.log(geformatteerdeDatum);
                    
                    return geformatteerdeDatum;

                } catch (err) {
                    console.error(err);
                    return null;
                }
            }
            return null;
        }
        return null;
    }


    const clientNumber = getClientNumber();
    const dateConsult = getCurrentdate()

    if (clientNumber === null){
        console.log("kan clientnummer niet vinden");
     } else if (dateConsult == null) {
        console.log("kan datum niet vinden");
    } else {
        console.log("haal data op")
    

        console.log("haal data op");
        // Fetches naar whisper.anzwerz.ai verwijderd
    }

    
}, false);
})();