/[locfinder]/locfinder/pages/edit.php
ViewVC logotype

Diff of /locfinder/pages/edit.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by yob, Wed Jan 15 11:23:53 2003 UTC revision 1.2 by yob, Sun Jan 19 14:19:55 2003 UTC
# Line 23  Line 23 
23   *    GNU General Public License for more details.   *    GNU General Public License for more details.
24   *   *
25   *    You should have received a copy of the GNU General Public License   *    You should have received a copy of the GNU General Public License
26   *    along with Foobar; if not, write to the Free Software   *    along with locfinder; if not, write to the Free Software
27   *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28   *   *
29   ********************************************************************/   ********************************************************************/
30    
31  // open their session  // if the user is logged in
32  session_start();  if (!isset($_SESSION["logged_in"]))
33        header("location:http://" . $opt_server . $opt_loc_path . "index.php?page=login");
34    
35  $in_locfinder = true;  if (!node_is_users($_SESSION["logged_in"], $node_id))
36        header("location:http://" . $opt_server . $opt_loc_path . "index.php?page=account");
37    
38  include("./config.php");  updated_today($node_id);
   
 // if the user is logged in, and the node their trying to edit  
 // matches the node that logged in  
 if ((!isset($logged_in)) || (strtoupper($node) != strtoupper($id)))  
     header("location:http://" . $opt_server . $opt_loc_path . "/login.php?id=" . $id);  
   
 // include global config options  
 include("./includes/func_mapping.php");  
 include("./includes/func_emails.php");  
 include("./includes/func_node.php");  
 include("./includes/func_iprouting.php");  
 include("./includes/func_stats.php");  
   
 // if the user has submitted some updated data  
 if (isset($type)) {  
   
     if ($type == "general") {  
   
         if ($action == "update") {  
   
             $exec_code = update_node($id, $txt_name, $txt_owner, $txt_email, $nodestatus, $suburb, $txt_long, $txt_lat, $area, 'none', $txt_url, $notify_updates, $notify_nearby, $password, $password_confirm);  
   
         } elseif ($action == "delete") {  
   
             $exec_code = delete_node($id);  
             
             if ($exec_code) {  
               
                 header ("location:http://" . $opt_server . $opt_loc_path . "index.php?msg=" . $success_message. "&msg_type=" . $exec_code);  
               
             } else {  
               
                 header ("location:http://" . $opt_server . $opt_loc_path . "index.php?msg=" . $err_message. "&msg_type=" . $exec_code);  
               
             }  
   
         }  
   
     } elseif ($type == "link") {  
   
         if ($action == "new") {  
   
             $exec_code = create_link($interface_1, $interface_2);  
   
         } elseif ($action == "delete") {  
   
             $exec_code = delete_link($link_id);  
   
         }  
   
     } elseif ($type == "interface") {  
   
         if ($action == "new") {  
   
             $exec_code = create_interface($id, $card_power, $card_receive, $card_manufacturer, $antenna_dbi, $antenna_type, $cable_loss, $mode, $class, $mac, $channel);  
   
         } elseif ($action == "update") {  
   
             $exec_code = update_interface($int_id, $id, $card_power, $card_receive, $card_manufacturer, $antenna_dbi, $antenna_type, $cable_loss, $mode, $class, $mac, $channel);  
   
         } elseif ($action == "delete") {  
   
             $exec_code = delete_interface($int_id);  
   
         }  
   
     } elseif ($type == "service") {  
   
         if ($action == "new") {  
   
             $exec_code = create_service($id, $service_type, $service_ip, $service_port, $service_description);  
   
         } elseif ($action == "delete") {  
   
             $exec_code = delete_service($service_id);  
   
         }  
   
     } elseif ($type == "ip") {  
   
         if ($action == "block") {  
   
             $exec_code = request_ip_block($id);  
   
         } elseif ($action == "router") {  
   
             $exec_code = request_ip_router($int_id);  
   
         } elseif ($action == "backbone") {  
   
             $exec_code = request_ip_backbone($int_id);  
         }  
   
     }  
       
     if (($type != "general") && ($action != "delete")) {  
       
         if ($exec_code) {  
   
             header ("location:http://" . $opt_server . $opt_loc_path . "edit.php?id=" . $id . "&msg=" . $success_message . "&msg_type=" . $exec_code);  
   
         } else {  
   
             header ("location:http://" . $opt_server . $opt_loc_path . "edit.php?id=" . $id . "&msg=" . $err_message . "&msg_type=" . $exec_code);  
   
         }  
       
     }  
       
 }  
   
 updated_today($id);  
   
 // include the page header  
 include("header.php");  
39    
40  // select the nodes basic info  // select the nodes basic info
41  $sql = "SELECT * FROM nodes WHERE id='" . $id ."'";  $sql = "SELECT * FROM nodes WHERE id='" . $node_id ."'";
42    
43  $loc_db->query($sql);  $loc_db->query($sql);
44    
45  $loc_db->next_record();  $loc_db->next_record();
46    
 $node_id = $loc_db->f("id");  
