1   <?php
  2   ##############################################################
  3   ##In-portal                                                                                                     ##
  4   ##############################################################
  5   ##                                            In-portal                                                 ##
  6   ##                                      Intechnic Corporation                                   ##
  7   ##                         All Rights Reserved, 1998-2002                               ##
  8   ##                                                                                                                      ##      
  9   ##      No portion of this code may be copied, reproduced or    ##      
  10   ##         otherwise redistributed without proper written               ##
  11   ##        consent of Intechnic Corporation.  Violation will             ##
  12   ##         result in revocation of the license and support              ##
  13   ##       privileges along maximum prosecution allowed by law.   ##
  14   ##############################################################
  15  
  16           // new startup: begin
  17           define('REL_PATH', 'admin');
  18           $relation_level = count( explode('/', REL_PATH) );
  19           define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
  20           require_once FULL_PATH.'/kernel/startup.php';
  21           // new startup: end
  22           
  23           $prefix = $application->GetVar('prefix');
  24           $application->SetVar($prefix.'_mode', 't');
  25           
  26           $id_field = $application->getUnitOption($prefix, 'IDField');
  27           $temp_handler =& $application->recallObject($prefix.'_TempHandler', 'kTempTablesHandler');
  28           $table_name = $temp_handler->GetTempName( $application->getUnitOption($prefix, 'TableName') );
  29           
  30           $db =& $application->GetADODBConnection();
  31           $item_id = $db->GetOne('SELECT '.$id_field.' FROM '.$table_name, (int)$application->GetVar('en'));
  32           $application->SetVar($prefix.'_id', $item_id);          
  33           
  34           $template = $application->GetVar('t');
  35           include_once FULL_PATH.'/admin/'.$template.'.php';
  36           
  37           $application->Run();
  38           
  39           int_footer();
  40   ?>