1
0
Fork 0

aplicacion de notas

This commit is contained in:
humano 2017-11-10 22:56:06 -05:00
parent 5a36ca5d7a
commit 0b4d21a19b
12 changed files with 1475 additions and 38 deletions

View File

@ -71,6 +71,8 @@ $librerias_pie ="";
/// j=ADDON EMBEBIDO *
/// k= suite
/// l= Listado
/// n=notas
/// p= Planilla
/// s= SET DE DATOS *
/// S= SET DE DATOS EMBEBIDO
@ -650,7 +652,26 @@ $aplicacion_pie="
$librerias_cabeza ="
$presentacion_cabeza ";
$suite_listado = suite_listado("$id","$_REQUEST[suite]");
$onload = "$suite_listado";
}
elseif($v[0] =='n') {
/// g=FORMULARIO EMBEBIDO
$form =$v[1];
$embebido = "1";
$no_mostrar ="display:none; ";
$librerias_cabeza ="
<script type='text/javascript' src='librerias/notas/script.js'></script>
<script type='text/javascript' src='./librerias/jquery/jquery-ui.min.js'></script>
<script type='text/javascript' src='./librerias/jquery/jquery.ui.touch-punch.js'></script>
<script type='text/javascript' src='./librerias/notas/jquery.infinitedrag.js'></script>
<link rel='stylesheet' type='text/css' href='./librerias/notas/styles.css' />
";
$tablero = notas_tablero("$form");
$onload = $tablero;
}
else{
@ -711,7 +732,7 @@ $uri = $_SERVER['REQUEST_URI'];
?>
<?php echo $librerias_cabeza; ?>
<meta NAME="Language" CONTENT="Spanish">
<meta NAME="Revisit" CONTENT="1 days">
<meta NAME="Distribution" CONTENT="Global">
@ -798,6 +819,7 @@ $uri = $_SERVER['REQUEST_URI'];
<script src="./librerias/charts/Chart.bundle.js"></script>
<script src="./librerias/charts/utils.js"></script>
<script src="./librerias/lazy/jquery.lazy.min.js"></script>
<?php echo $librerias_cabeza; ?>
@ -923,14 +945,9 @@ document.oncopy = addLink;
</head>
<body data-spy="scroll" data-target="#toc">
<!-- <div class="text-center">
<a href="frida.php?redirect" >
<img class='center-block img img-responsive' src='https://tupale.co/milfs/images/frida.gif'>
</a>
<a href="frida.php" ><small class="center-block" >¿ Necesitas ayuda para apoyarnos ?</small></a>
</div> -->
<?php
//echo "<h1>$identificador</h1>";
if($tema=="") {
echo $barra ;

7
librerias/jquery/jquery-ui.min.css vendored Normal file

File diff suppressed because one or more lines are too long

13
librerias/jquery/jquery-ui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,180 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 20112014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
(function ($) {
// Detect touch support
$.support.touch = 'ontouchend' in document;
// Ignore browsers without touch support
if (!$.support.touch) {
return;
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
}
event.preventDefault();
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
event.target.dispatchEvent(simulatedEvent);
}
/**
* Handle the jQuery UI widget's touchstart events
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return;
}
// Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true;
// Track movement to determine if interaction was a click
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
};
/**
* Handle the jQuery UI widget's touchmove events
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Interaction was not a click
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
};
/**
* Handle the jQuery UI widget's touchend events
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// Simulate the click event
simulateMouseEvent(event, 'click');
}
// Unset the flag to allow other widgets to inherit the touch event
touchHandled = false;
};
/**
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
* This method extends the widget with bound touch event handlers that
* translate touch events to mouse events and pass them to the widget's
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.bind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse init method
_mouseInit.call(self);
};
/**
* Remove the touch event handlers
*/
mouseProto._mouseDestroy = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.unbind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);
};
})(jQuery);

View File

@ -0,0 +1,11 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 20112014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);

BIN
librerias/notas/img/ajax_load.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -0,0 +1,281 @@
/*
* jQuery Infinite Drag
* Version 0.3
* Copyright (c) 2010 Ian Li (http://ianli.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*
* Requires:
* jQuery http://jquery.com
*
* Reference:
* http://ianli.com/infinitedrag/ for Usage
*
* Versions:
* 0.3
* - Added move
* 0.2
* - Fixed problem with IE 8.0
* 0.1
* - Initial implementation
*/
(function($) {
/**
* Function to create InfiniteDrag object.
*/
$.infinitedrag = function(draggable, draggable_options, tile_options) {
return new InfiniteDrag(draggable, draggable_options, tile_options);
};
$.infinitedrag.VERSION = 0.3;
/**
* The InfiniteDrag object.
*/
var InfiniteDrag = function(draggable, draggable_options, tile_options) {
// Use self to reduce confusion about this.
var self = this;
var $draggable = $(draggable);
var $viewport = $draggable.parent();
$draggable.css({
position: "relative",
cursor: "move"
});
// Draggable options
var _do = (draggable_options) ? draggable_options : {};
// Tile options (DEFAULT)
var _to = {
class_name: "_tile",
width: 100,
height: 100,
start_col: 0,
start_row: 0,
range_col: [-1000000, 1000000],
range_row: [-1000000, 1000000],
oncreate: function($element, i, j) {
$element.text("");
// $element.css("background","url(librerias/notas/img/corcho.jpg)");
$element.css("background","url(./librerias/notas/img/corcho.jpg)");
// $element.class("holam");
}
};
// Override tile options.
for (var i in tile_options) {
if (tile_options[i] !== undefined) {
_to[i] = tile_options[i];
}
}
// Override tile options based on draggable options.
if (_do.axis == "x") {
_to.range_row = [_to.start_row, _to.start_row];
} else if (_do.axis == "y") {
_to.range_col = [_to.start_col, _to.start_col];
}
// Creates the tile at (i, j).
function create_tile(i, j) {
if (i < _to.range_col[0] || _to.range_col[1] < i) {
return;
} else if (j < _to.range_row[0] || _to.range_row[1] < j) {
return;
}
grid[i][j] = true;
var x = i * _to.width;
var y = j * _to.height;
var $e = $draggable.append('<div></div>');
var $new_tile = $e.children(":last");
$new_tile.attr({
"class": _to.class_name,
col: i,
row: j
}).css({
position: "absolute",
left: x,
top: y,
width: _to.width,
height: _to.height
});
_to.oncreate($new_tile, i, j);
};
// Updates the containment box wherein the draggable can be dragged.
var update_containment = function() {
// Update viewport info.
viewport_width = $viewport.width(),
viewport_height = $viewport.height(),
viewport_cols = Math.ceil(viewport_width / _to.width),
viewport_rows = Math.ceil(viewport_height / _to.height);
// Create containment box.
var half_width = _to.width / 2,
half_height = _to.height / 2,
viewport_offset = $viewport.offset(),
viewport_draggable_width = viewport_width - _to.width,
viewport_draggable_height = viewport_height - _to.height;
var containment = [
(-_to.range_col[1] * _to.width) + viewport_offset.left + viewport_draggable_width,
(-_to.range_row[1] * _to.height) + viewport_offset.top + viewport_draggable_height,
(-_to.range_col[0] * _to.width) + viewport_offset.left,
(-_to.range_row[0] * _to.height) + viewport_offset.top
];
$draggable.draggable("option", "containment", containment);
};
var update_tiles = function() {
var $this = $draggable;
var $parent = $this.parent();
// Problem with .position() in Chrome/WebKit:
// var pos = $(this).position();
// So, we compute it ourselves.
var pos = {
left: $this.offset().left - $parent.offset().left,
top: $this.offset().top - $parent.offset().top
}
var visible_left_col = Math.ceil(-pos.left / _to.width) - 1,
visible_top_row = Math.ceil(-pos.top / _to.height) - 1;
for (var i = visible_left_col; i <= visible_left_col + viewport_cols; i++) {
for (var j = visible_top_row; j <= visible_top_row + viewport_rows; j++) {
if (grid[i] === undefined) {
grid[i] = {};
} else if (grid[i][j] === undefined) {
create_tile(i, j);
}
}
}
};
// Public Methods
//-----------------
self.draggable = function() {
return $draggable;
};
self.disabled = function(value) {
if (value === undefined) {
return $draggable;
}
$draggable.draggable("option", "disabled", value);
$draggable.css({ cursor: (value) ? "default" : "move" });
};
self.move = function(col, row) {
var offset = $draggable.offset();
var move = {
left: col * _to.width,
top: row * _to.height
};
var new_offset = {
left: offset.left - move.left,
top: offset.top - move.top
};
if (_do.axis == "x") {
new_offset.top = offset.top;
} else if (_do.axis == "y") {
new_offset.left = offset.left;
}
var containment = $draggable.draggable("option", "containment");
if (containment[0] <= new_offset.left && new_offset.left <= containment[2]
&& containment[1] <= new_offset.top && new_offset.top <= containment[3]) {
$draggable.offset(new_offset);
update_tiles();
} else {
// Don't let the tile go beyond the right edge.
if (new_offset.left < containment[0]) {
new_offset.left = containment[0];
}
// Don't let the tile go beyond the left edge.
if (new_offset.left > containment[2]) {
new_offset.left = containment[2];
}
$draggable.offset(new_offset);
update_tiles();
}
};
self.center = function(col, row) {
var x = _to.width * col,
y = _to.height * row,
half_width = _to.width / 2,
half_height = _to.height / 2,
half_vw_width = $viewport.width() / 2,
half_vw_height = $viewport.height() / 2,
offset = $draggable.offset();
var new_offset = {
left: -x - (half_width - half_vw_width),
top: -y - (half_height - half_vw_height)
};
if (_do.axis == "x") {
new_offset.top = offset.top;
} else if (_do.axis == "y") {
new_offset.left = offset.left;
}
$draggable.offset(new_offset);
update_tiles();
};
// Setup
//--------
var viewport_width = $viewport.width(),
viewport_height = $viewport.height(),
viewport_cols = Math.ceil(viewport_width / _to.width),
viewport_rows = Math.ceil(viewport_height / _to.height);
$draggable.offset({
left: $viewport.offset().left - (_to.start_col * _to.width),
top: $viewport.offset().top - (_to.start_row * _to.height)
});
var grid = {};
for (var i = _to.start_col, m = _to.start_col + viewport_cols; i < m && (_to.range_col[0] <= i && i <= _to.range_col[1]); i++) {
grid[i] = {}
for (var j = _to.start_row, n = _to.start_row + viewport_rows; j < n && (_to.range_row[0] <= j && j <= _to.range_row[1]); j++) {
create_tile(i, j);
}
}
// Handle resize of window.
$(window).resize(function() {
// HACK:
// Update the containment when the window is resized
// because the containment boundaries depend on the offset of the viewport.
update_containment();
});
// The drag event handler.
_do.drag = function(e, ui) {
update_tiles();
};
$draggable.draggable(_do);
update_containment();
};
})(jQuery);

View File

@ -0,0 +1,379 @@
/*
* jQuery Infinite Drag
* Copyright (c) 2010 Ian Li (http://ianli.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*
* Requires jQuery with either jQuery UI Draggable or jQuery Pep
*
* Reference:
* http://ianli.com/infinitedrag/ for usage and examples
* http://github.com/Sleavely/jquery-infinite-drag/ for additional documentation
*/
(function($) {
/**
* Function to create InfiniteDrag object.
*/
$.infinitedrag = function(draggable, draggable_options, tile_options) {
return new InfiniteDrag(draggable, draggable_options, tile_options);
};
$.infinitedrag.serializeTiles = function(tiles) {
var pairs = [];
$.each(tiles, function(key, tile) {
pairs.push(tile.x + ';' + tile.y);
});
return pairs.join();
};
/**
* The InfiniteDrag object.
*/
var InfiniteDrag = function(draggable, draggable_options, tile_options) {
// Use self to reduce confusion about this.
var self = this;
var $draggable = $(draggable);
var $viewport = $draggable.parent();
$draggable.css({
position: "relative"
});
// Draggable options
var _do = {
shouldEase: false,
cursor: true
};
$.extend(_do, draggable_options);
if (_do.cursor) {
$draggable.css({
cursor: "move"
});
}
// Tile options (DEFAULT)
var _to = {
class_name: "_tile",
width: 100,
height: 100,
start_col: 0,
start_row: 0,
range_col: [-1000000, 1000000],
range_row: [-1000000, 1000000],
margin: 0,
cleaning_enabled: true,
remove_buffer: 10,
draggable_lib: $.fn.pep ? "pep" : "draggable",
oncreate: function($element, i, j) {
$element.text(i + "," + j);
},
on_aggregate: false,
aggregate_time: 10
};
// Override tile options.
$.extend(_to, tile_options);
// Override tile options based on draggable options.
if (_do.axis == "x") {
_to.range_row = [_to.start_row, _to.start_row];
} else if (_do.axis == "y") {
_to.range_col = [_to.start_col, _to.start_col];
}
var aggregator_data = [],
aggregator_timer = 0;
// Creates the tile at (i, j).
function create_tile(i, j) {
if (i < _to.range_col[0] || _to.range_col[1] < i) {
return;
} else if (j < _to.range_row[0] || _to.range_row[1] < j) {
return;
}
var x = i * _to.width;
var y = j * _to.height;
var $e = $draggable.append('<div></div>');
var $new_tile = $e.children(":last");
_storeTile($new_tile, i, j);
$new_tile.attr({
"class": _to.class_name,
col: i,
row: j
});
_setTileStyle($new_tile, i, j);
if (_to.on_aggregate) {
aggregator_data.push({
tile: $new_tile,
x: i,
y: j
});
if (aggregator_timer === 0) {
aggregator_timer = setTimeout(_fireAgregate, _to.aggregate_time);
}
}
_to.oncreate.call(self, $new_tile, i, j);
};
// Tries to register a tile
function register_tile(elem) {
var i = $(elem).attr('col');
var j = $(elem).attr('row');
if (typeof i === 'undefined' || typeof j === 'undefined') {
return;
}
if (typeof grid[i] == "undefined") {
grid[i] = {};
}
_storeTile(elem, i, j);
_setTileStyle(elem, i, j);
}
function _setTileStyle(tile, i, j) {
var x = i * _to.width;
var y = j * _to.height;
$(tile).css({
position: "absolute",
left: x,
top: y,
width: _to.width,
height: _to.height
});
}
function _storeTile(tile, i, j) {
grid[i][j] = $(tile).get(0);
if (typeof grid[i].cnt == "undefined") grid[i].cnt = 0;
grid[i].cnt++;
}
function _fireAgregate() {
_to.on_aggregate.call(self, aggregator_data);
aggregator_timer = 0;
aggregator_data = [];
}
// Updates the containment box wherein the draggable can be dragged.
self.update_containment = function() {
// Update viewport info.
viewport_zoom = $viewport.css('zoom');
viewport_width = $viewport.width() + _to.margin * 2;
viewport_height = $viewport.height() + _to.margin * 2;
viewport_cols = Math.ceil(viewport_width / _to.width);
viewport_rows = Math.ceil(viewport_height / _to.height);
// Create containment box.
var half_width = _to.width / 2,
half_height = _to.height / 2,
viewport_offset = $viewport.offset(),
viewport_draggable_width = (viewport_width / viewport_zoom) - _to.width,
viewport_draggable_height = (viewport_height / viewport_zoom) - _to.height;
var containment = [
(-_to.range_col[1] * _to.width) + viewport_offset.left + viewport_draggable_width,
(-_to.range_row[1] * _to.height) + viewport_offset.top + viewport_draggable_height,
(-_to.range_col[0] * _to.width) + viewport_offset.left,
(-_to.range_row[0] * _to.height) + viewport_offset.top,
];
if (_to.draggable_lib == "draggable") {
$draggable.draggable("option", "containment", containment);
}
// Force check for new tiles in visible area,
// in case the containment was triggered by a zoom change.
update_tiles();
};
var last_cleaned_tiles = {
left: 0,
top: 0
};
var update_tiles = function(dragged_pos) {
if (typeof dragged_pos == "undefined") {
dragged_pos = {
left: 0,
top: 0
}
}
var $this = $draggable;
var $parent = $this.parent();
// Problem with .position() in Chrome/WebKit:
// var pos = $(this).position();
// So, we compute it ourselves.
var pos = {
left: $this.offset().left - $parent.offset().left + _to.margin,
top: $this.offset().top - $parent.offset().top + _to.margin
}
// - 1 because the previous tile is partially visible
var visible_left_col = Math.ceil(-pos.left / _to.width) - 1,
visible_top_row = Math.ceil(-pos.top / _to.height) - 1;
for (var i = visible_left_col; i <= visible_left_col + viewport_cols; i++) {
if (typeof grid[i] == "undefined") {
grid[i] = {};
}
for (var j = visible_top_row; j <= visible_top_row + viewport_rows; j++) {
if (typeof grid[i][j] == "undefined") {
create_tile(i, j);
}
}
}
if (
Math.abs(dragged_pos.left - last_cleaned_tiles.left) > (_to.remove_buffer * _to.width) ||
Math.abs(dragged_pos.top - last_cleaned_tiles.top) > (_to.remove_buffer * _to.height)) {
remove_tiles(visible_left_col, visible_top_row);
last_cleaned_tiles = dragged_pos;
}
};
// Removes unseen tiles
//-----------------------
var remove_tiles = function(left, top) {
// Is cleaning disabled?
if (_to.cleaning_enabled) {
return;
}
// Finds tiles which can be seen based on window width & height
var maxLeft = (left + viewport_cols) + 1,
maxTop = (top + viewport_rows);
$.each(grid, function(i, rows) {
$.each(rows, function(j, elem) {
if (j !== 'cnt') {
if ((i < left) || (i > maxLeft) || (j < top) || (j > maxTop)) {
delete grid[i][j];
grid[i].cnt--;
if (grid[i].cnt == 0) delete grid[i];
$(elem).remove();
}
}
});
});
}
// Public Methods
//-----------------
self.draggable = function() {
return $draggable;
};
self.disabled = function(value) {
if (value === undefined) {
return $draggable;
}
if ($.fn.pep) {
$.pep.toggleAll(!value)
} else {
$draggable.draggable("option", "disabled", value);
}
if (_do.cursor) {
$draggable.css({
cursor: (value) ? "default" : "move"
});
}
};
self.center = function(col, row) {
var x = _to.width * col,
y = _to.height * row,
half_width = _to.width / 2,
half_height = _to.height / 2,
half_vw_width = $viewport.width() / 2,
half_vw_height = $viewport.height() / 2,
offset = $draggable.offset();
var new_offset = {
left: -x - (half_width - half_vw_width),
top: -y - (half_height - half_vw_height)
};
if (_do.axis == "x") {
new_offset.top = offset.top;
} else if (_do.axis == "y") {
new_offset.left = offset.left;
}
$draggable.offset(new_offset);
update_tiles(new_offset);
};
self.get_tile_dimensions = function() {
var tileDims = {
width: _to.width,
height: _to.height
};
return tileDims;
};
self.get_tile = function(x, y) {
if (typeof grid[x] !== 'undefined' && typeof grid[x][y] !== 'undefined') {
return $(grid[x][y]);
}
return null;
}
// Setup
//--------
//To make sure minimal setup will show something
if ($viewport.height() == 0) {
$viewport.css({
'min-height': '300px'
});
}
var viewport_zoom = $viewport.css('zoom'),
viewport_width = $viewport.width() + _to.margin * 2,
viewport_height = $viewport.height() + _to.margin * 2,
viewport_cols = Math.ceil(viewport_width / _to.width),
viewport_rows = Math.ceil(viewport_height / _to.height);
$draggable.offset({
left: $viewport.offset().left - (_to.start_col * _to.width),
top: $viewport.offset().top - (_to.start_row * _to.height)
});
var grid = {};
// Tries to register any existing tiles
$draggable.children("." + _to.class_name).each(function() {
register_tile(this);
});
// Create initial tiles
update_tiles();
// Handle resize of window.
$(window).resize(function() {
// HACK:
// Update the containment when the window is resized
// because the containment boundaries depend on the offset of the viewport.
self.update_containment();
});
// The drag event handler.
_do.drag = function(e, ui) {
update_tiles(ui.position);
};
$draggable[_to.draggable_lib](_do);
self.update_containment();
};
})(jQuery);

