Class WPDA_Data_Tables

author Peter Schulz
since 1.0.0
package WPDataAccess\Data_Tables

 Methods

Performs jQuery DataTable query

get_data() 

Once a jQuery DataTable is build using \WPDataAccess\Data_Tables\WPDA_Data_Tables::show(), the DataTable is filled according to the search criteria and pagination settings on the Datable. The query is performed through this function. The query result is returned (echo) in JSON format. Table and column names are checked for existence and access to prevent hacking the DataTable code and SQL injection.

since 1.0.0
see \WPDataAccess\Data_Tables\WPDA_Data_Tables::show()

Generate jQuery DataTable code

show(integer $pub_id, string $database, string $table_name, string $column_names, string $responsive, integer $responsive_cols, string $responsive_type, string $responsive_icon, string $sql_where, string $sql_orderby) : \WPDataAccess\Data_Tables\Shortcode

Table and column names provided are checked for existency and access to prevent hacking the DataTable code and SQL injection.

since 1.0.0

Parameters

$pub_id

integer

Publication ID.

$database

string

Database name.

$table_name

string

Database table name.

$column_names

string

Comma seperated list of column names.

$responsive

string

Yes = responsive mode, No = No responsive mode.

$responsive_cols

integer

Number of columns to be displayd in responsive mode.

$responsive_type

string

Modal, Collaped or Expanded (only if $responsive = Yes).

$responsive_icon

string

Yes = show icon, No = do not show icon (only if $responsive = Yes).

$sql_where

string

SQL default where clause

$sql_orderby

string

SQL default order by

Returns

\WPDataAccess\Data_Tables\Shortcoderesponse

Show table header (footer as well)

show_header(string $columns, string $responsive, integer $responsive_cols, string $pub_format, string $hyperlinks, $add_data_attribute = false) : \WPDataAccess\Data_Tables\HTML

Parameters

$columns

string

Comma seperated list of column names.

$responsive

string

Yes = responsive mode, No = No responsive mode.

$responsive_cols

integer

Number of columns to be displayd in responsive mode.

$pub_format

string

Formatting options.

$hyperlinks

string

Hyperlinks defined in column settings.

$add_data_attribute

Returns

\WPDataAccess\Data_Tables\HTMLoutput

 Properties

 

$wpda_list_columns

$wpda_list_columns 

Default