users.tool 1.33 KB
Newer Older
CupCakeArmy's avatar
CupCakeArmy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class="row">
	<div class="col-xs-10 col-md-11">
		<div class="users-table-wrapper">
			<div class="tools-full-height">
				<table class="table table-hover users-table">
				  <thead>
				    <tr>
				    </tr>
				  </thead>
				  <tbody>
				  </tbody>
				</table>
			</div>
		</div>
	</div>
	<div class="col-xs-2 col-md-1">
		<div class="users-sidebar tools-full-height">
			<div class="row">
				<div class="col-sm-12">Test</div>
				<div class="col-sm-12">A</div>
				<div class="col-sm-12">B</div>
			</div>
		</div>
	</div>
CupCakeArmy's avatar
CupCakeArmy committed
25
26
</div>
<style>
CupCakeArmy's avatar
CupCakeArmy committed
27
28
29
30
31
32
33
34
35
36
	.users-table-wrapper {
		position: relative;
	}
	.users-table-wrapper>div {
		overflow: auto;
	}
	
	.users-sidebar {
		background: #fff;
	}
CupCakeArmy's avatar
CupCakeArmy committed
37
38
</style>
<script type="text/javascript">
CupCakeArmy's avatar
CupCakeArmy committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	var showInTable = ['firstname', 'lastname', 'email', 'membership'];
	amivcore.users.GET({data:{'max_results':'50'}}, function(ret){
		
		if(!ret || ret['_items'].length == 0){
			tools.log('No Data', 'w');
			return;
		}
		
		showInTable.forEach(function(i){
			$('.users-table thead tr').append('<th>'+ i +'</th>');
		});
		
		for(var n in ret['_items']){
			var tmp = '';
			showInTable.forEach(function(i){
				tmp += '<td>'+ ret['_items'][n][i] +'</td>';
			});
			$('.users-table tbody').append('<tr>'+tmp+'</tr>');
		  //$('.users-table tbody').append('<tr><td>'+ret['_items'][n].firstname+'</td></tr>');
	  }
CupCakeArmy's avatar
CupCakeArmy committed
59
60
  });
</script>