49
librerias/notas/script.js Executable file
View File

@ -0,0 +1,49 @@
$(document).ready(function(){
/* This code is executed after the DOM has been completely loaded */
var tmp;
$('.note').each(function(){
/* Finding the biggest z-index value of the notes */
tmp = $(this).css('z-index');
if(tmp>zIndex) zIndex = tmp;
})
/* A helper function for converting a set of elements to draggables: */
make_draggable($('.note'));
});
var zIndex = 200;
function make_draggable(elements)
{
/* Elements is a jquery object: */
elements.draggable({
//containment:'parent',
start:function(e,ui){ ui.helper.css('z-index',++zIndex); },
stop:function(e,ui){
var left = ui.position.left;
var top = ui.position.top;
var index = zIndex;
/// var id = parseInt(ui.helper.find('span.data').html());
var id = ui.helper.find('span.data').html();
/* Sending the z-index and positon of the note to update_position.php via AJAX GET: */
var datos = [['id',id],['x',left],['y',top],['z',index]];
var formulario = id.split("-", 1);
xajax_notes('','mover',datos,'');
xajax_ultimos_registros(document.getElementById('ultimo_id').value,formulario[0]);
}
});
}

218
librerias/notas/styles.css Executable file
View File

@ -0,0 +1,218 @@
html{
overflow: hidden;
}
.accion{
width:10px;
height:10px;
border: solid 1px ; border-color: #cccccc;
}
.botonera .btn{
padding: 1px;
}
.note{
height:150px;
padding:5px;
width:150px;
position:absolute;
overflow:hidden;
cursor:move;
font-family:Trebuchet MS,Tahoma,Myriad Pro,Arial,Verdana,sans-serif;
font-size:12px;
/* Adding a CSS3 shadow below the note, in the browsers which support it: */
-moz-box-shadow:2px 2px 0 #A58452;
-webkit-box-shadow:2px 2px 0 #A58452;
box-shadow:2px 2px 15px #3E3131;
}
#viewport {
overflow:hidden; /* Occlude elements outside viewport! */
max-height: calc(100vh);
min-height: 3000px;
/* zoom: 0.5;*/
}
#wall {
/* Default settings by code:
* position: relative;
* cursor: move;
*/
}
/* background:url(librerias/notas/img/corcho.jpg);*/
#fancy_ajax .note{ cursor:default; }
/* Three styles for the notes: */
.yellow{
background-color:#FDFB8C;
border:1px solid #DEDC65;
}
.blue{
background-color:#A6E3FC;
border:1px solid #75C5E7;
}
.green{
background-color:#A5F88B;
border:1px solid #98E775;
}
.red{
background-color:#FFDAE9;
border:1px solid #FFAAAA;
}
.tablero_descripcion{
background-color:white;
border:1px solid black;
height:20vw;
padding:10px;
width:90vw;
position:absolute;
overflow:hidden;
cursor:move;
text-align: center;
top: 400px;
left: 700px;
z-index: 1000;
resize: both;
}
.tablero_titulo{
background-color:white;
/*border:1px solid #333; */
height:150px;
padding:10px;
width:1000px;
position:relative;
overflow:hidden;
cursor:move;
text-align: center;
top: 100px;
left: 400px;
z-index: 1;
box-shadow:2px 2px 15px #3E3131;
/*resize: both;*/
}
.tablero_titulo h1 {
font-size: 30px;;
}
.fantasma{
background-color:white;
border:1px solid gray;
opacity: 0.5;
}
/* Each note has a data span, which holds its ID */
span.data{ display:none; }
/* The "Add a note" button: */
#addButton{
position:absolute;
top:-70px;
left:0;
}
/* Green button class: */
a.green-button,a.green-button:visited{
color:black;
display:block;
font-size:10px;
font-weight:bold;
height:15px;
padding:6px 5px 4px;
text-align:center;
width:60px;
text-shadow:1px 1px 1px #DDDDDD;
background:url(img/button_green.png) no-repeat left top;
}
a.green-button:hover{
text-decoration:none;
background-position:left bottom;
}
.author{
/* The author name on the note: */
bottom:10px;
color:#666666;
font-family:Arial,Verdana,sans-serif;
font-size:12px;
position:absolute;
right:10px;
}
#main{
/* Contains all the notes and limits their movement: */
margin:0 auto;
position:relative;
width:980px;
height:980px;
z-index:10;
/*background:url(img/corcho.jpg) repeat left top;*/
}
h3.popupTitle{
border-bottom:1px solid #DDDDDD;
color:#666666;
font-size:24px;
font-weight:normal;
padding:0 0 5px;
}
#noteData{
/* The input form in the pop-up: */
height:200px;
margin:30px 0 0 200px;
width:350px;
}
.note-form label{
display:block;
font-size:10px;
font-weight:bold;
letter-spacing:1px;
text-transform:uppercase;
padding-bottom:3px;
}
.note-form textarea, .note-form input[type=text]{
background-color:#FCFCFC;
border:1px solid #AAAAAA;
font-family:Arial,Verdana,sans-serif;
font-size:16px;
height:60px;
padding:5px;
width:300px;
margin-bottom:10px;
}
.note-form input[type=text]{ height:auto; }
.color{
/* The color swatches in the form: */
cursor:pointer;
float:left;
height:10px;
margin:0 5px 0 0;
width:10px;
}
#note-submit{ margin:20px auto; }
/* The styles below are only necessary for the demo page */

View File

