Example #1
0
        $row = '';
        $sourcefile = @file($_SETTINGS['freetdspath']) or die(throwGeneralError('unable to parse FreeTDS configuration file, check path<br>in config.php, and permissions on the freetds.conf file'));
        foreach ($sourcefile as $row) {
            if ($row[0] == '[' && trim($row) != '[global]') {
                $sources[] = substr(str_replace(']', '', trim($row)), 1);
            }
        }
        if (count($sources) == 0) {
            throwGeneralError('unable to find any datasources in your freetds.conf,<br>check your FreeTDS configuration');
        }
    } else {
        if (file_exists($_SETTINGS['odbcinipath'])) {
            $sourcefile = array();
            $row = '';
            $skipds = array('[ODBC 32 bit Data Sources]', '[MS Access Database]', '[Excel Files]', '[dBASE Files]');
            $sourcefile = @file($_SETTINGS['odbcinipath']) or die(throwGeneralError('unable to parse ODBC configuration file, check path<br>in config.php, and permissions on the odbc.ini file'));
            foreach ($sourcefile as $row) {
                if ($row[0] == '[' && !in_array(trim($row), $skipds)) {
                    $sources[] = substr(str_replace(']', '', trim($row)), 1);
                }
            }
        }
    }
    if (count($_SETTINGS['connections']) > 0) {
        $sources = array_merge($sources, $_SETTINGS['connections']);
    }
}
?>

<form name="form1" method="post" action="index.php">
<table width="300" style="border: 1px solid; border-color: black">
Example #2
0
        if (count($sources) == 0) {
            die(throwGeneralError('unable to find any datasources in your freetds.conf,<br>check your FreeTDS configuration'));
        }
    } else {
        $sourcefile = array();
        $sources = array();
        $row = '';
        $skipds = array('[ODBC 32 bit Data Sources]', '[MS Access Database]', '[Excel Files]', '[dBASE Files]');
        $sourcefile = @file($_SETTINGS['odbcinipath']) or die(throwGeneralError('unable to parse ODBC configuration file, check path<br>in config.php, and permissions on the odbc.ini file'));
        foreach ($sourcefile as $row) {
            if ($row[0] == '[' && !in_array(trim($row), $skipds)) {
                $sources[] = substr(str_replace(']', '', trim($row)), 1);
            }
        }
        if (count($sources) == 0) {
            die(throwGeneralError('unable to find any datasources in your odbc.ini,<br>check your ODBC configuration'));
        }
    }
}
?>

<form name="form1" method="post" action="index.php">
<table width="<?php 
echo $_SETTINGS['mobilescreenwidth'];
?>
">
	<tr>
		<td align="right" style="color: white; background: #2A00A6">
			<b>DSN:</b>
		</td>
		<td style="background: #2A00A6">