<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
page_header('Simulator engines', 'set_simulators');
?>

   <div id="jqxgrid"></div>
    <div style="margin-top: 30px;">
    <div id="cellbegineditevent"></div>
    <div style="margin-top: 10px;" id="cellendeditevent"></div>
   </div>

   <!-- Popup editor window. -->
   <div id="popupWindow">
    <div>Edit simulator</div>
    <div style="overflow: hidden;">
     <table style="width: 100%;">
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Name:</td>
       <td colspan="3" align="left" style="vertical-align: top; padding: 3px;"><input id="name" /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">No:</td>
       <td style="padding: 3px;"><div style="float: left;" id="simno"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Temperature:</td>
       <td style="padding: 3px;"><div style="float: left;" id="room_temperature"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Humidity:</td>
       <td style="padding: 3px;"><div style="float: left;" id="room_humidity"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Volume air:</td>
       <td style="padding: 3px;"><div style="float: left;" id="volume_air"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Volume beer:</td>
       <td style="padding: 3px;"><div style="float: left;" id="volume_beer"></div></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Frigo isulation:</td>
       <td style="padding: 3px;"><div style="float: left;" id="frigo_isolation"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Last update:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="timestamp" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Uuid:</td>
       <td align="left" colspan="3" style="vertical-align: top; padding: 3px;"><input id="uuid" readonly /></td>
      </tr>
      <tr><td colspan="8"><hr></td></tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Air address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="air_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Temperature:</td>
       <td style="padding: 3px;"><div style="float: left;" id="air_temperature"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="air_present"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Beer address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="beer_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Temperature:</td>
       <td style="padding: 3px;"><div style="float: left;" id="beer_temperature"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="beer_present"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Beer alternate:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="beer_address2" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Temperature:</td>
       <td style="padding: 3px;"><div style="float: left;" id="beer_temperature2"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="beer_present2"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Chiller address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="chiller_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Temperature:</td>
       <td style="padding: 3px;"><div style="float: left;" id="chiller_temperature"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="chiller_present"></div></td>
       <td></td><td></td>
      </tr>

      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Cooler address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="cooler_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Power:</td>
       <td style="padding: 3px;"><div style="float: left;" id="cooler_power"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="cooler_present"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Min temp:</td>
       <td style="padding: 3px;"><div style="float: left;" id="cooler_temp"></div></td>
      </tr>
      <tr>
       <td></td><td></td>
       <td></td><td></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Time:</td>
       <td style="padding: 3px;"><div style="float: left;" id="cooler_time"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Size:</td>
       <td style="padding: 3px;"><div style="float: left;" id="cooler_size"></div></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Heater address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="heater_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Power:</td>
       <td style="padding: 3px;"><div style="float: left;" id="heater_power"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="heater_present"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Max temp:</td>
       <td style="padding: 3px;"><div style="float: left;" id="heater_temp"></div></td>
      </tr>
      <tr>
       <td></td><td></td>
       <td></td><td></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Time:</td>
       <td style="padding: 3px;"><div style="float: left;" id="heater_time"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Size:</td>
       <td style="padding: 3px;"><div style="float: left;" id="heater_size"></div></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Fan address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="fan_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Power:</td>
       <td style="padding: 3px;"><div style="float: left;" id="fan_power"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="fan_present"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Light address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="light_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Power:</td>
       <td style="padding: 3px;"><div style="float: left;" id="light_power"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="light_present"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">Door address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="door_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Value:</td>
       <td style="padding: 3px;"><div style="float: left;" id="door_value"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="door_present"></div></td>
       <td></td><td></td>
      </tr>
      <tr>
       <td style="vertical-align: top; float: right; padding: 3px;">PSU address:</td>
       <td style="vertical-align: top; padding: 3px;"><input id="psu_address" readonly /></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Value:</td>
       <td style="padding: 3px;"><div style="float: left;" id="psu_value"></div></td>
       <td style="vertical-align: top; float: right; padding: 3px;">Present:</td>
       <td style="padding: 3px;"><div style="float: left;" id="psu_present"></div></td>
       <td></td><td></td>
      </tr>

      <tr><td colspan="8">&nbsp;</td></tr>
      <tr>
       <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Delete" /></td>
       <td></td>
       <td></td><td></td><td></td>
       <td style="padding-top: 20px;" align="right"><input style="margin-right: 5px;" type="button" id="Save" value="Save" /></td>
       <td></td>
       <td style="padding-top: 20px;" align="left"><input id="Cancel" type="button" value="Cancel" /></td>
      </tr>
     </table>
    </div>
   </div>


   <div id="addWindow">
    <div>
     Add new device
    </div>
    <div>
     <div>
      Press "OK" to create a new simulator record.<br>
      Press "Cancel" to close without adding a new simulator.
     </div>
     <div style="margin-top: 10px;">
      <div style="float: right; vertical-align: top; padding: 10px; margin-right: 120px">Name:<input id="addName" /></div>
     </div>
     <div>
      <div style="float: right; margin-top: 10px; margin-bottom: 10px;">
       <input type="button" id="addOk" value="OK" style="margin-right: 15px" />
       <input type="button" id="addCancel" value="Cancel" style="margin-right: 160px" />
      </div>
     </div>
    </div>
   </div>

<?php
confirm_delete();
page_footer();
?>
