Exemple #1
0
 $hiveid = test_input($_POST["HIVEID"]);
 $beekeeperid = test_input($_POST["BEEKEEPERID"]);
 $yardid = test_input($_POST["YARDID"]);
 $city = test_input($_POST["CITY"]);
 $state = test_input($_POST["STATE"]);
 $country = test_input($_POST["COUNTRY"]);
 $latitude = test_input($_POST["LATITUDE"]);
 $longitude = test_input($_POST["LONGITUDE"]);
 #$homedir = test_input_allow_slash($_POST["HOMEDIR"]);
 $timezone = test_input_allow_slash($_POST["TIMEZONE"]);
 $share_hivetool = test_input($_POST["SHARE_HIVETOOL"]);
 $HT_USERNAME = test_input($_POST["HT_USERNAME"]);
 $HT_PASSWORD = test_input($_POST["HT_PASSWORD"]);
 $HT_URL = test_input($_POST["HT_URL"]);
 $GDD_BASE_TEMP = test_input($_POST["GDD_BASE_TEMP"]);
 $GDD_START_DATE = test_input_allow_slash($_POST["GDD_START_DATE"]);
 #$NASA_HONEYBEE_NET_ID = test_input($_POST["NASA_HONEYBEE_NET_ID"]);
 $POWER = test_input($_POST["POWER"]);
 $INTERNET = test_input($_POST["INTERNET"]);
 $STATUS = test_input($_POST["STATUS"]);
 $COMPUTER = test_input($_POST["COMPUTER"]);
 $START_DATE = test_input($_POST["START_DATE"]);
 $ZIP = test_input($_POST["ZIP"]);
 // Update into the DB
 $doit = $conn->prepare("UPDATE hiveconfig SET hivename=?,hiveid=?,beekeeperid=?,yardid=?,city=?,state=?,country=?,latitude=?,longitude=?,version=?,timezone=?,share_hivetool=?,HT_USERNAME=?,HT_PASSWORD=?,HT_URL=?,GDD_BASE_TEMP=?,GDD_START_DATE=?,POWER=?,INTERNET=?,STATUS=?,COMPUTER=?,START_DATE=?,ZIP=? WHERE id=1");
 $doit->execute(array($hivename, $hiveid, $beekeeperid, $yardid, $city, $state, $country, $latitude, $longitude, $version, $timezone, $share_hivetool, $HT_USERNAME, $HT_PASSWORD, $HT_URL, $GDD_BASE_TEMP, $GDD_START_DATE, $POWER, $INTERNET, $STATUS, $COMPUTER, $START_DATE, $ZIP));
 sleep(3);
 // Refresh the fields in the form
 $sth = $conn->prepare("SELECT * FROM hiveconfig");
 $sth->execute();
 $result = $sth->fetch(PDO::FETCH_ASSOC);
     $HIVE_LUX_SLOPE = test_input($_POST["HIVE_LUX_SLOPE"]);
     $HIVE_LUX_INTERCEPT = test_input($_POST["HIVE_LUX_INTERCEPT"]);
     $HIVE_LUX_GPIO = test_input($_POST["HIVE_LUX_GPIO"]);
 }
 #Camera/Counter
 $ENABLE_HIVE_CAMERA = test_input($_POST["ENABLE_HIVE_CAMERA"]);
 $ENABLE_BEECOUNTER = test_input($_POST["ENABLE_BEECOUNTER"]);
 $CAMERATYPE = test_input($_POST["CAMERATYPE"]);
 $COUNTERTYPE = test_input($_POST["COUNTERTYPE"]);
 #Weather
 $weather_level = test_input($_POST["WEATHER_LEVEL"]);
 $weather_detail = test_input($_POST["WEATHER_DETAIL"]);
 $key = test_input($_POST["KEY"]);
 $wxstation = test_input($_POST["WXSTATION"]);
 $WXTEMPTYPE = test_input($_POST["WXTEMPTYPE"]);
 $WX_TEMPER_DEVICE = test_input_allow_slash($_POST["WX_TEMPER_DEVICE"]);
 $WX_TEMP_GPIO = test_input($_POST["WX_TEMP_GPIO"]);
 $local_wx_type = test_input($_POST["local_wx_type"]);
 $local_wx_url = test_input($_POST["local_wx_url"]);
 $WX_TEMP_SLOPE = test_input($_POST["WX_TEMP_SLOPE"]);
 $WX_TEMP_INTERCEPT = test_input($_POST["WX_TEMP_INTERCEPT"]);
 $WX_HUMIDITY_SLOPE = test_input($_POST["WX_HUMIDITY_SLOPE"]);
 $WX_HUMIDITY_INTERCEPT = test_input($_POST["WX_HUMIDITY_INTERCEPT"]);
 // Get current version
 $ver = $conn->prepare("SELECT version FROM hiveconfig");
 $ver->execute();
 $ver = $ver->fetchColumn();
 // Increment version
 $version = ++$ver;
 // Update into the DB
 $doit = $conn->prepare("UPDATE hiveconfig SET ENABLE_HIVE_CAMERA=?,ENABLE_HIVE_WEIGHT_CHK=?,ENABLE_HIVE_TEMP_CHK=?,SCALETYPE=?,TEMPTYPE=?,version=?,HIVEDEVICE=?,ENABLE_LUX=?,LUX_SOURCE=?,HIVE_TEMP_GPIO=?,HIVE_WEIGHT_SLOPE=?,HIVE_WEIGHT_INTERCEPT=?,ENABLE_BEECOUNTER=?,CAMERATYPE=?,COUNTERTYPE=?,weather_level=?,key=?,wxstation=?,WXTEMPTYPE=?,WX_TEMPER_DEVICE=?,WX_TEMP_GPIO=?,weather_detail=?,local_wx_type=?,local_wx_url=?, HIVE_LUX_SLOPE=?, HIVE_LUX_INTERCEPT=?, HIVE_TEMP_SLOPE=?, HIVE_TEMP_INTERCEPT=?, WX_TEMP_SLOPE=?, WX_TEMP_INTERCEPT=?, HIVE_HUMIDITY_SLOPE=?, HIVE_HUMIDITY_INTERCEPT=?, WX_HUMIDITY_SLOPE=?, WX_HUMIDITY_INTERCEPT=?, HIVE_LUX_GPIO=?, HIVE_WEIGHT_GPIO=? WHERE id=1");