Index: /extensions/Piwecard/admin/admin_management.php
===================================================================
--- /extensions/Piwecard/admin/admin_management.php	(revision 20111)
+++ /extensions/Piwecard/admin/admin_management.php	(revision 20112)
@@ -6,5 +6,57 @@
 $piwecard = get_plugin_data($plugin_id);
 
-if (isset($_POST['nb_ecard_page_submit'])) {
+$query = 'SELECT * FROM '.PIWECARD_TABLE;
+	
+if (isset($_POST['ecard_form_filter_submit'])) {
+	switch ($_POST['ecard_status']) {
+		case 'valid':
+			$query .= ' WHERE date_validity >= NOW() OR date_validity IS NULL';
+			break;
+		case 'invalid':
+			$query .= ' WHERE date_validity < NOW() AND date_validity IS NOT NULL';
+			break;
+		default:
+			break;
+	}
+	
+	switch ($_POST['ecard_sort_by']) {
+		case 'date':
+			$query .= ' ORDER BY date_creation';
+			break;
+		case 'title':
+			$query .= ' ORDER BY title';
+			break;
+		case 'sender':
+			$query .= ' ORDER BY sender_name';
+			break;
+		case 'recipient':
+			$query .= ' ORDER BY recipient_name';
+			break;
+		case 'validity':
+			$query .= ' ORDER BY date_validity';
+			break;
+		default:
+			$query .= ' ORDER BY date_creation';
+			break;
+	}
+	
+	switch ($_POST['ecard_sort_order']) {
+		case 'asc':
+			$query .= ' ASC';
+			break;
+		case 'desc':
+			$query .= ' DESC';
+			break;
+		default:
+			$query .= ' ASC';
+			break;
+	}
+	$template->assign('ecard_filter', array(
+											'status' => $_POST['ecard_status'],
+											'sort_by' => $_POST['ecard_sort_by'],
+											'sort_order' => $_POST['ecard_sort_order'],
+										)
+	);
+	
 	if (intval($_POST['ecard_nb_ecard_page']) == 0)
 		$piwecard->config['nb_ecard_page'] = 1;
@@ -40,5 +92,10 @@
 $ecard_navbar = create_navigation_bar($management_url, $piwecard->get_nb_ecard(), $start, $piwecard->config['nb_ecard_page']);
 
-$query = 'SELECT * FROM '.PIWECARD_TABLE.' ORDER BY date_creation DESC LIMIT '.$start.','.$piwecard->config['nb_ecard_page'].';';
+//DB Query
+if (strpos($query, 'ORDER BY') === FALSE) {
+	$query .= ' ORDER by date_creation ASC';
+}
+
+$query .= ' LIMIT '.$start.','.$piwecard->config['nb_ecard_page'].';';
 $result = pwg_query($query);
 
Index: /extensions/Piwecard/admin/template/admin_configuration.tpl
===================================================================
--- /extensions/Piwecard/admin/template/admin_configuration.tpl	(revision 20111)
+++ /extensions/Piwecard/admin/template/admin_configuration.tpl	(revision 20112)
@@ -109,5 +109,5 @@
 			</div>
 			<div class="ecard_form_line ecard_email_config">
-				<label for="ecard_email_subject">{'piwecard_email_subject'|@translate}</label><br /><span class="ecard_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
+				<label for="ecard_email_subject">{'piwecard_email_subject'|@translate}</label><span class="ecard_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span>
 				<input type="text" maxlength="255" name="ecard_email_subject" id="ecard_email_subject" {$ecard_errors.email_subject.style_error_input} value="{$ecard_email_subject}" />
 			</div>
Index: /extensions/Piwecard/admin/template/admin_management.tpl
===================================================================
--- /extensions/Piwecard/admin/template/admin_management.tpl	(revision 20111)
+++ /extensions/Piwecard/admin/template/admin_management.tpl	(revision 20112)
@@ -18,27 +18,70 @@
 </div>
 <div id="ECardAdminManagement">
+	<fieldset>
+		<legend>{'piwecard_list'|@translate}</legend>
+		<div class="ecard_last_line">
+			{$nb_ecard_valid_total}
+		</div>
+	</fieldset>
+	<fieldset>
+		<legend>{'Filter'|@translate}</legend>
+		<form method="post" id="ecard_form_filter" onsubmit="return piwecard_checkForm(this);">
+			<div class="ecard_error" id="ecard_nb_ecard_page_error">
+				{'piwecard_error'|@translate} {'piwecard_error_number'|@translate}
+			</div>
+			<span>
+				<label>
+					{'Status'|@translate}
+					<select name="ecard_status">
+						<option value="all" label="------------">------------</option>
+						<option value="valid" label="{'piwecard_valid'|@translate}" {if $ecard_filter.status=='valid'}selected="selected"{/if}>{'piwecard_valid'|@translate}</option>
+						<option value="invalid" label="{'piwecard_invalid'|@translate}" {if $ecard_filter.status=='invalid'}selected="selected"{/if}>{'piwecard_invalid'|@translate}</option>
+					</select>
+				</label>
+			</span>
+			<span>
+				<label>
+					{'Sort by'|@translate}
+					<select name="ecard_sort_by">
+						<option value="default" label="------------">------------</option>
+						<option value="date" label="{'Date'|@translate}" {if $ecard_filter.sort_by=='date'}selected="selected"{/if}>{'Date'|@translate}</option>
+						<option value="title" label="{'Title'|@translate}" {if $ecard_filter.sort_by=='title'}selected="selected"{/if}>{'Title'|@translate}</option>
+						<option value="sender" label="{'piwecard_sender_name'|@translate}" {if $ecard_filter.sort_by=='sender'}selected="selected"{/if}>{'piwecard_sender_name'|@translate}</option>
+						<option value="recipient" label="{'piwecard_recipient_name'|@translate}" {if $ecard_filter.sort_by=='recipient'}selected="selected"{/if}>{'piwecard_recipient_name'|@translate}</option>
+						<option value="validity" label="{'piwecard_validity'|@translate}" {if $ecard_filter.sort_by=='validity'}selected="selected"{/if}>{'piwecard_validity'|@translate}</option>
+					</select>
+				</label>
+			</span>
+			<span>
+				<label>
+					{'Sort order'|@translate}
+					<select name="ecard_sort_order">
+						<option value="asc" label="{'ascending'|@translate}" {if $ecard_filter.sort_order=='asc'}selected="selected"{/if}>{'ascending'|@translate}</option>
+						<option value="desc" label="{'descending'|@translate}" {if $ecard_filter.sort_order=='desc'}selected="selected"{/if}>{'descending'|@translate}</option>
+					</select>
+				</label>
+			</span>
+			<span>
+				<label>
+					{'piwecard_nb_ecard_page'|@translate}
+					<input type="text" maxlength="3" size="3" name="ecard_nb_ecard_page" id="ecard_nb_ecard_page" value="{$ecard_nb_ecard_page}" />
+				</label>
+			</span>
+			<span>
+				<label>
+					&nbsp;
+					<input type="submit" name="ecard_form_filter_submit" value="{'Submit'|@translate}" />
+				</label>
+			</span>
+		</form>
+	</fieldset>
 	{if count($ecard_file)}
-		<fieldset>
-			<legend>{'piwecard_list'|@translate}</legend>
-			<div class="ecard_last_line">
-				{$nb_ecard_valid_total}
-			</div>
-		</fieldset>
-		<fieldset>
-			<legend>{'Filter'|@translate}</legend>
-			<form method="post" id="ecard_nb_ecard_page_form" onsubmit="return piwecard_checkForm(this);">
-				<span><label for="ecard_nb_ecard_page">{'piwecard_nb_ecard_page'|@translate}</label></span>
-				<span><input type="text" maxlength="3" size="3" name="ecard_nb_ecard_page" id="ecard_nb_ecard_page" value="{$ecard_nb_ecard_page}" /></span>
-				<span><input type="submit" name="nb_ecard_page_submit" value="{'Submit'|@translate}" /></span>
-				<span class="ecard_error" id="ecard_nb_ecard_page_error">{'piwecard_error'|@translate} {'piwecard_error_number'|@translate}</span>
-			</form>
-		</fieldset>
-		<form method="post" id="delete_selected_form">
+		<form method="post" id="ecard_form_delete">
 			<table class="table2" width="97%">
 				<thead>
 					<tr class="throw">
 						<td>&nbsp;</td>
+						<td>{'Date'|@translate}</td>
 						<td>{'Title'|@translate}</td>
-						<td>{'Date'|@translate}</td>
 						<td>{'piwecard_sender_name'|@translate}</td>
 						<td>{'piwecard_recipient_name'|@translate}</td>
Index: /extensions/Piwecard/css/admin.css
===================================================================
--- /extensions/Piwecard/css/admin.css	(revision 20111)
+++ /extensions/Piwecard/css/admin.css	(revision 20112)
@@ -27,8 +27,10 @@
 	width: 75%;
 	height: 200px;
+	display: block;
 }
 
 #ECardAdminConfiguration .ecard_email_config input {
 	width: 75%;
+	display: block;
 }
 
