Пример #1
0
         }
     } else {
         //If IP info is invalid this message shows
         echo Form::warning("INVALID INFO TRY AGAIN");
         exit;
     }
 }
 //If a network id is posted, it means a modification (update, split, host, or delete) is called
 if (isset($_POST['id'])) {
     //Get this network information from the database
     $ip_info = new IP_Database($_POST['id']);
     //if it's a split
     if (isset($_POST['ip_split_submit'])) {
         //do the split calculation first
         $ip_manager->set_IP($ip_info->get_address_ip(), $ip_info->get_family());
         $split = $ip_manager->split_IP($_POST['split']);
         //insert the split calculation into the database
         $add = true;
         foreach ($split as $id => $ip) {
             //GETTING RID OF DESCRIPTION
             $ip_manager = new Netblock($ip);
             $n_ip = new IP_Database();
             $n_ip->set_address_int($ip_manager->get_long());
             $n_ip->set_subnet_size($ip_manager->get_length());
             $n_ip->set_family($ip_info->get_family());
             //set the parent id to know who the parent is
             $n_ip->set_parent_id($ip_info->get_netblock_id());
             //if there are any inheritance of the information, inherit them into the new network
             if ($_POST['inh_loc'] == "on") {
                 $n_ip->set_location_id($ip_info->get_location_id());
             }