require_once "../shared/logincheck.php";
require_once "../classes/LookupOpts.php";
require_once "../classes/LookupQuery.php";
require_once "../functions/errorFuncs.php";
#****************************************************************************
#*  Checking for post vars.  Go back to form if none found.
#****************************************************************************
if (count($_POST) == 0) {
    //header("Location: ../admin/lookup_edit_form.php?reset=Y");
    header("Location: ../admin/lookupOptsForm.php?reset=Y");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$set = new LookupOpts();
$set->setProtocol($_POST["protocol"]);
$_POST["protocol"] = $set->getProtocol();
$set->setMaxHits($_POST["maxHits"]);
$_POST["maxHits"] = $set->getMaxHits();
$set->setKeepDashes(isset($_POST["keepDashes"]));
$_POST["keepDashes"] = $set->getKeepDashes();
$set->setCallNmbrType($_POST["callNmbrType"]);
$_POST["callNmbrType"] = $set->getCallNmbrType();
$set->setAutoDewey($_POST["autoDewey"]);
$_POST["autoDewey"] = $set->getAutoDewey();
$set->setDefaultDewey($_POST["defaultDewey"]);
$_POST["defaultDewey"] = $set->getDefaultDewey();
$set->setAutoCutter($_POST["autoCutter"]);
$_POST["autoCutter"] = $set->getAutoCutter();
$set->setCutterType($_POST["cutterType"]);
 function fetchRow()
 {
     global $postVars;
     $array = $this->_conn->fetchRow();
     if ($array == false) {
         return false;
     }
     //echo "from fetch:<br />";print_r($array);echo "<br />";
     $set = new LookupOpts();
     $set->setProtocol($array["protocol"]);
     $set->setMaxHits($array["max_hits"]);
     $set->setKeepDashes($array["keep_dashes"]);
     $set->setCallNmbrType($array["callNmbr_type"]);
     $set->setAutoDewey($array["auto_dewey"]);
     $set->setDefaultDewey($array["default_dewey"]);
     $set->setAutoCutter($array["auto_cutter"]);
     $set->setCutterType($array["cutter_type"]);
     $set->setCutterWord($array["cutter_word"]);
     $set->setAutoCollect($array["auto_collect"]);
     $set->setFictionName($array["fiction_name"]);
     $set->setFictionCode($array["fiction_code"]);
     $set->setFictionLoC($array["fiction_loc"]);
     $set->setFictionDew($array["fiction_dewey"]);
     return $set;
 }