Changeset 2653 for cpc/trunk/project
- Timestamp:
- Apr 14, 2012, 2:23:45 PM (9 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/parlementaire/actions/actions.class.php
r2646 r2653 362 362 $this->gpes[$gpe[1]][0]['desc'] = $gpe[3]; 363 363 } 364 /* 365 $this->mandats = array(); 366 for ($i = 1; $i < 6; $i++) { 367 $this->mandats[$i] = array(); 368 $this->mandats[$i][0] = array(); 369 $this->mandats[$i][0]['nb'] = 0; 370 $this->mandats[$i][0]['nom'] = "$i mandat".($i > 1 ? "s" : ""); 371 } 372 $this->sexes = array("H" => array("0" => array("nb" => 0, "nom" => "Hommes")), "F" => array("0" => array("nb" => 0, "nom" => "Femmes"))); 373 */ 364 374 foreach($parlementaires as $p) { 365 375 $tops = unserialize($p['top']); … … 367 377 $i = 0; 368 378 $this->tops[$id][$i++] = $p; 379 # $nbmdts = count(unserialize($p['autres_mandats'])); 380 # $this->sexes[$p['sexe']][0]['nb']++; 381 # $this->mandats[$nbmdts][0]['nb']++; 369 382 $this->gpes[$p['groupe_acronyme']][0]['nb']++; 370 383 foreach(array_keys($tops) as $key) { … … 379 392 $this->gpes[$p['groupe_acronyme']][$i] = 0; 380 393 $this->gpes[$p['groupe_acronyme']][$i] += $tops[$key]['value']; 394 /* 395 if (!isset($this->sexes[$p['sexe']][$i])) 396 $this->sexes[$p['sexe']][$i] = 0; 397 $this->sexes[$p['sexe']][$i] += $tops[$key]['value']; 398 if (!isset($this->mandats[$nbmdts][$i])) 399 $this->mandats[$nbmdts][$i] = 0; 400 $this->mandats[$nbmdts][$i] += $tops[$key]['value']; 401 */ 381 402 $i++; 382 403 } -
cpc/trunk/project/apps/frontend/modules/parlementaire/templates/topSuccess.php
r2596 r2653 121 121 <div class="synthese_groupes"> 122 122 <table> 123 <?php $cpt = 0; foreach ($gpes as $gpe => $t) { 124 $cpt++;?><tr<?php if ($cpt %2) echo ' class="tr_odd"'?>> 125 <td id="<?php echo $gpe; ?>" class="jstitle c_<?php echo strtolower($gpe); ?> <?php echo $class['parl']; ?>" title="<?php echo $t[0]['nom']." -- ".$t[0]['desc']; ?>"><a href="<?php echo url_for('@list_parlementaires_groupe?acro='.$gpe); ?>"><?php echo $gpe." : ".$t[0]['nb']." députés"; ?></a></td> 126 <?php for($i = 1 ; $i < count($t) ; $i++) { 127 $t[$i] = round($t[$i]/$t[0]['nb']); ?> 128 <td title="<?php echo $t[$i].' '; if ($t[$i] < 2) echo preg_replace('/s (.*-- )/', ' \\1', preg_replace('/s (.*-- )/', ' \\1', $bulles[$i])); else echo $bulles[$i]; ?>" class="jstitle <?php echo $class[$ktop[$i]]; ?>"> 129 <?php if (preg_match('/\./', $t[$i])) 130 printf('%02d', $t[$i]); 131 else echo $t[$i]; ?> 132 </td> 133 <?php } ?> 134 </tr> 135 <?php } ?> 123 <?php $cp = 0; 124 $cp = myTools::echo_synthese_groupe($gpes, $bulles, $class, $ktop, $cp); 125 # $cp = myTools::echo_synthese_groupe($sexes, $bulles, $class, $ktop, $cp); 126 # $cp = myTools::echo_synthese_groupe($mandats, $bulles, $class, $ktop, $cp); ?> 136 127 </table> 137 128 </div> -
cpc/trunk/project/lib/model/doctrine/myTools.class.php
r2574 r2653 179 179 return $s; 180 180 } 181 182 public static function echo_synthese_groupe($list, $bulles, $class, $ktop, $cpt) { 183 foreach ($list as $gpe => $t) { 184 $cpt++; 185 echo '<tr'.($cpt %2 ? ' class="tr_odd"' : '').'>'; 186 echo '<td id="'.$gpe.'" class="jstitle c_'.strtolower($gpe).' '.$class['parl'].'" title="'.$t[0]['nom']; 187 if (isset($t[0]['desc'])) { 188 echo ' -- '.$t[0]['desc'].'"><a href="'.url_for('@list_parlementaires_groupe?acro='.$gpe).'">'.$gpe.' : '.$t[0]['nb'].' députés</a>'; 189 } else { 190 echo '">'.$t[0]['nom']." : ".$t[0]['nb']; 191 } 192 echo '</td>'; 193 for($i = 1 ; $i < count($t) ; $i++) { 194 $t[$i] = round($t[$i]/$t[0]['nb']); 195 echo '<td title="'.$t[$i].' '.($t[$i] < 2 ? preg_replace('/s (.*-- )/', ' \\1', preg_replace('/s (.*-- )/', ' \\1', $bulles[$i])) : $bulles[$i]).'" class="jstitle '.$class[$ktop[$i]].'">'; 196 if (preg_match('/\./', $t[$i])) 197 printf('%02d', $t[$i]); 198 else echo $t[$i]; 199 echo '</td>'; 200 } 201 echo '</tr>'; 202 } 203 return $cpt; 204 } 205 181 206 }
Note: See TracChangeset
for help on using the changeset viewer.