<?php
require("./total.inc");

session_start();
require("./ninsyou.inc");
if(0 > ninsyou_check(2)){
   exit;
   }


echo "<!DOCTYP:pserver:cvs@dhcvs.ms-n.com:/usr/home/cvsE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>";
echo "<HTML>";
echo "<HEAD>";
echo "<META name='GENERATOR' content='AmBuilder'>";
echo "<META http-equiv='Content-Type' content='text/html; charset=euc-jp'>";
	echo "<title>zither monitorring save info</title>";

echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "<!--

function WinCls(){
        window.close()
                       }
// window.onload=WinCls();
//-->";
echo "</SCRIPT>";

echo "</head>";
echo "<body alink='#ff0000' bgcolor='#ffffff' link='#0000ff' text='#000000' vlink='#000080'>";

echo "<pre>";




$C_NAME = enco($_GET["C_NAME"]); 
$CIP = enco($_GET["CIP"]); 
$C_INFO = enco($_GET["C_INFO"]);
$SOCK_IPADDR = enco($_GET["SOCK_IPADDR"]); 
$SOCK2_IPADDR = enco($_GET["SOCK2_IPADDR"]);
$SOCK_PORT = enco($_GET["SOCK_PORT"]);
$SOCK2_PORT = enco($_GET["SOCK2_PORT"]);
$BAT_FILE = enco($_GET["BAT_FILE"]);
$BAT2_FILE = enco($_GET["BAT2_FILE"]);
$COMMAND_PATH = enco($_GET["COMMAND_PATH"]);
$BAT_INT = enco($_GET["BAT_INT"]);
$BAT2_INT = enco($_GET["BAT2_INT"]);
$LIFE_INT = enco($_GET["LIFE_INT"]);
$LIFE_LOS =  enco($_GET["LIFE_LOS"]);
$MAIL_CC = enco($_GET["MAIL_CC"]); 
$UPDATE_COM = enco($_GET["UPDATE_COM"]); 

$COM_MONITOR = enco($_GET["COM_MONITOR"]); 
$PORT_MONITOR = enco($_GET["PORT_MONITOR"]); 
$LOG_MONITOR = enco($_GET["LOG_MONITOR"]); 
$GEN = enco($_GET["GEN"]); 


$THREAD_MAX = enco($_GET["THREAD_MAX"]); 
$TBUF_MAX = enco($_GET["TBUF_MAX"]); 
$LIFE_ONOFF = enco($_GET["LIFE_ONOFF"]); 
$MID_MAX = enco($_GET["MID_MAX"]); 
$THREAD_LEN = enco($_GET["THREAD_LEN"]); 
$MID_INT = enco($_GET["MID_INT"]); 
$DNS_IP = enco($_GET["DNS_IP"]); 
$DNS_IP2 = enco($_GET["DNS_IP2"]); 
$MIDUMP_FILE = enco($_GET["MIDUMP_FILE"]); 
$MIDUMP_FILE_2 = enco($_GET["MIDUMP_FILE_2"]); 

$EDIT = enco($_GET["EDIT"]);

$UP_TIME = date("Y m d g i s A");   

$C_BLOCK_NAME = $C_NAME . "-default";




print($font_size);
print($version_name);
print(date("Y m d g i s A"));
print("\n");
print("監視クライアント $CNAME の起動ファイルを編集できます\n");


if($LIFE_LOS > $LIFE_INT){
   $LIFE_LOS = $LIFE_INT;
   }


if(0 == strlen($C_NAME)){
   print("NOT hostname");
   exit;
   }
if(0 == strlen($CIP)){
   print("NOT client ip");
   exit;
   }


$conn = db_connect();
if(!$conn){
   echo "not connection!<br>";
   exit;
   }