@@ -60,13 +62,19 @@
 }
 
-#ECardAdminManagement #ecard_nb_ecard_page_form {
+#ECardAdminManagement #ecard_form_filter {
 	text-align: left;
 }
 
-#ECardAdminManagement #ecard_nb_ecard_page_form input {
+#ECardAdminManagement #ecard_form_filter input, #ECardAdminManagement #ecard_form_filter select {
+	display: block;
+	margin: 0.5em 0px;
+}
+
+#ECardAdminManagement #ecard_form_filter input {
 	text-align: center;
 }
 
-#ECardAdminManagement #ecard_nb_ecard_page_form span {
-	margin-right: 0.7em;
+#ECardAdminManagement #ecard_form_filter span {
+	margin-right: 1em;
+	float:left;
 }
Index: /extensions/Piwecard/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 20111)
+++ /extensions/Piwecard/language/en_UK/plugin.lang.php	(revision 20112)
@@ -51,4 +51,6 @@
 $lang['piwecard_list'] 							= 'List of e-cards';
 $lang['piwecard_nb_ecard_valid_total'] 			= '%nb_valid% valid e-cards out of %nb_total% e-cards';
+$lang['piwecard_valid']							= 'Valid';
+$lang['piwecard_invalid']						= 'Expired';
 $lang['piwecard_delete_all_invalid'] 			= 'Delete all expired e-card';
 $lang['piwecard_validity'] 						= 'Validity date';
