<?php

//        # Copyright (C) 2012-2013 GNU remotecontrol authors.
//        #
//        # This program is free software: you can redistribute it and/or modify
//        # it under the terms of the GNU Affero General Public License as
//        # published by the Free Software Foundation, either version 3 of the
//        # License, or (at your option) any later version.
//        #
//        # This program is distributed in the hope that it will be useful,
//        # but WITHOUT ANY WARRANTY; without even the implied warranty of
//        # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//        # GNU Affero General Public License for more details.
//        #
//        # You should have received a copy of the GNU Affero General Public License
//        # along with this program.  If not, see <http://www.gnu.org/licenses/>.

	require_once('../lib/Global.php');

	$thermid = $_POST['ThermID'];
	$thermostats = $_SESSION['Thermostats'];
	$therm = $thermostats->FindThermostatByID(intval($thermid));

	$oids = '';

	$counter = 1;

	foreach($therm->ObjectArray as $obj)
	{
		if($obj->OID != 'OID1.10.9' && $obj->OID != 'OID1.2' && $obj->OID != 'OID2.7.1' && $obj->OID != 'OID1.13.2.1' &&
			$obj->OID != 'OID1.13.2.2' && $obj->OID != 'OID1.13.2.3' && $obj->OID != 'OID1.13.2.4')
		{
			if($counter == $therm->ObjectArray->count())
			{
				$oids .= "$obj->OID=$obj->CurrentValue";
			}
			else
			{
				$oids .= "$obj->OID=$obj->CurrentValue;";
			}
		}

		$counter++;
	}

	print $thermid.';'.$oids;

?>
