// $jsonData['rows'][] = $entry;
// }
// $jsonData['total'] = count($all);
// echo json_encode($jsonData);
// exit();
// }
// }
$db = DB::query_getone('select database() as `db`');
$db = $db['db'];
$tbl_opts = array('url' => 'admin_player_list2.php', 'model' => "{$db}::player", 'title' => __l('All Players'), 'order' => array('player_id', 'userid', 'email', 'signup_time'), 'columns' => array('player_id' => array('label' => __l('ID')), 'userid' => array('label' => __l('Username')), 'email' => array('label' => __l('Email'), 'width' => 300, 'render_as' => 'email'), 'signup_time' => array('label' => __l('Signup Time'), 'render_as' => 'date_time', 'width' => 150)), 'delete' => FALSE, 'controllers' => array('create' => array('label' => __l('Add')), 'update' => array('label' => __l('Edit'))), 'form_options' => array('default' => array('order' => array('player_id', 'userid', 'email', 'password', 'signup_time'), 'fields' => array('password' => array('required' => TRUE, 'render_as' => 'password')), 'callbacks' => array('process_values' => 'process_values')), 'update' => array('fields' => array('password' => array('required' => FALSE, 'render_as' => 'password'))), 'create' => array('order' => array('userid', 'email', 'password', 'signup_time'), 'fields' => array('signup_time' => array('value' => time())))), 'usepager' => TRUE, 'useRp' => TRUE, 'rp' => 15, 'height' => 500, 'action_callback' => 'admin_player_list2.php', 'findtext' => __l('Find'), 'pagestat' => __l('Displaying {from} to {to} of {total} items'), 'pagetext' => __l('Page'), 'outof' => __l('of'), 'findtext' => __l('Find'), 'procmsg' => __l('Processing, please wait ...'), 'nomsg' => __l('No items'), 'errormsg' => __l('Connection Error'));
$table = new Table();
//$table->model_value_processors['client']['phpchess::player'] = test;
if ($_POST['page'] || $_POST['tbl_action'] || $_POST['form_action']) {
    header("Content-type: application/json");
    if (isset($_POST['page'])) {
        $result = $table->handle_table_action('data', $tbl_opts);
    } elseif (isset($_POST['tbl_action'])) {
        $result = $table->handle_table_action($_POST['tbl_action'], $tbl_opts);
    }
    echo json_encode($result);
    exit;
} else {
    $result = $table->initialise($tbl_opts);
    if (!$result['success']) {
        $table_init_options = FALSE;
    } else {
        $table_init_options = json_encode($result['table_init_options']);
    }
}
// function test($data)
// {