query($query); if ($result_query->num_rows > 0){ while ($obj = $result_query->fetch_object()){ $url1 = 'categorias/'.TituloToEnlace($obj->id.'-'.$obj->categoria); echo '
  • '.$obj->categoria.'
  • '; } } } ?> Blog de Láser Xauen Clinic. Clínica médico-estética en Jaén

    Jaén: 953 821 821 / 953 042 478

    Úbeda: 953 032 785

    MENÚ

    Láser Xauen Clinic - Centro Médico Estético de Jaén y Úbeda

    Blog

    Últimas entradas

    query($query); $total = $result_query->num_rows; if($total>0){ $lastpage = ceil($total/$limit); $prev = $page - 1; $next = $page + 1; $lpm1 = $lastpage - 1; $page = ($page < 1) ? $page = 1 : (($page > $lastpage) ? $lastpage : $page); $start = ($page - 1) * $limit; $query="SELECT * FROM noticias ORDER BY fecha DESC, id DESC LIMIT $start, $limit"; $result_query = $db->query($query); if ($result_query->num_rows > 0){ while ($obj = $result_query->fetch_object()){ $foto = ($obj->foto_ppal) ? '
    '.$obj->titulo.'

    ' : ''; $id_noticia = $obj->id; $url = 'noticias/'.TituloToEnlace($obj->id.'-'.$obj->titulo); echo '

    '.$obj->titulo.'

    '.$foto.'
    '.$obj->texto_intro.'
    '; $query1="SELECT categorias.* FROM noticias_categorias, categorias WHERE categorias.id = noticias_categorias.id_categoria AND noticias_categorias.id_noticia = $id_noticia ORDER BY categorias.categoria ASC"; $result_query1 = $db->query($query1); if ($result_query1->num_rows > 0){ while ($obj1 = $result_query1->fetch_object()){ $url1 = 'categorias/'.TituloToEnlace($obj1->id.'-'.$obj1->categoria); echo ''.$obj1->categoria.' '; } } echo '
    '; } } $pagination = ""; $counter = 0; if($lastpage > 1) { $pagination .= "
      "; if ($page > $counter+1) { $pagination.= "
    • <
    • "; } if ($lastpage < 7 + ($adjacents * 2)) { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "
    • $counter
    • "; else $pagination.= "
    • $counter
    • "; } } elseif($lastpage > 5 + ($adjacents * 2)) { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "
    • $counter
    • "; else $pagination.= "
    • $counter
    • "; } $pagination.= "
    • ...
    • "; $pagination.= "
    • $lpm1
    • "; $pagination.= "
    • $lastpage
    • "; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "
    • 1
    • "; $pagination.= "
    • 2
    • "; $pagination.= "
    • ...
    • "; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "
    • $counter
    • "; else $pagination.= "
    • $counter
    • "; } $pagination.= "
    • ...
    • "; $pagination.= "
    • $lpm1
    • "; $pagination.= "
    • $lastpage
    • "; } //close to end; only hide early pages else { $pagination.= "
    • 1
    • "; $pagination.= "
    • 2
    • "; $pagination.= "
    • ...
    • "; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "
    • $counter
    • "; else $pagination.= "
    • $counter
    • "; } } } //next button if ($page < $counter - 1) $pagination.= "
    • >
    • "; else $pagination.= ""; $pagination.= "
    \n"; } echo $pagination; } else echo '
    No hay noticias actualmente. Vuelve a intentarlo más tarde.
    '; ?>