Orden alfabetico en la tabla de campos

This commit is contained in:
fredyrivera 2017-02-27 20:24:25 -05:00
parent 6c395d8529
commit 6137489c86

View File

@ -3834,12 +3834,12 @@ $w_especialista ="";
if($filtro == 'id_empresa') { $w_empresa = " AND id_empresa = '$_SESSION[id_empresa]' ";}
if($filtro == 'id_especialista') { $w_especialista = " AND id_especialista = '$_SESSION[id]' ";}
if($filtro == 'llenos') {
$consulta= " SELECT * , form_campos.id as id FROM form_campos, form_datos WHERE form_campos.id = form_datos.id_campo $w_empresa $w_especialista GROUP BY id_campo ORDER BY campo_area, campo_nombre ";
$consulta= " SELECT * , form_campos.id as id FROM form_campos, form_datos WHERE form_campos.id = form_datos.id_campo $w_empresa $w_especialista GROUP BY id_campo ORDER BY campo_nombre ";
}elseif($filtro == 'vacios') {
//$consulta= " SELECT DISTINCT(form_campos.id) as id , `id_especialista` , `id_empresa`, `campo_nombre`, `campo_descripcion`, `campo_tipo`,`campo_area`, `orden`, `activo`, `identificador`, `bloqueo` FROM form_campos WHERE id NOT IN ( SELECT distinct(id_campo) FROM form_datos GROUP BY id_campo) GROUP BY id ORDER BY campo_area, campo_nombre";
$consulta= " SELECT DISTINCT(form_campos.id) as id , `id_especialista` , `id_empresa`, `campo_nombre`, `campo_descripcion`, `campo_tipo`,`campo_area`, `orden`, `activo`, `identificador`, `bloqueo` FROM form_campos WHERE id NOT IN ( SELECT distinct(id_campo) FROM form_contenido_campos GROUP BY id_campo) GROUP BY id ORDER BY campo_area, campo_nombre";
}else{
$consulta= " SELECT * FROM form_campos WHERE id = id $w_empresa $w_especialista ORDER BY campo_area, campo_nombre ";
$consulta= " SELECT * FROM form_campos WHERE id = id $w_empresa $w_especialista ORDER BY campo_nombre ";
}
$link=Conectarse();
mysqli_set_charset($link, "utf8");