2 <!-- Javacript function used to switch a complete row or col of selected hours -->
3 <script language="javascript" type="text/javascript">
4 {literal}
5 var $regex = new Array();
6 function toggle_chk($reg)
7 {
8 if(!$regex[$reg]){
9 $regex[$reg] =1;
10 }
11 $regex[$reg] *= -1;
12 if($regex[$reg] == 1){
13 chk_set_all($reg,true);
14 }else{
15 chk_set_all($reg,false);
16 }
17 }
18 {/literal}
19 </script>
21 <h1>{t}Specify the hours this user is allowed to log in{/t}</h1>
22 <br>
24 <table cellspacing=0 cellpadding=0 style='border: solid 1px #B0B0B0; background-color: #EEEEEE; width :100%;' >
25 <tr>
26 <td> </td>
27 <td colspan=24 style='text-align:center;height:24px;border-bottom: solid 1px #B0B0B0;'><b>{t}Hour{/t}</b></td>
28 </tr>
29 <tr>
30 <td style='text-align: left;' class='list0'> </td>
31 {foreach from=$Hours item=hours key=key_hours}
32 {if (($hours)%2) == 0 }
33 <td style="text-align:center;height: 22px; background-color: rgb(226, 226, 226); ">
34 {else}
35 <td style="text-align:center;height: 22px; background-color: rgb(245, 245, 245); border-right: solid 1px #B0B0B0;">
36 {/if}
37 {$hours}
38 </td>
39 {/foreach}
40 </tr>
42 <!-- Add toggle buttons for hours -->
43 <tr>
44 <td style='text-align: left;' class='list0'>
45
46 </td>
47 {foreach from=$Hours item=hours key=key_hours}
48 {if (($hours)%2) == 0 }
49 <td style="text-align:center; height: 22px; background-color: rgb(226, 226, 226); text-align: right;">
50 {else}
51 <td style="text-align:center; height: 22px; background-color: rgb(245, 245, 245); border-right: solid 1px #B0B0B0; text-align: right;">
52 {/if}
54 <input type='button' onClick="toggle_chk('^day_[0-9]*_{$hours}$');" value='+/-' style='width:100%;'>
55 </td>
56 {/foreach}
57 <td>
59 <input type='button' onClick="toggle_chk('^day_[0-9]*_[0-9]*$');" value='+/-' style='width:100%;'>
60 </td>
61 </tr>
63 <!-- Add Entries -->
64 {foreach from=$Matrix item=days key=key_day}
65 <tr>
66 <td class='list0'>
67 <b>{$Days[$key_day]}</b>
68 </td>
69 {foreach from=$days item=hours key=key_hour}
70 {if (($key_hour)%2) == 0 }
71 <td style="text-align:center;height: 22px; background-color: rgb(226, 226, 226); ">
72 {else}
73 <td style="text-align:center;height: 22px; background-color: rgb(245, 245, 245); border-right: solid 1px;">
74 {/if}
75 {if $Matrix[$key_day].$key_hour}
76 <input id='day_{$key_day}_{$key_hour}' type='checkbox' name='day_{$key_day}_{$key_hour}' checked >
77 {else}
78 <input id='day_{$key_day}_{$key_hour}' type='checkbox' name='day_{$key_day}_{$key_hour}' >
79 {/if}
80 </td>
81 {/foreach}
83 <!-- Add toggle button for days -->
84 <td>
85 <input type='button' onClick="toggle_chk('^day_{$key_day}_[0-9]*$')" value='+/-' style='padding:0px;margin:0px;'>
86 </td>
87 </tr>
88 {/foreach}
89 </table>
90 <br>
91 <input type='hidden' name='sambaLogonHoursPosted' value='1'>
92 <br>
93 <p class="plugbottom">
94 <input type=submit name="save_logonHours" value="{msgPool type=applyButton}">
95
96 <input type=submit name="cancel_logonHours" value="{msgPool type=cancelButton}">
97 </p>
99 <!--
100 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
101 -->