SignUp/subs/admin.php

75 lines
3.1 KiB
PHP
Raw Normal View History

2019-08-08 13:40:15 +00:00
<?php
/**
* /subs/admin.php
* @version 1.0
* @desc administrator area
* @author Fándly Gergő Zoltán
* @copy 2017 Fándly Gergő Zoltán
*/
?>
<div id="content">
<h2><?php echo $lang['admin'] ?></h2>
<br>
<div id="master_switch">
<form class="ajaxform" data-noreset="1" method="POST" action="" id="master_switch_form">
<input type="hidden" name="ms_post">
<fieldset>
<legend><?php echo $lang['masterswitch'] ?></legend>
<center>
<p><?php echo $lang['allow_login'] ?></p>
<div class="checkbox">
<input type="checkbox" name="allow_login" <?php if($config['allowlogin']) echo "checked" ?> id="o_<?php echo $oid ?>" onchange="$('#master_switch_form').submit()">
<label for="o_<?php echo $oid; $oid++ ?>"></label>
</div>
<br>
<br>
<p><?php echo $lang['allow_signup'] ?></p>
<div class="checkbox">
<input type="checkbox" name="allow_signup" <?php if($config['allowsignup']) echo "checked" ?> id="o_<?php echo $oid ?>" onchange="$('#master_switch_form').submit()">
<label for="o_<?php echo $oid; $oid++ ?>"></label>
</div>
</center>
</fieldset>
</form>
</div>
<hr class="placeholder">
<fieldset>
<legend><?php echo $lang['allow_signup_timesequence'] ?></legend>
<center>
<table>
<thead>
<tr>
<td data-breakpoints="xs"><?php echo $lang['id'] ?></td>
<td><?php echo $lang['timesequence'] ?></td>
<td data-breakpoints="xs sm"><?php echo $lang['actions'] ?></td>
</tr>
</thead>
<tbody>
<?php
$sql=$db->prepare("SELECT id, name, allow_signup FROM time_sequences ORDER BY id ASC");
$sql->execute();
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>";
echo "<form class=\"ajaxform\" data-noreset=\"1\" method=\"POST\" action=\"\" id=\"f_".$oid."\">";
echo "<input type=\"hidden\" name=\"set_tsas_id\" value=\"".$row['id']."\">";
echo "<div class=\"checkbox\">";
echo "<input type=\"checkbox\" name=\"set_tsas\" ".($row['allow_signup']==1?"checked":"")." id=\"o_".$oid."\" onchange=\"$('#f_".$oid."').submit()\">";
echo "<label for=\"o_".$oid."\"></label>";
echo "</div>";
echo "</form>";
echo "</td>";
echo "</tr>";
$oid++;
}
?>
</tbody>
</table>
</center>
</fieldset>
</div>