", $varname); while ($row=db_fetch_array($result)) { printf("", $row["id"], ($row["id"]==$default) ? " selected" : "", $row["name"]); } print(""); } function client_selbox($varname, $default=0) { global $dbh; $result=db_query($dbh, "SELECT cl.id, cl.firstname, cl.lastname, ". "cl.town, co.name FROM client cl, country co ". "WHERE cl.country=co.id ORDER BY cl.firstname, ". "cl.lastname"); printf(""); } function enter_personal_data() { global $dbh; $query = sprintf("INSERT INTO client (firstname, lastname, ". "address1, country, town, zipcode, state, ". "active) VALUES ('%s', '%s', '%s', %d, '%s', ". "'%05d', '%s', true)", $_POST["firstname"], $_POST["lastname"], $_POST["address"], $_POST["country"], $_POST["town"], $_POST["zipcode"], $_POST["state"]); db_exec($dbh, $query); } function has_personal_data() { global $dbh; $result=db_query($dbh, "SELECT id FROM client"); return (db_num_rows($result)!=0); } function setup_admin_account() { global $dbh; $query = sprintf("INSERT INTO sysuser (name, type, home, shell, ". "password, client, toupdate, md5pass, sysuid) ". "VALUES ('%s', %d, '/root', true, '%s', ". "%d, false, '%s', 0)", $_POST["adminuser"], cUSRADMIN, $_POST["adminpass1"], $_POST["clientid"], md5($_POST["adminpass1"])); db_exec($dbh, $query); } function has_admin_account() { global $dbh; $query=sprintf("SELECT id FROM sysuser WHERE type=%d", cUSRADMIN); $result=db_query($dbh, $query); return (db_num_rows($result)!=0); } include("commonhead.php"); if (!isset($_POST["mode"])) { $mode = "step1"; } else { $mode = $_POST["mode"]; } switch ($mode) : case "step1": ?>
">

">
">

">
">

">
Start page\"."), "start.php"); break; default: ?> You are trying to trick me. I don't like this