noalyss  Version-6.7.2
Public Member Functions
Sort_Table Class Reference

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)

Detailed Description

Description of class_syn_sort_table.

Author:
dany

Definition at line 26 of file class_sort_table.php.


Constructor & Destructor Documentation

Definition at line 29 of file class_sort_table.php.

References nb().

    {
        $this->nb = 0;
        $this->array = array();
    }

Member Function Documentation

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:
type$p_headerlabel of the header
type$p_urlbase url
type$p_sql_ascsql if ascending
type$p_sql_descsql if descending
type$p_get_ascthe value in $_GET if ascending is choosen
type$p_get_descthe value in $_GET if descending is choosen

Definition at line 45 of file class_sort_table.php.

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

    {
        $array = array(
            'head' => $p_header,
            'url' => $p_url,
            'sql_asc' => $p_sql_asc,
            'sql_desc' => $p_sql_desc,
            'parm_asc' => $p_get_asc,
            'parm_desc' => $p_get_desc,
            'car_asc' => '<span>&#9650</span>',
            'car_desc' => '<span>&#9660</span>'
        );
        $ind = $this->nb;
        $this->array[$ind] = $array;
        $this->nb++;
    }
Sort_Table::get_header ( p_ind)

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

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

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;
    }

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">&#9650</span>';
                return $this->array[$i]['sql_asc'];
            }
            if ($p_get == $this->array[$i]['parm_desc'])
            {
                $this->array[$i]['car_desc'] = '<span style="color:red">&#9660</span>';
                return $this->array[$i]['sql_desc'];
            }
        }
    }

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations