first commit
This commit is contained in:
28
template/templates/presence.tpl
Normal file
28
template/templates/presence.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
<table>
|
||||
<input type="hidden" id="tr_id" value="{$tr_id}">
|
||||
|
||||
{foreach $users as $user}
|
||||
<tr>
|
||||
<td>{$user->get_uk_last_name()} {$user->get_uk_first_name()}</td>
|
||||
<td><input name="chk" type="checkbox" id="chk" value="{$user->get_uk_id()}" class="chk" {if $user->get_uk_presence($tr_id)}checked{/if}> </td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
<script>
|
||||
$('.chk').click(function() {
|
||||
var checked = $(this).is(':checked');
|
||||
var user_id = $(this).val();
|
||||
var tr_id = $("#tr_id").val();
|
||||
alert(checked);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/ajax/update_presence.php',
|
||||
data: { checked : checked, user_id : user_id, tr_id : tr_id },
|
||||
success: function(data) {
|
||||
//alert('it worked');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user