<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<meta http-equiv="Content-Language" content="nl">
<TITLE>Site@School migration tool</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE>A:link {
	BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #638ab9; TEXT-DECORATION: none
}
A:active {
	BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #638ab9; TEXT-DECORATION: none
}
A:visited {
	BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #638ab9; TEXT-DECORATION: none
}
A:hover {
	BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ff0000; TEXT-DECORATION: none
}
TEXTAREA {
	COLOR: #000000; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #ccdaec
}
Input.BUTTON {
	border:1px outset #ccdaec; BACKGROUND-COLOR: #ccdaec
}
SELECT {
	BORDER-RIGHT: #ccdaec 1px inset; BORDER-TOP: #ccdaec 1px inset; BORDER-LEFT: #ccdaec 1px inset; COLOR: #000000; BORDER-BOTTOM: #ccdaec 1px inset; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #ccdaec
}
.text {
	FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial
}
.link {
	FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #638ab9; FONT-FAMILY: Verdana, Arial
}
.heading {
	FONT-WEIGHT: bold; FONT-SIZE: 13pt; COLOR: #638ab9; FONT-FAMILY: Verdana, Arial
}


INPUT.textfield {
	BORDER-RIGHT: #ccdaec 1px inset; BORDER-TOP: #ccdaec 1px inset; BORDER-LEFT: #ccdaec 1px inset; BORDER-BOTTOM: #ccdaec 1px inset; BACKGROUND-COLOR: #ccdaec
}
</STYLE>


</HEAD>
<BODY style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica" bottomMargin=0 vLink=#000000 aLink=#466c9b link=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 rightMargin=0>


<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 height=45
cellSpacing=0 cellPadding=0 width="100%"
background=../graphics/banner-bg.gif border=0>
  <TBODY>
  <TR>
    <TD align=left width="5%"><IMG height=45
      src="../graphics/banner-left.gif" width=4 border=0></TD>
    <TD align=right width="70%">
    <b><font size="6" color="#FFFFFF">Migration of 1.1 to 1.2</font></b></TD>
    <TD align=right width="3%"><IMG height=45
      src="../graphics/banner-right.gif" width=3
border=0></TD></TR></TBODY></TABLE>
<TABLE id=AutoNumber3 style="BORDER-COLLAPSE: collapse" borderColor=#111111
cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD vAlign=top>
      <TABLE cellPadding=5 width="100%" border=0>
        <TBODY>
        <TR>
          <TD>