47  $node_name = $loc_db->f("name");  $node_name = $loc_db->f("name");
 $node_owner = $loc_db->f("owner");  
 $node_email = $loc_db->f("email");  
48  $node_lat = (double)$loc_db->f("latitude");  $node_lat = (double)$loc_db->f("latitude");
49  $node_long = (double)$loc_db->f("longitude");  $node_long = (double)$loc_db->f("longitude");
50  $node_suburb = $loc_db->f("suburb");  $node_suburb = $loc_db->f("suburb");
51  $node_status = $loc_db->f("status");  $node_status = $loc_db->f("status");
52  $node_notify_nearby = $loc_db->f("notify_nearby");  $node_notify_nearby = $loc_db->f("notify_nearby");
 $node_notify_updates = $loc_db->f("notify_updates");  
53  $node_area = $loc_db->f("area");  $node_area = $loc_db->f("area");
 $node_ospf_mode = $loc_db->f("ospf_mode");  
 $node_age = $loc_db->f("age");  
54  $node_url = $loc_db->f("url");  $node_url = $loc_db->f("url");
55    
56  if ($node_area == -1) {  if ($node_area == -1) {
# Line 178  if ($node_area == -1) { Line 59  if ($node_area == -1) {
59    
60  } else {  } else {
61    
62      $node_ip_block = get_ip_block($node_id) . "<BR><a href='edit.php?id=" . $id . "&type=ip&action=block'>request</a> a block";      $node_ip_block = get_ip_block($node_id) . "<BR><a href='index.php?action=ip&id=" . $id . "&option=block'>request</a> a block";
63    
64  }  }
65    
# Line 194  if ($loc_db->f("status") == "gathering") Line 75  if ($loc_db->f("status") == "gathering")
75  if ($loc_db->f("status") == "interested")  if ($loc_db->f("status") == "interested")
76      $status_interested = "selected";      $status_interested = "selected";
77    
 // to make sure the ospf_mode dropdown list is selected correctly  
 if ($loc_db->f("ospf_mode") == "none")  
     $ospf_none = "selected";  
 if ($loc_db->f("ospf_mode") == "Area Internal Router")  
     $ospf_air = "selected";  
 if ($loc_db->f("ospf_mode") == "Area Border Router")  
     $ospf_abr = "selected";  
 if ($loc_db->f("ospf_mode") == "System Border Router")  
     $ospf_sbr = "selected";  
   
78  // to make sure the notify dropdown list is selected correctly  // to make sure the notify dropdown list is selected correctly
79  if ($node_notify == 1) {  if ($node_notify_nearby == 1) {
80          $notify_1 = "selected";          $notify_1 = "selected";
81  } elseif ($node_notify == 2) {  } elseif ($node_notify_nearby == 2) {
82          $notify_2 = "selected";          $notify_2 = "selected";
83  } elseif ($node_notify == 5) {  } elseif ($node_notify_nearby == 5) {
84          $notify_5 = "selected";          $notify_5 = "selected";
85  } elseif ($node_notify == 10) {  } elseif ($node_notify_nearby == 10) {
86          $notify_10 = "selected";          $notify_10 = "selected";
87  } elseif ($node_notify == 20) {  } elseif ($node_notify_nearby == 20) {
88          $notify_20 = "selected";          $notify_20 = "selected";
89  } else {  } else {
90      $notify_none = "selected";      $notify_none = "selected";
91  }  }
92    
 //to make sure the notify checkbox is selected correctly  
 if ($node_notify_updates)  
     $notify_updates_checked = "checked";  
   
 if ((isset($msg)) && (isset($msg_type))) {  
   
     if ($msg_type) {  
   
         $msg_class = "success";  
   
     } else {  
   
         $msg_class = "error";  
   
     }  
   
         echo "<table width=100%>";  
         echo "<tr><td class='" . $msg_class . "'>" . $msg . "</td></tr>";  
         echo "</table>";  
         echo "<BR>";  
   
 }  
   
93  ?>  ?>
94    
95    <h2>Edit node <?=$node_id?>: <?=$node_name?></h2>
 <h2>Edit node <? echo $loc_db->f("id") ?>: <? echo $loc_db->f("name") ?></h2>  
96    
97  <p>Please fill in as much information as you can. Fields marked with a <FONT color="red">*</FONT> must be filled in. Any other fields, you may leave blank if you wish; you can always update the entries at a later date.  <p>Please fill in as much information as you can. Fields marked with a <FONT color="red">*</FONT> must be filled in. Any other fields, you may leave blank if you wish; you can always update the entries at a later date.
98    
99  <div align="right"><FORM action="view.php" method="get"><input type="hidden" name="id" value="<?=$id?>"><input type="submit" value="logout >>" class="button"></form> </div>      <table>
         <table>  
