<?php 

// new startup: begin
define('REL_PATH', 'admin/import');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
require_once FULL_PATH.'/kernel/startup.php';
// new startup: end

$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
//Set Section
$section = "in-portal:main_import";
//Set Environment Variable
$envar = "env=" . BuildEnv();

 $sec = $objSections->GetSection($section);
 $objCatToolBar = new clsToolBar();

// Clean Up Import DB Connection Variables
$objSession->SetVariable("import_sql_type",""); // sql server type
$objSession->SetVariable("import_server","");	// sql server address
$objSession->SetVariable("import_db","");		// database name
$objSession->SetVariable("import_user","");		// connection user
$objSession->SetVariable("import_pass","");		// connection password
$objSession->SetVariable("error_importing","");	// connection error

// Clean Up Last Step Variables
$objSession->SetVariable('import_table_prefix','');

$objSession->SetVariable('user_admin_names','');
$objSession->SetVariable('user_regular_names','');
$objSession->SetVariable('user_admin_values','');
$objSession->SetVariable('user_regular_values','');
$objSession->SetVariable('catnavbar','');
$objSession->SetVariable('init_cat','');
$objSession->SetVariable('user_input1',''); // in use ?
$objSession->SetVariable('user_input2',''); // in use ?
$objSession->SetVariable('importtodo','');

	$var="?env=".BuildEnv();
	
	// Prev Button (no use at a time :)
    $MouseOver="";
    $MouseOut="";
    $onClick="";
    $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif");
    
	// Next Button  
    $MouseOver="if( UsedAgreed() ) swap('moveright','toolbar/tool_next_f2.gif');";
    $MouseOut="if( UsedAgreed() ) swap('moveright', 'toolbar/tool_next.gif');";
    
    $link2=$adminURL."/import/step2.php".$var;
    $onClick="if( UsedAgreed() ) document.location= '$link2';";
    $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
  
  
  $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 1";
  
  int_header($objCatToolBar,NULL,$title,' onload="PageOnLoad(1);"');

?>
         
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<form name="import_form" METHOD="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">	
<?php int_subsection_title(admin_language("la_Prompt_Warning"));  ?>
 <TR <?php echo int_table_color(); ?>> 
       <TD COLSPAN="2"><span class=\"text\">This utility allows you to import data from other databases and applications, including third party products and earlier versions of this software.
            </span> 
       </TD>
    </TR>
 <tr <?php echo int_table_color(); ?>>
     <TD>
 	<?php
      		echo int_hint(prompt_language("la_text_disclaimer_part1")." ".prompt_language("la_text_disclaimer_part2")); 
      ?>
   </td>
   </tr>
 <tr>
 <td COLSPAN="2">
	<input type="checkbox" value="0" id="agree" name="agree" onclick="if( UsedAgreed() ) swap('moveright', 'toolbar/tool_next.gif'); else swap('moveright', 'toolbar/tool_next_f3.gif'); "><label for="agree"><?php echo admin_language("la_Text_IAgree"); ?></label>
 </td>
 </tr>
</FORM>
</TABLE>

<?php
int_footer();
?>