-// Exports (and displays) the table 'network_vcheck_params'
-function doAdminNetworkExportVcheckParams () {
- // 'network_id' must be set
- if (!isGetRequestElementSet('network_id')) {
- // Only network vcheck parameters of one network will be exported per time
- reportBug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
- } // END - if
-
- // Get all network types of given network
- $result = SQL_QUERY_ESC('SELECT
- `network_id`,
- `network_vcheck_param_key`,
- `network_vcheck_param_value`,
- `network_vcheck_param_default`
-FROM
- `{?_MYSQL_PREFIX?}_network_vcheck_params`
-WHERE
- `network_id`=%s
-ORDER BY
- `network_vcheck_param_id` ASC',
- array(
- bigintval(getRequestElement('network_id'))
- ), __FUNCTION__, __LINE__);
-
- // Start an empty SQL query
- $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`, `network_vcheck_param_key`, `network_vcheck_param_value`, `network_vcheck_param_default`) VALUES' . PHP_EOL;
-
- // Load all entries
- while ($content = SQL_FETCHARRAY($result)) {
- // Add row
- $SQL .= '(' .
- $content['network_id'] . ", '" .
- $content['network_vcheck_param_key'] . "', '" .
- $content['network_vcheck_param_value'] . "', ";
-
- // Is the column NULL?
- if (is_null($content['network_vcheck_param_default'])) {
- // Column is NULL
- $SQL .= "NULL),\n";
- } else {
- // Column is set
- $SQL .= chr(39) . $content['network_vcheck_param_default'] . "'),\n";
- }
- } // END - while
-
- // Remove last commata and close braces
- $SQL = substr($SQL, 0, -2);
-
- // Free result
- SQL_FREERESULT($result);
-
- // Output the SQL query
- loadTemplate('admin_export_network_vcheck_params', FALSE, $SQL);
-}
-