100        <tr valign=top>        <tr valign=top>
101          <td>          <td>
102    
103              <form action="edit.php" method="post">              <form action="index.php" method="post">
104    
105              <input type="hidden" name="id" value="<? echo $loc_db->f("id") ?>">              <input type="hidden" name="node_id" value="<?=$node_id?>">
106              <input type="hidden" name="type" value="general">              <input type="hidden" name="action" value="edit">
             <input type="hidden" name="action" value="update">  
107    
108              <table border=0 class="tableline" width="100%">              <table border=0 class="tableline" width="100%">
109    
# Line 283  if ((isset($msg)) && (isset($msg_type))) Line 128  if ((isset($msg)) && (isset($msg_type)))
128                  <td class="minor" colspan=2><P>Your contact Information and location...<P>Coordinates are in standard GPS format, and you can look them up <a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>gpslookup.html','Win1',400,250 ); return false">automatically</a> or <a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>lookup.html','Win1',640,480 ); return false">manually</a> </td>                  <td class="minor" colspan=2><P>Your contact Information and location...<P>Coordinates are in standard GPS format, and you can look them up <a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>gpslookup.html','Win1',400,250 ); return false">automatically</a> or <a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>lookup.html','Win1',640,480 ); return false">manually</a> </td>
129                </tr>                </tr>
130    
131                <tr>            <? if ($opt_defined_suburbs_list) {?>
                 <th class="nodeinfo">Contact's name:</th>  
                 <td class="nodeinfo"><INPUT type="text" size=30 name="txt_owner" value="<? echo $node_owner ?>"></td>  
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">Contact's email address:<FONT color="red">*</FONT></th>  
                 <td class="nodeinfo"><INPUT type="text" size=30 name="txt_email" value="<? echo $node_email ?>"></td>  
               </tr>  
   
132                <tr>                <tr>
133                  <th class="nodeinfo">Suburb:</th>                  <th class="nodeinfo">Suburb:</th>
134                  <td class="nodeinfo"><SELECT name='suburb'>                  <td class="nodeinfo"><SELECT name='suburb'>
# Line 329  if ((isset($msg)) && (isset($msg_type))) Line 165  if ((isset($msg)) && (isset($msg_type)))
165                     </select>                     </select>
166                  </td>                  </td>
167                </tr>                </tr>
168              <? } else { ?>
169            <TR>
170              <th class="nodeinfo">Suburb:</th>
171              <td class="nodeinfo"><INPUT type="text" name="suburb" size=15 value="<?=$node_suburb?>"></td>
172            </TR>
173              <? } ?>
174                <tr>                <tr>
175                  <th class="nodeinfo">Latitude:<FONT color="red">*</FONT></th>                  <th class="nodeinfo">Latitude:<FONT color="red">*</FONT></th>
176                  <td class="nodeinfo"><INPUT type="text" size=15 name="txt_lat" value="<? echo $node_lat ?>"></td>                  <td class="nodeinfo"><INPUT type="text" size=15 name="txt_lat" value="<? echo $node_lat ?>"></td>
# Line 370  if ((isset($msg)) && (isset($msg_type))) Line 211  if ((isset($msg)) && (isset($msg_type)))
211                  <th class="nodeinfo">&nbsp;</th>                  <th class="nodeinfo">&nbsp;</th>
212                </tr>                </tr>
213    
               <?  
               /*  
                * OSPF parts commented out until a final decision on routing  
                *  is made  
                *  
               ?>  
               <tr>  
                 <td class="minor" colspan=2><P>To join the Melbourne Wireless Network, you must be classified using OSPF. If the information here isn't detailed enough, <a href="http://melbourne.wireless.org.au/wiki/?OSPF%20architecture">read</a> a more detailed description, or <a href="http://melbourne.wireless.org.au/wiki/?OSPF%20Help">ask</a> someone for help.<P>Area - start with <a href="img/area_boundaries.png">this</a> map to find out roughly what area you are in. Only use it as a guide, so for example, if your geographically in one Area, but have better LOS to a different Area, choose the 2nd option. If you are connected to only one other person as a client, then you will be the same area as them<p><B>Even if you plan to form part of the Backbone, still specify your 'area of residence', as you can specify which of your interfaces make up part of the backbone in the interface table</B><P>Mode - <B>if your not running OSPF, or have no idea what OSPF is, select none.</b><P>If your running OSPF; <MENU><LI>and route soley within your Area, your an Internal Router; <LI>and route to another area, your a Border Router; <LI>and route to a different network (like another community wireless group) your a System Border Router</MENU></td>  
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">OSPF Primary Area:</th>  
                 <td class="nodeinfo"><SELECT name="ospf_area">  
                       
                     <OPTION value="-1" <? echo $ospf_minus_1 ?>>none<OPTION value="--">--  
                       
                     <? for ($i =1; $i <= count_areas();$i++) { ?>  
                         <? if ($node_ospf_area == $i) {?>  
                             <? $selected = "selected" ?>  
                         <? } else { ?>  
                             <? $selected = "" ?>  
                         <? } ?>  
                         <OPTION value=<?=$i?> <?=$selected?>><?=$i?> - <?=get_area_name($i)?>  
                     <? } ?>  
                       
                     </SELECT></td>  
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">OSPF Mode:</th>  
                 <td class="nodeinfo"><SELECT name="ospf_mode"><OPTION name="none" <? echo $ospf_none ?>>none<OPTION name="--">--<OPTION name="Area Internal Router" <? echo $ospf_air ?>>Area Internal Router<OPTION name="Area Border Router" <? echo $ospf_abr ?>>Area Border Router<OPTION name="System Border Router" <? echo $ospf_sbr ?>>System Border Router</SELECT></td>  
               </tr>  
               <? */ ?>  
   