Index: /extensions/Piwecard/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 20111)
+++ /extensions/Piwecard/language/fr_FR/plugin.lang.php	(revision 20112)
@@ -51,4 +51,6 @@
 $lang['piwecard_list'] = 'Liste des cartes virtuelles';
 $lang['piwecard_nb_ecard_valid_total'] = '%nb_valid% cartes virtuelles valides sur %nb_total% cartes virtuelles';
+$lang['piwecard_valid']	= 'Valides';
+$lang['piwecard_invalid'] = 'Périmées';
 $lang['piwecard_delete_all_invalid'] = 'Supprimer toutes les cartes virtuelles périmées';
 $lang['piwecard_validity'] = 'Date de péremption';
@@ -56,5 +58,5 @@
 $lang['piwecard_deleted'] = 'Les cartes virtuelles sélectionnées ont été supprimées.';
 $lang['piwecard_invalid_deleted'] = 'Toutes les cartes périmées ont été supprimées.';
-$lang['piwecard_nb_ecard_page'] = 'Nombre de cartes virtuelles par page';
+$lang['piwecard_nb_ecard_page'] = 'Nombre de cartes par page';
 $lang['piwecard_no_ecard'] = 'Aucune carte virtuelle dans la base de données';
 $lang['piwecard_delete_selected'] = 'Supprimer les cartes virtuelles sélectionnées';
