die("Failed! Tickets 'Settings' table absent. " . __LINE__ . "\n");
}
if (!table_exists("tracks_hh", FALSE)) {
    die("Failed! Tickets 'tracks_hh' table already installed. " . __LINE__ . "\n");
}
$the_version = get_variable("_version");
$pos = strpos($the_version, $findme);
if ($pos === false) {
    die("Failed!  This upgrade applies only to Tickets Version 10. " . __LINE__ . "\n");
}
die(" ---------------------------------------. " . __LINE__ . "\n");
if (!get_variable("terrain")) {
    do_insert_settings("terrain", "1");
}
if (!table_exists("tracks_hh", FALSE)) {
    // write tracks_hh table if not exist
    do_tracks_hh();
}
if (table_exists("session", TRUE)) {
    // drop either way - no value
    do_session();
}
//	write_conf($_POST['frm_db_host'],$_POST['frm_db_dbname'],$_POST['frm_db_user'],$_POST['frm_db_password'],$_POST['frm_db_prefix']);
write_conf($mysql_host, $mysql_db, $mysql_user, $mysql_passwd, $mysql_prefix);
//	/* generated by 'install.php' Wed, 25 Feb 2009 08:13:55 -0600 */
//	$mysql_host 	= 'localhost';
//	$mysql_db 		= 'test_10_c';
////	$mysql_db 		= 'ari';
//	$mysql_user 	= '******';
//	$mysql_passwd 	= '';
//	$mysql_prefix 	= '';
            print "<LI> Re-Installation done!";
            break;
            //			case 'upgrade-0.65':{
            //				upgrade_065_07($_POST['frm_db_prefix']);
            //				write_conf($_POST['frm_db_host'],$_POST['frm_db_dbname'],$_POST['frm_db_user'],$_POST['frm_db_password'],$_POST['frm_db_prefix']);
            //				print "<LI> Upgrade <B>0.65->0.7</B> complete!";
            //				break;
            //				}
        //			case 'upgrade-0.65':{
        //				upgrade_065_07($_POST['frm_db_prefix']);
        //				write_conf($_POST['frm_db_host'],$_POST['frm_db_dbname'],$_POST['frm_db_user'],$_POST['frm_db_password'],$_POST['frm_db_prefix']);
        //				print "<LI> Upgrade <B>0.65->0.7</B> complete!";
        //				break;
        //				}
        case 'writeconf':
            write_conf($_POST['frm_db_host'], $_POST['frm_db_dbname'], $_POST['frm_db_user'], $_POST['frm_db_password'], $_POST['frm_db_prefix']);
            print "<LI> All done.";
            break;
        default:
            print "<LI> <FONT CLASS=\"warn\">'{$_POST['frm_option']}' is not a valid option!</FONT>";
    }
    print '<BR /><BR /><FONT CLASS="warn">Your Tickets installation is now complete - the start page is \'index.php\' .</FONT>';
    print '<BR /><BR /><FONT CLASS="warn">It is strongly recommended that you move/delete/change rights on install.php after this</FONT>';
    print '<BR /><BR /><A HREF="index.php"><< Start Tickets</A>';
} else {
    if (array_key_exists('help', $_GET)) {
        // 9/16/08
        ?>
		<BLOCKQUOTE>
		1.  Fill in the install form with your mysql server settings. The 'table prefix' option enables you to prefix the tables with
		an optional name if you're only using one database or need multiple instances. Thus a prefix of <B>my_</B> would name the