214                <tr>                <tr>
215                  <td class="minor" colspan=2><P>Melbourne has been divided up into - initially - <a href="img/area_boundaries.png">11 geographical regions</a>. Some areas are quite organised and hold thier own meetings and events, while others are little more than words on our website - the oppurtunity exists to build strong social, as well a network, links with these people in your area. By choosing your area of residence, it also allows us to assign you an ip that will be close to that of your neighbours.<P>It is important that you use the geographical boundaries only as a guide - for example, if you find yourself physically in one area, but with better LOS to a neighbouring area, select the neighbouring area as yours.</td>                  <td class="minor" colspan=2><P>Melbourne has been divided up into - initially - <a href="img/area_boundaries.png">11 geographical regions</a>. Some areas are quite organised and hold thier own meetings and events, while others are little more than words on our website - the oppurtunity exists to build strong social, as well a network, links with these people in your area. By choosing your area of residence, it also allows us to assign you an ip that will be close to that of your neighbours.<P>It is important that you use the geographical boundaries only as a guide - for example, if you find yourself physically in one area, but with better LOS to a neighbouring area, select the neighbouring area as yours.</td>
216                </tr>                </tr>
# Line 461  if ((isset($msg)) && (isset($msg_type))) Line 268  if ((isset($msg)) && (isset($msg_type)))
268                </tr>                </tr>
269                                
270                <tr>                <tr>
271                  <td class="minor" colspan=2><P>Optional Notifications<BR>Locfinder updates - do you wish to recieve occasional emails when locfinder is updated with new features?<BR>Nearby nodes - you may specify a radius around your node, and whenever a new node is registered within that range, you will be notified via email</td>                  <td class="minor" colspan=2><P>Optional Notifications<BR>Nearby nodes - you may specify a radius around your node, and whenever a new node is registered within that range, you will be notified via email</td>
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">Locfinder updates:</th>  
                 <td class="nodeinfo"><INPUT type="checkbox" name="notify_updates" $notify_updates_checked></td>  
272                </tr>                </tr>
273    
274                <tr>                <tr>
# Line 486  if ((isset($msg)) && (isset($msg_type))) Line 288  if ((isset($msg)) && (isset($msg_type)))
288                </tr>                </tr>
289    
290                <tr>                <tr>
                 <th class="nodeinfo">&nbsp;</th>  
               </tr>  
   
               <tr>  
                 <td class="minor" colspan=2><P>Typing your password is only necesary if you wish to change it. Passwords are limited to <b>10</b> characters.</td>  
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">Password:</th>  
                 <td class="nodeinfo"><INPUT type="password" size=15 name="password"></td>  
               </tr>  
   
               <tr>  
                 <th class="nodeinfo">Retype Password:</th>  
                 <td class="nodeinfo"><INPUT type="password" size=15 name="password_confirm"></td>  
               </tr>  
   
               <tr>  
291                  <td colspan=2 align=right><BR><input type="submit" name="submit" value="update >>" class="button"></td>                  <td colspan=2 align=right><BR><input type="submit" name="submit" value="update >>" class="button"></td>
292                </tr>                </tr>
293    
294              </table>              </table>
295              </form>              </form>
296    
             <BR>  
             <BR>  
   
             <table border=0 class="tableline" align="center" width="100%">  
   
               <tr>  
                 <th colspan=5 class="major">Delete Node</th>  
               </tr>  
               <tr>  
                 <td class="service" colspan=5><B>Warning!</b><BR>Once a node has been deleted, all records of it are removed from the Database<BR>and it is impossible to undelete</td>  
               </tr>  
   
               <tr>  
                 <td><BR></td>  
               </tr>  
   
               <form action="edit.php" method="post">  
               <input type="hidden" name="id" value="<? echo $id ?>">  
               <input type="hidden" name="type" value="general">  
               <input type="hidden" name="action" value="delete">  
               <tr>  
                 <td align="center" colspan=5><input type="submit" value="delete node >>" class="button"></td>  
               </tr>  
               </form>  
   
             </table>  
   
297          <? // only show all the extra stuff if the node is operational ?>          <? // only show all the extra stuff if the node is operational ?>
298          <? // or testing ?>          <? // or testing ?>
299                    
# Line 559  if ((isset($msg)) && (isset($msg_type))) Line 316  if ((isset($msg)) && (isset($msg_type)))
316              <?              <?
317    
318              // grab the services this node is running              // grab the services this node is running
319              $sql = "SELECT * FROM services WHERE node = '" . $id . "'";              $sql = "SELECT * FROM services WHERE node = '" . $node_id . "'";
320    
321              // run query              // run query
322              $loc_db->query($sql);              $loc_db->query($sql);
# Line 570  if ((isset($msg)) && (isset($msg_type))) Line 327  if ((isset($msg)) && (isset($msg_type)))
327              ?>              ?>
328    
329                <tr>                <tr>
330                  <td class="service"><? echo $loc_db->f("service_type") ?></td>                  <td class="service"><? echo $loc_db->f("type") ?></td>
331                  <td class="service"><? echo $loc_db->f("service_ip") ?></td>                  <td class="service"><? echo $loc_db->f("ip") ?></td>
332                  <td class="service"><? echo $loc_db->f("service_port") ?></td>                  <td class="service"><? echo $loc_db->f("port") ?></td>
333                  <td class="service"><? echo $loc_db->f("description") ?></td>                  <td class="service"><? echo $loc_db->f("description") ?></td>
334                  <td class="service"><a href="edit.php?id=<?=$id?>&type=service&action=delete&service_id=<? echo $loc_db->f("service_id") ?>&node_id=<? echo $id ?>">delete</a></td>                  <td class="service"><a href="index.php?action=services&node_id=<?=$node_id?>&option=delete&service_id=<? echo $loc_db->f("id") ?>">delete</a></td>
335                </tr>                </tr>
336    
337              <? } ?>              <? } ?>
# Line 583  if ((isset($msg)) && (isset($msg_type))) Line 340  if ((isset($msg)) && (isset($msg_type)))
340                  <td><BR></td>                  <td><BR></td>
341              </tr>              </tr>
342    
343              <form action="edit.php" method="post">              <form action="index.php" method="post">
344              <input type="hidden" name="id" value="<? echo $id ?>">              <input type="hidden" name="node_id" value="<? echo $node_id ?>">
345              <input type="hidden" name="type" value="service">              <input type="hidden" name="option" value="new">
346              <input type="hidden" name="action" value="new">              <input type="hidden" name="action" value="services">
347              <tr>              <tr>
348                  <td class="service"><select name="service_type"><option value="dhcp">dhcp<option value="dns">dns<option value="finger">finger<option value="ftp">ftp<option value="game_server">game server<option value="imap">imap<option value="irc">irc<option value="im">IM Server<option value="other">other...<option value="p2p">p2p<option value="pop3">pop3<option value="qotd">qotd<option value="smtp">smtp<option value="ssh">ssh<option value="telnet">telnet<option value="www">www</select></td>                  <td class="service"><select name="type"><option value="dhcp">dhcp<option value="dns">dns<option value="finger">finger<option value="ftp">ftp<option value="game_server">game server<option value="imap">imap<option value="irc">irc<option value="im">IM Server<option value="other">other...<option value="p2p">p2p<option value="pop3">pop3<option value="qotd">qotd<option value="smtp">smtp<option value="ssh">ssh<option value="telnet">telnet<option value="www">www</select></td>
349                  <td class="service"><input type="text" name="service_ip" size=15></td>                  <td class="service"><input type="text" name="ip" size=15></td>
350                  <td class="service"><input type="text" name="service_port" size=3></td>                  <td class="service"><input type="text" name="port" size=3></td>
351                  <td class="service"><input type="text" name="service_description" size=15></td>                  <td class="service"><input type="text" name="description" size=15></td>
352                  <td align="right"><input type="submit" name="submit" value="add >>" class="button"></td>                  <td align="right"><input type="submit" name="submit" value="add >>" class="button"></td>
353              </tr>              </tr>
354              </form>              </form>
# Line 601  if ((isset($msg)) && (isset($msg_type))) Line 358  if ((isset($msg)) && (isset($msg_type)))
358              <?              <?
359    
360                  // build SQL query to each interface for this node                  // build SQL query to each interface for this node
361                  $sql = "SELECT * FROM interfaces WHERE node = '" . $id . "'";                  $sql = "SELECT * FROM interfaces WHERE node = '" . $node_id . "'";
362    
363                  // run query                  // run query
364                  $loc_db->query($sql);                  $loc_db->query($sql);
# Line 617  if ((isset($msg)) && (isset($msg_type))) Line 374  if ((isset($msg)) && (isset($msg_type)))
374    
375                          // make sure the right dropdown is selected                          // make sure the right dropdown is selected
376                          // for antenna type                          // for antenna type
377              if ($loc_db->f("antenna_type") == "built in") {                      if ($loc_db->f("antenna_type") == "built in") {
378                  $antenna_builtin = "selected";                              $antenna_builtin = "selected";
379              } else {                      } else {
380                  $antenna_builtin = "";                              $antenna_builtin = "";
381              }                      }
382    
383                          if ($loc_db->f("antenna_type") == "cantenna") {                          if ($loc_db->f("antenna_type") == "cantenna") {
384                              $antenna_cantenna = "selected";                              $antenna_cantenna = "selected";
# Line 648  if ((isset($msg)) && (isset($msg_type))) Line 405  if ((isset($msg)) && (isset($msg_type)))
405                          } else {                          } else {
406                              $antenna_waveguide = "";                              $antenna_waveguide = "";
407                          }                          }
408                            if ($loc_db->f("antenna_type") == "yagi") {
409                                $antenna_yagi = "selected";
410                            } else {
411                                $antenna_yagi = "";
412                            }
413    
414                          // make sure the right dropdown is selected                          // make sure the right dropdown is selected
415                          // for mode                          // for mode
# Line 688  if ((isset($msg)) && (isset($msg_type))) Line 450  if ((isset($msg)) && (isset($msg_type)))
450                              $class_client = "";                              $class_client = "";
451                          }                          }
452                                                    
453                          $int_id = $loc_db->f("int_id");                          $int_id = $loc_db->f("id");
454                          $card_manufacturer = $loc_db->f("card_manufacturer");                          $card_manufacturer = $loc_db->f("card_manufacturer");
455                          $card_power = $loc_db->f("card_power");                          $card_power = $loc_db->f("card_power");
456                          $card_receive = $loc_db->f("card_receive");                          $card_receive = $loc_db->f("card_receive");
# Line 701  if ((isset($msg)) && (isset($msg_type))) Line 463  if ((isset($msg)) && (isset($msg_type)))
463                                                    
464                          if ($router_ip == "") {                          if ($router_ip == "") {
465    
466                              $router_ip = "<A HREF='edit.php?id=" . $id . "&type=ip&action=router&int_id=" . $int_id . "'>Request</a> one";                              $router_ip = "<A HREF='index.php?node_id=" . $node_id . "&action=ip&option=router&int_id=" . $int_id . "'>Request</a> one";
467    
468                          }                          }
469    
# Line 721  if ((isset($msg)) && (isset($msg_type))) Line 483  if ((isset($msg)) && (isset($msg_type)))
483                          <BR>                          <BR>
484                          <BR>                          <BR>
485    
486                          <form action="edit.php" method="post">                          <form action="index.php" method="post">
487                          <input type="hidden" name="int_id" value="<? echo $int_id ?>">                          <input type="hidden" name="int_id" value="<? echo $int_id ?>">
488                          <input type="hidden" name="id" value="<? echo $id ?>">                          <input type="hidden" name="node_id" value="<? echo $node_id ?>">
489                          <input type="hidden" name="action" value="update">                          <input type="hidden" name="action" value="interfaces">
490                          <input type="hidden" name="type" value="interface">                          <input type="hidden" name="option" value="update">
491                          <table border=0 class="tableline" align="center" width="100%">                          <table border=0 class="tableline" align="center" width="100%">
492    
493                           <tr>                           <tr>
494                              <th colspan=5 class="major">Interface <? echo $counter ?> ( <a href="edit.php?type=interface&action=delete&int_id=<? echo $loc_db->f("int_id") ?>&id=<? echo $id ?>">delete</a> )</th>                              <th colspan=5 class="major">Interface <? echo $counter ?> ( <a href="index.php?action=interfaces&option=delete&int_id=<?=$int_id?>&node_id=<?=$node_id?>">delete</a> )</th>
495                            </tr>                            </tr>
496                            <tr>                            <tr>
497                              <td class="node_info" colspan=5 align="center"><i>blank fields are valid if you're unsure of a value</i></td>                              <td class="node_info" colspan=5 align="center"><i>blank fields are valid if you're unsure of a value</i></td>
# Line 773  if ((isset($msg)) && (isset($msg_type))) Line 535  if ((isset($msg)) && (isset($msg_type)))
535                            </tr>                            </tr>
536                            <tr>                            <tr>
537                              <td class="node_info"><B>Antenna Type: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_type','glossary',400,250 ); return false">?</a>)</B></td>                              <td class="node_info"><B>Antenna Type: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_type','glossary',400,250 ); return false">?</a>)</B></td>
538                              <td class="node_info"> <select name="antenna_type"><option value="built in" <? echo $antenna_builtin ?>>Built In<option value="cantenna" <? echo $antenna_cantenna ?>>Cantenna<option value="omni" <? echo $antenna_omni ?>>Omni<option value="panel" <? echo $antenna_panel ?>>Panel<option value="parabolic" <? echo $antenna_parabolic ?>>Parabolic Dish<option value="waveguide" <? echo $antenna_waveguide ?>>Slotted Waveguide</select></td></td>                              <td class="node_info"> <select name="antenna_type"><option value="built in" <? echo $antenna_builtin ?>>Built In<option value="cantenna" <? echo $antenna_cantenna ?>>Cantenna<option value="omni" <? echo $antenna_omni ?>>Omni<option value="panel" <? echo $antenna_panel ?>>Panel<option value="parabolic" <? echo $antenna_parabolic ?>>Parabolic Dish<option value="waveguide" <? echo $antenna_waveguide ?>>Slotted Waveguide<option value="yagi" <? echo $antenna_yagi ?>>Yagi</select></td></td>
539                            </tr>                            </tr>
540                            <tr>                            <tr>
541                              <td class="node_info"><B>Antenna Gain: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_gain','glossary',400,250 ); return false">?</a>)</B></td>                              <td class="node_info"><B>Antenna Gain: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_gain','glossary',400,250 ); return false">?</a>)</B></td>
# Line 803  if ((isset($msg)) && (isset($msg_type))) Line 565  if ((isset($msg)) && (isset($msg_type)))
565                            <?                            <?
566    
567                            // grab all the links for this interface                            // grab all the links for this interface
568                            $sql = "SELECT * FROM links WHERE ((interface_1 = " . $loc_db->f("int_id") . ") OR (interface_2 = " . $loc_db->f("int_id") . ")) ORDER BY link_id";                            $sql = "SELECT * FROM links WHERE ((interface_1 = " . $int_id . ") OR (interface_2 = " . $int_id . ")) ORDER BY id";
569    
570                            $loc_db_2->query( $sql );                            $loc_db_2->query( $sql );
571    
572                            while ($loc_db_2->next_record()) {                            while ($loc_db_2->next_record()) {
573    
574                            // which node is on the other end of the link?                              // which node is on the other end of the link?
575                            if ($loc_db->f("int_id") == $loc_db_2->f("interface_1")) {                              if ($loc_db->f("int_id") == $loc_db_2->f("interface_1")) {
576    
577                              $link_int = $loc_db_2->f("interface_2");                                $link_int = $loc_db_2->f("interface_2");
578    
579                            } else {                              } else {
580    
581                              $link_int = $loc_db_2->f("interface_1");                                $link_int = $loc_db_2->f("interface_1");
582    
583                            }                              }
584    
585                            // assign the id for this link to a variable                            // assign the id for this link to a variable
586                            $link_id = $loc_db_2->f("link_id");                            $link_id = $loc_db_2->f("id");
587    
588                            // select the interface info for the other                            // select the interface info for the other
589                            // end of this link                            // end of this link
590                            $sql = "SELECT * FROM interfaces WHERE int_id = " . $link_int . " ORDER BY node";                            $sql = "SELECT * FROM interfaces WHERE id = " . $link_int . " ORDER BY node";
591    
592                            $loc_db_3->query( $sql );                            $loc_db_3->query( $sql );
593    
# Line 833  if ((isset($msg)) && (isset($msg_type))) Line 595  if ((isset($msg)) && (isset($msg_type)))
595    
596                            ?>                            ?>
597                                  <tr>                                  <tr>
598                                      <td class="minor" colspan="3" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Linked to <A HREF="view.php?id=<? echo $loc_db_3->f("node") ?>"><? echo $loc_db_3->f("node") ?></A> : (<? echo $loc_db_3->f("antenna_dbi") ?>dBi <? echo $loc_db_3->f("antenna_type") ?>)</td>                                      <td class="minor" colspan="3" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Linked to <A HREF="index.php?page=view&node_id=<? echo $loc_db_3->f("node") ?>"><? echo $loc_db_3->f("node") ?></A> : (<? echo $loc_db_3->f("antenna_dbi") ?>dBi <? echo $loc_db_3->f("antenna_type") ?>)</td>
599                                      <td class="minor"><a href="edit.php?id=<?=$id?>&type=link&action=delete&link_id=<? echo $loc_db_2->f("link_id") ?>&node_id=<? echo $id ?>">delete</a></td>                                      <td class="minor"><a href="index.php?action=links&node_id=<?=$node_id?>&action=links&option=delete&link_id=<? echo $loc_db_2->f("id") ?>">delete</a></td>
600                                  </tr>                                  </tr>
601    
602                            <? } ?>                            <? } ?>
603                            <? } ?>                            <? } ?>
604                                  <form action="edit.php" method="post">                                      
                                 <input type="hidden" name="interface_1" value="<? echo $loc_db->f("int_id") ?>">  
                                 <input type="hidden" name="id" value="<? echo $id ?>">  
                                 <input type="hidden" name="type" value="link">  
                                 <input type="hidden" name="action" value="new">  
                                 <tr>  
                                     <td class="minor" colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Interface is also linked to:  
                                     <select name="interface_2" WIDTH="160">  
