<?php
include($_SERVER['DOCUMENT_ROOT'] .'/script/HeaderInc.php');
//SiteLibs::GetVarDump($MS_SP);
//echo ini_get('memory_limit');


$fh = fopen("script/IPFilterMod.phb", "w");
bcompiler_write_header($fh);
bcompiler_write_file($fh, "script/IPFilterMod.php"); //исходный файл для компиляции
bcompiler_write_footer($fh);
fclose($fh);

//require_once('test.php');

phpinfo();

//$mdb2 =& MDB2::connect($MS_SP->Sp_DbConf['dbuser']['DbDsn']);
//      if (PEAR::isError($mdb2)) {
//        die($mdb2->getMessage());
//      }
//      SiteLibs::DbSetCharset($mdb2, 'cp1251');
//      $sql = "DROP PROCEDURE IF EXISTS addcol";
//      $VarResult =& $mdb2->exec($sql);
//      if (PEAR::isError($VarResult)) {
//        die($VarResult->getMessage());
//      }
//      
//      
//      $sql = "
//CREATE PROCEDURE addcol() BEGIN 
//IF NOT EXISTS( 
//SELECT * FROM information_schema.COLUMNS 
//WHERE COLUMN_NAME='users_id' AND TABLE_NAME='ipsuser_ndselectiontree'
//) 
//THEN 
//ALTER TABLE `ipsuser`.`ipsuser_ndselectiontree` ADD users_id INT( 11 ) NOT NULL AFTER ndselectiontree_parent_id;
//END IF;
//END;";
//      //echo "sql: ". $sql ."<br />";
//      $VarResult =& $mdb2->exec($sql);
//      if (PEAR::isError($VarResult)) {
//        die($VarResult->getMessage());
//      }
//      
//            
//      $sql = "CALL addcol()";
//      $VarResult =& $mdb2->exec($sql);
//      if (PEAR::isError($VarResult)) {
//        die($VarResult->getMessage());
//      }
//      $sql = "DROP PROCEDURE IF EXISTS addcol";
//      $VarResult =& $mdb2->exec($sql);
//      if (PEAR::isError($VarResult)) {
//        die($VarResult->getMessage());
//      }
//      
//      $mdb2->disconnect();



//if(true === is_file($MS_SP->SP_CurrFileNameText)){
//  $VarPagesTxt .= $smarty->fetch($MS_SP->SP_CurrFileNameText);
//}
//
//$smarty->assign('VarPagesTxt', @$VarPagesTxt);
//if (true === isset($MS_SP->SP_CurrPage['template_file']) && '' != $MS_SP->SP_CurrPage['template_file']){
//	$smarty->display($MS_SP->SP_CurrPage['template_file']);
//}
//else {
//	$smarty->display('Page.tpl');
//}
//include($_SERVER['DOCUMENT_ROOT'] .'/script/FooterInc.php');
?>