<?php
if($_GET[step] == "")
{
?>
          <form method="POST" action="migrate1.1_1.2.php?step=1">
            <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
            cellSpacing=0 cellPadding=4 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=left width="65%">
                <SPAN class=heading>Welcome<BR></SPAN></TD>
                <TD vAlign=top align=middle width="10%">&nbsp;</TD>
              </TR>
              <TR>
                <TD align=center width="25%">
                <img border="0" src="../graphics/install_banner.jpg"></TD>
                <TD vAlign=top align=middle width="65%">
                <table border="1" height="300" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#E5E5E5" width="100%" id="AutoNumber4" bgcolor="#F7F7F7">
                  <tr>
                    <td width="100%" valign="top"><span class=text>
                    <br><br><br>This wizard will perform the migration of version 1.1 to 1.2 .<br><br>
                     Before you continue , please make sure you have made a <b>backup</b> of you MYSQL database.<br>
                     This can be done with <a href="http://phpmyadmin.sourceforge.net/">PHPMYADMIN</a> or a simular tool.
                    </span></td>
                  </tr>
                </table>
                </TD>
                <TD vAlign=top align=middle width="10%"></TD></TR>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=right width="65%">

                 <p>
                  <input type="submit" value="Continue" name="B1" class="BUTTON">
                  </p>
                </form>
<?php
}
if($_GET[step] == "1")
{
$installdir = $_SERVER["DOCUMENT_ROOT"]."/starnet";
$installdir = str_replace("//","/",$installdir);
?>


          <form method="POST" action="migrate1.1_1.2.php?step=2">

            <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
            cellSpacing=0 cellPadding=4 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=left width="65%">
                <SPAN class=heading>Step 1<BR></SPAN><span class="text">Database migration.</span></TD>
                <TD vAlign=top align=middle width="10%">&nbsp;</TD>
              </TR>
              <TR>
                <TD align=center width="25%">
                <img border="0" src="../graphics/install_banner.jpg"></TD>
                <TD vAlign=top align=middle width="65%">
                <table border="1" height="300" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#E5E5E5" width="100%" id="AutoNumber4" bgcolor="#F7F7F7">
                  <tr>
                    <td width="100%" valign="top"><span class=text>
                   <br><br>Tables will be altered during the next step..<br>Click on continue.</td>
                  </tr>
                </table>
                </TD>
                <TD vAlign=top align=middle width="10%"></TD></TR>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=right width="65%">


                 <p>
                  <input type="submit" value="Continue" name="B1" class="BUTTON">
                </form>
<?php
}
if($_GET[step] == "2")
{
?>
            <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
            cellSpacing=0 cellPadding=4 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=left width="65%">
                <SPAN class=heading>Step 2<BR></SPAN></TD>
                <TD vAlign=top align=middle width="10%">&nbsp;</TD>
              </TR>
              <TR>
                <TD align=center width="25%">
                <img border="0" src="../graphics/install_banner.jpg"></TD>
                <TD vAlign=top align=middle width="65%">
                <table border="1" height="300" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#E5E5E5" width="100%" id="AutoNumber4" bgcolor="#F7F7F7">
                  <tr>
                  <td width="100%" valign="top"><span class=text>

<?php
echo "start migration .....<br>"   ;
include("../configuration/database.inc.php");       
mysql_connect("$db_server", "$db_username", "$db_password");
mysql_select_db("$db_name");
$old_table_configuration = $table_configuration ;
$new_table_configuration = $dbprefix."config" ;
$query = "SELECT serverpath,url,sessioncode,language,editor,theme,sitename,startsection,highvisual,securitymethod,dateformat,email FROM $table_configuration";                                     
$result = mysql_query($query) or die_script(mysql_error());

$row = mysql_fetch_array($result) ;
$serverpath = $row['serverpath'];
$url = $row['url'];
$sessioncode = $row['sessioncode'];
$language = $row['language'];
$editor = $row['editor'];
$theme = $row['theme'];
$sitename = $row['sitename'];
$startsection = $row['startsection'];
$highvisual = $row['highvisual'];
$securitymethod = $row['securitymethod'];
$dateformat = $row['dateformat'];
$email = $row['email'];
echo "create new configuration table .....<br>"   ;
mysql_query("CREATE TABLE $new_table_configuration (config_key varchar(64) not NULL,config_value text, description varchar(255), PRIMARY KEY (config_key))");
echo "fill the new configuration table .....<br>"   ;
mysql_query("INSERT INTO $new_table_configuration VALUES ('serverpath', '$serverpath', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('url', '$url', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('language', '$language', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('sessioncode', '$sessioncode', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('editor', '$editor', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('theme', '$theme', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('sitename', '$sitename', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('startsection', '$startsection', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('highvisual', '$highvisual', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('securitymethod', '$securitymethod', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('dateformat', '$dateformat', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('email', '$email', '')");
 mysql_query("DROP TABLE  $old_table_configuration"); 
echo "get info from news module .....<br>"   ;
$query = "SELECT dbtables FROM $table_modules WHERE location='sn_news'";      
$result = mysql_query($query) or die_script(mysql_error());
$moduletables = mysql_result($result,0);
unset($query);
unset($result);
$moduletables = explode(",", $moduletables);
$news_configtable = "$moduletables[2]";
  $query = "SELECT template FROM $news_configtable";        // getting the template
  $result = mysql_query($query) or die_script(mysql_error());
  $template = mysql_result($result,0);
  unset($query);
  unset($result);
  $query = "SELECT welcome FROM $news_configtable";        
  $result = mysql_query($query) or die_script(mysql_error());
  $welcometext = mysql_result($result,0);
  unset($query);
  unset($result);
mysql_query("INSERT INTO $new_table_configuration VALUES ('news_template', '$template', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('news_welcome_text', '$welcometext', '')");
echo "get info from ads module .....<br>"   ;
 mysql_query("DROP TABLE $news_configtable"); 
$query = "SELECT dbtables FROM $table_modules WHERE location='sn_ads'";        // getting the table names
$result = mysql_query($query) or die_script(mysql_error());
$moduletables = mysql_result($result,0);
unset($query);
unset($result);
$moduletables = explode(",", $moduletables);
$table_ads_config = "$moduletables[1]";
   $query = "SELECT welcome FROM $table_ads_config";                 // get the welcome text
   $result = mysql_query($query) or die_script(mysql_error());
   $welcometext = mysql_result($result,0);
   unset($query);
   unset($result);

   $query = "SELECT disclaimer FROM $table_ads_config";               // get the disclaimer text
   $result = mysql_query($query) or die_script(mysql_error());
   $disclaimer = mysql_result($result,0);
   unset($query);
   unset($result);
mysql_query("INSERT INTO $new_table_configuration VALUES ('ads_disclaimer', '$disclaimer', '')");
mysql_query("INSERT INTO $new_table_configuration VALUES ('ads_welcome_text', '$welcometext', '')");
mysql_query("INSERT INTO $table_editors VALUES ('','Htmlarea Editor', 'htmlarea/editor.php', '')");
mysql_query("DROP TABLE $table_ads_config");
mysql_query("ALTER TABLE $new_table_configuration rename $old_table_configuration")  ;
echo "<p>migration is finished for version 1.2<p>You can now continue normal operation on your site."   ;
?>
<br><br>
The S@S team.<br>
</span></td>



                  </tr>
                </table>
                </TD>
                <TD vAlign=top align=middle width="10%"></TD></TR>
              <TR>
                <TD align=center width="25%">&nbsp;
                </TD>
                <TD vAlign=top align=right width="65%">
                  <p>
<?php
}
?>
               </TD>
                <TD vAlign=top align=middle width="10%">&nbsp;</TD></TR>
              </TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
    </TR></TBODY></TABLE></BODY></HTML>
