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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="colorPicker/css/style.css" rel="stylesheet" type="text/css" />
<link href="colorPicker/css/reset.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="colorPicker/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="colorPicker/js/jquery.simple-color.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.fontColor').simpleColor({
cellWidth: 9,
cellHeight: 9,
border: '1px solid #333333',
buttonClass: 'button',
displayColorCode: false
});
$('.fontBg').simpleColor({
cellWidth: 9,
cellHeight: 9,
border: '1px solid #333333',
buttonClass: 'button',
displayColorCode: false
});
});
</script>
</head>
<body>
<form action="index.php" method="post" name="form" title="Pick a color" lang="fr">
<label for="sampleText">Votre texte :</label>
<input name="sampleText" type="text" size="20" value="<?php if(isset($_POST['submit'])){echo $_POST['sampleText'];} ?>"/>
<label for="fontSize">Taille :</label>
<select name="fontSize" id="fontSize">
<option value="<?php if(isset($_POST['submit'])){echo $_POST['fontSize'];} ?>" selected="selected"><?php if(isset($_POST['submit'])){echo $_POST['fontSize'];} ?></option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
<label for="fontColor">Couleur texte :</label>
<input name="fontColor" class="fontColor" value="<?php if(isset($_POST['submit'])){echo $_POST['fontColor'];} ?>"/>
<label for="fontBg">couleur fond :</label>
<input name="fontBg" class="fontBg" value="<?php if(isset($_POST['submit'])){echo $_POST['fontBg'];} ?>"/>
<input name="submit" type="submit" value="Valider" />
</form>
<?php
require_once('inc/config.inc.php');
require_once('functions/font_generator.function.php');
//si on a recus des infos du formulaire
if (isset($_POST['submit']))
{
$hex_bg_color = $_POST['fontBg'];
$hex_txt_color = $_POST['fontColor'];
$txt_size = $_POST['fontSize'];
$txt_sample = $_POST['sampleText'];
$fontLoop = $db->query('SELECT * FROM fonts') or die(print_r($db->errorInfo()));
while($data = $fontLoop->fetch())
{
$font_file= 'fonts/'.$data["file"];
$nom_image= 'fonts/'.$data["font_name"].'.png';
CreateImage($hex_bg_color,$hex_txt_color,$txt_size,$txt_sample,$font_file,$nom_image);
echo '
<p>
<a href="font_detail2.php?id='.$data['id'].'&fontSample='.$_POST['sampleText'].'&fontSize='.$_POST['fontSize'].'&fontColor='.$_POST['fontColor'].'&fontBg='.$_POST['fontBg'].'&file='.$data["file"].'&font='.$data["font_name"].'">
<img src="'.$nom_image.'">
</a>
</p>
<br/>
';
}
}
?>
<?php
echo '<pre>';
echo print_r($_POST);
echo '</pre>';
?>
</body>
</html> |
Partager