<?php 
$orden_anterior = $db->getVar(TABLA,'orden',"orden<'{$row->orden}'",'orden DESC','1');
$orden_siguiente = $db->getVar(TABLA,'orden',"orden>'{$row->orden}'",'orden DESC','1');  
?>

<?php if ($orden_anterior) {?>
      <a href="javascript:void(0)" data-act="bajar" data-key="<?php echo $row->id?>" data-pagina="<?php echo $pagina?>" data-tabla="<?php echo TABLA?>" class="btn-orden"> <i class="far fa-arrow-alt-circle-down h5" aria-hidden="true"></i></a>
<?php } else {?>
      <i class="far fa-circle h5" aria-hidden="true"></i>                                  
<?php } ?> 
<?php if ($orden_siguiente) {?>
      <a href="javascript:void(0)" data-act="subir" data-key="<?php echo $row->id?>" data-pagina="<?php echo $pagina?>" data-tabla="<?php echo TABLA?>"  class="btn-orden"> <i class="far fa-arrow-alt-circle-up h5" aria-hidden="true" ></i></a>
<?php } else {?>
      <i class="far fa-circle h5" aria-hidden="true"></i>
<?php }?>