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


session_start();
require("./ninsyou.inc");
if(0 > ninsyou_check(5)){
   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 "</head>";






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


//  監視ブロック名リスト作成
$bname_count = 0;
$result = db_query($conn, "select distinct(bname) from userblock;");
if(!$result){
   print("banem select , bud query\n");
   exit;
   }
$num = db_num_rows($result);
if($num > 0){
   while($bname_count < $num){
      $bname_data[$bname_count] = enco_rtrim(db_fetch_Result($result, $bname_count, bname));
      $result1=db_query($conn,"select distinct(cname) from userblock where bname='$bname_data[$bname_count]';");
      if(!$result1){
         print("bname , canem select , bud query\n");
         exit;
         }
      $num1 = db_num_rows($result1);
      if($num1 > 0){
         $cname_data[$bname_count] = enco_rtrim(db_fetch_Result($result1, 0, cname));
         }
      $bname_count++;
      }
   }
else{
   print("NG 監視ブロックが無いです \n");
   }
db_free_result($result);
db_free_result($result1);

db_Close($conn);





print("</head>");
print("<body alink='#ff0000' bgcolor='$my_bgcolor' link='#0000ff' text='#000000' vlink='#000080'>\n");

print("<TABLE border='0' bgcolor='FFA500' cellspacing='3' cellpadding='0' width=100%>\n");
print("<tr><td align=left><font color='ffffff'><b>　監視設定 -> 新規作成</b></font></td></tr>\n");

print("</table>\n");

print("<TABLE border=0 cellspacing=0 cellpadding=3 WIDTH=80% BGCOLOR=#e6e8fa>\n");
print("<FORM METHOD=GET ACTION='monitor_newedit.php' target='insert'>\n");

print("<tr><td>\n");
print("監視設定の新規作成です、監視ブロック名を指定して作成してください。<br>\n");
print("</td></tr>\n");

print("<tr><td>\n");
print("監視の属性<br>\n");
print("</td>\n");
print("<td>\n");
print("<select size=1 name=MONITOR>\n");
print("<option value=PORT>PORT or DHW or MYSQL\n");
print("<option value=COMAND>COMAND\n");
print("<option value=SNMP>SNMP\n");
print("</select>\n");
print("</td>\n");
print("</tr>\n");
print("<br>\n");

//print("<tr><td>\n");
//print("監視ブロックの名前<br>\n");
//print("</td>\n");
//print("<td>\n");
//print("<INPUT type='text' NAME=FREE4 size='24' value='NOT'>\n");
// print("</td></tr><br>\n");


echo "<tr><td>";
echo "監視ブロック名\n";
echo "</td><td>";
echo "<select size=1 name=FREE4>";
echo "<option value=>選択してね";
for($select_count = 0; $select_count < $bname_count; $select_count++){
   echo "<option value=$bname_data[$select_count]>$bname_data[$select_count] ($cname_data[$select_count])";
   }
echo "</select>";
echo "</td></tr>";



print("<tr><td>\n");
print("このボタンを押すと新規作成ページに移動します。<br>\n");
print("</td>\n");
print("<td>\n");
print("<input type=submit value='新規作成ページに移動します'>\n");
print("</td></tr><br><br>\n");

print("</form>\n");
print("</table>\n");

?>

</body>
</html>
