Ejemplo n.º 1
0
function init_resultat_election()
{
    global $image, $blanc, $noir, $gris, $gris2;
    header("Content-type: image/png");
    $annee = $_REQUEST[annee];
    $genre = $_REQUEST[genre];
    $type = $_REQUEST[type];
    $lesMiss = selectDbMiss($annee, $genre, $type, "", true);
    usort($lesMiss, "callback_sort_nb_votes");
    $nb = count($lesMiss);
    $hauteur = TAILLE_BARRE * $nb;
    $largeur = TAILLE_HAUTEUR;
    $image = ImageCreate($hauteur, $largeur);
    // On passe en blanc le fond de l'image
    $blanc = imagecolorallocate($image, 255, 255, 255);
    $noir = imagecolorallocate($image, 0, 0, 0);
    $gris = ImageColorAllocate($image, 190, 190, 190);
    $gris2 = ImageColorAllocate($image, 140, 140, 140);
    imagefilledrectangle($image, 0, 0, $largeur, $hauteur, $blanc);
    $total_votes = nombre_votes_db($annee, $genre, $type);
    dessine_nom_results_miss($lesMiss, $total_votes);
    // Génération de l'image
    ImagePng($image);
    // Desctruction de l'image
    ImageDestroy($image);
}
Ejemplo n.º 2
0
function afficher_administration_miss_fiche($annee, $genre, $type, $id_troll_miss)
{
    afficher_titre_tableau("Fiche de Miss");
    $lesMiss = selectDbMiss($annee, $genre, $type, $id_troll_miss);
    $res = $lesMiss[1];
    $id_troll_miss = $res[id_troll_miss];
    $nom_troll = $res[nom_troll];
    $image_1_miss = $res[image_1_miss];
    $image_2_miss = $res[image_2_miss];
    $description_miss = stripslashes($res[description_miss]);
    $question_miss = stripslashes($res[question_miss]);
    $reponse_miss = stripslashes($res[reponse_miss]);
    ?>
	<form method='post' action=''>
	<input type='hidden' name='id_troll_miss' value='<?php 
    echo $id_troll_miss;
    ?>
'>
	<input type='hidden' name='act_admin' value='editdb'>

	<table class='mh_tdborder' width='70%'  border='0' cellpadding='0' cellspacing='1' align='center'>
		<tr class='mh_tdtitre'>
			<td colspan="2" align="center">
				 <h2>
				 	<?php 
    echo $nom_troll . " ({$id_troll_miss}) ";
    afficherLien('troll', 'mh_evenements', $id_troll_miss, "", "", "", "", true);
    ?>
					</h2>
			</td>
		</tr>
		<tr class='mh_tdpage'>
			<td align='center'>
			Slogan : <br>
			<?php 
    echo $description_miss;
    ?>
			</td>
			<td>

				<textarea name='description_miss' size='60' maxlength='65000' value='' cols=60 rows=4><?php 
    echo $description_miss;
    ?>
</textarea>
			</td>
		</tr>

		<tr class='mh_tdpage'>
			<td align='center'>
			Question : <br>
			<?php 
    echo $question_miss;
    ?>
			</td>
			<td>
				<textarea name='question_miss' size='60' maxlength='65000' value='' cols=60 rows=4><?php 
    echo $question_miss;
    ?>
</textarea>
			</td>
		</tr>

		<tr class='mh_tdpage'>
			<td align='center'>
			Réponse : <br>
			<?php 
    echo $reponse_miss;
    ?>
			</td>
			<td>
				<textarea name='reponse_miss' size='60' maxlength='65000' value='' cols=60 rows=4><?php 
    echo $reponse_miss;
    ?>
</textarea>
			</td>
		</tr>
		<tr class='mh_tdpage'>
			<td align='center'>
				Petite image<br>
				<?php 
    echo "<img src='{$image_1_miss}'>";
    ?>
			</td>
			<td>
				<input type='textbox' name='image_1_miss' size='50' maxlength='240' value='<?php 
    echo $image_1_miss;
    ?>
'>
			</td>
		</tr>
		<tr class='mh_tdpage'>
			<td align='center'>
			Grande image<br>
			<?php 
    echo "<img src='{$image_2_miss}'>";
    ?>
			</td>
			<td>
				<input type='textbox' name='image_2_miss' size='50' maxlength='240' value='<?php 
    echo $image_2_miss;
    ?>
'>
			</td>
		</tr>
		<tr class='mh_tdtitre'>
			<td align='center' colspan='2'>
				<?php 
    $link_del = 'document.location.href="/miss/miss.php?act_miss=admin&act_admin=deldb&id_troll_miss=' . $id_troll_miss . '";';
    $link_back = 'document.location.href="/miss/miss.php?act_miss=admin"';
    ?>
					
				<input type='submit' value='Modifier' class='mh_form_submit'>	
				<input type='button' value='Supprimer' class='mh_form_submit' onClick='javascript:if(confirm("Confirmer la suppression ?")) {<?php 
    echo $link_del;
    ?>
}'>	
				<input type='button' value='Retour Liste' class='mh_form_submit' onClick='javascript:<?php 
    echo $link_back;
    ?>
'>	
			</td>
		</tr>
	</table>
	</form>

	<?php 
}