605                                      <?                                      <?
606                                      $sql = "SELECT * FROM interfaces where node <> '" . $id . "' ORDER BY node, antenna_type";                                      $sql = "SELECT * FROM interfaces where node <> '" . $node_id . "' ORDER BY node, antenna_type";
607    
608                                      $loc_db_2->query( $sql );                                      $loc_db_2->query( $sql );
609    
610                                      while ($loc_db_2->next_record()) { ?>                                      if (!$loc_db_2->num_rows() == 0) { ?>
   
                                         <option value="<? echo $loc_db_2->f("int_id") ?>"><? echo $loc_db_2->f("node") ?> : <? echo $loc_db_2->f("antenna_type") ?> (<? echo $loc_db_2->f("mac") ?>)  
611    
612                                            <form action="index.php" method="post">
613                                            <input type="hidden" name="interface_1" value="<? echo $loc_db->f("id") ?>">
614                                            <input type="hidden" name="node_id" value="<? echo $node_id ?>">
615                                            <input type="hidden" name="action" value="links">
616                                            <input type="hidden" name="option" value="new">
617                                            <tr>
618                                      
619                                            <td class="minor" colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Interface is also linked to:
620                                        
621                                                <select name="interface_2" WIDTH="160">
622    
623                                                <? while ($loc_db_2->next_record()) { ?>
624    
625                                                    <option value="<? echo $loc_db_2->f("int_id") ?>"><? echo $loc_db_2->f("node") ?> : <? echo $loc_db_2->f("antenna_type") ?> (<? echo $loc_db_2->f("mac") ?>)
626    
627                                                <? } ?>
628    
629                                                </select>
630                                            </td>
631                                        
632                                            <td class='minor'>
633                                                <input type="submit" name="submit" value="add >>">
634                                            </td>
635                                            
636                                            </tr>
637                                            </form>
638                                    
639                                      <? } ?>                                      <? } ?>
640                                      </select>  
                                     </td>  
                                     <td class='minor'>  
                                         <input type="submit" name="submit" value="add >>">  
                                     </tD>  
                                 </tr>  
                                 </form>  
