1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <table>
<tr>
<td>
Search by:
</td>
</tr>
<tr>
<td align="center">
<?php
$selected = isset( $_GET['By'] ) ? $_GET['By'] : "" ;
$selectedValue = 'selected="selected"';
$arrayBy = array(
'all' => 'All',
'noproject' => '#Issue',
'title' => 'Title',
'clientname' => 'Client',
'responsible' => 'Responsible',
'datetimestart' => 'Started on',
'duedate' => 'Due Date',
'priority' => 'Priority');
// Variable qui ajoutera l'attribut selected
$selected = '';
// Parcours du tableau
echo '<select name="By">',"n";
foreach($arrayBy as $valeurBy => $codeBy){
if($codeBy === 'all'){
$selected = ' selected="selected"';
}
// Affichage de la ligne
echo "\t",'<option value="', $valeurBy ,'"', $selected ,'>', $codeBy ,'</option>',"\n";
// Remise à zéro de $selected
$selected = '';
}
echo '</select>',"\n";
?>
</td>
</tr>
</table> |
Partager