
/*** Code generated by Orion PHP Framework ***/
if(typeof $App.admin == 'undefined'){$App.admin = {};};



$App.admin.content = {
    presvisible : function(presId,visible){

        if(visible){
            visible = 1;
        }else{
            visible = 0;
        }
        $.post('/Admin/Content/presvisible', {
            'presId': presId,
            'visible': visible
        }, null, 'json');
    },
    resvisible : function(resId,visible){

        if(visible){
            visible = 1;
        }else{
            visible = 0;
        }
        $.post('/Admin/Content/resvisible', {
            'resId': resId,
            'visible': visible
        }, null, 'json');
    },
    
    remove: function(id,confirm_msg){
        if(confirm(confirm_msg)){
            $.post('/Admin/Content/carateristicas_remove', {'id':id}, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh('content');
                }
            }, 'json');
        }
    },
    removeSeccion:function(id,confirm_msg){
        if(confirm(confirm_msg)){
            $.post('/Admin/Content/caracteristicasRemoveSeccion', {'id':id}, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh('content');
                }
            }, 'json');
        }
    },
   
    eliminarYoutube: function(id,confirm_msg){
        if(confirm(confirm_msg)){
            $.post('/Admin/Content/eliminarYoutube', {'id':id}, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh('content');
                }
            }, 'json');
        }
    },
         eliminartexto: function(id,confirm_msg){
        
        if(confirm(confirm_msg)){
            $.post('/Admin/Content/eliminartexto', {
                'id': id
            }, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh();
                }
            }, 'json');
        }
    },
    eliminarImagen: function(id,confirm_msg){
        
        if(confirm(confirm_msg)){
            $.post('/Admin/Content/eliminarImagen', {
                'id': id
            }, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh();
                }
            }, 'json');
        }
    },
    imagenprimaria:function(id,valor,pres_id){
        var val=0;
        if(valor==true)
            val=1;
        $.post('/Admin/Content/imagenprimaria', {
                'id': id,
                'valor':val,
                'pres_id':pres_id
            }, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh();
                }
            }, 'json');
    },
    generarGaleria : function(presId,generar){

        if(generar){
            generar = 1;
        }else{
            generar = 0;
        }
        $.post('/Admin/Content/generarGaleria', {
            'presId': presId,
            'generar': generar
        },null, 'json');
    }
  
    

}

/*** Code generated by Orion PHP Framework ***/
if(typeof $App.admin == 'undefined'){$App.admin = {};};



$App.admin.sucursales = {
    base : '/Admin/Sucursales',

    add : function(){
        
    },

    editor : function (id){
      orion_box.xhr('/Admin/Sucursales/editor?id=' + id, 300, 100);
    },

    remove: function(id,confirm_msg){
        if(confirm(confirm_msg)){
            $.post(this.base + '/remove', {
                'id': id
            }, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh();
                }
            }, 'json');
        }
    }

}

/*** Code generated by Orion PHP Framework ***/
if(typeof $App.admin == 'undefined'){$App.admin = {};};



$App.admin.productos = {
    base : '/Admin/Productos',

    add : function(){
        
    },

    editor : function (id){
        orion_box.xhr('/Admin/Productos/editor?id=' + id, 400, 400);
    },

    remove: function(id,confirm_msg){
        if(confirm(confirm_msg)){
            $.post(this.base + '/remove', {
                'id': id
            }, function(data){
                if(orion.forms.jsonResponse(data, 0) == true){
                    orion.xhr.refresh();
                }
            }, 'json');
        }
    },

    destacado: function(prodId,state){
        if(state){
            state = 1;
        }else{
            state = 0;
        }

        $.post(this.base + '/destacado', {
            'id': prodId,
            'state': state
        }, function(data){
            if(orion.forms.jsonResponse(data, 0) == true){
        //orion.xhr.refresh();
        }

        }, 'json');
    }

}

