Hamburger Hamburger

Heating and Ventilation Control

/HV_serviceLog

Keine Erläuterungen gefunden.

<?php
/* published under GPL www.gnu.org/licenses/gpl.html */
function HV_serviceShowLog($fname){
  /* read log file */
  $service=HV_serviceReadLog($fname);
  /* show dates in a form */
  $today=date('Y-m-d');
  $content ="<table>\n";
  for($n=0;$n<count($service);$n++){
    $content.="<tr><td>".$service[$n]['name']."</td>";
    $content.="<td>".$service[$n]['date']."</td>\n";
    $content.="<td><form action='?what2do=updateService' method='POST'>\n";
    $content.="<input type='hidden' name='serviceDate".$n."' value='".$today."'>\n";
    $content.="<input type='submit' name='service".$n."' value='heute'></form></td>\n";
  } #n
  $content.="</table>\n";
  return $content;
}

function HV_serviceUpdateLog($fname){
  /* read log file */
  $service=HV_serviceReadLog($fname);
  /* get data from form */
  for($n=0;$n<count($service);$n++){
    if(isset($_POST['service'.$n])){
      $service[$n]['date']=$_POST['serviceDate'.$n];
    }
  } #n
  /* write log file */
  $fid = fopen($fname, "w");
  for($n=0;$n<count($service);$n++){
    $string=$service[$n]['name']."=".trim($service[$n]['date'])."\n";
    fputs($fid,$string);
  } #n
  fclose($fid);
}

function HV_serviceReadLog($fname){
  if (file_exists($fname)) {
    $fid = fopen($fname, "r");
    $line = trim(fgets( $fid, 512 ));
    $n=-1;
    while(!feof($fid)){
      $n++;
      $values=explode("=",$line);
      $service[$n]['name']=$values[0];
      $service[$n]['date']=trim($values[1]);
      $line = fgets($fid, 512);
    } #n
    fclose($fid);
    return $service;
  }else{
    return FALSE;
  }
}
  ?>

python

1/HvcLightControl.py
2/HvcHCSR04ultrasonic.py
3/HvcPV.py
4/HvcMotorDriver.py
5/HvcRollerShutter.py
6/manGenMqttMap.py
7/HvcReadSPI.py
8/HvcMqtt.py
9/HvcTables.py
10/HvcMain.py
11/HvcSetGPIO.py
12/HvcWifiRelay.py
13/HvcOperationMode.py
14/HvcControl.py
15/HvcRaw2phys.py
16/HvcWeather.py
17/HvcOneWire.py
18/makeDoc.py
19/HvcFronius.py
20/EnergyManager.py
21/HvcSendI2C.py

php

1/HV_colorMap.php
2/HV_Admin_Login.php
3/HV_readOperationState.php
4/HV_setParameters.php
5/HV_config.php
6/EM_handleJSON.php
7/index.php
8/readFilenames.php
9/HV_restart.php
10/HV_moveGate.php
11/HV_showLog.php
12/HV_RollerShutter.php
13/EM_editParameter.php
14/HV_serviceLog.php
15/HV_H2Olevel.php
16/HV_TempCal.php
17/HV_Fronius.php
18/EM_plot.php
19/readNamedData.php
20/HV_composeH2Oplot.php
21/HVdoc.php
22/HV_showWeatherForecast.php
23/HV_showHouse.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.