<?php //TODO DOD2LAT UKL8D8N9?>
<div class="modal-container modal-container-hiden" id="modal-setting-<?php echo $SCENEID ?>">
    <div class="modal">
        <div class="close">
            <i class="fa fa-times"></i>
        </div>
        <h4 class="mb-4"><?php echo $LANG['t_editScene']?></h4>
        <form method="post">
            <div class="field">
                <div class="label"><?php echo $LANG['w_title'];?>:</div>
                <input type="text" class="input" name="sceneName" value="<?php echo $SCENE['name']; ?>"/>  
            </div>
            <div class="field">
                <div class="label"><?php echo $LANG['w_icon'];?>:</div>
                <select class="input fa" name="sceneIcon">
                    <option value=""><?php echo $LANG['w_no'].$LANG['w_icon'];?></option>
                    <option value="f0eb" <?php ECHO ($SCENE['icon'] == "f0eb" ? 'selected="selected"' : ''); ?>>&#xf0eb; - fa-lightbulb-o</option>
                    <option value="f2dc" <?php ECHO ($SCENE['icon'] == "f2dc" ? 'selected="selected"' : ''); ?>>&#xf2dc; - fa-snowflake-o</option>
                    <option value="f0e7" <?php ECHO ($SCENE['icon'] == "f0e7" ? 'selected="selected"' : ''); ?>>&#xf0e7; - fa-bolt</option>
                    <option value="f2c7" <?php ECHO ($SCENE['icon'] == "f2c7" ? 'selected="selected"' : ''); ?>>&#xf2c7; - fa-thermometer-full</option>
                    <option value="f236" <?php ECHO ($SCENE['icon'] == "f236" ? 'selected="selected"' : ''); ?>>&#xf236; - fa-bed</option>
                    <option value="f185" <?php ECHO ($SCENE['icon'] == "f185" ? 'selected="selected"' : ''); ?>>&#xf185; - fa-sun-o</option>
                    <option value="f2db" <?php ECHO ($SCENE['icon'] == "f2db" ? 'selected="selected"' : ''); ?>>&#xf2db; - fa-microchip</option>
                    <option value="f011" <?php ECHO ($SCENE['icon'] == "f011" ? 'selected="selected"' : ''); ?>>&#xf011; - fa-power-off</option>
                    <option value="f011" <?php ECHO ($SCENE['icon'] == "f011" ? 'selected="selected"' : ''); ?>>&#xf108; - fa-desktop</option>
                </select>
            </div>
            <div class="field px-2">
                <?php 
                $i = 0;
                foreach($SCENE['doSomething'] as $subDeviceId => $subDeviceData){ ?> 
                    <div id="scene-<?php echo $SCENEID; ?>-content">               
                        <div class="label"><?php echo $subDeviceData['name']; ?></div>
                        <select class="input" name="devices[<?php echo $subDeviceId; ?>]">
                            <option value="0" <?php ECHO ($subDeviceData['state'] == "0" ? 'selected="selected"' : ''); ?>>off</option>
                            <option value="1" <?php ECHO ($subDeviceData['state'] == "1" ? 'selected="selected"' : ''); ?>>on</option>
                        </select>
                        <button name="remove" type="button" class="button is-danger fa" data-scene-id="<?php echo $SCENEID; ?>">&#xf1f8;</button>
                    </div>
                    <?php 
                    $i++;
                } ?>
            </div>
            <input type="submit" class="button" name="saveDevice" value="<?php echo $LANG['b_edit'];?>"/>	
            <input type="button" class="button is-danger" onClick="ajaxPost('ajax',{scene_id:'<?php echo $SCENEID ?>', 'action':'delete'}, this, true);" name="saveDevice" value="<?php echo $LANG['b_remove'];?>"/>	
        </form>
    </div>
</div>