noalyss Version-9
Public Member Functions | Private Attributes
Sort_Table Class Reference

Description of class_syn_sort_table. More...

+ Collaboration diagram for Sort_Table:

Public Member Functions

 __construct ()
 
 add ($p_header, $p_url, $p_sql_asc, $p_sql_desc, $p_get_asc, $p_get_desc)
 add row of a header in the internal array ($this->array) , it uses the $_GET['ord'] parameter, More...
 
 get_header ($p_ind)
 Returns the header (the value into th tags) with the symbol ascending and descending. More...
 
 get_sql_order ($p_get)
 

Private Attributes

 $array
 
 $nb
 

Detailed Description

Description of class_syn_sort_table.

Author
dany

Definition at line 26 of file sort_table.class.php.

Constructor & Destructor Documentation

◆ __construct()

Sort_Table::__construct ( )

Definition at line 31 of file sort_table.class.php.

32 {
33 $this->nb = 0;
34 $this->array = array();
35 }
nb($p_number)
format the number for the CSV export
Definition: ac_common.php:107

References nb().

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

Sort_Table::add (   $p_header,
  $p_url,
  $p_sql_asc,
  $p_sql_desc,
  $p_get_asc,
  $p_get_desc 
)

add row of a header in the internal array ($this->array) , it uses the $_GET['ord'] parameter,

Parameters
string$p_headerlabel of the header
string$p_urlbase url
string$p_sql_ascsql if ascending
string$p_sql_descsql if descending
string$p_get_ascthe value in $_GET if ascending is choosen
string$p_get_descthe value in $_GET if descending is choosen

Definition at line 47 of file sort_table.class.php.

48 {
49 $array = array(
50 'head' => $p_header,
51 'url' => $p_url,
52 'sql_asc' => $p_sql_asc,
53 'sql_desc' => $p_sql_desc,
54 'parm_asc' => $p_get_asc,
55 'parm_desc' => $p_get_desc,
56 'car_asc' => '<span style="font-size:70%">&#9650</span>',
57 'car_desc' => '<span style="font-size:70%">&#9660</span>'
58 );
60 $this->array[$ind] = $array;
61 $this->nb++;
62 }
for($i=0;$i<=6;$i++) $ind
Definition: calendar.php:34
$p_url

References $array, $ind, $nb, $p_url, and nb().

+ Here is the call graph for this function:

◆ get_header()

Sort_Table::get_header (   $p_ind)

Returns the header (the value into th tags) with the symbol ascending and descending.

Parameters
int$p_indthe element (from 0 to nb)
Returns
string

Definition at line 69 of file sort_table.class.php.

70 {
71 if ($p_ind < 0 || $p_ind > $this->nb)
72 return 'ERREUR TRI';
73 $file = str_replace('extension.php', '', $_SERVER['PHP_SELF']);
74
75 $base = $this->array[$p_ind]['url'];
76 $str = $this->array[$p_ind]['head'] .'';
77 $str .= '<A style="display:inline;text-decoration:none" HREF="' . $base . '&ord=' . $this->array[$p_ind]['parm_asc'] . '">' .
78 $this->array[$p_ind]['car_asc'] .
79 '</A>' .
80
81 '<A style="display:inline;text-decoration:none" HREF="' . $base . '&ord=' . $this->array[$p_ind]['parm_desc'] . '">' .
82 $this->array[$p_ind]['car_desc'] .
83 '</A>';
84 return $str;
85 }
$base
Definition: action.inc.php:56
$str
Definition: fiche.inc.php:91

References $base, $file, $str, and nb().

+ Here is the call graph for this function:

◆ get_sql_order()

Sort_Table::get_sql_order (   $p_get)

Definition at line 87 of file sort_table.class.php.

88 {
89 for ($i = 0; $i < $this->nb; $i++)
90 {
91 if ($p_get == $this->array[$i]['parm_asc'])
92 {
93 $this->array[$i]['car_asc'] = '<span style="color:red;font-size:70%">&#9650</span>';
94 return $this->array[$i]['sql_asc'];
95 }
96 if ($p_get == $this->array[$i]['parm_desc'])
97 {
98 $this->array[$i]['car_desc'] = '<span style="color:red;font-size:70%">&#9660</span>';
99 return $this->array[$i]['sql_desc'];
100 }
101 }
102 }

References $i, and $nb.

Field Documentation

◆ $array

Sort_Table::$array
private

Definition at line 29 of file sort_table.class.php.

Referenced by add().

◆ $nb

Sort_Table::$nb
private

Definition at line 28 of file sort_table.class.php.

Referenced by add(), and get_sql_order().


The documentation for this class was generated from the following file: