Subversion Repositories ALCASAR

Rev

Rev 602 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
602 stephane 1
<?php
2
/*
3
 
4
 
5
*/
6
require_once('includes/defines.inc.php');
7
require_once(ALCASAR_ADMIN_PATH_INC.'/session.inc.php');
610 stephane 8
require_once(ALCASAR_ADMIN_PATH_LIB.'/radiusMysqlUser.class.php');
602 stephane 9
 
10
$options['fields'] = "*";
11
$users = radiusMysqlUser::find($options);
12
 
610 stephane 13
//a faire
14
$vouchers = array();
15
$models = array();
16
 
602 stephane 17
?><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
18
<html>
19
<head>
20
<title>Users page</title>
21
<!-- include default CSS -->
22
<link rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/default.css" type="text/css">
23
<!-- include JQUERY UI CSS -->
24
<link type="text/css"  rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/ui-lightness/jquery-ui-1.8.10.custom.css">
25
<!-- include tablesorter CSS -->
26
<link type="text/css"  rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/tablesorter-blue/style.css">
27
 
28
<link type="text/css"  rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/datatables/css/demo_table.css">
29
<!-- include custom page CSS -->
30
<style type="text/css">
31
	div#users-contain { width: 450px; margin: 20px 0; }
32
	div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
33
	div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
34
	div#users-contain table th { ui-widget-header }
35
 
36
	.dataTables_filter {
37
    float: left;
38
    text-align: left;
39
    width: 220px;
40
}
41
</style>
42
<!-- include JQUERY -->
43
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery-1.5.min.js"></script>
44
<!-- include JQUERY UI -->
45
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery-ui-1.8.10.all.min.js"></script>
46
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery.tablesorter.min.js"></script>
47
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery.tablesorter.pager.js"></script>
48
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery.quicksearch.js"></script>
49
<script type="text/javascript" language="javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery.dataTables.min.js"></script>
50
<!-- include page javascript -->
51
<script type="text/javascript">
52
	var table_data_lang = {
53
			"sProcessing": "Patientez...",
54
			"sLengthMenu": "Afficher _MENU_ enregistrements",
55
			"sZeroRecords": "Aucun enregistrement disponible.",
56
			"sInfo": "_START_ à _END_ sur _TOTAL_ enregistrements",
57
			"sInfoEmpty": "0 à 0 sur 0 enregistrement",
58
			"sInfoFiltered": "(Filtré à partir de _MAX_  enregistrements)",
59
			"sInfoPostFix": "",
60
			"sSearch": "Recherche : ",
61
			"sUrl": "",
62
			"oPaginate": {
63
				"sFirst":    "Première page",
64
				"sPrevious": "Page précédente",
65
				"sNext":     "Page suivante",
66
				"sLast":     "Dernière page"
67
			}
68
		};
69
 
70
	$(document).ready(function(){
71
		// Tabs
72
		$('#tabs-users').tabs();
73
		// buttons
74
		$( "button, input:submit, input:button, input:reset").button();
75
		// Users table		
76
		$('#users_table').dataTable(
77
		{
78
			// fonction suivante permet d'avoir une colone numérotée dynamiquement (non triable)
79
			"fnDrawCallback": function ( oSettings ) {
80
				/* Need to redo the counters if filtered or sorted */
81
				if ( oSettings.bSorted || oSettings.bFiltered )
82
				{
83
					for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
84
					{
85
						$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
86
					}
87
				}
88
			},
89
			"aoColumnDefs": [
90
				{ "bSortable": false, "aTargets": [ 0 ] }
91
			],
92
			"aaSorting": [[ 1, 'asc' ]]
93
			//fin 			
94
			,"oLanguage": table_data_lang
95
		});
96
 
97
		$('#users_table_filter').after('<div style="float:left"><a href="javascript:alert(\'Fonction prochainement dispobible.\');" title="Recherche avancée">Avancée</a></div>');
98
 
99
 
100
		$('#vouchers_table').dataTable({
101
 
102
		// fonction suivante permet d'avoir une colone numérotée dynamiquement (non triable)
103
		"fnDrawCallback": function ( oSettings ) {
104
			/* Need to redo the counters if filtered or sorted */
105
			if ( oSettings.bSorted || oSettings.bFiltered )
106
			{
107
				for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
108
				{
109
					$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
110
				}
111
			}
112
		},
113
		"aoColumnDefs": [
114
			{ "bSortable": false, "aTargets": [ 0 ] }
115
		],
116
		"aaSorting": [[ 1, 'asc' ]]
117
		//fin
118
		,"oLanguage": table_data_lang
119
		});
120
		$('#vouchers_table_filter').after('<div style="float:left"><a href="javascript:alert(\'Fonction prochainement dispobible.\');" title="Recherche avancée">Avancée</a></div>');
610 stephane 121
 
122
 
123
		$('#models_table').dataTable({
124
 
125
		// fonction suivante permet d'avoir une colone numérotée dynamiquement (non triable)
126
		"fnDrawCallback": function ( oSettings ) {
127
			/* Need to redo the counters if filtered or sorted */
128
			if ( oSettings.bSorted || oSettings.bFiltered )
129
			{
130
				for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
131
				{
132
					$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
133
				}
134
			}
135
		},
136
		"aoColumnDefs": [
137
			{ "bSortable": false, "aTargets": [ 0 ] }
138
		],
139
		"aaSorting": [[ 1, 'asc' ]]
140
		//fin
141
		,"oLanguage": table_data_lang
142
		});
602 stephane 143
	});
144
</script>
145
</head>
146
<body>
147
<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
148
	<span class="ui-dialog-title" id="ui-dialog-title-dialog">Gestion des usagers</span>
149
</div>
150
<br />
151
<div id="tabs-users">
152
	<ul>
153
		<li><a href="#tabs1">Usagers</a></li>
154
		<li><a href="#tabs2">Vouchers</a></li>
610 stephane 155
		<li><a href="#tabs3">Modèles</a></li>
602 stephane 156
	</ul>
157
	<div id="tabs1">
158
		<div>
159
			Un usager est un utilisateur standard de votre réseau de consultation.<br>
160
			<font color="red">ATTENTION POUR DEMONSTRATION DES OPTIONS A UTILISER. Données du serveur RADIUS traitées (tri, pagination) par la page dans l'exemple , gérées par le serveur (AJAX) en production</font>
161
		</div>
162
		<br>
163
		<div style="float:right;">
164
			<form name="newUserform">
165
				<input type="button" value="Nouvel usager">
166
			</form>
167
		</div>
168
		<br>
169
		<table id="users_table" cellspacing="1" class="tablesorter" border="0" width="100%">
170
		<thead>
171
			<tr>
172
				<th width="20">#</th><th width="200">Usagers</th><th>Nom, prénom</th><th width="100">Date validitée</th>
173
			</tr>
174
		</thead>
175
		<tfoot>
176
			<tr>
177
				<th width="20">#</th><th width="200">Usagers</th><th>Nom, prénom</th><th width="100">Date validitée</th>
178
			</tr>
179
		</tfoot>
180
		<tbody>
181
		<?php 
182
		foreach ($users as $user){
183
			echo "<tr><td></td><td><a href='user.php?username=".$user['username']."' title='Edit User'>".$user['username']."</a></td><td>".$user['Name']."</td><td><font color=red>ND</font></td></tr>";
184
		}
185
		?>
186
		</tbody>
187
		</table>
188
 
189
		<br><br><br>
190
	</div>
191
	<div id="tabs2">
192
		<div>
193
		Un "Voucher" est un compte d'accès de type "pré-payé" qui dépend d'une durée d'utilisation ou d'un délai dans le temps.<br>
194
		<font color="red">PROCHAINEMENT DISPONIBLE</font>
195
		</div>
196
		<br>
197
		<div style="float:right;">
198
			<form name="newVoucherform">
199
				<input type="button" value="Nouveau voucher">
200
			</form>
201
		</div>
202
		<br>
203
		<table id="vouchers_table" cellspacing="1" class="tablesorter" border="0" width="100%">
204
		<thead>
205
			<tr>
206
				<th width="20">#</th>
207
				<th>Vouchers</th>
208
				<th>Description</th>
209
				<th>Nom complet (identifier la personne)</th>
610 stephane 210
				<th width="100">Date validitée</th>
602 stephane 211
			</tr>
212
		</thead>
213
		<tfoot>
214
			<tr>
215
				<th width="20">#</th>
216
				<th>Vouchers</th>
217
				<th>Description</th>
218
				<th>Nom complet (identifier la personne)</th>
610 stephane 219
				<th width="100">Date validitée</th>
602 stephane 220
			</tr>
221
		</tfoot>
222
		<tbody>
610 stephane 223
		<?php 
224
		foreach ($vouchers as $voucher){
225
			echo "<tr><td></td><td>".$voucher['name']."</td><td>".$voucher['description']."</td><td>".$voucher['user']."</td><td>".$voucher['validity']."</td></tr>";
226
		}
227
		?>
602 stephane 228
		</tbody>
229
		</table>
230
	</div>
231
	<div id="tabs3">
232
		<div>
610 stephane 233
		Afin de gagner du temps dans la création des comptes usagers et vouchers, vous avez la possibilité de prédéfinir des modèles de création de compte.<br>
602 stephane 234
		<font color="red">PROCHAINEMENT DISPONIBLE</font>
235
		</div>
236
		<br>
610 stephane 237
		<div style="float:right;">
238
			<form name="newModelform">
239
				<input type="button" value="Nouveau modèle">
240
			</form>
241
		</div>
242
		<br>
243
		<table id="models_table" cellspacing="1" class="tablesorter" border="0" width="100%">
244
		<thead>
245
			<tr>
246
				<th width="20px">#</th>
247
				<th>Modèle</th>
248
				<th>Description</th>
249
			</tr>
250
		</thead>
251
		<tfoot>
252
			<tr>
253
				<th width="20px">#</th>
254
				<th>Modèle</th>
255
				<th>Description</th>
256
			</tr>
257
		</tfoot>
258
		<tbody>
259
		<?php
260
		foreach ($models as $model){
261
			echo "<tr><td></td><td>".$model['name']."</td><td>".$model['description']."</td></tr>";
262
		}
263
		?>
264
		</tbody>
265
		</table>
602 stephane 266
	</div>
267
</div>
268
</body>
269
</html>