- $show_bounds = 0;
- if (($order == "name") || ($order == "-name")) {
- $first = $res[0]['nom'];
- $last = $end['nom'];
- $show_bounds = 1;
- } elseif (($order == "promo") || ($order == "-promo")) {
- $first = $end['promo'];
- $last = $res[0]['promo'];
- $show_bounds = 1;
- }
- if (($show_bounds) && ($order{0} == '-')) {
- $aux = $first;
- $first = $last;
- $last = $aux;
+ if ($show_bounds) {
+ if ($show_bounds == 1) {
+ $first = $res[0][$this->bound_field];
+ $last = $end[$this->bound_field];
+ } elseif ($show_bounds == -1) {
+ $first = $end[$this->bound_field];
+ $last = $res[0][$this->bound_field];
+ }
+ $page->assign('first', $first);
+ $page->assign('last', $last);