выборка моделей типа "шаблон". Подробнее...
Переменные | |
$table_name = basename($request) | |
$columns = ['id', 'file', 'groups', 'owner_group', 'name', 'type', 'note', 'cache_time', 'act'] | |
$order_column = isset($_GET['order'][0]['column']) && isset($columns[$_GET['order'][0]['column']]) ? $columns[$_GET['order'][0]['column']] : $columns[0] | |
$order_dir = isset($_GET['order'][0]['dir']) && $_GET['order'][0]['dir'] == 'asc' ? 'ASC' : 'DESC' | |
$start = abs(intval($_GET['start'])) | |
$length = intval($_GET['length']) | |
$query = "SELECT " . implode(', ', $columns) . " FROM `$table_name` ORDER BY `$order_column` $order_dir" | |
$sth = $dbh->prepare($query) | |
$arr = $sth->fetchAll(PDO::FETCH_NUM) | |
$arr_filtered = $arr | |
if(!empty($_GET['search']['value'])) | $response = [] |
$response ['recordsTotal'] = count($arr) | |
$response ['recordsFiltered'] = $response['recordsTotal'] | |
$response ['recordsFiltered'] = count($arr_filtered) | |
$response ['data'] = array_slice($arr_filtered, $start, $length) | |
$response ['draw'] = abs(intval($_GET['draw'])) | |
выборка моделей типа "шаблон".
См. определение в файле templates.php
$arr = $sth->fetchAll(PDO::FETCH_NUM) |
См. определение в файле templates.php строка 25
$arr_filtered = $arr |
См. определение в файле templates.php строка 29
$columns = ['id', 'file', 'groups', 'owner_group', 'name', 'type', 'note', 'cache_time', 'act'] |
См. определение в файле templates.php строка 14
$length = intval($_GET['length']) |
См. определение в файле templates.php строка 19
$order_column = isset($_GET['order'][0]['column']) && isset($columns[$_GET['order'][0]['column']]) ? $columns[$_GET['order'][0]['column']] : $columns[0] |
См. определение в файле templates.php строка 16
$order_dir = isset($_GET['order'][0]['dir']) && $_GET['order'][0]['dir'] == 'asc' ? 'ASC' : 'DESC' |
См. определение в файле templates.php строка 17
$query = "SELECT " . implode(', ', $columns) . " FROM `$table_name` ORDER BY `$order_column` $order_dir" |
См. определение в файле templates.php строка 21
if (!empty( $_GET[ 'search'][ 'value'])) $response = [] |
См. определение в файле templates.php строка 53
$response[ 'data'] = array_slice($arr_filtered, $start, $length) |
См. определение в файле templates.php строка 58
$response[ 'draw'] = abs(intval($_GET['draw'])) |
См. определение в файле templates.php строка 59
$response[ 'recordsFiltered'] = $response['recordsTotal'] |
См. определение в файле templates.php строка 55
$response[ 'recordsFiltered'] = count($arr_filtered) |
См. определение в файле templates.php строка 57
$response[ 'recordsTotal'] = count($arr) |
См. определение в файле templates.php строка 54
$start = abs(intval($_GET['start'])) |
См. определение в файле templates.php строка 18
$sth = $dbh->prepare($query) |
См. определение в файле templates.php строка 23
$table_name = basename($request) |
См. определение в файле templates.php строка 12