mejoraras vista aplicacion

This commit is contained in:
humano 2018-10-25 22:18:45 -05:00
parent 9d6530d8d4
commit cdc39dfee6
3 changed files with 46 additions and 23 deletions

View File

@ -15,6 +15,7 @@ require ("funciones/conex.php");
@$datos['fin']=$_REQUEST['fin'];
@$datos['tipo']=$_REQUEST['tipo'];
@$datos['registros']=$_REQUEST['registros'];
@$datos['pagina']=$_REQUEST['pagina'];
@$datos['proyecto']=$_REQUEST['proyecto'];
if($datos['proyecto']==""){
@ -32,7 +33,7 @@ if(isset($_REQUEST['formato'])){
//print_r($array);//echo "hola li";
$json= json($datos);
$array = json_decode($json);
echo build_list($array);
echo "".build_list($array);
//echo $json;
//echo planilla($datos['id'],$datos['registros'],"dinamico");
}

View File

@ -12,13 +12,13 @@ function build_list($group) {
$output .= build_list($item);
} else {
if( $attr=="identificador") {
$output .= formulario_imprimir_linea("","$item","linea_planilla");
$output .= formulario_imprimir_linea("","$item","linea_planilla")."";
// $output .= "<td>$attr - $item</td>";
}
}
}
$output .= (is_array($group)) ? "</tr>" : "";
$salida ="<table class='table table-bordered'> $output</table>";
$salida =" $output";
return $salida;
}
function generar_token($div,$tipo) {
@ -11518,7 +11518,7 @@ function formulario_embebido_campos($id,$opcion){
function json($datos){
$w_rango="";
$limite="limit 10";
// $limite="limit 10";
$features="";
// if($datos['registros'] ==""){ $limite="";}else{$limite = " limit $datos[registros]";}
@ -11548,24 +11548,46 @@ function json($datos){
//$id_campo = remplacetas('form_datos','id',$row["id"],'id_campo',"") ;
//$campo_tipo = remplacetas("form_campos","id",$row["id_campo"],"campo_tipo","");
$features = array();
if($datos["tipo"] =='simple') {
$campos ="control " ;
$consulta = "SELECT $campos, form_id.id as form_id ,form_datos.id as id_dato
$consulta_total = "SELECT $campos, form_id.id as form_id ,form_datos.id as id_dato
FROM `form_datos` , `form_campos` ,form_id
WHERE $w_rango form_datos.id_campo = `form_campos`.id
AND form_datos.form_id = `form_id`.id
AND (form_id = '$datos[id]' )
$publico
GROUP BY form_datos.control
ORDER BY form_datos.timestamp DESC $limite ";
ORDER BY form_datos.timestamp DESC ";
$sql_total = mysqli_query($link,$consulta_total) or die("Error al ejecutar consulta_total ");
$cantidad = mysqli_num_rows($sql_total);
$features['total'] = $cantidad;
$features['registros'] = $datos['registros'];
$features['pagina'] = $datos['pagina'];
$features['total_paginas'] = ceil($cantidad / $datos['registros']);
if ($datos['pagina'] =='') {$inicio = 0; $pagina = $datos['registros']; }
else {
$pagina = ($datos['pagina'] * $datos['registros']);
$inicio = ($datos['pagina'] - 1) * $datos['registros'];}
$features['limit_pagina'] = $pagina;
$features['inicio_pagina'] = $inicio;
$limite= " limit $inicio,$features[registros]";
$features['limite'] = $limite;
$consulta ="$consulta_total $limite";
$sql = mysqli_query($link,$consulta) or die("Error al ejecutar consulta 03 ");
$sql = mysqli_query($link,$consulta) or die("Error al ejecutar consulta 03 $consulta ");
// $features['consulta'] = $consulta;
if (mysqli_num_rows($sql)!='0'){
$i = 1;
$features = array();
$features['consulta_total'] = $consulta_total;
$features['consulta'] = $consulta;
while($row = mysqli_fetch_array( $sql ))
{
@ -11580,7 +11602,7 @@ function json($datos){
$nuevos_datos["identificador"]="$row[control]";
$nuevos_datos["tipo"]="array";
$features[$row['control']][] = datos_array($row["control"],"$datos[id]","") ;
// $features['consulta'] = $consulta;
//$features['consulta'] = $consulta;
}
else {
@ -13853,7 +13875,7 @@ if ($autorizado != '0'){
}
$csv .= "<td style ='max-width:200px;' class='col_$row[id_campo] planilla_contenido_$row[id_campo] $clase_interaccion $class_area'>$contenido</td>$col_checkeo_td";
}else{ $csv.="<td class='col_$row[id_campo] planilla_contenido_$row[id_campo] $class_area $clase_interaccion'></td> $col_checkeo_td";}
}else{ $csv.="<td style ='max-width:200px;' class='col_$row[id_campo] planilla_contenido_$row[id_campo] $class_area $clase_interaccion'>vacia</td> $col_checkeo_td";}
}
elseif($tipo=="array"){

View File

@ -33,7 +33,7 @@ function leerCookie(nombre) {
function loadArticle(pageNumber,id,plantilla,registros,scroll) {
var newDiv = document.createElement('div');
var newDiv = document.createElement('tr');
document.getElementById(scroll).appendChild(newDiv);
$.ajax({