1
0
Fork 0

mejoras en campo tabla

This commit is contained in:
humano 2018-11-10 09:40:45 -05:00
parent 04149ea1df
commit b7d53d4f23
1 changed files with 11 additions and 3 deletions

View File

@ -7517,11 +7517,12 @@ foreach($listado_campos as $campo=>$valor){
@$listado_campos .= "<td title='' >$valor_actual</td>"; @$listado_campos .= "<td title='' >$valor_actual</td>";
} }
elseif( $tipo_campo[0] =="34" ) { elseif( $tipo_campo[0] =="34" ) {
if($contenido[0] !=""){
$contenido_limpio = stripslashes($contenido[0]); $contenido_limpio = stripslashes($contenido[0]);
$contenido_array = json_decode($contenido_limpio,true); $contenido_array = json_decode($contenido_limpio,true);
$array =$contenido_array[$id_campo][0]; $array =$contenido_array[$id_campo][0];
$valor_actual= campo_tabla($array,$control,$tipo); $valor_actual= campo_tabla($array,$control,$tipo)."tabla";
}else{ $valor_actual="";}
@$listado_campos .= "<td title='' >$valor_actual</td>"; @$listado_campos .= "<td title='' >$valor_actual</td>";
} }
@ -13475,13 +13476,15 @@ if (mysqli_num_rows($sql)!='0'){
$valor_actual = json_render("$contenido","html","$control"); $valor_actual = json_render("$contenido","html","$control");
$contenido = "$valor_actual";} $contenido = "$valor_actual";}
elseif($campo_tipo=="34") { elseif($campo_tipo=="34") {
if($contenido !=""){
$contenido = stripslashes($contenido); $contenido = stripslashes($contenido);
$contenido_array = json_decode($contenido,true); $contenido_array = json_decode($contenido,true);
$array =$contenido_array[$row['id_campo']][0]; $array =$contenido_array[$row['id_campo']][0];
$contenido = campo_tabla($array,$control,$tipo); $contenido = campo_tabla($array,$control,$tipo)."";
//$contenido_full = json_render("$contenido","csv","$control"); //$contenido_full = json_render("$contenido","csv","$control");
// $valor_actual = json_render("$contenido","html","$control"); // $valor_actual = json_render("$contenido","html","$control");
//$contenido = "$valor_actual"; //$contenido = "$valor_actual";
}
} }
elseif($campo_tipo=='5' AND $contenido !=""){ elseif($campo_tipo=='5' AND $contenido !=""){
@ -16236,6 +16239,7 @@ function campo_tabla($array,$control,$tipo){
//$json=json_encode($array,true); //$json=json_encode($array,true);
$html = "<table class='table table-bordered table-striped table-condensed tabla_campo_tabla'>"; $html = "<table class='table table-bordered table-striped table-condensed tabla_campo_tabla'>";
// header row // header row
$cantidad = 0;
$html .= '<thead><tr>'; $html .= '<thead><tr>';
foreach($array[0] as $key=>$value){ foreach($array[0] as $key=>$value){
$html .= '<th>' . htmlspecialchars($key) . '</th>'; $html .= '<th>' . htmlspecialchars($key) . '</th>';
@ -16246,6 +16250,7 @@ function campo_tabla($array,$control,$tipo){
foreach( $array as $key=>$value){ foreach( $array as $key=>$value){
$html .= '<tr>'; $html .= '<tr>';
foreach($value as $key2=>$value2){ foreach($value as $key2=>$value2){
if($value2 != ""){ $cantidad++;}
$html .= '<td>'.$value2.'</td>'; $html .= '<td>'.$value2.'</td>';
} }
$html .= '</tr>'; $html .= '</tr>';
@ -16254,7 +16259,10 @@ function campo_tabla($array,$control,$tipo){
// finish table and return it // finish table and return it
$html .= '</table>'; $html .= '</table>';
if($cantidad >0 ){
$resultado ="<div class='container-fluid table-responsive'>$html</div>"; $resultado ="<div class='container-fluid table-responsive'>$html</div>";
}
else{ $resultado="";}
return $resultado; return $resultado;
} }