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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
<head>
<style>
#dividnumero1
{
width:300px;
}
table.tableau
{
width:300px;
}
.tableau
{
border:1px solid;
border-collapse:collapse;
text-align:center;
padding:0px;
margin:0px;
}
.tableau .titres_horiz
{
text-align:center;
}
.titres_horiz .acces
{
text-align:center;
padding-top:10px;
border:1px solid;
}
.titres_horiz .option
{
width:120px;
text-align:center;
padding-bottom:10px;
padding-top:10px;
}
.ss_titres_horiz
{
text-align:center;
border-bottom:1px solid;
}
.ss_titres_horiz td
{
width:30px;
text-align:center;
}
.tableau .titres_verti
{
text-align:left;
width:90px;
border-right:1px solid;
border-left:1px solid;
}
.tableau tr.gris
{
background-color:#e3e0e0;
}
.tableau td
{
border-left:1px solid #b8b7b7;
width:30px;
text-align:center;
}
</style>
<!--cacher le div-->
<script type="text/javascript">
function visibilite(thingId)
{
var
targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
}
else
{
targetElement.style.display = "none" ;
}
}
</script>
<title>Test</title>
</head>
<body>
<?php
//choix des options
$acces_en_tete='<p>';
//valeur de case précochée option type
$checked_no='';
$checked_plan='';
$checked_cle='';
$checked_autre='';
//valeur case précochée tableau
$checked_blop_no='';
$checked_bang_no='';
$checked_tim_no='';
$checked_blop_plan='';
$checked_bang_plan='';
$checked_tim_plan='';
$checked_blop_cle='';
$checked_bang_cle='';
$checked_tim_cle='';
if(isset($_POST['options_type_acces']))
{
$options_type_acces=$_POST['options_type_acces'];
//Personne n'a d'accès
if($options_type_acces=='no')
{
$checked_no=' checked="checked" ';
$checked_blop_no=' checked="checked" ';
$checked_bang_no=' checked="checked" ';
$checked_tim_no=' checked="checked" ';
}
//tout le monde a accès aux plans
elseif($options_type_acces=='plan')
{
$checked_plan=' checked="checked" ';
$checked_blop_plan=' checked="checked" ';
$checked_bang_plan=' checked="checked" ';
$checked_tim_plan=' checked="checked" ';
}
//tout le monde a accès aux clés
elseif($options_type_acces=='cle')
{
$checked_cle=' checked="checked" ';
$checked_blop_cle=' checked="checked" ';
$checked_bang_cle=' checked="checked" ';
$checked_tim_cle=' checked="checked" ';
}
//autres
elseif($options_type_acces=='autre')
{
$checked_autre=' checked="checked" ';
$checked_bang_no=' checked="checked" ';
$checked_blop_plan=' checked="checked" ';
$checked_tim_cle=' checked="checked" ';
}
//(rien n'est précisé)
else
{
//valeur de case précochée option type
$checked_no='';
$checked_plan='';
$checked_cle='';
$checked_autre='';
//valeur case précochée tableau
$checked_blop_no='';
$checked_bang_no='';
$checked_tim_no='';
$checked_blop_plan='';
$checked_bang_plan='';
$checked_tim_plan='';
$checked_blop_cle='';
$checked_bang_cle='';
$checked_tim_cle='';
}
}
//clic et si clic déplie les options sinon par déft tout à NON : pas d'accès
$options='
<a href="javascript:visibilite(\'dividnumero1\');"><strong>Définir les options</strong></a>
<div id="dividnumero1" style="display:none;">
<p>
<strong>Options type :</strong>
</p>
<form method="post" action="test_ccm.php" name="options_type_acces">
<br/>
<input id="options_type_acces" type="radio" onclick="this.form.submit()" '.$checked_no.' name="options_type_acces" value="no"/>
<label for="options_type_acces"> Aucun accès</label>
<br/>
<input id="options_type_acces" type="radio" onclick="this.form.submit()" '.$checked_plan.' name="options_type_acces" value="plan"/>
<label for="options_type_acces"> Plans</label>
<br/>
<input id="options_type_acces" type="radio" onclick="this.form.submit()" '.$checked_cle.' name="options_type_acces" value="cle"/>
<label for="options_type_acces"> Clés</label>
<br/>
<input id="options_type_acces" type="radio" onclick="this.form.submit()" '.$checked_autre.' name="options_type_acces" value="autre"/>
<label for="options_type_acces"> Autre</label>
</form>
<table class="tableau">
<tr valign="top" class="titres_horiz">
<td colspan=1 rowspan=2 class="acces">
<strong>Accès</strong>
</td>
<td colspan=4 rowspan=1 class="option">
<strong>Options</strong>
</td>
</tr>
<tr class="ss_titres_horiz">
<td colspan=1 rowspan=1>
Aucun accès
</td>
<td colspan=1 rowspan=1>
Plans
</td>
<td colspan=1 rowspan=1>
Clés
</td>
</tr>
<tr class="gris">
<td colspan=1 rowspan=1 class="titres_verti">
<label for="blop_acces">Professeur Blop</label>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="blop_acces" '.$checked_blop_no.' value="NO"/>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="blop_acces" '.$checked_blop_plan.' value="PLAN"/>
<td colspan=1 rowspan=1>
<input type="radio" name="blop_acces" '.$checked_blop_cle.' value="CLE"/>
</td>
</tr>
<tr>
<td colspan=1 rowspan=1 class="titres_verti">
<label for="bang_acces">Professeur Bang</label>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="bang_acces" '.$checked_bang_no.' value="NO"/>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="bang_acces" '.$checked_bang_plan.' value="PLAN"/>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="bang_acces" '.$checked_bang_cle.' value="CLE"/>
</td>
</tr>
<tr class="gris">
<td colspan=1 rowspan=1 class="titres_verti">
<label for="tim_acces">Professeur Tim</label>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="tim_acces" '.$checked_tim_no.' value="NO"/>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="tim_acces" '.$checked_tim_plan.' value="PLAN"/>
</td>
<td colspan=1 rowspan=1>
<input type="radio" name="tim_acces" '.$checked_tim_cle.' value="CLE"/>
</td>
</tr>
</table>
</div>
';
$acces_pied='</p>';
$acces=$acces_en_tete.$options.$acces_pied;
echo $acces;
?> |
Partager