webpage/connector.js
//Update the users data on the server for a specific time.

Update the users data on the server for a specific time.
Update the users data on the server for a specific time .
static updateTime(day,timevalue,onSuccessCallback,onFailCallback){
        console.log("SENDING TIME UPDATE REQUEST FOR " + day);
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                let result = JSON.parse(this.responseText);
                if(result['action'] == 'success'){
                    Session.action = 'success';
                    Session.actionr = null;
                    onSuccessCallback();
                }
                else{
                    Session.action = 'fail';
                    Session.actionr = result.reason;
                    onFailCallback();
                }
            }
        };
        let p1 = 'https://lamp.cse.fau.edu/~dbenne11/whendiagram/enter_time.php?time='
        let p2 = timevalue;
        let p3 = '&day=';
        let p4 = day;
        let p5 = '&at=';
        let url = p1 + p2 + p3 + p4 + p5 + Session.getAT();
        xmlhttp.open("POST", url, true);
        xmlhttp.send();
    }
static updateTime ( day , timevalue , onSuccessCallback , onFailCallback ) { console . log ( "SENDING TIME UPDATE REQUEST FOR " + day ) ; var xmlhttp = new XMLHttpRequest ( ) ; xmlhttp . onreadystatechange = function ( ) { if ( this . readyState == 4 && this . status == 200 ) { let result = JSON . parse ( this . responseText ) ; if ( result [ 'action' ] == 'success' ) { Session . action = 'success' ; Session . actionr = null ; onSuccessCallback ( ) ; } else { Session . action = 'fail' ; Session . actionr = result . reason ; onFailCallback ( ) ; } } } ; let p1 = 'https://lamp.cse.fau.edu/~dbenne11/whendiagram/enter_time.php?time=' let p2 = timevalue ; let p3 = '&day=' ; let p4 = day ; let p5 = '&at=' ; let url = p1 + p2 + p3 + p4 + p5 + Session . getAT ( ) ; xmlhttp . open ( "POST" , url , true ) ; xmlhttp . send ( ) ; }
Update the users data on the server for a specific time.
Update the users data on the server for a specific time .
//console.log(this.responseText);
