diff --git a/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.css b/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.css new file mode 100644 index 0000000..98e91eb --- /dev/null +++ b/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.css @@ -0,0 +1,2 @@ +.ekko-lightbox-nav-overlay a:focus,.ekko-lightbox-nav-overlay a>:focus{outline:0}.ekko-lightbox-container{position:relative}.ekko-lightbox-container>div.ekko-lightbox-item{position:absolute;top:0;left:0;width:100%;transition:opacity .5s ease-in-out;opacity:1}.ekko-lightbox-nav-overlay{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex}.ekko-lightbox-nav-overlay a{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;transition:opacity .5s;color:#fff;font-size:30px;z-index:1}.ekko-lightbox-nav-overlay a>*{-ms-flex-positive:1;flex-grow:1}.ekko-lightbox-nav-overlay a span{padding:0 30px}.ekko-lightbox-nav-overlay a:last-child span{text-align:right}.ekko-lightbox-nav-overlay a:hover{text-decoration:none}.ekko-lightbox a:hover{opacity:1;text-decoration:none}.ekko-lightbox .modal-footer{text-align:left}.ekko-lightbox-loader{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.ekko-lightbox-loader>div{width:40px;height:40px;position:relative;text-align:center}.ekko-lightbox-loader>div>div{width:100%;height:100%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;animation:a 2s infinite ease-in-out}.ekko-lightbox-loader>div>div:last-child{animation-delay:-1s}@keyframes a{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}} +/*# sourceMappingURL=ekko-lightbox.min.css.map */ \ No newline at end of file diff --git a/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.js b/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.js new file mode 100644 index 0000000..beddbea --- /dev/null +++ b/librerias/ekko-lightbox/4.0.1/ekko-lightbox.min.js @@ -0,0 +1,2 @@ ++function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function a(a,b){for(var c=0;c
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},g=function(){function d(c,e){var g=this;b(this,d),this._config=a.extend({},f,e),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=c instanceof jQuery?c:a(c),this._isBootstrap3=3==a.fn.modal.Constructor.VERSION[0];var h='",i='',j='",k='",l='',m='";a(this._config.doc.body).append('"),this._$modal=a("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=a(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),a(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('
'+this._config.leftArrow+''+this._config.rightArrow+"
"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(a){return a.preventDefault(),g.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(a){return a.preventDefault(),g.navigateRight()}))),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return g._toggleLoading(!0),g._handle(),g._config.onShown.call(g)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return g._galleryName&&(a(document).off("keydown.ekkoLightbox"),a(window).off("resize.ekkoLightbox")),g._$modal.remove(),g._config.onHidden.call(g)}).modal(this._config),a(window).on("resize.ekkoLightbox",function(){g._resize(g._wantedWidth,g._wantedHeight)})}return c(d,null,[{key:"Default",get:function(){return f}}]),c(d,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(b){return b<0||b>this._$galleryItems.length-1?this:(this._galleryIndex=b,this._$element=a(this._$galleryItems.get(this._galleryIndex)),void this._handle())}},{key:"navigateLeft",value:function(){if(1!==this._$galleryItems.length)return 0===this._galleryIndex?this._galleryIndex=this._$galleryItems.length-1:this._galleryIndex--,this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"navigateRight",value:function(){if(1!==this._$galleryItems.length)return this._galleryIndex===this._$galleryItems.length-1?this._galleryIndex=0:this._galleryIndex++,this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(a){return a=a||window.event,39===a.keyCode?this.navigateRight():37===a.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(a,b){return b=b||!1,!b&&this._isImage(a)&&(b="image"),!b&&this._getYoutubeId(a)&&(b="youtube"),!b&&this._getVimeoId(a)&&(b="vimeo"),!b&&this._getInstagramId(a)&&(b="instagram"),(!b||["image","youtube","vimeo","instagram","video","url"].indexOf(b)<0)&&(b="url"),b}},{key:"_isImage",value:function(a){return a&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var a=this,b=this._$lightboxBodyTwo,c=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(b=this._$lightboxBodyOne,c=this._$lightboxBodyTwo),c.removeClass("in show"),setTimeout(function(){a._$lightboxBodyTwo.hasClass("in")||a._$lightboxBodyTwo.empty(),a._$lightboxBodyOne.hasClass("in")||a._$lightboxBodyOne.empty()},500),b.addClass("in show"),b}},{key:"_handle",value:function(){var a=this._containerToUse();this._updateTitleAndFooter();var b=this._$element.attr("data-remote")||this._$element.attr("href"),c=this._detectRemoteType(b,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(c)<0)return this._error(this._config.strings.type);switch(c){case"image":this._preloadImage(b,a),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(b,a);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(b),a);break;case"instagram":this._showInstagramVideo(this._getInstagramId(b),a);break;case"video":this._showHtml5Video(b,a);break;default:this._loadRemoteContent(b,a)}return this}},{key:"_getYoutubeId",value:function(a){if(!a)return!1;var b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!b||11!==b[2].length)&&b[2]}},{key:"_getVimeoId",value:function(a){return!!(a&&a.indexOf("vimeo")>0)&&a}},{key:"_getInstagramId",value:function(a){return!!(a&&a.indexOf("instagram")>0)&&a}},{key:"_toggleLoading",value:function(b){return b=b||!1,b?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),a(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),a(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(a){return parseInt(this._$modalDialog.css(a),10)+parseInt(this._$modalContent.css(a),10)+parseInt(this._$modalBody.css(a),10)}},{key:"_updateTitleAndFooter",value:function(){var a=this._$element.data("title")||"",b=this._$element.data("footer")||"";return this._titleIsShown=!1,a||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(a||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,b?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(b)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(a,b){var c=this._getYoutubeId(a),d=a.indexOf("&")>0?a.substr(a.indexOf("&")):"",e=this._$element.data("width")||560,f=this._$element.data("height")||e/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+c+"?badge=0&autoplay=1&html5=1"+d,e,f,b)}},{key:"_showVimeoVideo",value:function(a,b){var c=this._$element.data("width")||500,d=this._$element.data("height")||c/(560/315);return this._showVideoIframe(a+"?autoplay=1",c,d,b)}},{key:"_showInstagramVideo",value:function(a,b){var c=this._$element.data("width")||612,d=c+80;return a="/"!==a.substr(-1)?a+"/":a,b.html(''),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(a,b,c,d){return c=c||b,d.html('
'),this._resize(b,c),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(a,b){var c=this._$element.data("width")||560,d=this._$element.data("height")||c/(560/315);return b.html('
'),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(b,c){var d=this,e=this._$element.data("width")||560,f=this._$element.data("height")||560,g=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),g||this._isExternal(b)?(c.html(''),this._config.onContentLoaded.call(this)):c.load(b,a.proxy(function(){return d._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(e,f),this}},{key:"_isExternal",value:function(a){var b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol||"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(a){return console.error(a),this._containerToUse().html(a),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(b,c){if(this._$galleryItems){var d=a(this._$galleryItems.get(b),!1);if("undefined"!=typeof d){var e=d.attr("data-remote")||d.attr("href");return("image"===d.attr("data-type")||this._isImage(e))&&this._preloadImage(e,!1),c>0?this._preloadImageByIndex(b+1,c-1):void 0}}}},{key:"_preloadImage",value:function(b,c){var d=this;c=c||!1;var e=new Image;return c&&!function(){var f=setTimeout(function(){c.append(d._config.loadingMessage)},200);e.onload=function(){f&&clearTimeout(f),f=null;var b=a("");return b.attr("src",e.src),b.addClass("img-fluid"),b.css("width","100%"),c.html(b),d._$modalArrows&&d._$modalArrows.css("display",""),d._resize(e.width,e.height),d._toggleLoading(!1),d._config.onContentLoaded.call(d)},e.onerror=function(){return d._toggleLoading(!1),d._error(d._config.strings.fail+(" "+b))}}(),e.src=b,e}},{key:"_resize",value:function(b,c){c=c||b,this._wantedWidth=b,this._wantedHeight=c;var d=this._padding.left+this._padding.right+this._border.left+this._border.right,e=Math.min(b+d,this._config.doc.body.clientWidth);b+d>e?(c=(e-d)/b*c,b=e):b+=d;var f=0,g=0;this._footerIsShown&&(g=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(f=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,i=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),j=Math.min(c,a(window).height()-h-i-f-g);if(c>j){var k=Math.min(j/c,1);b=Math.ceil(k*b)}if(this._$lightboxContainer.css("height",j),this._$modalDialog.css("width","auto").css("maxWidth",b),this._isBootstrap3){var l=this._$modal.data("bs.modal");l&&l.handleUpdate()}else{var l=this._$modal.data("bs.modal");l&&l._handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(b){var c=this;return b=b||{},this.each(function(){var e=a(c),f=a.extend({},d.Default,e.data(),"object"==typeof b&&b);new d(c,f)})}}]),d}();return a.fn[d]=g._jQueryInterface,a.fn[d].Constructor=g,a.fn[d].noConflict=function(){return a.fn[d]=e,g._jQueryInterface},g})(jQuery)}(jQuery); +//# sourceMappingURL=ekko-lightbox.min.js.map \ No newline at end of file diff --git a/librerias/ekko-lightbox/ekko-lightbox.min.js b/librerias/ekko-lightbox/ekko-lightbox.min.js index ea94b14..beddbea 100644 --- a/librerias/ekko-lightbox/ekko-lightbox.min.js +++ b/librerias/ekko-lightbox/ekko-lightbox.min.js @@ -1,2 +1,2 @@ -+function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function a(a,b){for(var c=0;c
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},g=function(){function d(c,e){var g=this;b(this,d),this._config=a.extend({},f,e),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=c instanceof jQuery?c:a(c),this._isBootstrap3=3==a.fn.modal.Constructor.VERSION[0];var h='",i='',j='",k='",l='',m='";a(this._config.doc.body).append('"),this._$modal=a("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=a(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),a(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(a){return a.preventDefault(),g.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(a){return a.preventDefault(),g.navigateRight()}))),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return g._toggleLoading(!0),g._handle(),g._config.onShown.call(g)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return g._galleryName&&(a(document).off("keydown.ekkoLightbox"),a(window).off("resize.ekkoLightbox")),g._$modal.remove(),g._config.onHidden.call(g)}).modal(this._config),a(window).on("resize.ekkoLightbox",function(){g._resize(g._wantedWidth,g._wantedHeight)})}return c(d,null,[{key:"Default",get:function(){return f}}]),c(d,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(b){return b<0||b>this._$galleryItems.length-1?this:(this._galleryIndex=b,this._$element=a(this._$galleryItems.get(this._galleryIndex)),void this._handle())}},{key:"navigateLeft",value:function(){if(1!==this._$galleryItems.length)return 0===this._galleryIndex?this._galleryIndex=this._$galleryItems.length-1:this._galleryIndex--,this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"navigateRight",value:function(){if(1!==this._$galleryItems.length)return this._galleryIndex===this._$galleryItems.length-1?this._galleryIndex=0:this._galleryIndex++,this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(a){return a=a||window.event,39===a.keyCode?this.navigateRight():37===a.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(a,b){return b=b||!1,!b&&this._isImage(a)&&(b="image"),!b&&this._getYoutubeId(a)&&(b="youtube"),!b&&this._getVimeoId(a)&&(b="vimeo"),!b&&this._getInstagramId(a)&&(b="instagram"),(!b||["image","youtube","vimeo","instagram","video","url"].indexOf(b)<0)&&(b="url"),b}},{key:"_isImage",value:function(a){return a&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var a=this,b=this._$lightboxBodyTwo,c=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(b=this._$lightboxBodyOne,c=this._$lightboxBodyTwo),c.removeClass("in show"),setTimeout(function(){a._$lightboxBodyTwo.hasClass("in")||a._$lightboxBodyTwo.empty(),a._$lightboxBodyOne.hasClass("in")||a._$lightboxBodyOne.empty()},500),b.addClass("in show"),b}},{key:"_handle",value:function(){var a=this._containerToUse();this._updateTitleAndFooter();var b=this._$element.attr("data-remote")||this._$element.attr("href"),c=this._detectRemoteType(b,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(c)<0)return this._error(this._config.strings.type);switch(c){case"image":this._preloadImage(b,a),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(b,a);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(b),a);break;case"instagram":this._showInstagramVideo(this._getInstagramId(b),a);break;case"video":this._showHtml5Video(b,a);break;default:this._loadRemoteContent(b,a)}return this}},{key:"_getYoutubeId",value:function(a){if(!a)return!1;var b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!b||11!==b[2].length)&&b[2]}},{key:"_getVimeoId",value:function(a){return!!(a&&a.indexOf("vimeo")>0)&&a}},{key:"_getInstagramId",value:function(a){return!!(a&&a.indexOf("instagram")>0)&&a}},{key:"_toggleLoading",value:function(b){return b=b||!1,b?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),a(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),a(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(a){return parseInt(this._$modalDialog.css(a),10)+parseInt(this._$modalContent.css(a),10)+parseInt(this._$modalBody.css(a),10)}},{key:"_updateTitleAndFooter",value:function(){var a=this._$element.data("title")||"",b=this._$element.data("footer")||"";return this._titleIsShown=!1,a||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(a||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,b?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(b)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(a,b){var c=this._getYoutubeId(a),d=a.indexOf("&")>0?a.substr(a.indexOf("&")):"",e=this._$element.data("width")||560,f=this._$element.data("height")||e/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+c+"?badge=0&autoplay=1&html5=1"+d,e,f,b)}},{key:"_showVimeoVideo",value:function(a,b){var c=500,d=this._$element.data("height")||c/(560/315);return this._showVideoIframe(a+"?autoplay=1",c,d,b)}},{key:"_showInstagramVideo",value:function(a,b){var c=this._$element.data("width")||612,d=c+80;return a="/"!==a.substr(-1)?a+"/":a,b.html(''),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(a,b,c,d){return c=c||b,d.html('
'),this._resize(b,c),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(a,b){var c=this._$element.data("width")||560,d=this._$element.data("height")||c/(560/315);return b.html('
'),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(b,c){var d=this,e=this._$element.data("width")||560,f=this._$element.data("height")||560,g=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),g||this._isExternal(b)?(c.html(''),this._config.onContentLoaded.call(this)):c.load(b,a.proxy(function(){return d._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(e,f),this}},{key:"_isExternal",value:function(a){var b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol||"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(a){return console.error(a),this._containerToUse().html(a),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(b,c){if(this._$galleryItems){var d=a(this._$galleryItems.get(b),!1);if("undefined"!=typeof d){var e=d.attr("data-remote")||d.attr("href");return("image"===d.attr("data-type")||this._isImage(e))&&this._preloadImage(e,!1),c>0?this._preloadImageByIndex(b+1,c-1):void 0}}}},{key:"_preloadImage",value:function(b,c){var d=this;c=c||!1;var e=new Image;return c&&!function(){var f=setTimeout(function(){c.append(d._config.loadingMessage)},200);e.onload=function(){f&&clearTimeout(f),f=null;var b=a("");return b.attr("src",e.src),b.addClass("img-fluid"),b.css("width","100%"),c.html(b),d._$modalArrows&&d._$modalArrows.css("display",""),d._resize(e.width,e.height),d._toggleLoading(!1),d._config.onContentLoaded.call(d)},e.onerror=function(){return d._toggleLoading(!1),d._error(d._config.strings.fail+(" "+b))}}(),e.src=b,e}},{key:"_resize",value:function(b,c){c=c||b,this._wantedWidth=b,this._wantedHeight=c;var d=this._padding.left+this._padding.right+this._border.left+this._border.right,e=Math.min(b+d,this._config.doc.body.clientWidth);b+d>e?(c=(e-d)/b*c,b=e):b+=d;var f=0,g=0;this._footerIsShown&&(g=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(f=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,i=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),j=Math.min(c,a(window).height()-h-i-f-g);if(c>j){var k=Math.min(j/c,1);b=Math.ceil(k*b)}if(this._$lightboxContainer.css("height",j),this._$modalDialog.css("width","auto").css("maxWidth",b),this._isBootstrap3){var l=this._$modal.data("bs.modal");l&&l.handleUpdate()}else{var l=this._$modal.data("bs.modal");l&&l._handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(b){var c=this;return b=b||{},this.each(function(){var e=a(c),f=a.extend({},d.Default,e.data(),"object"==typeof b&&b);new d(c,f)})}}]),d}();return a.fn[d]=g._jQueryInterface,a.fn[d].Constructor=g,a.fn[d].noConflict=function(){return a.fn[d]=e,g._jQueryInterface},g})(jQuery)}(jQuery); ++function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function a(a,b){for(var c=0;c
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},g=function(){function d(c,e){var g=this;b(this,d),this._config=a.extend({},f,e),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=c instanceof jQuery?c:a(c),this._isBootstrap3=3==a.fn.modal.Constructor.VERSION[0];var h='",i='',j='",k='",l='',m='";a(this._config.doc.body).append('"),this._$modal=a("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=a(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),a(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(a){return a.preventDefault(),g.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(a){return a.preventDefault(),g.navigateRight()}))),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return g._toggleLoading(!0),g._handle(),g._config.onShown.call(g)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return g._galleryName&&(a(document).off("keydown.ekkoLightbox"),a(window).off("resize.ekkoLightbox")),g._$modal.remove(),g._config.onHidden.call(g)}).modal(this._config),a(window).on("resize.ekkoLightbox",function(){g._resize(g._wantedWidth,g._wantedHeight)})}return c(d,null,[{key:"Default",get:function(){return f}}]),c(d,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(b){return b<0||b>this._$galleryItems.length-1?this:(this._galleryIndex=b,this._$element=a(this._$galleryItems.get(this._galleryIndex)),void this._handle())}},{key:"navigateLeft",value:function(){if(1!==this._$galleryItems.length)return 0===this._galleryIndex?this._galleryIndex=this._$galleryItems.length-1:this._galleryIndex--,this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"navigateRight",value:function(){if(1!==this._$galleryItems.length)return this._galleryIndex===this._$galleryItems.length-1?this._galleryIndex=0:this._galleryIndex++,this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(a){return a=a||window.event,39===a.keyCode?this.navigateRight():37===a.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(a,b){return b=b||!1,!b&&this._isImage(a)&&(b="image"),!b&&this._getYoutubeId(a)&&(b="youtube"),!b&&this._getVimeoId(a)&&(b="vimeo"),!b&&this._getInstagramId(a)&&(b="instagram"),(!b||["image","youtube","vimeo","instagram","video","url"].indexOf(b)<0)&&(b="url"),b}},{key:"_isImage",value:function(a){return a&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var a=this,b=this._$lightboxBodyTwo,c=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(b=this._$lightboxBodyOne,c=this._$lightboxBodyTwo),c.removeClass("in show"),setTimeout(function(){a._$lightboxBodyTwo.hasClass("in")||a._$lightboxBodyTwo.empty(),a._$lightboxBodyOne.hasClass("in")||a._$lightboxBodyOne.empty()},500),b.addClass("in show"),b}},{key:"_handle",value:function(){var a=this._containerToUse();this._updateTitleAndFooter();var b=this._$element.attr("data-remote")||this._$element.attr("href"),c=this._detectRemoteType(b,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(c)<0)return this._error(this._config.strings.type);switch(c){case"image":this._preloadImage(b,a),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(b,a);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(b),a);break;case"instagram":this._showInstagramVideo(this._getInstagramId(b),a);break;case"video":this._showHtml5Video(b,a);break;default:this._loadRemoteContent(b,a)}return this}},{key:"_getYoutubeId",value:function(a){if(!a)return!1;var b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!b||11!==b[2].length)&&b[2]}},{key:"_getVimeoId",value:function(a){return!!(a&&a.indexOf("vimeo")>0)&&a}},{key:"_getInstagramId",value:function(a){return!!(a&&a.indexOf("instagram")>0)&&a}},{key:"_toggleLoading",value:function(b){return b=b||!1,b?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),a(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),a(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(a){return parseInt(this._$modalDialog.css(a),10)+parseInt(this._$modalContent.css(a),10)+parseInt(this._$modalBody.css(a),10)}},{key:"_updateTitleAndFooter",value:function(){var a=this._$element.data("title")||"",b=this._$element.data("footer")||"";return this._titleIsShown=!1,a||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(a||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,b?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(b)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(a,b){var c=this._getYoutubeId(a),d=a.indexOf("&")>0?a.substr(a.indexOf("&")):"",e=this._$element.data("width")||560,f=this._$element.data("height")||e/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+c+"?badge=0&autoplay=1&html5=1"+d,e,f,b)}},{key:"_showVimeoVideo",value:function(a,b){var c=this._$element.data("width")||500,d=this._$element.data("height")||c/(560/315);return this._showVideoIframe(a+"?autoplay=1",c,d,b)}},{key:"_showInstagramVideo",value:function(a,b){var c=this._$element.data("width")||612,d=c+80;return a="/"!==a.substr(-1)?a+"/":a,b.html(''),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(a,b,c,d){return c=c||b,d.html('
'),this._resize(b,c),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(a,b){var c=this._$element.data("width")||560,d=this._$element.data("height")||c/(560/315);return b.html('
'),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(b,c){var d=this,e=this._$element.data("width")||560,f=this._$element.data("height")||560,g=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),g||this._isExternal(b)?(c.html(''),this._config.onContentLoaded.call(this)):c.load(b,a.proxy(function(){return d._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(e,f),this}},{key:"_isExternal",value:function(a){var b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol||"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(a){return console.error(a),this._containerToUse().html(a),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(b,c){if(this._$galleryItems){var d=a(this._$galleryItems.get(b),!1);if("undefined"!=typeof d){var e=d.attr("data-remote")||d.attr("href");return("image"===d.attr("data-type")||this._isImage(e))&&this._preloadImage(e,!1),c>0?this._preloadImageByIndex(b+1,c-1):void 0}}}},{key:"_preloadImage",value:function(b,c){var d=this;c=c||!1;var e=new Image;return c&&!function(){var f=setTimeout(function(){c.append(d._config.loadingMessage)},200);e.onload=function(){f&&clearTimeout(f),f=null;var b=a("");return b.attr("src",e.src),b.addClass("img-fluid"),b.css("width","100%"),c.html(b),d._$modalArrows&&d._$modalArrows.css("display",""),d._resize(e.width,e.height),d._toggleLoading(!1),d._config.onContentLoaded.call(d)},e.onerror=function(){return d._toggleLoading(!1),d._error(d._config.strings.fail+(" "+b))}}(),e.src=b,e}},{key:"_resize",value:function(b,c){c=c||b,this._wantedWidth=b,this._wantedHeight=c;var d=this._padding.left+this._padding.right+this._border.left+this._border.right,e=Math.min(b+d,this._config.doc.body.clientWidth);b+d>e?(c=(e-d)/b*c,b=e):b+=d;var f=0,g=0;this._footerIsShown&&(g=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(f=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,i=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),j=Math.min(c,a(window).height()-h-i-f-g);if(c>j){var k=Math.min(j/c,1);b=Math.ceil(k*b)}if(this._$lightboxContainer.css("height",j),this._$modalDialog.css("width","auto").css("maxWidth",b),this._isBootstrap3){var l=this._$modal.data("bs.modal");l&&l.handleUpdate()}else{var l=this._$modal.data("bs.modal");l&&l._handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(b){var c=this;return b=b||{},this.each(function(){var e=a(c),f=a.extend({},d.Default,e.data(),"object"==typeof b&&b);new d(c,f)})}}]),d}();return a.fn[d]=g._jQueryInterface,a.fn[d].Constructor=g,a.fn[d].noConflict=function(){return a.fn[d]=e,g._jQueryInterface},g})(jQuery)}(jQuery); //# sourceMappingURL=ekko-lightbox.min.js.map \ No newline at end of file diff --git a/milfs/funciones/funciones.bak.php b/milfs/funciones/funciones.bak.php new file mode 100644 index 0000000..be6b1c1 --- /dev/null +++ b/milfs/funciones/funciones.bak.php @@ -0,0 +1,14604 @@ +addAssign("$div","innerHTML",""); + return $respuesta; + } + require("includes/datos.php"); +// require ("includes/parametrizacion.php"); +$consulta = "SELECT * FROM `$tabla_autenticacion` WHERE `id_empresa` = '$proyecto' AND equipo REGEXP '^$clave' GROUP BY equipo ORDER BY equipo "; +$resultado ="
    "; + $link=Conectarse(); +mysqli_set_charset($link, "utf8"); +$sql=mysqli_query($link,$consulta); +if (mysqli_num_rows($sql)!=0){ + +while( $row = mysqli_fetch_array( $sql ) ) { +$resultado .="
  • $row[equipo]
  • "; +}} +$resultado .="
"; +$respuesta->addAssign("$div","innerHTML","$resultado"); + +} +else{ + +$resultado =" + "; + return $resultado; +} + + + return $respuesta; + + + +} +$xajax->registerFunction("equipos"); + + + +function cambiar_propiedades($div,$clave,$valor) +{ +$respuesta = new xajaxResponse('utf-8'); +if($clave !="") { + +$respuesta->addAssign("$div","$clave"," $valor");} + + +else{$respuesta->addAssign($div,"style.top","0px"); + $respuesta->addAssign($div,"style.height","100%");} + + + //$respuesta->addAssign("$div","innerHTML","$resultado"); + + + return $respuesta; + + +} +$xajax->registerFunction("cambiar_propiedades"); + + +function galleria($id){ + $contenido =""; + $link=Conectarse(); + $campo_nombre ="1665"; + $campo_coleccion ="1666"; + $campo_autor ="1667"; + $campo_licencia ="175"; + $campo_imagen = buscar_campo_tipo("$id","15"); +$consulta_principal = "SELECT control,id,form_id FROM form_datos WHERE form_id = '$id' GROUP BY form_datos.control limit 200"; + + +mysqli_set_charset($link, "utf8"); +mysqli_real_escape_string($link,$consulta_principal); +$sql_total=mysqli_query($link,$consulta_principal); + $sql=mysqli_query($link,$consulta_principal); +mysqli_data_seek($sql_total, 0); +while( $row = mysqli_fetch_array( $sql ) ) { + ; +$imagen = remplacetas('form_datos','id_campo',$campo_imagen[0],'contenido'," control = '$row[control]' ") ; +$titulo = remplacetas('form_datos','id_campo',$campo_nombre,'contenido'," control = '$row[control]' ") ; +$proyecto = remplacetas('form_datos','id_campo',$campo_proyecto,'contenido'," control = '$row[control]' ") ; +$autor = remplacetas('form_datos','id_campo',$campo_autor,'contenido'," control = '$row[control]' ") ; +$licencia = remplacetas('form_datos','id_campo',$campo_licencia,'contenido'," control = '$row[control]' ") ; + $imagen = "../milfs/images/secure/?file=150/$imagen[0]"; + $url ="$_SESSION[site]milfs/images/secure/?file=150/$imagen[0]"; + //$respuesta->addAssign("$div","$className"," input-group has-error ");} +$contenido .= " + +
+
+
    +
  • $titulo[0]
  • + +
  • Autor: $autor[0]
  • +
  • Licencia: $licencia[0]
  • + +
+
+
"; + +} +$resultado=" +
$contenido
"; +return $resultado; +} + +function json_render($contenido,$tipo,$control){ + +$campos = "$tipo,$contenido"; +$datos = json_decode($contenido, true); +if ($tipo == "html"){ + foreach ($datos as $id_campo => $valor) { + $campo_nombre = remplacetas('form_campos','id',"$id_campo",'campo_nombre',"") ; + $campo_descripcion = remplacetas('form_campos','id',"$id_campo",'campo_descripcion',"") ; + foreach ($valor as $c => $v) { + foreach ($v as $c1 => $v1) { + $linea .= "$v1"; + } + } + } + +$resultado=" + + +$linea +
$campo_nombre[0]
+ +"; +} +elseif($tipo == "csv") { + foreach ($datos as $id_campo => $valor) { + $campo_nombre = remplacetas('form_campos','id',"$id_campo",'campo_nombre',"") ; + $campo_descripcion = remplacetas('form_campos','id',"$id_campo",'campo_descripcion',"") ; + foreach ($valor as $c => $v) { + foreach ($v as $c1 => $v1) { + $linea .= " $v1,"; + } + + } + } +$resultado = trim($linea,","); +} +elseif($tipo == "array") { + $array= array(); + foreach ($datos as $id_campo => $valor) { + foreach ($valor as $c => $v) { + foreach ($v as $c1 => $v1) { + $array[]= "$v1"; + } + + } + } +$resultado = $array; +} +else{ + +} + +return $resultado; +} + +function exportar_svg($formulario) { + $linea=""; +if($formulario !=""){ + $estructura = "$_SESSION[path]/tmp/$formulario/svg/"; + if (!file_exists($estructura)) { + + if(!mkdir($estructura, 0775, true)) { + + die("Fallo al crear las carpetas... $estructura"); +} +//$archivo = "milfs/tmp/$nombre"; + + +$impresion ="Esto es"; +$consulta_principal = "SELECT control,id,form_id FROM form_datos WHERE form_id = '$formulario' GROUP BY form_datos.control "; +$link=Conectarse(); +mysqli_set_charset($link, "utf8"); +mysqli_real_escape_string($link,$consulta_principal); +$sql_total=mysqli_query($link,$consulta_principal); + $sql=mysqli_query($link,$consulta_principal); +mysqli_data_seek($sql_total, 0); +while( $row = mysqli_fetch_array( $sql ) ) { + $campo_titulo = remplacetas('form_parametrizacion','campo',$formulario,'descripcion'," tabla='form_id' and opcion = 'titulo'") ; + $id_campo = $campo_titulo[0]; + $titulo = remplacetas('form_datos','id_campo',$campo_titulo[0],'contenido'," control = '$row[control]' ") ; + +// if (!is_array($listado_campos)){$listado_campos="$listado_campos";}else {$listado_campos=$listado_campos;} +$linea .= landingpage_contenido_identificador("$row[control]","$formulario","svg",'paginado'); +$impresion = landingpage_contenido_identificador("$row[control]","$formulario","svg",'paginado'); +$impresion = str_replace("'", '"', $impresion); +$impresion = str_replace('@"', "'", $impresion); +$encabezado = ' + + + + + + + + + + image/svg+xml + + + + + + +'; +$pie=""; +//$linea .= mostrar_identificador("$row[control]","$id_form","landingpage",'simple');; +//$linea .= "
$row[control]"; +$archivo = $estructura."$titulo[0]"."_$row[control]".".svg"; +$file=fopen($archivo,"w") or die("Problemas en la creacion $archivo"); +$impresion = $encabezado.$impresion.$pie; +fputs($file,$impresion); +fclose($file); + } + + + +} + + echo $linea; + + //$file = fopen($filePath, 'w'); +} + +} + +function filtro_opciones_campo($id_campo,$formulario){ +$opciones = ""; +$consulta = "SELECT * FROM `form_campos_valores` WHERE `id_form_campo` = '$id_campo'"; + + $link=Conectarse(); +mysqli_set_charset($link, "utf8"); +$sql=mysqli_query($link,$consulta); +if (mysqli_num_rows($sql)!=0){ + +while( $row = mysqli_fetch_array( $sql ) ) { + + $opciones .=" +
  • $row[campo_valor]
  • + "; + +} +$opciones =" +
  • Limpiar
  • + $opciones +"; + +} + +return $opciones; +} + +function filtro_generico_buscar($formulario,$id){ +$div ="mostrar_resultado"; +$resultado .=""; +foreach ($formulario as $clave => $valor) { + if($valor !=""){ + $campo = str_replace("filtro_", "", "$clave"); + $resultado = " id_campo = $campo AND contenido = '$valor' "; + $campos[] = $resultado; + } + +} +$campos = implode(" AND ",$campos); + +$consulta ="SELECT * FROM form_datos WHERE form_id ='$id' AND $campos GROUP BY control"; +$resultado = "$consulta"; + $respuesta = new xajaxResponse('utf-8'); + $respuesta->addAssign("$div","innerHTML","$resultado"); + return $respuesta; + + +} +$xajax->registerFunction("filtro_generico_buscar"); + + +function filtro_generico($formulario,$tipo){ + +$filtro=""; +$consulta= " + SELECT campo_nombre,tipo_campo_nombre ,campo_tipo ,id_campo + FROM `form_contenido_campos` , form_campos , form_tipo_campo + WHERE form_contenido_campos.id_campo = form_campos.id + AND form_tipo_campo.id_tipo_campo= form_campos.campo_tipo + AND `id_form` = '$formulario' + AND (`campo_tipo` = 8 OR `campo_tipo` = 16 OR `campo_tipo` = 24 OR `campo_tipo` = 25 OR `campo_tipo` = 10) + group by form_contenido_campos.id + ORDER BY form_contenido_campos.orden "; + + $link=Conectarse(); +mysqli_set_charset($link, "utf8"); +$sql=mysqli_query($link,$consulta); +if (mysqli_num_rows($sql)!=0){ + +while( $row = mysqli_fetch_array( $sql ) ) { +$listado = filtro_opciones_campo($row[id_campo],$formulario); + $filtro .=" + + + + "; + +} +$filtro = " +
    + + $filtro + + +
    "; + +} +return $filtro; +} + + +function formulario_tabla_temporal($id){ + +$lineas=""; + +$link=Conectarse(); +mysqli_set_charset($link, "utf8"); + +/// LISTADO DE CAMPOS PARAMETRIZADO POR ID /// + $consulta_campos = "SELECT id_campo FROM `form_datos` , form_campos , form_tipo_campo WHERE form_datos.id_campo = form_campos.id + AND form_tipo_campo.id_tipo_campo= form_campos.campo_tipo AND `form_id` = '$id' AND (`campo_tipo` = 8 OR `campo_tipo` = 16 OR `campo_tipo` = 24 OR `campo_tipo` = 25 OR `campo_tipo` = 10) + GROUP BY id_campo ORDER BY id_campo"; + $sql=mysqli_query($link,$consulta_campos); + ; + if (mysqli_num_rows($sql)!='0'){ + while( $row = mysqli_fetch_array( $sql ) ) { + + $campos[] = " campo_$row[id_campo] longtext "; + $id_campos[] = "$row[id_campo]"; + + } + $campos[] = "control longtext"; + } +/// ENTRADAS QUE TIENEN VALORES EN ESOS CAMPOS + + $consulta_contenido = "SELECT id_campo ,contenido,control FROM `form_datos` , form_campos , form_tipo_campo WHERE form_datos.id_campo = form_campos.id + AND form_tipo_campo.id_tipo_campo= form_campos.campo_tipo AND `form_id` = '$id' AND (`campo_tipo` = 8 OR `campo_tipo` = 16 OR `campo_tipo` = 24 OR `campo_tipo` = 25 OR `campo_tipo` = 10) GROUP BY control "; + + $sql_contenido=mysqli_query($link,$consulta_contenido); + if (mysqli_num_rows($sql_contenido)!='0'){ + + while( $row_contenido = mysqli_fetch_array( $sql_contenido ) ) { + $los_campos=""; + $campos_insertar=""; + foreach($id_campos as $campo_nombre){ + $contenido = remplacetas('form_datos','form_id',"$id",'contenido'," id_campo ='$campo_nombre' and control ='$row_contenido[control]' ") ; + $los_campos .= "$campo_nombre $contenido[0]"; + $campos_insertar[] ="campo_$campo_nombre ='$contenido[0]'"; + + } + $campos_insertar[] ="control ='$row_contenido[control]'"; + $lineas .= "$row_contenido[control] $los_campos //"; + $insertar_campos= implode(",",$campos_insertar); + $insert[] = "INSERT INTO temporal_6 SET $insertar_campos "; + + } + } +$campos= implode(",",$campos); +$insert= implode(";",$insert); + + +$crear = "CREATE TABLE IF NOT EXISTS temporal_$id ($campos)"; +$consultar= "SELECT * FROM temporal_$id"; +$query = "$crear ; $insert"; +//$tabla_temporal=mysqli_query($link," $crear ; $insertar"); +$tabla_temporal=mysqli_multi_query($link, $query); + +//$insert_temporal=mysqli_query($link,"$insertar"); +return ;//" //

    $tabla_temporal

    ** $crear ; $insert ; $consultar ; * $lineas
    // "; +} + +function formulario_estadistica_ocultar($id_form,$id_campo,$accion,$tipo) { + $etiqueta_limpia = str_replace(array(' '), '', $etiqueta); +$div="div_manejo_$etiqueta";if($accion=='') { + + if($_SESSION['id'] == 1){ + $resultado=" +
    +
    Eliminar gráfica
    +
    + "; +}else {$resultado="";} + return $resultado; +}elseif($accion =="eliminar") { + +$borrar= parametrizacion_linea("$tipo","$id_form",'ocultar',"$id_campo",'','',"$id_campo"); +//$resultado="$id_campo $borrar"; +$div="contenedor_grafica_$tipo_$id_campo"; +}else{} + + $respuesta = new xajaxResponse('utf-8'); + $respuesta->addAssign("$div","innerHTML","$resultado"); + return $respuesta; + + +} +$xajax->registerFunction("formulario_estadistica_ocultar"); + + + +function formulario_estadistica($id_form,$id_campo,$group,$tipo){ +$mostrar = remplacetas("form_parametrizacion",'item',"$id_campo",'descripcion',"opcion = 'ocultar' AND tabla = '$tipo'") ; +if($mostrar[0] !="") { + + $contenido =""; + return $contenido; +} + +$consulta = "SELECT count(control) as cantidad , id_campo ,contenido FROM `form_datos`, `form_campos` WHERE `form_datos`.id_campo = `form_campos`.id AND `id_campo` = '$id_campo' AND `form_id` = '$id_form' GROUP BY $group order by cantidad"; +$link=Conectarse(); +mysqli_set_charset($link, "utf8"); + $sql=mysqli_query($link,$consulta); + + if (mysqli_num_rows($sql)!='0'){ + + while( $row = mysqli_fetch_array( $sql ) ) { + $dato[] =$row; + $lineas .="$row[cantidad]$row[contenido]"; + } + $datos= json_encode($dato); + + $resultado =" + + + $lineas +
    $row[cantidad]$row[contenido]
    + + "; + $manejo_grafica = formulario_estadistica_ocultar("$id_form","$id_campo","","$tipo"); +$grafica =" +
    +
    +$manejo_grafica +
    + + +"; + + } + return $grafica; + +} + +function formulario_acciones($id) { + // $areas = resumen_identificador("$row[control]",'','','boton'); + $geo = buscar_campo_tipo("$id","14"); + $buscador = buscar_datos("*formato*","$id","grid","mostrar_contenido_buscador"); + if($geo[0] !='') { + $mapa= "Mapa + {GEOJson} + ";}else {$mapa='';} +$acciones="
    + + {json} + {json simple} + $mapa + + Mostrar + Llenar + Embeber + Doc + SVG + $buscador + +
    "; +return $acciones; + +} + + + + +function portal_filtro_campos_drop($formulario,$id_campo,$div,$plantilla){ +$listado=""; +$tabla=""; +if($id_campo =="") { + $campo_titulo = remplacetas('form_parametrizacion','campo',$formulario,'descripcion'," tabla='form_id' and opcion = 'titulo'") ; + $id_campo = $campo_titulo[0]; + if($id_campo =="") { $resultado = ""; return $resultado;} + } + $tipo_campo = remplacetas('form_campos','id',"$id_campo",'campo_tipo',"") ; + if($tipo_campo[0] =="10" ) {$tipo ="relacion";}else{$tipo ="";} + /// $valor_actual = relacion_render("$id","$row[id_campo]",$contenido,'5'); + +$formulario_descripcion = remplacetas('form_id','id',"$formulario",'descripcion',"") ; +$formulario_nombre = remplacetas('form_id','id',"$formulario",'nombre',"") ; +$campo_nombre = remplacetas('form_campos','id',"$id_campo",'campo_nombre',"") ; +$campo_descripcion = remplacetas('form_campos','id',"$id_campo",'campo_descripcion',"") ; + +$consulta ="SELECT * + FROM form_campos ,form_datos + WHERE form_datos.form_id = '$formulario' + AND form_campos.id = form_datos.id_campo + AND form_datos.id_campo = '$id_campo' + GROUP BY contenido + ORDER BY contenido"; +$link=Conectarse(); +mysqli_set_charset($link, "utf8"); +$sql=mysqli_query($link,$consulta); +if (mysqli_num_rows($sql)!=0){ + +while( $row = mysqli_fetch_array( $sql ) ) { + if($tipo =='relacion') { + ///($form_id,$id_campo,$valor,$cantidad) + $valor_actual = relacion_render("$formulario","$id_campo","$row[contenido]",'0','relacion_drop'); + } + else { + $valor_actual="$row[contenido]"; + } + +$listado .= "
  • $valor_actual
  • "; +} + +} +/*$resultado =" +
    + Filtro + $resultado +
    "; + */ + $resultado=" + + "; + +return $resultado; +} + +function drop($tabla,$value,$descripcion,$onchange,$where,$nombre){ +$group =""; +@$valor=$valor; +@$value =$value; +$link=Conectarse(); +$campos = explode(",",$descripcion); +@$campo1 = $campos[0]; +@$campo2 = $campos[1]; +$lis=""; + mysqli_set_charset($link, "utf8"); + $consulta = "SELECT *,$value, $descripcion FROM $tabla WHERE 1 $group ORDER BY $campo1 "; + $sql=mysqli_query($link,$consulta); + + if (mysqli_num_rows($sql)!='0'){ + while( $row = mysqli_fetch_array( $sql ) ) { + if($row[$value]=="") {$resultado.="";}else{ + $mostrar_id = "[$row[$value]]"; + $lis.= "
  • ".substr(@$row[$campo1], 0, 150 )." ".substr(@$row[$campo2], 0, 30 )." $mostrar_id
  • "; + } + } + $resultado=" + + "; + } + else{ + $resultado = "
    No hay resultados 0019
    "; + } +return $resultado; +} + + + +function contenido_presentacion($id){ + $imagen =""; + $acciones =""; + $busca =""; + $busqueda =""; + $fechas =""; + $campo =""; + $campo_filtro =""; + $lineas =""; + $linea =""; + $formato =""; + $href_4=""; + $href_5=""; + $listado_nombres =""; + if(isset($_REQUEST['orden'])) { $orden= "$_REQUEST[orden]";} + if(isset($_REQUEST['registros'])) { $registros= "$_REQUEST[registros]";} + if(isset($_REQUEST['pagina'])) { $pagina= "$_REQUEST[pagina]";} + if(isset($_REQUEST['v'])) { $origen= "$_REQUEST[v]";} + //$campo_orden = remplacetas('form_parametrizacion','campo',"$form",'descripcion'," tabla='form_id' and opcion = 'orden'") ; + //$campo_orden = $campo_orden[0]; + + + + + $descripcion = remplacetas('form_id','id',$id,'descripcion') ; + $nombre = remplacetas('form_id','id',$id,'nombre') ; + $respuesta = new xajaxResponse('utf-8'); + + $campo_titulo = remplacetas('form_parametrizacion','campo',$id,'descripcion'," tabla='form_id' and opcion = 'titulo'") ; +if($campo_titulo[0] !='') {$w_campo = "AND id_campo = '$campo_titulo[0]'";} +$campo_titulo = $campo_titulo[0]; + + $campo_orden = remplacetas('form_parametrizacion','campo',"$id",'descripcion'," tabla='form_id' and opcion = 'orden'") ; + $campo_orden = $campo_orden[0]; + + + +if($orden == "" ) { $ordenar= "ORDER BY form_datos.id DESC ";} +elseif($orden == "ASC" ) { $ordenar= "ORDER BY form_datos.id ASC "; } +else{} + + + if($campo_orden !="") { + $consulta = " + SELECT control,id,form_id,contenido FROM form_datos + WHERE form_id = '$id' AND id_campo ='$campo_orden' + GROUP BY form_datos.control + ORDER BY CAST(contenido AS SIGNED ) $orden "; + }else { +$consulta ="SELECT *,GROUP_CONCAT(id ORDER by timestamp desc ) as identificador FROM form_datos WHERE form_id = '$id' $w_campo GROUP BY control $ordenar"; + } + + +//$consulta ="SELECT *,GROUP_CONCAT(id ORDER by timestamp desc ) as identificador FROM form_datos WHERE form_id = '$id' $w_campo GROUP BY control $ordenar"; +$link=Conectarse(); +$sql=mysqli_query($link,$consulta); +if (mysqli_num_rows($sql)!='0'){ + $control = mysqli_result($sql,0,control); + //$contenido = "