Skip to content

Commit

Permalink
Added option to set the number next events at once for all devices
Browse files Browse the repository at this point in the history
  • Loading branch information
fernadosilva committed Apr 21, 2016
1 parent 06ee30e commit ec2d37a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/orvfms/process_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ function processSetup($mac,&$s20Table,$actionValue){
}
}
$nnext = (int) $_POST['numberOfNextEvents'];
$s20Table[$mac]['next'] = $nnext;
if(!isset($_POST['applyToAllAction'])){
$s20Table[$mac]['next'] = $nnext;
}
else{
foreach($s20Table as $macAux => $devAux){
$s20Table[$macAux]['next'] = $nnext;
}
}
writeDataFile($s20Table);
$_SESSION['s20Table'] = $s20Table;

Expand Down
8 changes: 7 additions & 1 deletion lib/orvfms/setup_page.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script>

</script>

<?php
function displaySetupPage($mac,&$s20Table,$myUrl){
global $daysOfWeek;
Expand Down Expand Up @@ -55,7 +59,9 @@ function displaySetupPage($mac,&$s20Table,$myUrl){
}
?>
</select>

<br>
<input id="applyToAll" type="checkBox" name="applyToAllAction">
<label for="applyToAll"><span><span></span></span>Apply the same to all</label>
<p>
<button type="submit" name="toMainPage" value="procSetup<?php echo $mac ?>" id="doneButton">Done</button>
<hr>
Expand Down

0 comments on commit ec2d37a

Please sign in to comment.