641    
642                          </table>                          </table>
643                      <? $counter++ ?>                      <? $counter++ ?>
# Line 874  if ((isset($msg)) && (isset($msg_type))) Line 648  if ((isset($msg)) && (isset($msg_type)))
648                  <BR>                  <BR>
649                  <BR>                  <BR>
650    
651                  <form action="edit.php" method="post">                  <form action="index.php" method="post">
652                  <input type="hidden" name="id" value="<? echo $id ?>">                  <input type="hidden" name="node_id" value="<? echo $node_id ?>">
653                  <input type="hidden" name="action" value="new">                  <input type="hidden" name="action" value="interfaces">
654                  <input type="hidden" name="type" value="interface">                  <input type="hidden" name="option" value="new">
655    
656                  <table border=0 class="tableline" align="center" width="100%">                  <table border=0 class="tableline" align="center" width="100%">
657    
# Line 926  if ((isset($msg)) && (isset($msg_type))) Line 700  if ((isset($msg)) && (isset($msg_type)))
700                    </tr>                    </tr>
701                    <tr>                    <tr>
702                      <td class="node_info"><B>Antenna Type: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=eantenna_type','glossary',400,250 ); return false">?</a>)</B></td>                      <td class="node_info"><B>Antenna Type: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=eantenna_type','glossary',400,250 ); return false">?</a>)</B></td>
703                      <td class="node_info"> <select name="antenna_type"><option value="built in">Built In<option value="cantenna">Cantenna<option value="omni">Omni<option value="panel">Panel<option value="parabolic">Parabolic Dish<option value="waveguide">Slotted Waveguide</select></td></td>                      <td class="node_info"> <select name="antenna_type"><option value="built in">Built In<option value="cantenna">Cantenna<option value="omni">Omni<option value="panel">Panel<option value="parabolic">Parabolic Dish<option value="waveguide">Slotted Waveguide<option value="yagi">Yagi</select></td></td>
704                    </tr>                    </tr>
705                    <tr>                    <tr>
706                      <td class="node_info"><B>Antenna Gain: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_gain','glossary',400,250 ); return false">?</a>)</B></td>                      <td class="node_info"><B>Antenna Gain: (<a href="#" onClick="popup('<? echo $opt_server . $opt_loc_path  ?>glossary.php?term=antenna_gain','glossary',400,250 ); return false">?</a>)</B></td>
# Line 941  if ((isset($msg)) && (isset($msg_type))) Line 715  if ((isset($msg)) && (isset($msg_type)))
715                    </tr>                    </tr>
716                  </table>                  </table>
717                  </form>                  </form>
718  <? // } ?>  <? } ?>
719  </table>  </table>
   
     <div align="right">  
     <FORM action="view.php" method="get"><input type="hidden" name="id" value="<?=$id?>"><input type="submit" value="logout >>" class="button"></form></div>  
   
 <?  
   
 // include page footer  
 include("footer.php");  
   
 }  
   
 ?>  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26