@ -1,6 +1,263 @@
<?php
date_default_timezone_set('America/Bogota');
function notas_tablero($form) {
$titulo = remplacetas('form_id','id',$form,'nombre',"") ;
$descripcion = remplacetas('form_id','id',$form,'descripcion',"") ;
$zoom = remplacetas('form_parametrizacion','campo',"$form",'descripcion'," opcion= 'zoom' AND item = 'tablero' ") ;
$empresa = remplacetas('form_id','id',$form,'id_empresa',"") ;
$notes = notes("$form",'','','');
$footer="
<nav class='navbar navbar-inverse navbar-fixed-bottom'>
<div class='list-inline'>
<ul class=' center-block' style='
float:none;
margin:0 auto;
display: block;
text-align: center;'>
<a href='e$empresa[0]' class='btn btn-default ' >
<i class='fa fa-home' aria-hidden='true'></i>
</a>
<div class='btn-group'>
<a href='#' class='btn btn-default dropdown-toggle' data-toggle='dropdown'>
<i class='fa fa fa-search-plus' aria-hidden='true'></i>
</a>
<ul class='dropdown-menu drop-up dropdown-menu-right' role='menu'>
<li>
<div class='hidden' id='zoom_label'>$zoom_label</div>
<input id='zoom_nivel' class='' onchange=\"viewport.style.zoom=(this.value); xajax_parametrizacion_linea('form_id','$form','zoom',(this.value),'zoom_label','','tablero'); \"; type='range' min='0.3' value='$zoom[0]' max='2' step='0.01' />
</li>
</ul>
</div>
<a href='https://tupale.co' class='navbar-brand pull-right'>Tupale.co</a>
</ul>
</div>
</nav>
";
$tablero="
$footer
<div id='viewport' style='width:100%; zoom: $zoom[0]; ' onclick=\" xajax_ultimos_registros(document.getElementById('ultimo_id').value,'$form'); \" >
<div id='main' ondblclick=\"coordenadas(event);\" >
<div class=' img-rounded tablero_titulo ' style='' ><h1>$titulo[0] <br><small>$descripcion[0]</small></h1>
<span class='data'>$form-titulo</span>
<div class='hidden' id='mensaje_titulo'></div>
</div>
$notes
<span id='prueba' class=''></span>
</div>
</div>
<script type='text/javascript'>
// #wall is the infinite wall.
// The wall is made of tiles 100px wide and 100px high.
var infinitedrag = jQuery.infinitedrag('#main', {}, {
width: 366,
height: 366,
start_col: 0,
start_row: 0
});
function coordenadas(event) {
x=event.clientX;
y=event.clientY;
// var cordenadas= 'x:'+x+'y'+y;
var datos = [['id','$form'],['x',x],['y',y],['z',++zIndex]];
//alert(cordenadas);
javascript:xajax_formulario_embebido_ajax(datos,'$form','','nuevo');
}
</script>
";
return $tablero;
}
function ultimos_registros($id,$form) {
//$id= ($id -100000);
$registros="";
$respuesta = new xajaxResponse('utf-8');
$consulta ="SELECT * , md5(binary control ) as md5_control FROM form_datos WHERE form_id = '$form' AND timestamp > '$id' GROUP BY control order by timestamp DESC LIMIT 1";
$link=Conectarse();
mysqli_set_charset($link, "utf8");
$sql=mysqli_query($link,$consulta);
if (mysqli_num_rows($sql)!='0'){
while($row=mysqli_fetch_assoc($sql))
{
$registros .= notes("$form",'','',"$row[control]")." ";
}}
//$notes = notes("$form",'','','');
//$respuesta->addAlert("$id $registros");
//$respuesta->addPrepend("prueba","innerHTML","$registros");
$respuesta->addAssign("prueba","innerHTML","$registros");
$respuesta->addScript("make_draggable($('.note'));");
return $respuesta;
}
$xajax->registerFunction("ultimos_registros");
function campo_titulo($id){
$campo_titulo = remplacetas('form_parametrizacion','campo',$id,'descripcion'," tabla='form_id' and opcion = 'titulo'") ;
if($campo_titulo[0] !=""){
return $campo_titulo[0];
}else{
$consulta ="SELECT form_contenido_campos.id_campo , orden FROM form_contenido_campos WHERE form_contenido_campos.id_form = '$id' ORDER BY form_contenido_campos.orden desc LIMIT 1";
$link=Conectarse();
mysqli_set_charset($link, "utf8");
$sql=mysqli_query($link,$consulta);
if (mysqli_num_rows($sql)!=0){
return mysqli_result($sql,0,'id_campo');
}
}
}
function notes($id,$accion,$datos,$registro){
if($accion =="") {
if($registro !="") {
//$color='blue';
$consulta = "SELECT * FROM form_datos WHERE form_id = '$id' AND control ='$registro' Limit 1";
}else {
$consulta = "SELECT * FROM form_datos WHERE form_id = '$id' GROUP BY control ORDER BY id desc limit 50 ";
}
// return $consulta;
$link=Conectarse();
mysqli_set_charset($link, "utf8");
$sql=mysqli_query($link,$consulta);
if (mysqli_num_rows($sql)!='0'){
$notes = '';
$left='';
$top='';
$zindex='';
$id_campo = campo_titulo($id) ;
$orden =1;
mysqli_data_seek($sql, 0);
while($row=mysqli_fetch_assoc($sql))
{
$titulo = remplacetas('form_datos','id_campo',$id_campo,'contenido'," control = '$row[control]' ") ;
$posicion = remplacetas('form_parametrizacion','item',"$row[control]",'descripcion'," campo= '$id' AND opcion = 'posicion' ") ;
$color = remplacetas('form_parametrizacion','item',"$row[control]",'descripcion'," campo= '$id' AND opcion = 'clase' ") ;
$mostrar = remplacetas('form_parametrizacion','item',"$row[control]",'descripcion'," campo= '$id' AND opcion = 'mostrar' ") ;
$color=$color[0];
$mostrar =$mostrar[0];
list($left,$top,$zindex) = explode('-',$posicion[0]);
if($left=="") {
$top = ($orden+100);//random_int(1,5000);
$left = ($orden+100);//random_int(1,5000);
$zindex = $orden;
}else{
$left=$left;
$top=$top;
$zindex=$zindex;
}
if($color =="") { $color="yellow";}else { $color=$color;}
if($mostrar =="") { $mostrar="";}else { $mostrar=$mostrar;}
$notes.= "
<div id='nota_$id-$row[control]' class='note $color $mostrar' style=\" left: ".$left."px; top: ".$top."px; z-index: ".$zindex." \">
<div class='botonera'>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','mostrar','hidden','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'hidden'; \"class='pull-right ' ><i class='btn fa fa-trash-o' aria-hidden='true'></i></div>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','clase','fantasma','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'note '; \"class='pull-right ' ><i class='btn fa fa-low-vision' aria-hidden='true'></i></div>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','clase','yellow','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'note yellow'; \"class='pull-right yellow btn accion' style=''></div>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','clase','blue','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'note blue'; \" class='pull-right blue btn accion' ></div>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','clase','green','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'note green'; \"class='pull-right green btn accion' ></div>
<div onclick=\"xajax_parametrizacion_linea('form_id','$id','clase','red','mensaje_$row[control]','','$row[control]'); javascript: document.getElementById('nota_$id-$row[control]').className= 'note red'; \"class='pull-right red btn accion' ></div>
</div>
<hr>
<p>$titulo[0]</p>
<div class='author'><a href='#' onclick=\"xajax_mostrar_modal('$id','$row[control]','landingpage');\" ><i class='fa fa-plus'></i></a> </div>
<span class='data'>$id-$row[control]</span>
<div class='hidden' id='mensaje_$row[control]'></div>
</div>
";
// return "hola".$notes;
$orden = ($orden+1);
$ultimo_id = $row['timestamp'];
}
return "$notes <input type='hidden' id='ultimo_id' name='ultimo_id' value='$ultimo_id'>";
}else {return "";}
}elseif($accion =='mover') {
$id = explode("-", $datos[0][1]);
$form=$id[0];
$control= $id[1];
$respuesta = new xajaxResponse('utf-8');
/// $resultado = print_r($datos,true);
$x= $datos[1][1];
$y= $datos[2][1];
$z= $datos[3][1];
$resultado = parametrizacion_linea('form_id',"$form",'posicion',"$x-$y-$z",'mensaje_$control','',"$control");
$respuesta->addAssign("mensaje_$control","innerHTML","");
return $respuesta;
}else{
$respuesta = new xajaxResponse('utf-8');
$resultado = print_r($accion,true);
$resultado = $accion[3][1];
$respuesta->addAlert("Hola mundo// $resultado // !");
return $respuesta;
}
}
$xajax->registerFunction("notes");
function suite_listado($id_empresa,$suite){
if($id_empresa=="") { $id_empresa="1";}
@ -77,7 +334,7 @@ if (mysqli_num_rows($sql)!='0'){
if($llenar[0] !="0") {$boton_agregar =" <div class='boton_land btn btn-default ' onclick=\"xajax_formulario_embebido_ajax('$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </div>";}
if($llenar[0] !="0") {$boton_agregar =" <div class='boton_land btn btn-default ' onclick=\"xajax_formulario_embebido_ajax('','$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </div>";}
else{$boton_agregar = "";}
if($ver_data[0] !="0") {$boton_ver_data =" <a target='datos'class='boton_land btn btn-default ' href= 'opendata.php?id=$row[id]'> <i class='fa fa-bar-chart' aria-hidden='true'></i> OpenData</a>";}
else{$boton_ver_data = "";}
@ -91,7 +348,7 @@ if($publico[0] =='1') {
$linea .= "<li class='list-group-item' title='' data-toggle='tooltip' data-placement='auto' data-html='true'><a class='' href='k$id_empresa&suite=$row[grupo]'><h2>$row[grupo]</h2></a></li>";
$linea_consulta .= "<li title='$descripcion[0]' data-toggle='tooltip' data-placement='auto' data-html='true'><a href='#mostrar' onclick=\" xajax_consultar_contenido_formulario('$row[id]','5','','','','$plantilla')\">$titulo[0]</a></li>";
$lista .= "<li class='list-group-item' ><a href='#mostrar' onclick=\" xajax_consultar_contenido_formulario('$row[id]','5','','','','$plantilla')\">$titulo[0]</a> $descripcion[0]</li>";
$linea_editar .= "<li title='$descripcion[0]' data-toggle='tooltip' data-placement='auto' data-html='true'><a href='#' class=' ' title='Agregar' onclick=\"xajax_formulario_embebido_ajax('$row[id]','','nuevo');\">$titulo[0]</a></li>";
$linea_editar .= "<li title='$descripcion[0]' data-toggle='tooltip' data-placement='auto' data-html='true'><a href='#' class=' ' title='Agregar' onclick=\"xajax_formulario_embebido_ajax('','$row[id]','','nuevo');\">$titulo[0]</a></li>";
}else{
if($llenar[0] !="0"){
@ -959,7 +1216,7 @@ function formulario_acciones($id,$tipo) {
// $propietario = remplacetas('usuarios','id',$propietario[0],'email',"") ;
if($publico[0] !="0" OR $_SESSION["id_empresa"] =="$propietario[0]") {
$agregar = "<li class='list-inline-item'><a href='#' class='btn btn-info ' title='Agregar' onclick =\"xajax_formulario_embebido_ajax('$id','','nuevo');\"><i class='fa fa-plus-square-o'></i></a>";
$agregar = "<li class='list-inline-item'><a href='#' class='btn btn-info ' title='Agregar' onclick =\"xajax_formulario_embebido_ajax('','$id','','nuevo');\"><i class='fa fa-plus-square-o'></i></a>";
$camara = "
@ -970,7 +1227,7 @@ function formulario_acciones($id,$tipo) {
</a>
<ul class='dropdown-menu drop-up dropdown-menu-right' role='menu'>
<li title='' data-toggle='tooltip' data-placement='auto' data-html='true' data-original-title='Toma una foto'>
<a href='#galeria' onclick =\"xajax_formulario_embebido_ajax('$id','','nuevo');\">
<a href='#galeria' onclick =\"xajax_formulario_embebido_ajax('','$id','','nuevo');\">
<h1>
<i class='fa fa-plus fa-6' aria-hidden='true'></i>
@ -2547,7 +2804,7 @@ while( $row = mysqli_fetch_array( $sql ) ) {
}
///href='../d$row[control]'
$listado .= "
<li class='list-group-item' ><a class='btn btn-link ' onclick =\"xajax_formulario_embebido_ajax('$formulario','$row[control]','edit') \" target='nuevo'> $nombre[0]</a></li>
<li class='list-group-item' ><a class='btn btn-link ' onclick =\"xajax_formulario_embebido_ajax('','$formulario','$row[control]','edit') \" target='nuevo'> $nombre[0]</a></li>
";
@ -2601,7 +2858,7 @@ while( $row = mysqli_fetch_array( $sql ) ) {
aria-controls='collapse_$row[id]'
class='collapsed btn btn-default'
>Mostrar últimos $registros</a>
<a class='btn btn-default' target='nuevo' onclick=\"xajax_formulario_embebido_ajax('$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Nueva entrada</a>
<a class='btn btn-default' target='nuevo' onclick=\"xajax_formulario_embebido_ajax('','$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Nueva entrada</a>
<div class='btn btn-default btn-default' onclick=\"xajax_consultar_formulario('$row[id]','$registros','','modal'); \"><i class='glyphicon glyphicon-eye-open'></i> Consultar</div>
</div>
<div id='collapse_$row[id]' class='panel-collapse collapse' role='tabpanel' aria-labelledby='tab_$row[id]'>
@ -3643,7 +3900,7 @@ if (mysqli_num_rows($sql)!='0'){
$resultado ="
<div class='formulario_respuesta_contenedor'>";
while( $row = mysqli_fetch_array( $sql ) ) {
$resultado .= "<div class='respuesta_linea'><a class='btn btn-success' onclick = \"xajax_formulario_embebido_ajax('$row[id]','$identificador','respuesta') \" title='$row[descripcion]'>$row[nombre]</a> $row[descripcion] </div>";
$resultado .= "<div class='respuesta_linea'><a class='btn btn-success' onclick = \"xajax_formulario_embebido_ajax('','$row[id]','$identificador','respuesta') \" title='$row[descripcion]'>$row[nombre]</a> $row[descripcion] </div>";
}
$resultado .="</div>";
@ -3833,7 +4090,7 @@ if( $tipo !== "" AND $tipo !=="embebido" ) {
// $propietario = remplacetas('usuarios','id',$propietario[0],'email',"") ;
if($publico[0] !="0" OR $_SESSION["id_empresa"] =="$propietario[0]") {
$agregar = " <div class='btn btn-default btn-block ' onclick =\"xajax_formulario_embebido_ajax('$form','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </a></div>";
$agregar = " <div class='btn btn-default btn-block ' onclick =\"xajax_formulario_embebido_ajax('','$form','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </a></div>";
}
$acciones="
@ -4223,7 +4480,7 @@ $contenido
$documento=""; $respuestas="";}else{
if(!isset($_SESSION['id_empresa'])){
$edicion ="<a href='d$identificador' target='editar'><i class='glyphicon glyphicon-pencil-square-o'></i> Editar</a>";
// $edicion ="<a class='btn btn-default btn-xs' onclick= \"xajax_formulario_embebido_ajax('$form','$identificador','edit') \"><i class='glyphicon glyphicon-pencil-square-o'></i> Editar</a>";
// $edicion ="<a class='btn btn-default btn-xs' onclick= \"xajax_formulario_embebido_ajax('','$form','$identificador','edit') \"><i class='glyphicon glyphicon-pencil-square-o'></i> Editar</a>";
}else {$edicion="";}
$documento="<div id='gen_documento'><a href='opendata.php?tipo=documento&identificador=$identificador'>Generar documento</a></div>";
}
@ -4495,7 +4752,7 @@ if (mysqli_num_rows($sql)!='0'){
if($llenar[0] !="0") {$boton_agregar =" <div class='boton_land btn btn-default ' onclick=\"xajax_formulario_embebido_ajax('$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </div>";}
if($llenar[0] !="0") {$boton_agregar =" <div class='boton_land btn btn-default ' onclick=\"xajax_formulario_embebido_ajax('','$row[id]','','nuevo');\"> <i class='glyphicon glyphicon-plus-sign'></i> Agregar </div>";}
else{$boton_agregar = "";}
if($ver_data[0] !="0") {$boton_ver_data =" <a target='datos'class='boton_land btn btn-default ' href= 'opendata.php?id=$row[id]'> <i class='fa fa-bar-chart' aria-hidden='true'></i> OpenData</a>";}
else{$boton_ver_data = "";}
@ -4537,7 +4794,7 @@ if($publico[0] =='1') {
<div class='articulo_contenido col-md-12 animate-box'>
<h2 class='text-center titulo_formulario section-heading'>
<a href='#' onclick=\"xajax_formulario_embebido_ajax('$row[id]','','nuevo');\" >$row[nombre] <i class='glyphicon glyphicon-external-link-square'></i></a></h2>
<a href='#' onclick=\"xajax_formulario_embebido_ajax('','$row[id]','','nuevo');\" >$row[nombre] <i class='glyphicon glyphicon-external-link-square'></i></a></h2>
$imagen
<p class='descripcion_formulario text-left'>$row[descripcion] </p>
</div>
@ -5338,7 +5595,7 @@ foreach($listado_campos as $campo=>$valor){
</div >
<div class='row'>
<div class='col-md-12'>
<a title='Editar' class='btn btn-default btn-xs' onclick=\"xajax_formulario_embebido_ajax('$row[form_id]','$row[control]','edit'); \"><i class='glyphicon glyphicon-pencil'></i> E</a>
<a title='Editar' class='btn btn-default btn-xs' onclick=\"xajax_formulario_embebido_ajax('','$row[form_id]','$row[control]','edit'); \"><i class='glyphicon glyphicon-pencil'></i> E</a>
<a title='Borrar' class='btn btn-default btn-xs' onclick=\"xajax_eliminar_identificador('$row[control]','','$row[form_id]'); \" href='#'><i class='glyphicon glyphicon-trash'></i> B</a>
<a title='Clonar' class='btn btn-default btn-xs' onclick=\"xajax_clonar_identificador('$row[control]',''); \" href='#'><i class='glyphicon glyphicon-clone'></i> C</a>
<div id='eliminar_$row[control]'></div>
@ -5585,7 +5842,7 @@ return $array;
function parametrizacion_linea($tabla,$campo,$opcion,$descripcion,$div,$script,$item){
if(isset($_SESSION['id_empresa']) ){$id_empresa= $_SESSION['id_empresa']; }else{ return;//$id_empresa="";
if(isset($_SESSION['id_empresa']) ){$id_empresa= $_SESSION['id_empresa']; }else{ $id_empresa="";
}
$respuesta = new xajaxResponse('utf-8');
if($tabla =="") {
@ -5635,6 +5892,8 @@ mysqli_query($link,"SET NAMES 'utf8mb4'");
$limpiar ="DELETE FROM `form_parametrizacion` WHERE tabla = '".mysqli_real_escape_string($link,$tabla)."' AND campo ='".mysqli_real_escape_string($link,$campo)."' AND opcion ='".mysqli_real_escape_string($link,$opcion)."' AND id_empresa = '$id_empresa' AND item = '".mysqli_real_escape_string($link,$item)."' LIMIT 1 ";
$sql=mysqli_query($link,$limpiar);
$consulta="INSERT INTO form_parametrizacion set tabla = '".mysqli_real_escape_string($link,$tabla)."' , campo ='".mysqli_real_escape_string($link,$campo)."', opcion ='".mysqli_real_escape_string($link,$opcion)."', descripcion ='".mysqli_real_escape_string($link,$descripcion)."', item ='".mysqli_real_escape_string($link,$item)."', visible='1' , id_empresa = '$id_empresa'";
$sql=mysqli_query($link,$consulta);
if($sql) {
if($descripcion =="") {
@ -5655,6 +5914,7 @@ if($sql) {
}
}else {
//$respuesta->addAlert("$consulta");
return $consulta;
}
///$respuesta->addAssign("$div","innerHTML",$exito);
return $respuesta;
@ -6477,7 +6737,7 @@ $xajax->registerFunction("parametrizacion_titulo");
function mostrar_modal($form,$control,$plantilla){
$respuesta = new xajaxResponse('utf-8');
if( $control == "") {
$datos = formulario_areas($form,"");
$datos = formulario_areas('',$form,"");
}else {
$datos = contenido_mostrar("$form","$control",'',"$plantilla");
}
@ -6910,12 +7170,12 @@ $form_id = $form_id[0];
}
//$campos = formulario_areas($form_id,'campos');
//$campos = formulario_areas('',$form_id,'campos');
$control_original = $control;
if($control =="") {
$control = md5(rand(1,99999999).microtime());
}
$campos = formulario_areas($form_id,'campos');
$campos = formulario_areas('',$form_id,'campos');
$formulario ="
<input type='hidden' id='$campo_remitente"."[0]' name='$campo_remitente"."[0]' value='$_SESSION[usuario_milfs]'>
<input type='hidden' id='tipo' name='tipo' value='solocampos'>
@ -7012,7 +7272,7 @@ if($control =="") {
$mensajes = mysqli_query($link,$consulta);
// $destinatario ="$campo_destinatario"."[0]";
// $para = buscador_campo("$campo_destinatario","$form_id","","$destinatario","","");
$campos = formulario_areas($form_id,'campos');
$campos = formulario_areas('',$form_id,'campos');
$formulario ="
<input type='hidden' id='$campo_remitente"."[0]' name='$campo_remitente"."[0]' value='$_SESSION[usuario_milfs]'>
<input type='hidden' id='tipo' name='tipo' value='solocampos'>
@ -7396,7 +7656,7 @@ elseif($tipo=='registrarse') {
return $respuesta;
}
$campos = formulario_areas($form_id,'campos');
$campos = formulario_areas('',$form_id,'campos');
$boton ="
<button id='boton_registro' href='#' class='btn btn-success btn-block'
@ -7420,7 +7680,7 @@ elseif($tipo=='registrarse') {
elseif($tipo=='recuperar') {
if($datos =="") {
//$campos = formulario_areas($form_id,'campos');
//$campos = formulario_areas('',$form_id,'campos');
$campos ="
<div class='form-group>
@ -7985,7 +8245,7 @@ $resultado = "$muestra_form ";
}
function formulario_areas($perfil,$tipo,$form_respuesta,$control_respuesta){
function formulario_areas($metadatos,$perfil,$tipo,$form_respuesta,$control_respuesta){
$id="";
$resultado_campos ="";
$subir_imagen ="";
@ -8145,7 +8405,7 @@ $controladores .= " <li class='$activo '>
//// botonera form
$metadatos = json_encode($metadatos);
$muestra_form = "
<div id ='div_$control' >
@ -8162,11 +8422,13 @@ $muestra_form = "
</ul>
</div>
</div>
<form role='form' id='$control' name='$control' class='form-horizontal' >
<input type='hidden' id='control' name='control' value='$control'>
<input type='hidden' id= 'form_id' name= 'form_id' value='$perfil' >
<input type='hidden' id= 'form_nombre' name= 'form_nombre' value='$nombre' >
<input type='hidden' id= 'tipo' name= 'tipo' value='$tipo' >
<input type='hidden' id= 'metadatos' name= 'metadatos' value='$metadatos' >
. <div class='tab-content'>
$resultado_campos
</div>
@ -9265,10 +9527,10 @@ function formulario_embebido($id,$opciones){
//$impresion = formulario_modal("$id",$form_respuesta,$control,"embebido");
//($perfil,$tipo,$form_respuesta,$control_respuesta)
$impresion = formulario_areas($id,"embebido",'','');
$impresion = formulario_areas('',$id,"embebido",'','');
$formulario_nombre = remplacetas('form_id','id',$id,'nombre','') ;
$formulario_descripcion = remplacetas('form_id','id',$id,'descripcion','') ;
$visitas= contar_visitas($id,'formulario') ;
//$visitas= contar_visitas($id,'formulario') ;
$muestra_form = "
<style>
fieldset.fieldset-borde {
@ -9308,7 +9570,7 @@ function formulario_embebido($id,$opciones){
}
function formulario_embebido_ajax($id,$opciones,$tipo){
function formulario_embebido_ajax($datos,$id,$opciones,$tipo){
$respuesta = new xajaxResponse('utf-8');
@ -9318,11 +9580,12 @@ function formulario_embebido_ajax($id,$opciones,$tipo){
$formulario_nombre = remplacetas('form_id','id',$id,'nombre') ;
$formulario_descripcion = remplacetas('form_id','id',$id,'descripcion') ;
$cabecera = "
<div class='' >
<div class='col-xs-12 col-md-8 '>
$encabezado
$encabezado
</div>
<div class='col-md-4 hidden-xs'>
<h2 class='pull-right '>$formulario_nombre[0]<small class='hidden-xs' > $formulario_descripcion[0]</small></h2>
@ -9410,11 +9673,11 @@ if($tipo =='edit' AND ($_SESSION['equipo'] !== $equipo[0] )){
// return "Hola mundo";}
if($tipo=="respuesta") { $form_respuesta = "respuesta";}else {$form_respuesta="";}
$impresion = formulario_areas("$id","$tipo","$form_respuesta","$opciones");
$cantidad_areas = formulario_areas("$id","cantidad","$form_respuesta","$opciones");
$impresion = formulario_areas($datos,"$id","$tipo","$form_respuesta","$opciones");
$cantidad_areas = formulario_areas('',"$id","cantidad","$form_respuesta","$opciones");
$formulario_nombre = remplacetas('form_id','id',$id,'nombre','') ;
$formulario_descripcion = remplacetas('form_id','id',$id,'descripcion','') ;
$visitas= contar_visitas($id,'formulario') ;
//$visitas= contar_visitas($id,'formulario') ;
$muestra_form = "
<div class='container-fluid' style=' background-color:white; overflow:no;' id='contenedor_datos' >
@ -13733,7 +13996,7 @@ elseif($campo_tipo_accion == 'email'){$render = "
$render = "$select ";}
elseif($campo_tipo_accion == 'vinculado'){
$vinculado = remplacetas('form_campos_valores','id_form_campo',$id_campo,'campo_valor',"") ;
$select = formulario_areas($vinculado[0],'campos');
$select = formulario_areas('',$vinculado[0],'campos');
$render = " <!-- vinculado -->
$select
<!-- fin vinculado --> ";
@ -13986,6 +14249,7 @@ function formulario_grabar($formulario) {
$control = $formulario['control']; //
$form_id = $formulario['form_id']; //
$tipo = $formulario['tipo']; //
$metadatos = json_decode($formulario['metadatos']);
if(@$formulario['imagen'] !=''){$formulario[0][0] = $formulario['imagen'];}
$consulta_form = "SELECT * FROM form_contenido_campos,form_campos
@ -14201,12 +14465,20 @@ $json_datos[] = array($c, array("nombre_campo",$campo_nombre[0]), array("conteni
//$respuesta->addAssign("pie_modal","innerHTML","$debug");
if($consulta_grabada =='1') {
$x= $metadatos[1][1];
$y= $metadatos[2][1];
$z= $metadatos[3][1];
$resultado = parametrizacion_linea('form_id',"$formulario[form_id]",'posicion',"$x-$y-$z",'mensaje_$control','',"$formulario[control]");
if(@$formulario['continuar']=='1') {
// xajax_formulario_embebido_ajax($form[0],'$identificador','edit')
//$respuesta->addscript("$('#muestraInfo').modal('hide')");
//$respuesta->addscript("$('#muestraInfo').modal('toggle')");
$respuesta->addscript("$('#muestraInfo').removeClass('fade').modal('hide')");
$respuesta->addscript("xajax_formulario_embebido_ajax('$formulario[form_id]','$formulario[control]','edit') ");
$respuesta->addscript("xajax_formulario_embebido_ajax('','$formulario[form_id]','$formulario[control]','edit') ");
return $respuesta;
}
@ -16096,5 +16368,15 @@ $respuesta->addAssign("$div","innerHTML","$resultado");
}
$xajax->registerFunction("XXX");
function holamundo() {
$respuesta = new xajaxResponse('utf-8');
//$respuesta->addAssign("mensaje_$control","innerHTML","");
$respuesta->addAlert("Hola mundo!");
return $respuesta;
}
$xajax->registerFunction("holamundo");
?>