$v) { if( endsWith($n, '_filter') and $v != 'null' and $v != '' ) { if( $_where != '' ) $_where .= ' and '; if( strpos($v, " - ") !== false and strlen($v) == 23 ) { list($d1, $d2) = periodtoarray($v); $_where .= str_replace('_filter' , '' , $n) . " between '" . $d1 . "' and '" . $d2 . "'"; } else { $_where .= str_replace('_filter' , '' , $n) . " = '" . $v . "'"; } } } if( $_where != '' ) $_dbwhere = '(' . $_where . ') and ' . $_dbwhere; if( isset($my) and $my == 'mine' ) { $_dbwhere .= " (select count(*) from emresp where form = '$_form' and objeto = ". $_dbtable . ".id and usuario = '$s_idusuario' and estado = estados.descripcion) > 0 and "; } $__tempresult = sqlexec($Link, "select descripcion, (select count(*) from $_dbtable where $_dbwhere status = estados.descripcion) from estados where form = '$_form' and activo = 'S' order by orden;"); while( $__temprow = mysql_fetch_array($__tempresult)) { $estados[] = $__temprow[0]; $cantidades[] = $__temprow[1]; } $_result['estados'] = array(); foreach($estados as $ii => $estado) { $_result['estados'][] = array('nombre' => $estado, 'cantidad' => $cantidades[$ii]); } } // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } } while(false); ?> class="popup" >