<?php
/*******************************************
/* Programm profile.php4
/* edit or add profile
/* (c) Copyright 2002, Jens Bierkandt
/* e-mail: jens@bierkandt.org
/* Entstanden im Rahmen meiner Diplomarbeit
/*******************************************
*/
error_reporting(63); // 0 = none, 63 = full
include("/home/schtorch/public_html/diplom/config.php4");
$db = mysql_connect($hostname, $username, $password);
mysql_select_db($database, $db);
if (isset($table)) {
$result = mysql_query("SELECT * FROM `admin` WHERE
table_name=\"$table\"", $db);
$row = mysql_fetch_row($result);
echo mysql_error($db);
$name = $row[0];
$computer = $row[1];
$table = $row[2];
$phone = $row[3];
$protocol = $row[4];
$user = $row[5];
$result = mysql_query("SELECT
DECODE(passwd,\"$secret_key\") FROM `admin` WHERE
table_name=\"$table\"", $db);
$row = mysql_fetch_row($result);
$passwd = $row[0];
} else {
$name = "";
$computer = "";
$table = "";
$phone = "";
$protocol = "";
$user = "";
$passwd = "";
}
mysql_close($db);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Analyse und Administration</title>
</head>
<body>
<center><a href="http://www.tu-ilmenau.de">
<img src="tu_header.jpg" width=574 height=40 align="middle"
border=0></a>
<h1>Profileingabe</h1>
<form action="check_profile.php4" method="POST">
<table width="500">
<tr>
<td align="left">Name der Windkraftanlage:</td>
<td align="left">
<?php
echo "<input type=\"text\" name=\"name\" value=\"$name\"
maxlength=20>";
?>
</td></tr>
<tr>
<td align="left">Name des Messcomputers: (nicht doppelt
vergeben)</td>
<td align="left">
<?php
echo "<input type=\"text\" name=\"computer\"
value=\"$computer\" maxlength=20>";
?>
</td></tr>
<tr>
<td align="left">Name der Datentabelle: (nicht doppelt
vergeben)</td>
<td align="left">
<?php
if (isset($row[0])) {
echo $table;
echo "<input type=\"hidden\" name=\"table\"
value=\"$table\">";
}
else
echo "<input type=\"text\" name=\"table\"
value=\"$table\" maxlength=15>";
?>
</td></tr>
<tr>
<td align="left">Telefonnummer des Messrechners (nur
Ziffern):</td>
<td align="left">
<?php
echo "<input type=\"text\" name=\"phone\"
value=\"$phone\" maxlength=30>";
?>
</td></tr>
<tr>
<td align="left">Modemart des Messrechners:</td>
<td align="left">
<?php
echo "<input type=\"radio\" name=\"protocol\"
value=\"hdlc sync\"";
if ($protocol == "hdlc sync" or $protocol == "") echo "
checked";
echo "> ISDN ";
echo "<input type=\"radio\" name=\"protocol\"
value=\"modem\"";
if ($protocol == "modem") echo " checked";
echo "> Analog";
?>
</td></tr>
<tr>
<td align="left">Name des Logins auf dem Messcomputer:</td>
<td align="left">
<?php
echo "<input type=\"text\" name=\"user\" value=\"$user\"
maxlength=30>";
?>
</td></tr>
<tr>
<td align="left">Passwort des Logins auf dem
Messcomputer:</td>
<td align="left">
<?php
echo "<input type=\"password\" name=\"passwd\"
value=\"$passwd\" maxlength=30>";
?>
</td></tr>
<tr>
<td align="left">Wiederholung des Passworts:</td>
<td align="left">
<?php
echo "<input type=\"password\" name=\"passwd1\"
value=\"$passwd\" maxlength=30>";
if (isset($row[0]))
echo "<input type=\"hidden\" name=\"change\"
value=\"true\">";
?>
</td></tr>
<tr><td colspan=2 align="right"> <br>
<input type="submit" name="Eintragen" value="Eintragen">
</td></tr>
</table>
</form>
<br><a href=index.php4>Hauptmenü</a><br>
<hr>
(c) 2002 Jens Bierkandt, entstanden im Rahmen meiner
Diplomarbeit </center>
</body>
</html>