"Fossies" - the Fresh Open Source Software Archive

Member "node-runner-0.6.0/html/addedit-nodes.php" (21 Dec 2004, 20829 Bytes) of package /linux/www/old/node-runner-0.6.0.tar.gz:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "addedit-nodes.php" see the Fossies "Dox" file reference documentation.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.


    1 <?
    2 require_once("connect.php");
    3 if ($_SESSION["isloggedin"] != $glbl_hash) {
    4     header("Location: ".$nr_url."login.php?referrer=addedit-nodes.php");
    5     exit;
    6 } else if (($_SESSION["isloggedin"] == $glbl_hash) && ($_SESSION["isadmin"] != $glbl_hash)) {
    7     header("Location: ".$nr_url);
    8     exit;
    9 }
   10 
   11 unset($err_msg);
   12 
   13 if ($_POST["description"] && $_POST["ipaddress"] && $_POST["ptime"] && $_POST["submitit"] && (!$_POST["del_sure"]) && ($_POST["delete"] != "DELETE THIS NODE")) {
   14 
   15   // Sanitize incoming data
   16   $edit_dependency = rtrim(ltrim(strip_tags($_POST["dependency"])));
   17   $edit_description = strtoupper(rtrim(ltrim(strip_tags($_POST["description"]))));
   18   $edit_ipaddress = rtrim(ltrim(strip_tags($_POST["ipaddress"])));
   19   $edit_port = rtrim(ltrim(strip_tags($_POST["port"])));
   20   $edit_query_type = rtrim(ltrim(strip_tags($_POST["query_type"])));
   21   $edit_server = rtrim(ltrim(strip_tags($_POST["server"])));
   22   $edit_enabled = rtrim(ltrim(strip_tags($_POST["enabled"])));
   23   if (!$edit_enabled) { $edit_enabled = 'N'; }
   24   $edit_mail_group = rtrim(ltrim(strip_tags($_POST["mail_group"])));
   25   $edit_ptime = rtrim(ltrim(strip_tags($_POST["ptime"])));
   26   $edit_smon_time = rtrim(ltrim(strip_tags($_POST['shour'].$_POST['smin'])));
   27   $edit_emon_time = rtrim(ltrim(strip_tags($_POST['ehour'].$_POST['emin'])));
   28   $edit_url = rtrim(ltrim(strip_tags($_POST["url"])));
   29   $edit_snmp_comm = rtrim(ltrim(strip_tags($_POST["snmp_comm"])));
   30   $edit_days= rtrim(ltrim(strip_tags($_POST['Sun']." ".$_POST['Mon']." ".$_POST['Tue']." ".$_POST['Wed']." ".$_POST['Thu']." ".$_POST['Fri']." ".$_POST['Sat'])));
   31   $edit_comments = rtrim(ltrim(strip_tags($_POST["comments"])));
   32   $edit_auth_user = rtrim(ltrim(strip_tags($_POST["auth_user"])));
   33   $edit_auth_pass = rtrim(ltrim(strip_tags($_POST["auth_pass"])));
   34 
   35   $magic_quotes_gpc = ini_get('magic_quotes_gpc');
   36   if (!$magic_quotes_gpc) { // Check for magic quotes, if it's Off, addslashes
   37     $edit_description = addslashes($edit_description);
   38     $edit_snmp_comm = addslashes($edit_snmp_comm);
   39     $edit_comments = addslashes($edit_comments);
   40   }
   41 
   42   if (!$_POST["id"]) {
   43     if (!$edit_url) { $edit_url_sql = 'NULL'; } else { $edit_url_sql = "'$edit_url'"; }
   44     if (!$edit_snmp_comm) { $edit_snmp_comm_sql = 'NULL'; } else { $edit_snmp_comm_sql = $edit_snmp_comm; }
   45     if (!$edit_auth_user) { $edit_auth_user_sql = 'NULL'; } else { $edit_auth_user_sql = $edit_auth_user; }
   46     if (!$edit_auth_pass) { $edit_auth_pass_sql = 'NULL'; } else { $edit_auth_pass_sql = $edit_auth_pass; }
   47     $insert_node = "INSERT INTO objects VALUES ('','".$edit_dependency."','".$edit_description."','".$edit_ipaddress."','".$edit_port."','".$edit_query_type."','".$edit_server."','".$edit_enabled."','".$edit_mail_group."','".$edit_ptime."','".$edit_smon_time."','".$edit_emon_time."',".$edit_url_sql.",".$edit_snmp_comm_sql.",'".$edit_days."','".$edit_comments."',".$edit_auth_user_sql.",".$edit_auth_pass_sql.")";
   48     $result_node = db_query($insert_node);
   49     $query_recent_node = "SELECT id FROM objects WHERE description='".$edit_description."' AND ipaddress='".$edit_ipaddress."' ORDER BY id DESC LIMIT 1";
   50     $result_recent_node = db_query($query_recent_node);
   51     list($get_id) = db_fetch_array($result_recent_node);
   52     if ($result_node == 1) { $err_msg .= '<b><br>Node added successfully.  <a href="'.$_SERVER["PHP_SELF"].'">Clear this page</a> to add another node.</b><br>&nbsp;'; }
   53   } else {
   54     if (!$edit_url) { $edit_url_sql = ',url=NULL'; } else { $edit_url_sql = ",url='".$edit_url."'"; }
   55     if (!$edit_snmp_comm) { $edit_snmp_comm_sql = ',snmp_comm=NULL'; } else { $edit_snmp_comm_sql = ",snmp_comm='".$edit_snmp_comm."'"; }
   56     if (!$edit_auth_user) { $edit_auth_user_sql = ',auth_user=NULL'; } else { $edit_auth_user_sql = ",auth_user='".$edit_auth_user."'"; }
   57     if (!$edit_auth_pass) { $edit_auth_pass_sql = ',auth_pass=NULL'; } else { $edit_auth_pass_sql = ",auth_pass='".$edit_auth_pass."'"; }
   58     $update_node = "UPDATE objects SET dependency='".$edit_dependency."',description='".$edit_description."',ipaddress='".$edit_ipaddress."',port='".$edit_port."',query_type='".$edit_query_type."',server='".$edit_server."',enabled='".$edit_enabled."',mail_group='".$edit_mail_group."',ptime='".$edit_ptime."',smon_time='".$edit_smon_time."',emon_time='".$edit_emon_time."',days='".$edit_days."',comments='".$edit_comments."'".$edit_url_sql."".$edit_snmp_comm_sql."".$edit_auth_user_sql."".$edit_auth_pass_sql." WHERE id='".$_POST["id"]."'";
   59     $result_node = db_query($update_node);
   60     if ($edit_enabled == 'N') {
   61       $update_alert_log = "UPDATE alert_log SET resolved='O' WHERE (description='".$edit_description."' AND resolved='N')";
   62       $result_alert_log = db_query($update_alert_log);
   63     } else {
   64       $update_alert_log = "UPDATE alert_log SET dependency='".$edit_dependency."',description='".$edit_description."',ipaddress='".$edit_ipaddress."',port='".$edit_port."',query_type='".$edit_query_type."',server='".$edit_server."'".$edit_url_sql."".$edit_snmp_comm_sql." WHERE (description='".$edit_description."' AND resolved='N')";
   65       $result_alert_log = db_query($update_alert_log);
   66     }
   67     if ($result_node == 1) { $err_msg .= '<b><br>Node updated successfully.  <a href="'.$_SERVER["PHP_SELF"].'">Clear this page</a> to add another node.</b><br>&nbsp;'; }
   68   }
   69   
   70   unset($edit_url_sql,$edit_snmp_comm_sql,$edit_auth_user_sql,$edit_auth_pass_sql);
   71   
   72   // stripslashes for re-display
   73   $edit_description = stripslashes($edit_description);
   74   $edit_snmp_comm = stripslashes($edit_snmp_comm);
   75   $edit_comments = stripslashes($edit_comments);
   76   
   77 }
   78 
   79 
   80 if (($_POST["submitit"]) && ($_POST["delete"] == "DELETE THIS NODE") && ($_POST["del_sure"] == 1) && ($_POST["id"])) {
   81     $del_id = rtrim(ltrim(strip_tags($_POST["id"])));
   82     $query_del = "DELETE FROM objects WHERE id='".$del_id."'";
   83     $result_del = db_query($query_del);
   84     if ($result_del == 1) { $err_msg .= '<b><br>Node removed successfully.</b><br>&nbsp;'; }
   85 }
   86 
   87 
   88 $title = "Add/Edit Nodes";
   89 require_once("header.php");
   90 
   91 
   92 function dropdown($name,$num,$selected) {
   93     //populates html drop down boxes
   94     echo '<select name="'. $name .'">';
   95     echo '<option value="';
   96     printf("%02.0f", $selected);
   97     echo '" selected>';
   98     printf("%02.0f", $selected);
   99     echo '</option>';
  100     for ($i=0;$i<$num;$i++) {
  101       echo '<option value="';
  102       printf("%02.0f", $i);
  103       echo '">';
  104       printf("%02.0f", $i);
  105       echo '</option>';
  106     }
  107     echo '</select>';
  108 }
  109 
  110 
  111 function list_of_includes($dir) {
  112     // Returns array of file names from $dir
  113 
  114     $i=0;
  115       if ($use_dir = @opendir($dir)) {
  116         while (($file = readdir($use_dir)) != false) {
  117           if (ereg("query_",$file)) {
  118             $includes_arr[$i] = "$file";
  119             $i++;
  120           }
  121         }
  122       closedir($use_dir);
  123     }
  124 
  125     return $includes_arr;
  126 }
  127 
  128 $query_type_includes = list_of_includes($path_to_include);
  129 $queries_type_array = array();
  130 foreach ($query_type_includes as $types) {
  131   include_once($path_to_include.$types);
  132 }
  133 
  134 
  135 
  136 if ($_POST["id"]) {
  137   $get_id = strip_tags(rtrim(ltrim($_POST["id"])));
  138 } else if ($_GET["id"]) {
  139   $get_id = strip_tags(rtrim(ltrim($_GET["id"])));
  140 }
  141   // Display the information for the node
  142   $query2 = "SELECT * FROM objects WHERE id='".$get_id."'";
  143   $result2 = db_query($query2);
  144   list($edit_id,$edit_dependency,$edit_description,$edit_ipaddress,$edit_port,$edit_query_type,$edit_server,$edit_enabled,$edit_mail_group,$edit_ptime,$edit_smon_time,$edit_emon_time,$edit_url,$edit_snmp_comm,$edit_days,$edit_comments,$edit_auth_user,$edit_auth_pass) = db_fetch_array($result2);
  145   
  146   if ($edit_id) {
  147     $query_children = "SELECT id FROM objects WHERE dependency='".$edit_id."'";
  148     $result_children = db_query($query_children);
  149     $num_rows_children = db_num_rows($result_children);
  150     if ($num_rows_children) {
  151       $disallow_checking_due_to_child = 1;
  152     }
  153   }
  154 
  155   if (!$edit_ptime) { $edit_ptime = 5; } // default timeout value
  156   
  157   if (!$edit_port) { $port_disabled = 'disabled'; }
  158   if (!$edit_snmp_comm) { $snmp_comm_disabled = 'disabled'; }
  159   if (!$edit_url) { $url_disabled = 'disabled'; }
  160   if (!$edit_auth_user) { $auth_user_disabled = 'disabled'; }
  161   if (!$edit_auth_pass) { $auth_pass_disabled = 'disabled'; }
  162 
  163 
  164   if ($err_msg) {
  165     echo '<div align="center" class="errmsg">'.$err_msg.'</div><br><br>';
  166   }
  167 
  168   echo '<table class="addedit-nodes" width="90%" align="center">
  169         <form name="addedit" action="'.$_SERVER['PHP_SELF'].'" method="POST">
  170           <tr>
  171             <td align="left" valign="top" width="50%">
  172             <font size="2">
  173             <b>Node Name:</b>&nbsp;[<a href="help.php?topic=description" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=description\',250,70))">?</a>]<br><input type="text" name="description" size="35" value="'.$edit_description.'"><br><br>
  174             <b>Node is Dependent Upon:</b>&nbsp;[<a href="help.php?topic=dependency" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=dependency\',300,250))">?</a>]<br>
  175             <select style="width:70%" size="6" name="dependency">
  176        ';
  177 
  178   $dep = "SELECT id,description FROM objects WHERE id='".$edit_dependency."'";
  179   $dep_result = db_query($dep);
  180   list($edit_dep,$desc) = db_fetch_array($dep_result);
  181 
  182   if (!$desc) {
  183     $edit_dep = 1;
  184     $desc = 'NODE RUNNER';
  185   }
  186   
  187   echo '<option value="'.$edit_dep.'" selected>'.$desc.'</option>';
  188 
  189   $query_other_deps = "SELECT id,description FROM objects WHERE enabled='Y' ORDER BY description ASC";
  190   $result_other_deps = db_query($query_other_deps);
  191   while ($r = db_fetch_array($result_other_deps)) {
  192          $other_id = $r["id"];
  193          $other_description = $r["description"];
  194          if (($other_description == $desc) || ($other_description == $edit_description)) { continue; }
  195          if (strlen($other_description) > 27) { $other_description = substr($other_description, 0 ,27)."..."; }
  196          print '<option value="'.$other_id.'">'.$other_description.'</option>';
  197   }
  198 
  199   echo '    </select><br><br>
  200             <b>IP Address:</b>&nbsp;[<a href="help.php?topic=ohplease" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=ohplease\',250,70))">?</a>]<br><input type="text" name="ipaddress" size="35" maxlength="15" value="'.$edit_ipaddress.'"><br><br>
  201             <b>Query Type:</b>&nbsp;[<a href="help.php?topic=query_type" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=query_type\',250,70))">?</a>]<br>
  202             <select onClick="javascript:disableAddEditFields();" style="width:70%" name="query_type" size="1">
  203        ';
  204        
  205   if ($edit_query_type) {
  206     echo '<option value="'.$edit_query_type.'" selected>'.$edit_query_type.'</option>';
  207   } else {
  208     echo '<option value="0">-- SELECT TYPE --</option>';
  209   }
  210        
  211   for ($x=0; $x<sizeof($queries_type_array); $x++) {
  212     if ($queries_type_array[$x] == $edit_query_type) { continue; }
  213     echo '<option value="'.$queries_type_array[$x].'">'.$queries_type_array[$x].'</option>';
  214   }
  215 
  216   echo '
  217             </select><br><br>
  218             <b>Query Timeout (seconds):</b>&nbsp;[<a href="help.php?topic=ptime" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=ptime\',250,70))">?</a>]<br><input type="text" name="ptime" size="35" value="'.$edit_ptime.'"><br><br>
  219             <b>Port to Query:</b>&nbsp;[<a href="help.php?topic=port" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=port\',250,70))">?</a>]<br><input type="text" name="port" size="35" value="'.$edit_port.'" '.$port_disabled.'><br><br>
  220             <b>SNMP Community:</b>&nbsp;[<a href="help.php?topic=snmp_comm" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=snmp_comm\',280,70))">?</a>]<br><INPUT TYPE="text" name="snmp_comm" size="35" value="'.$edit_snmp_comm.'" '.$snmp_comm_disabled.'><br><br>
  221             <b>URL to Query:</b>&nbsp;[<a href="help.php?topic=url" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=url\',300,200))">?</a>]<br><INPUT TYPE="text" name="url" size="35" value="'.$edit_url.'" '.$url_disabled.'><br><br>
  222             <b>HTTP User (if URL is secure):</b>&nbsp;[<a href="help.php?topic=auth_user" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=auth_user\',250,70))">?</a>]<br><INPUT TYPE="text" name="auth_user" size="35" value="'.$edit_auth_user.'" '.$auth_user_disabled.'><br><br>
  223             <b>HTTP Password (if URL is secure):</b>&nbsp;[<a href="help.php?topic=auth_pass" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=auth_pass\',260,120))">?</a>]<br><INPUT TYPE="password" name="auth_pass" size="35" value="'.$edit_auth_pass.'" '.$auth_pass_disabled.'><br><br>
  224             
  225         </td>
  226        ';
  227 
  228   $edit_smon_time = sprintf("%04s",$edit_smon_time);
  229   $edit_emon_time = sprintf("%04s",$edit_emon_time);
  230   $edit_smin = substr($edit_smon_time, -2);
  231   $edit_shour = substr($edit_smon_time, -4, 2);
  232   $edit_emin = substr($edit_emon_time, -2);
  233   if ($edit_emin == '00') { $edit_emin = 59; }
  234   $edit_ehour = substr($edit_emon_time, -4, 2);
  235   if ($edit_ehour == '00') { $edit_ehour = 23; }
  236 
  237   echo '
  238         <td align="left" valign="top" width="50%">
  239         <table class="addedit-nodes-whichdays" width="90%" border="0" cellpadding="3">
  240           <tr valign="top">
  241             <td width="40%" valign="top" align="left">
  242               <span style="border-bottom:1px solid #A00000;font-weight:bold;">Days to Monitor:</span>&nbsp;[<a href="help.php?topic=which_days" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=which_days\',260,70))">?</a>]<br><br>
  243        ';
  244 
  245   if ((!$get_id) && (!$edit_days)) {
  246     $edit_days = "Sun Mon Tue Wed Thu Fri Sat";
  247   }
  248 
  249   if(strstr($edit_days,"Sun")) {
  250     print "<input type='checkbox' name='Sun' value='Sun' checked>SUNDAY<br>";
  251   } else {
  252     print "<input type='checkbox' name='Sun' value='Sun'>SUNDAY<br>";
  253   }
  254   if(strstr($edit_days,"Mon")) {
  255      print "<input type='checkbox' name='Mon' value='Mon' checked>MONDAY<br>";
  256   } else {
  257      print "<input type='checkbox' name='Mon' value='Mon'>MONDAY<br>";
  258   }
  259   if(strstr($edit_days,"Tue")) {
  260      print "<input type='checkbox' name='Tue' value='Tue' checked>TUESDAY<br>";
  261   } else {
  262      print "<input type='checkbox' name='Tue' value='Tue'>TUESDAY<br>";
  263   }
  264   if(strstr($edit_days,"Wed")) {
  265      print "<input type='checkbox' name='Wed' value='Wed' checked>WEDNESDAY<br>";
  266   } else {
  267      print "<input type='checkbox' name='Wed' value='Wed'>WEDNESDAY<br>";
  268   }
  269   if(strstr($edit_days,"Thu")) {
  270      print "<input type='checkbox' name='Thu' value='Thu' checked>THURSDAY<br>";
  271   } else {
  272      print "<input type='checkbox' name='Thu' value='Thu'>THURSDAY<br>";
  273   }
  274   if(strstr($edit_days,"Fri")) {
  275      print "<input type='checkbox' name='Fri' value='Fri' checked>FRIDAY<br>";
  276   } else {
  277      print "<input type='checkbox' name='Fri' value='Fri'>FRIDAY<br>";
  278   }
  279   if(strstr($edit_days,"Sat")) {
  280      print "<input type='checkbox' name='Sat' value='Sat' checked>SATURDAY";
  281   } else {
  282      print "<input type='checkbox' name='Sat' value='Sat'>SATURDAY";
  283   }
  284 
  285   echo '    </td>
  286             <td width="60%" valign="top" align="right"><br>
  287 
  288         <table class="addedit-nodes-timeframe" cellpadding="3" border="0">
  289           <tr>
  290             <td><b>Monitor Timeframe:</b>&nbsp;[<a href="help.php?topic=timeframe" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=timeframe\',260,70))">?</a>]
  291             </td>
  292           </tr>
  293           <tr>
  294             <td align="right">
  295                Start Time:&nbsp&nbsp';
  296 
  297               dropdown("shour","24",$edit_shour);
  298 
  299               dropdown("smin","60",$edit_smin);
  300 
  301   echo '    </td>
  302           </tr>
  303           <tr>
  304             <td align="right">End Time:&nbsp&nbsp
  305         ';
  306 
  307               dropdown("ehour","24",$edit_ehour);
  308 
  309               dropdown("emin","60",$edit_emin);
  310 
  311   echo '    </td>
  312           </tr>
  313         </table>&nbsp;&nbsp;
  314 
  315 
  316             </td>
  317           </tr>
  318         </table>
  319         <br><br>
  320         <b>Comments (Optional):</b>&nbsp;[<a href="help.php?topic=comments" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=comments\',260,70))">?</a>]<br><textarea name="comments" rows="4" cols="34">'.$edit_comments.'</textarea><br><br>
  321         <b>Network Endpoint:</b>&nbsp;[<a href="help.php?topic=endpoint" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=endpoint\',300,180))">?</a>]&nbsp;
  322         <select style="font-size:10px" name="server" size="1">';
  323         if ((!$edit_server) || ($edit_server == "Y")) {
  324             echo '<option value="Y" selected>YES</option>
  325                   <option value="N">NO</option>';
  326         } else {
  327             echo '<option value="N" selected>NO</option>
  328                   <option value="Y">YES</option>';
  329         }
  330         
  331   echo '</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  332         <b>Enabled:</b>&nbsp;[<a href="help.php?topic=enabled" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=enabled\',260,210))">?</a>]&nbsp;';
  333 
  334         if ($edit_dependency == 'NONE') {
  335             echo '<input style="font-size:14px" type="checkbox" name="enabled" value="Y" checked disabled>';
  336         } else if ((!$edit_enabled) || ($edit_enabled == "Y")) {
  337             if ($disallow_checking_due_to_child) {
  338               echo '<input style="font-size:14px" type="checkbox" name="enabled_box" value="Y" checked disabled>';
  339               echo '<input style="font-size:14px" type="hidden" name="enabled" value="Y">';
  340             } else {
  341               echo '<input style="font-size:14px" type="checkbox" name="enabled" value="Y" checked>';
  342             }
  343         } else {
  344             echo '<input style="font-size:14px" type="checkbox" name="enabled" value="Y">';
  345         }
  346         
  347   if ($disallow_checking_due_to_child) {
  348     echo '<br><br><a href="help.php?topic=status_mon_dir_affect" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=status_mon_dir_affect&iid='.$edit_id.'\',300,200))"><b>NOTE:</b> This node cannot be disabled until the nodes<br>that depend upon it are disabled as well. Click here<br>to view a list of those nodes.</a>';
  349   }
  350         
  351   echo '<br><br>
  352         <b>Mail Group:</b>&nbsp;[<a href="help.php?topic=mail_group" style="text-decoration:none" onClick="return(openHelp(\'help.php?topic=mail_group\',300,120))">?</a>]&nbsp;<br>
  353         <select style="width:70%" size="1" name="mail_group">
  354        ';
  355 
  356   $mail_query = "SELECT name FROM mail_group WHERE id='".$edit_mail_group."'";
  357   $mail_result = db_query($mail_query);
  358   list($mname) = db_fetch_array($mail_result);
  359   if (!$mname) {
  360     $mail_query2 = "SELECT id,name FROM mail_group ORDER BY id ASC";
  361     $mail_result2 = db_query($mail_query2);
  362     list($edit_mail_group,$mname) = db_fetch_array($mail_result2);
  363   }
  364   
  365   echo '<option value="'.$edit_mail_group.'" selected>'.$mname.'</option>';
  366 
  367   $query_other_mail = "SELECT id,name FROM mail_group ORDER BY name DESC";
  368   $result_other_mail = db_query($query_other_mail);
  369   while ($r = db_fetch_array($result_other_mail)) {
  370          $other_mail_name = $r["name"];
  371          $other_mail_id = $r["id"];
  372          if ($other_mail_name == $mname) { continue; }
  373          echo '<option value="'.$other_mail_id.'">'.$other_mail_name.'</option>';
  374   }
  375 
  376   echo '</select><br><br>
  377         <input type="hidden" name="id" value="'.$get_id.'">
  378         <input type="hidden" name="submitit" value="1">';
  379         
  380         if ($get_id) {
  381             echo '<input type="button" value="SUBMIT CHANGES TO NODE" onClick="javascript:verify();"><br><br>
  382                   <input type="submit" name="delete" value="DELETE THIS NODE">&nbsp;<input type="checkbox" name="del_sure" value="1">Confirm Delete<br><br>';
  383         } else {
  384             echo '<input type="button" value="ADD NEW NODE" onClick="javascript:verify();"><p>&nbsp;</p>';
  385         }
  386         
  387   echo '
  388         <br>
  389         <table width="90%" align="left" class="addedit-nodes-select-for-edit" cellpadding="3">
  390         <tr>
  391         <td>
  392         <b>Modify a Different Node?</b><br>
  393         <select style="font-size:11px" name="select_for_edit" size="1" onChange="location.href=addedit.select_for_edit.options[selectedIndex].value">
  394         <option value="0">-- SELECT NODE TO EDIT --</option>';
  395         $query_other_nodes = "SELECT id,description FROM objects ORDER BY description ASC";
  396         $result_other_nodes = db_query($query_other_nodes);
  397         while ($r = db_fetch_array($result_other_nodes)) {
  398                $select_id = $r["id"];
  399                $select_description = $r["description"];
  400                if (strlen($select_description) > 40) { $select_description = substr($select_description, 0 ,40)."..."; }
  401                echo '<option value="http://'.$_SERVER["HTTP_HOST"].''.$_SERVER["PHP_SELF"].'?id='.$select_id.'">'.$select_description.'</option>';
  402         }
  403   echo '
  404         </select><br>
  405         <b>WARNING: Unsaved changes will be lost!</b>
  406         </td>
  407         </tr>
  408         </table>
  409         </font>
  410         </td>
  411         </tr>
  412         </form>
  413         </table>';
  414 
  415 
  416 require_once("footer.php");
  417 
  418 ?>