if(0 < strlen($GEN)){
   $result = db_query($conn, "select * from connection where cname='$C_NAME';");
   if(!$result){
      print("bud query set(select)\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num > 0){
      if(0 == strcmp($EDIT, "UPNEW")){
         print("connection.sqlに $C_NAME のデータが存在しますので複製は作れません\n");
         exit;
         }
      else{
         print("connection.sqlに $C_NAME のデータが存在しますが、続行します\n");
         }
      }




   $result = db_query($conn, "select * from config where c_name='$C_NAME';");
   if(!$result){
      print("bud update query set\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num > 0){
      print("config.sqlに $C_NAME のデータが存在しますが、上書きします\n");
      $result = db_query($conn, "update config set
       c_name='$C_NAME',
       c_info='$C_INFO',
       sock_ipaddr='$SOCK_IPADDR',
       sock_port='$SOCK_PORT',
       sock2_ipaddr='$SOCK2_IPADDR',
       sock2_port='$SOCK2_PORT',
       bat_file='$BAT_FILE',
       bat2_file='$BAT2_FILE',
      command_path='$COMMAND_PATH',
       bat_int=$BAT_INT,
       bat2_int=$BAT2_INT,
       life_int=$LIFE_INT,
       life_los=$LIFE_LOS,
       mail_cc='$MAIL_CC',
       update_com='$UPDATE_COM',
       up_time='$UP_TIME'
       where c_name='$C_NAME'");

      if(!$result){
         print("bud update query set\n");
         exit;
         }
      db_free_result($result);
      }
   else{
      print("config.sqlに $C_NAME のデータがないので、新規に作成します\n");
      $result = db_query($conn, "insert into config
        (
        c_name,
        c_info,
        sock_ipaddr,
        sock_port,
        sock2_ipaddr,
        sock2_port,
        bat_file,
        bat2_file,
        command_path,
        bat_int,
        bat2_int,
        life_int,
        life_los,
        mail_cc,
        update_com,
        up_time
        ) values (
       '$C_NAME',
       '$C_INFO',
       '$SOCK_IPADDR',
       '$SOCK_PORT',
       '$SOCK2_IPADDR',
       '$SOCK2_PORT',
       '$BAT_FILE',
       '$BAT2_FILE',
       '$COMMAND_PATH',
       $BAT_INT,
       $BAT2_INT,
       $LIFE_INT,
       $LIFE_LOS,
       '$MAIL_CC',
       '$UPDATE_COM',
       '$UP_TIME'
       )");

      if(!$result){
         print("bud update query set\n");
         exit;
         }
      db_free_result($result);
      }






   $result = db_query($conn, "select * from config2 where c_name='$C_NAME';");
   if(!$result){
      print("bud update query set config2\n");
      }

   else{
      $num = db_num_rows($result);
      if($num > 0){
         print("config2.sqlに $C_NAME のデータが存在しますが、上書きします\n");
         $result = db_query($conn, "update config2 set
          c_name='$C_NAME',
          thread_max='$THREAD_MAX',
          tbuf_max='$TBUF_MAX',
          life_onoff='$LIFE_ONOFF',
          mid_max='$MID_MAX',
          thread_len='$THREAD_LEN',
          mid_int='$MID_INT',
          dns_ip='$DNS_IP',
          dns_ip2='$DNS_IP2',
          midump_file='$MIDUMP_FILE',
          midump_file_2='$MIDUMP_FILE_2',
          up_time='$UP_TIME'
          where c_name='$C_NAME'");

         if(!$result){
            print("bud update query set\n");
            exit;
            }
         db_free_result($result);
         }
      else{
         print("config2.sqlに $C_NAME のデータがないので、新規に作成します\n");
         $result = db_query($conn, "insert into config2
           (
           c_name,
           thread_max,
           tbuf_max,
           life_onoff,
           mid_max,
           thread_len,
           mid_int,
           dns_ip,
           dns_ip2,
           midump_file,
           midump_file_2,
           up_time
           ) values (
          '$C_NAME',
          '$THREAD_MAX',
          '$TBUF_MAX',
          '$LIFE_ONOFF',
          '$MID_MAX',
          '$THREAD_LEN',
          '$MID_INT',
          '$DNS_IP',
          '$DNS_IP2',
          '$MIDUMP_FILE',
          '$MIDUMP_FILE_2',
          '$UP_TIME'
           )");


         if(!$result){
            print("bud update query set\n");
            exit;
            }
         db_free_result($result);
         }
      }





   $result = db_query($conn, "select * from connection where cname='$C_NAME';");
   if(!$result){
      print("bud query set(select)\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num > 0){
      $result = db_query($conn, "update connection set
       cname='$C_NAME',
       cip='$CIP'
       where cname='$C_NAME'");

      if(!$result){
         print("bud update query set\n");
         exit;
         }
      print("connection.sqlにデータが存在しますが、上書きします\n");
      }

   else{
      $result = db_query($conn, "insert into connection
       (
       uct,
       ye,
       mo,
       da,
       ha,
       mi,
       se,
       cname,
       cip,
       server,
       mode,
       stat
       ) values (
       0,
       0,
       0,
       0,
       0,
       0,
       0,
       '$C_NAME',
       '$CIP',
       'NOT',
       'NOT',
       'FREE')
       ");

      if(!$result){
         print("bud query set(insert)\n");
         exit;
         }
      print("コネクションDBに $C_NAME がないので新規追加\n");
      }

   }





$start_file = "/usr/local/zither/conf/$C_NAME.conf";
$result = db_query($conn, "select * from config where c_name='$C_NAME';");
if(!$result){
   print("bud query config\n");
   exit;
   }
$num = db_num_rows($result);
if($num > 0){
   if(($fp = fopen($start_file, "w+"))==NULL){
      print("file not open $start_file\n");
      exit;
      }
   $s = 0;
   while($s < $num){
      $DATA = enco_rtrim(db_fetch_Result($result, $s, up_time));
      if(0 != strlen($DATA)){ fwrite($fp, "### sitar config update:$DATA\n"); }

      $DATA = enco_rtrim(db_fetch_Result($result, $s, c_name));
      if(0 != strlen($DATA)){ fwrite($fp, "C_NAME:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, c_info));
      if(0 != strlen($DATA)){ fwrite($fp, "C_INFO:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, sock_ipaddr));
      if(0 != strlen($DATA)){ fwrite($fp, "SOCK_IPADDR:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, sock2_ipaddr));
      if(0 != strlen($DATA)){ fwrite($fp, "SOCK2_IPADDR:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, sock_port));
      if(0 != strlen($DATA)){ fwrite($fp, "SOCK_PORT:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, sock2_port));
      if(0 != strlen($DATA)){ fwrite($fp, "SOCK2_PORT:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, bat_file));
      if(0 != strlen($DATA)){ fwrite($fp, "BAT_FILE:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, bat2_file));
      if(0 != strlen($DATA)){ fwrite($fp, "BAT2_FILE:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, command_path));
      if(0 != strlen($DATA)){ fwrite($fp, "COMMAND_PATH:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, bat_int));
      if(0 != strlen($DATA)){ fwrite($fp, "BAT_INT:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, bat2_int));
      if(0 != strlen($DATA)){ fwrite($fp, "BAT2_INT:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, life_int));
      if(0 != strlen($DATA)){ fwrite($fp, "LIFE_INT:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, life_los));
      if(0 != strlen($DATA)){ fwrite($fp, "LIFE_LOS:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, mail_cc));
      if(0 != strlen($DATA)){ fwrite($fp, "MAIL_CC:$DATA\n"); }
      $DATA = enco_rtrim(db_fetch_Result($result, $s, update_com));
      if(0 != strlen($DATA)){ fwrite($fp, "UPDATE_COM:$DATA\n"); }
      $s++;
      }
   fclose($fp);
   echo "$C_NAME.conf file update ok\n";
   echo "成功 \n";
   db_free_result($result);
   }
else{
   echo "$C_NAME.conf file not update!!\n";
   echo "失敗ですぅ \n";
   }


$result = db_query($conn, "select * from config2 where c_name='$C_NAME';");
if(!$result){
   print("error bud query config2\n");
   }
else{
   $num = db_num_rows($result);
   if($num > 0){
      if(($fp = fopen($start_file, "a+"))==NULL){
         print("err file not open $start_file\n");
         exit;
         }
      $s = 0;
      while($s < $num){

         $DATA = enco_rtrim(db_fetch_Result($result, $s, up_time));
//       if(0 != strlen($DATA)){ fwrite($fp, "## sitar config2 update:$DATA\n"); }

         $DATA = enco_rtrim(db_fetch_Result($result, $s, thread_max));
         if(0 != strlen($DATA)){ fwrite($fp, "THREAD_MAX:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, tbuf_max));
         if(0 != strlen($DATA)){ fwrite($fp, "TBUF_MAX:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, life_onoff));
         if(0 != strlen($DATA)){ fwrite($fp, "LIFE_ONOFF:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, mid_max));
         if(0 != strlen($DATA)){ fwrite($fp, "MID_MAX:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, thread_len));
         if(0 != strlen($DATA)){ fwrite($fp, "THREAD_LEN:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, mid_int));
         if(0 != strlen($DATA)){ fwrite($fp, "MID_INT:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, dns_ip));
         if(0 != strlen($DATA)){ fwrite($fp, "DNS_IP:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, dns_ip2));
         if(0 != strlen($DATA)){ fwrite($fp, "DNS_IP2:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, midump_file));
         if(0 != strlen($DATA)){ fwrite($fp, "MIDUMP_FILE:$DATA\n"); }
         $DATA = enco_rtrim(db_fetch_Result($result, $s, midump_file_2));
         if(0 != strlen($DATA)){ fwrite($fp, "MIDUMP_FILE_2:$DATA\n"); }

         $s++;
         }
      fclose($fp);
      echo "$C_NAME.conf file update ok\n";
      echo "成功 \n";
      db_free_result($result);
      }
   else{
      echo "$C_NAME.conf file not update!!\n";
      echo "失敗ですぅ \n";
      }
   }

















if(0 == strcmp($EDIT, "UPNEW")){

   $result = db_query($conn, "select * from monitor where cname='$C_NAME';");
   if(!$result){
      print("bud query set(select)\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num < 1){
      echo "新規編集かもしれません、監視項目を追加していきます\n";
      $result = db_query($conn, "insert into monitor
         (
         come,
         cname,
         monitor,
         sign,
         proto,
         com,
         cip,
         port,
         wtime,
         pinfo,
         prino,
         free1,
         free2,
         free3,
         free4
         ) values (
         'ON',
         '$C_NAME',
         'COMAND',
         0,
         'NOT',
         'dfc.sh none 90',
         '$CIP',
         'NOT',
         8,
         '$C_NAME($CIP)',
         2,
         'NOT',
         'NOT',
         'NOT',
         '$C_BLOCK_NAME') ");
      if(!$result){
         print("bud query set\n");
         exit;
         }

      $result = db_query($conn, "insert into monitor
         (
         come,
         cname,
         monitor,
         sign,
         proto,
         com,
         cip,
         port,
         wtime,
         pinfo,
         prino,
         free1,
         free2,
         free3,
         free4
         ) values (
         'ON',
         '$C_NAME',
         'COMAND',
         0,
         'NOT',
         'inode.sh none 40',
         '$CIP',
         'NOT',
         8,
         '$C_NAME($CIP)',
         2,
         'NOT',
         'NOT',
         'NOT',
         '$C_BLOCK_NAME') ");
      if(!$result){
         print("bud query set\n");
         exit;
         }

      $result = db_query($conn, "insert into monitor
         (
         come,
         cname,
         monitor,
         sign,
         proto,
         com,
         cip,
         port,
         wtime,
         pinfo,
         prino,
         free1,
         free2,
         free3,
         free4
         ) values (
         'ON',
         '$C_NAME',
         'COMAND',
         0,
         'NOT',
         'uptime.sh 40',
         '$CIP',
         'NOT',
         8,
         '$C_NAME($CIP)',
         2,
         'NOT',
         'NOT',
         'NOT',
         '$C_BLOCK_NAME') ");
      if(!$result){
         print("bud query set\n");
         exit;
         }

      $result = db_query($conn, "insert into monitor
         (
         come,
         cname,
         monitor,
         sign,
         proto,
         com,
         cip,
         port,
         wtime,
         pinfo,
         prino,
         free1,
         free2,
         free3,
         free4
         ) values (
         'ON',
         '$C_NAME',
         'COMAND',
         0,
         'NOT',
         'freemem.sh 1000',
         '$CIP',
         'NOT',
          8,
          '$C_NAME($CIP)',
          2,
          'NOT',
          'NOT',
          'NOT',
          '$C_BLOCK_NAME') ");
      if(!$result){
         print("bud query set\n");
         exit;
         }        

      print("OK 監視ブロックを作成します\n");
      $result = db_query($conn, "insert into userblock
        (
        youname,
        bname,
        cname,
        mailsend,
        stat,
        plustime,
        starttime,
        stopsettime,
        mailto,
        mailcc,
        free1,
        free2,
        free3
        ) values (
        'test',
        '$C_BLOCK_NAME',
        '$C_NAME',
        'ON',
        'NON',
        60,
        0,
        0,
        'test@localhost',
        'test@localhost',
        'It corrects it. ',
        'NOT',
        'NOT'
      )");
      if(!$result){
         print("NG 監視ブロックを作成出来ませんでした\n");
         exit;
         }

      db_free_result($result);

      echo "OK Inser data\n";
      echo "$C_NAME\n";
      echo "$CIP\n";
      }
   else{
      print("すでに $C_NAME の監視設定が存在します \n");
      }
   }
else{
   echo "新規編集ではないので、監視項目の上書きは行いません\n";
   }












if(0 == strcmp($EDIT, "UPNEW")){
   echo "新規編集かもしれません、STATファイルを作成します\n";

   $conf_file = "/usr/local/zither/conf/$C_NAME.stat";
   if(($fp = fopen($conf_file, "w+"))==NULL){
      print("stat file not open\n");
      exit;
      }
   $result = db_query($conn, "select * from connection where cname='$C_NAME'");
   if(!$result){
      print("bud query\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num <= 0){
      print("no data\n");
      fwrite($fp, "START");
      echo "stat file update ok(START)\n";
      echo "成功 \n";
      }
   else{
      $s = 0;
      while($s < $num){
         $MODE = enco_rtrim(db_fetch_Result($result, $s, mode));
         fwrite($fp, $MODE);
         echo "stat file update ok\n";
         echo "成功 \n";
         $s++;
         }
      }

   fclose($fp);
   }
else{
   echo "STATファイルを上書きします\n";
   $conf_file = "/usr/local/zither/conf/$C_NAME.stat";
   if(($fp = fopen($conf_file, "r"))==NULL){
      print("1 stat file not open\n");
      exit;
      }
   else{
      $outdata = fgets($fp, 100);
      echo "OUT DATA -->$outdata\n";
      fclose($fp);
      }

   $result = db_query($conn, "select * from connection where cname='$C_NAME'");
   if(!$result){
      print("bud query\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num <= 0){
      if(($fp = fopen($conf_file, "w+"))==NULL){
         print("2 stat file not open\n");
         exit;
         }
      print("no data\n");
      fwrite($fp, "START");
      echo "file update ok(START)\n";
      echo "成功 \n";
      fclose($fp);
      }
   else{
      $s = 0;
      while($s < $num){
         $MODE = enco_rtrim(db_fetch_Result($result, $s, mode));
         if(0 != strcmp($MODE, $outdata)){
            echo "OUT MODE -->$MODE\n";
            if(($fp = fopen($conf_file, "w+"))==NULL){
               print("3 stat file not open\n");
               exit;
               }
            fwrite($fp, $MODE);
            echo "file update ok\n";
            echo "成功 \n";
            fclose($fp);
            }
         $s++;
         }
      }
   }








if(0 == strcmp($EDIT, "UPNEW")){
   echo "新規編集かもしれません、コマンドファイルを作成します\n";

   $conf_file = "/usr/local/zither/conf/$C_NAME.command";
   if(($fp = fopen($conf_file, "w+"))==NULL){
      print("$conf_file file not open\n");
      exit;
      }
   else{
      $conf_file2 = "/usr/local/zither/conf/test.command";
      if(($fp2 = fopen($conf_file2, "r+"))!=NULL){
         print("write open file name $conf_file \n");
         print("read open file name $conf_file2 \n");
         while(1){
            $file_data = fgets($fp2, 2048);
            fwrite($fp, "$file_data");
            if(0 == strcmp($file_data, NULL)){
               break;
               }
            }
         fclose($fp2);
         }
      else{
         fwrite($fp, "##\n");
         fwrite($fp, "##\n");
         fclose($fp);
         }
      }

   echo "command file update ok\n";
   echo "成功 \n";
   }
else{
   echo "新規編集ではないので、コマンドファイルは上書きしません\n";
   }









echo "認証ファイルを上書きします。\n";


$conf_file = "/usr/local/zither/conf/neg.conf";
$result = db_query($conn, "select * from connection");
if(!$result){
   print("bud query conection\n");
   exit;
   }
$num = db_num_rows($result);
if($num <= 0){
   print("no data conection\n");
   exit;
   }
if(($fp = fopen($conf_file, "w+"))==NULL){
   print("file not open neg.conf\n");
   exit;
   }
$s = 0;
while($s < $num){
   $CNAME = enco_rtrim(db_fetch_Result($result, $s, cname));
   $CIP = enco_rtrim(db_fetch_Result($result, $s, cip));
   fwrite($fp, "$CNAME:$CIP\n");
   print("$CNAME:$CIP\n");
   $s++;
   }
fclose($fp);
echo "neg.conf file update ok\n";
echo "成功 \n";



if(0 < strlen($GEN)){
   $s = 0;
   $result = db_query($conn, "select distinct(server) from connection;");
   if(!$result){
      print("bud query\n");
      exit;
      }
   $num = db_num_rows($result);
   if($num <= 0){
      print("no data\n");
      exit;
      }
   else{
      while($s < $num){
         $SERVER = enco_rtrim(db_fetch_Result($result, $s, server));
         print("$SERVER $my_web_ip ");
         if(0 != strcmp($SERVER, $my_web_ip)){

            $T_1 = "/config_up.php" . "?";
            $T_2 = "C_NAME=" . urlencode($C_NAME) . "&";
            $T_3 = "CIP=" . urlencode($CIP) . "&";
            $T_4 = "C_INFO=" . urlencode($C_INFO) . "&";
            $T_5 = "SOCK_IPADDR=" . urlencode($SOCK_IPADDR) . "&";
            $T_6 = "SOCK2_IPADDR=" . urlencode($SOCK2_IPADDR) . "&";
            $T_7 = "SOCK_PORT=" . urlencode($SOCK_PORT) . "&";
            $T_8 = "SOCK2_PORT=" . urlencode($SOCK2_PORT) . "&";
            $T_9 = "BAT_FILE=" . urlencode($BAT_FILE) . "&";
            $T_10 = "BAT2_FILE=" . urlencode($BAT2_FILE) . "&";
            $T_11 = "COMMAND_PATH=" . urlencode($COMMAND_PATH) . "&";
            $T_12 = "BAT_INT=" . urlencode($BAT_INT) . "&";
            $T_13 = "BAT2_INT=" . urlencode($BAT2_INT) . "&";
            $T_14 = "LIFE_INT=" . urlencode($LIFE_INT) . "&";
            $T_15 = "LIFE_LOS=" . urlencode($LIFE_LOS) . "&";
            $T_16 = "MAIL_CC=" . urlencode($MAIL_CC) . "&";
            $T_17 = "UPDATE_COM=" . urlencode($UPDATE_COM) . "&";
            $T_18 = "COM_MONITOR=" . urlencode($COM_MONITOR) . "&";
            $T_19 = "PORT_MONITOR=" . urlencode($PORT_MONITOR) . "&";
            $T_20 = "LOG_MONITOR=" . urlencode($LOG_MONITOR) . "&";

            $T_ALL = $T_1 . $T_2 . $T_3 . $T_4 . $T_5 . $T_6 . $T_7 . $T_8 . $T_9 . $T_10 . $T_11 . $T_12 . $T_13 . $T_14 . $T_15 . $T_16 . $T_17 . $T_18 . $T_19 . $T_20;

            print("<br>");
            print("$T_ALL");
            http_open($SERVER, $T_ALL, $my_web_ip);

            }

         $s++;
         }
      }
   }


db_free_result($result);
db_Close($conn);






if(0 == strcmp($EDIT, "UPNEW")){
   echo "新規編集かもしれません、リストファイルを作成します\n";
   list_file_upload($C_NAME, $GEN);
   }
else{
   echo "新規編集ではないので、LISTファイルは上書きしません \n";
   }




print("</font>");

?>

</pre>
</body>
</html>


