<?php
/* +----------------------------------------------------------------------+
| Netautor Professional Application Server |
+----------------------------------------------------------------------+
| Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net> |
+----------------------------------------------------------------------+
| This file is subject to license, that is bundled with this package |
| in the file LICENSE.TXT, and is available at through the |
| world-wide-web at http://www.netautor.com/license/ |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| hide@address.com so we can mail you a copy. |
+----------------------------------------------------------------------+
| Authors: Stefan Rottensteiner <hide@address.com> |
| Marek Kadziela <hide@address.com> |
| Gregor Wollner |
| Helli Kleinhans |
+----------------------------------------------------------------------+*/
/**
* Show & define database connection
*
* @author Stefan Rottensteiner
* @version $Revision: 1.31 $
*/
require_once ('./setup.inc');
if (empty($_POST['SETUP_CHECK']))
{
Header('Location: setup.php');
exit();
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta name="Description" content="<?php echo SOFTWARE_NAME_FULL;?> <?php echo SOFTWARE_VERSION_FULL;?> Setup Test Step 4">
<title><?php echo SOFTWARE_NAME_FULL; ?> <?php echo SOFTWARE_VERSION_FULL;?> Setup Test Step 4</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="robots" content="noindex,nofollow">
<link href="../../include/netautor.css" rel="stylesheet" type="text/css" src="../../include/netautor.css">
</head>
<script language="JavaScript" type="text/javascript">
function goOn(SiteName,ConfirmText)
{
if ((ConfirmText && ConfirmText!="") && (!confirm(ConfirmText))) return;
document.forms[0].action=SiteName;
document.forms[0].submit();
}
parent.frames['SETUP_HEAD'].document.setTitle('<?php echo (strtr($SETUP_LANGUAGE_TEXT['setup_step'],array('%1'=>'4','%2'=>'7')));?>');
</script>
<body bgcolor="White" text="Black" leftmargin=1 topmargin=1>
<form action="setup_5.php" method="post">
<input type="hidden" name="SQL_PCON" value="0">
<?php
echo(setup_getMyVars($_POST,'SQL_'));
if (!ini_get('register_globals'))
foreach( $_POST as $key => $value)
if (isset( $GLOBALS[ $key ]) && !isset( $$key)) $$key = &$GLOBALS[ $key ];
if (!isset($_POST['ERROR_DB'])) echo('<input type="hidden" name="ERROR_DB" value="1">');
?>
<br>
<br>
<table border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
<tr>
<td align="center" valign="top" colspan="3">
<?php
if (empty($SQL_VENDOR)) $SQL_VENDOR ='';
if (!isset($SQL_HOST)) $SQL_HOST ='';
if (!isset($SQL_PCON)) $SQL_PCON ='';
if (!isset($SQL_UID)) $SQL_UID ='';
if (!isset($SQL_PWD)) $SQL_PWD ='';
if (!isset($SQL_SID)) $SQL_SID ='';
$extension_exists = true;
switch ($SQL_VENDOR)
{
case 'mysql': $extension_exists = function_exists('mysql_connect') ; break;
case 'mysqli': $extension_exists = function_exists('mysqli_connect') ; break;
case 'oci_817': $extension_exists = function_exists('OCIPLogon') ; break;
case 'oci': $extension_exists = function_exists('OCIPLogon') ; break;
case 'odbc': $extension_exists = function_exists('odbc_connect') ; break;
case 'mssql': $extension_exists = function_exists('mssql_connect') ; break;
case 'informix': $extension_exists = function_exists('ifx_connect') ; break;
case 'pgsql': $extension_exists = function_exists('pg_connect') ; break;
}
?>
<table class="bgwindow700" width="700" border=0 align="center" >
<tr>
<td width="694" colspan="2" align="left" valign="top" class="head">
<img src="../../grafik/pixel.gif" width="1" height="7"><br>
<?php echo ($SETUP_LANGUAGE_TEXT['setup_step_3']['title']); ?><br>
<img src="../../grafik/spacer_700.gif" width="694" height="13"><br>
<img src="../../grafik/pixel.gif" width="1" height="6"><br>
</td>
</tr>
<tr>
<td class="text" width="40%" ><?php echo($SETUP_LANGUAGE_TEXT['db_vendor']);?><br></td>
<td width ="60%" >
<select name="SQL_VENDOR"
class="select"
onChange="db_choosen(this.options[this.options.selectedIndex].value);" >
<option value='' ></option>
<option value='mysql' <?php if ($SQL_VENDOR=='mysql') echo ('selected');?> >mySQL</option>
<option value='mssql' <?php if ($SQL_VENDOR=='mssql') echo ('selected');?> >MS-SQL via PHP</option>
<option value='odbc' <?php if ($SQL_VENDOR=='odbc') echo ('selected');?> >MS-SQL via ODBC</option>
<option value='oci_817' <?php if ($SQL_VENDOR=='oci_817') echo ('selected');?> >Oracle OCI 8.17</option>
<option value='oci' <?php if ($SQL_VENDOR=='oci') echo ('selected');?> >Oracle OCI 8.05</option>
<option value='mysqli' <?php if ($SQL_VENDOR=='mysqli') echo ('selected');?> >mySQLi (Beta!)</option>
<option value='informix' <?php if ($SQL_VENDOR=='informix') echo ('selected');?>>Informix (Beta!)</option>
<option value='pgsql' <?php if ($SQL_VENDOR=='pgsql') echo ('selected');?> >PostgresSQL (Beta!)</option>
</select><br>
</td>
</tr>
<?php if (!empty($SQL_VENDOR)) :?>
<?php if ($extension_exists) :?>
<tr>
<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['db_host'][$SQL_VENDOR]);?><br></td>
<td><input class="input319" type="text" size="30" value="<?php echo(htmlspecialchars($SQL_HOST));?>" name="SQL_HOST"></td>
</tr>
<tr>
<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['db_sid'][$SQL_VENDOR]);?><br></td>
<td><input class="input319" type="text" size="30" value="<?php echo(htmlspecialchars($SQL_SID));?>" name="SQL_SID"></td>
</tr>
<tr>
<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['db_pcon']);?><br></td>
<td><select name="SQL_PCON" class="select" onChange="this.form.elements['ERROR_DB'].value='1';">
<option value="1" <?php if (!empty($SQL_PCON)) echo(' selected');?>><?php echo( $SETUP_LANGUAGE_TEXT['yes']); ?></option>
<option value="" <?php if (empty($SQL_PCON)) echo(' selected');?>><?php echo( $SETUP_LANGUAGE_TEXT['no'] ); ?></option>
</select><br>
</td>
</tr>
<tr>
<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['db_uid']);?><br></td>
<td><input class="input319" type="text" maxlength="30" size="30" value="<?php echo(htmlspecialchars($SQL_UID));?>" name="SQL_UID"></td>
</tr>
<tr>
<td class="text"><?php echo($SETUP_LANGUAGE_TEXT['db_pwd']);?><br></td>
<td><input class="input319" type="password" maxlength="30" size="30" value="<?php echo(htmlspecialchars($SQL_PWD));?>" name="SQL_PWD"></td>
</tr>
<?php else :?>
<tr>
<td class="text" ><br></td>
<td class="textred" ><?php echo $SETUP_LANGUAGE_TEXT['setup_step_3']['no_extension']; ?></td>
</tr>
<input type="hidden" name="SQL_HOST" value="<?php echo $SQL_HOST;?>" >
<input type="hidden" name="SQL_SID" value="<?php echo $SQL_SID;?>" >
<input type="hidden" name="SQL_PCON" value="<?php echo $SQL_PCON;?>" >
<input type="hidden" name="SQL_UID" value="<?php echo $SQL_UID;?>" >
<input type="hidden" name="SQL_PWD" value="<?php echo $SQL_PWD;?>" >
<?php endif;?>
<?php else: ?>
<input type="hidden" name="SQL_HOST" value="<?php echo $SQL_HOST;?>" >
<input type="hidden" name="SQL_SID" value="<?php echo $SQL_SID;?>" >
<input type="hidden" name="SQL_PCON" value="<?php echo $SQL_PCON;?>" >
<input type="hidden" name="SQL_UID" value="<?php echo $SQL_UID;?>" >
<input type="hidden" name="SQL_PWD" value="<?php echo $SQL_PWD;?>" >
<?php endif; ?>
<tr>
<td colspan="2" valign="top">
<img src="../../grafik/pixel.gif" width="1" height="3"><br>
</td>
</tr>
</table>
<img src="../../grafik/bgwindow_482_stop.gif" width="700" height="14"><br>
<table class="bgwindow700" width="700" border=0 align="center" >
<tr>
<td class="head" width="33%" align="center" >
<input type="button" class="create" value="<?php echo ($SETUP_LANGUAGE_TEXT['back']);?>" onClick="goOn('setup_3.php');" >
</td>
<td class="head" width="34%" align="center" >
<input type="button" class="preview" value="<?php echo ($SETUP_LANGUAGE_TEXT['cancel']);?>" onClick="goOn('setup.php');" >
</td>
<td class="head" width="33%" align="center" >
<?php if ($extension_exists) :?>
<input type="button" class="create" value="<?php echo ($SETUP_LANGUAGE_TEXT['next']);?>" onClick="goOn('setup_5.php');" >
<?php endif; ?>
</td>
</tr>
</table>
<img src="../../grafik/bgwindow_482_stop.gif" width="700" height="14"><br>
</td>
</table>
</form>
<script language="JavaScript" type="text/javascript">
var chosenDB = '<?php echo($SQL_VENDOR);?>';
function db_choosen(sql_vendor)
{
chosenDB=sql_vendor;
document.forms[0].action="setup_4.php";
document.forms[0].submit();
}
var testWindow;
function doTheTest()
{
if (chosenDB == '' )
{
alert('<?php echo($SETUP_LANGUAGE_TEXT['db_no_db']);?>');
return;
}
if (testWindow && !testWindow.closed) testWindow.close();
testWindow= window.open('','SetupTestOuputWindow','scrollbars=yes,menubars=no,locationbars=no,resizable=yes,dependent=yes,width=640,height=250');
document.forms[0].action="setup_3_test.php";
document.forms[0].target="SetupTestOuputWindow";
if (testWindow) testWindow.focus();
window.setTimeout("window.document.forms[0].target='_self';window.document.forms[0].action='setup_3.php';",'300');
document.forms[0].submit();
}
</script>
</body>
</html>