|
noalyss
Version-6.7.2
|
Description of class_syn_sort_table. More...
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, | |
| get_header ($p_ind) | |
| Returns the header (the value into th tags) with the symbol ascending and descending. | |
| get_sql_order ($p_get) | |
Description of class_syn_sort_table.
Definition at line 26 of file class_sort_table.php.
Definition at line 29 of file class_sort_table.php.
References nb().
{
$this->nb = 0;
$this->array = array();
}
| 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,
| type | $p_header | label of the header |
| type | $p_url | base url |
| type | $p_sql_asc | sql if ascending |
| type | $p_sql_desc | sql if descending |
| type | $p_get_asc | the value in $_GET if ascending is choosen |
| type | $p_get_desc | the value in $_GET if descending is choosen |
Definition at line 45 of file class_sort_table.php.
| Sort_Table::get_header | ( | $ | p_ind | ) |
Returns the header (the value into th tags) with the symbol ascending and descending.
| $p_ind | the element (from 0 to nb) |
Definition at line 67 of file class_sort_table.php.
References $base, $file, $str, and nb().
{
if ($p_ind < 0 || $p_ind > $this->nb)
return 'ERREUR TRI';
$file = str_replace('extension.php', '', $_SERVER['SCRIPT_FILENAME']);
$base = $this->array[$p_ind]['url'];
$str = '';
$str .= '<A style="display:inline" HREF="' . $base . '&ord=' . $this->array[$p_ind]['parm_asc'] . '">' .
$this->array[$p_ind]['car_asc'] .
'</A>' .
$this->array[$p_ind]['head'] .
'<A style="display:inline" HREF="' . $base . '&ord=' . $this->array[$p_ind]['parm_desc'] . '">' .
$this->array[$p_ind]['car_desc'] .
'</A>';
return $str;
}
| Sort_Table::get_sql_order | ( | $ | p_get | ) |
Definition at line 85 of file class_sort_table.php.
References nb().
{
for ($i = 0; $i < $this->nb; $i++)
{
if ($p_get == $this->array[$i]['parm_asc'])
{
$this->array[$i]['car_asc'] = '<span style="color:red">▲</span>';
return $this->array[$i]['sql_asc'];
}
if ($p_get == $this->array[$i]['parm_desc'])
{
$this->array[$i]['car_desc'] = '<span style="color:red">▼</span>';
return $this->array[$i]['sql_desc'];
}
}
}