$ip = $data[0]['ip'];
                         $state = $data[0]['current-state'];
                         $next_state = $data[0]['next-state'];
                         $start = $data[0]['start'];
                         $end = $data[0]['end'];
                         $cltt = $data[0]['cltt'];
                         $abandoned = $data[0]['abandoned'];
                         $circut_id = $data[0]['circut-id'];
                         $remote_id = $data[0]['remote-id'];
                         $ddns_text = $data[0]['ddns-text'];
                         $ddns_fwd_name = $data[0]['ddns-fwd-name'];
                         $ddns_client_fqdn = $data[0]['ddns-client-fqdn'];
                         $ddns_rev_name = $data[0]['ddns-rev-name'];
                         $error = $err->GenerateErrorLink("help/help.html", "#lease_search", $defined['good'], "Your search for '" . $val->ValidateXSS($search) . "' returned '" . $db->dbNumRows($value) . "' results. The form has been populated for you to edit record #" . $id, NULL, NULL);
                     } else {
                         $lease_list = $misc->GenJumpMenuBoxLEASES($data, 'lease_list', $_GET['skin']);
                         $error = $err->GenerateErrorLink("help/help.html", "#lease_search", $defined['good'], "Your search for '" . $val->ValidateXSS($search) . "' returned '" . $db->dbNumRows($value) . "' results. Please select the host you wish to edit from the select box below", NULL, NULL);
                     }
                 } else {
                     $error = $err->GenerateErrorLink("help/help.html", "#lease_search", $defined['error'], $errors['sql_empty'], NULL, NULL);
                 }
             }
         } else {
             $search_err = $err->GenerateErrorImg($defined['error'], "help/help.html#lease_search", '800', '800');
             $list = "<ol><li>Search string is invalid. Allowed formats:<br>MAC Address: xx:xx:xx:xx:xx<br>IPv4 Address: xxx.xxx.xxx.xxx<br>Hostname: [0-9a-z]</li></ol>";
             $error = $err->GenerateErrorLink("help/help.html", "#lease_search", $defined['error'], $errors['val_host'] . $list, NULL, NULL);
         }
     }
 } else {
     // check each post element
     if (!empty($hardware) && !empty($ip) && !empty($start) && !empty($end)) {