<?php
// header("Content-type:image/jpeg");
$nome = isset($_REQUEST['nome']) ? $_REQUEST['nome'] : "inserisci il nome";
$img = imagecreatefromjpeg('http://oi67.tinypic.com/ix5pbq.jpg');
imagealphablending($img, true);
imagesavealpha($img, true);
$nero = imagecolorallocate($img, 0, 0, 0);
echo imagettftext($img, 16, 0, 86, 368, $nero, "Fancy_Caps.ttf", "Il fedele dell'Altissimo chiamato");
imagettftext($img, 16, 0, 166, 398, $nero, "Fancy_Caps.ttf", $_POST['nome']);
imagejpeg($img);
?>
<?php
// header("Content-type:image/jpeg");
echo "inizio";
$img = imagecreatefromjpeg('http://oi67.tinypic.com/ix5pbq.jpg');
echo "img";
imagealphablending($img, true);
imagesavealpha($img, true);
echo "trasparenza";
$nero = imagecolorallocate($img, 0, 0, 0);
echo "colore";
imagettftext($img, 16, 0, 86, 368, $nero, "Fancy_Caps.ttf", "Il fedele dell'Altissimo chiamato");
imagettftext($img, 16, 0, 166, 398, $nero, "Fancy_Caps.ttf", $_POST['nome']);
imagejpeg($img);
?>
<?php
header("Content-type:image/jpeg");
$img = imagecreatefromjpeg('http://oi67.tinypic.com/ix5pbq.jpg');
imagejpeg($img);
<html>
<style type="text/css">
div#container { width: 500px; height: 600px;}
p#dichiarazione{text-align:center; font-size:1.2em; position:relative; top: 350px;}
@font-face {
font-family: "12th c. Fancy Caps";
src: url(http://dl.dafont.com/dl/?f=12th_century_caps) format("truetype");
}
h1 { font-family: "12th c. Fancy Caps", sans-serif }
</style>
<div id="container" style='position: relative;'>
<img src='http://iabasic1.altervista.org/images/certificato_funerale.jpg' style='position: absolute;top:0;lef:0;z-index: -1;'/>
<p id="dichiarazione">
<i>
<b> <BODY TEXT="#8B0000"> Il fedele dell'Altissimo chiamato <br /> <?php echo $nome=$_POST["nome"] ; ?> <br /> dopo la prematura morte, <br /> ha ricevuto il sacramento del funerale, <br />
dal <?php echo $grado=$_POST["grado"]; ?> <?php echo $officiante=$_POST["officiante"]; ?><br />
nella Parrocchia di <?php echo $diofun=$_POST["diofun"]; ?>, Arcidiocesi di <?php echo $arcifun=$_POST["arcifun"]; ?>, <br />
in data <?php echo $datafun=$_POST["datafun"]; ?>.<br />
</b>
</i>
</p>
</div>
</html>
if (extension_loaded('gd')) {
echo "estensione installata";
} else {
echo "estensione non instalata";
}
$img = imagecreatefromjpeg('ix5pbq.jpg');
var_dump($img);
imagejpeg($img);
<?php
$nome = $_POST["nome"];
$grado = $_POST["grado"];
$officiante = $_POST["officiante"];
$arcifun = $_POST["arcifun"];
$diofun = $_POST["diofun"];
$datafun = $_POST["datafun"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>
<html>
<head>
<title>Certificato Funerale</title>
</head>
<body>
<form action="certificato_funerale.php" method="POST" target="foo" onsubmit="window.open('', 'foo','width=520,height=620,status=yes,resizable=yes,scrollbars=yes')">
Nome Defunto:<br />
<input type="text" size="12" maxlength="20" name="nome"><br />
Officiante Funerale:<br />
<input type="text" size="12" maxlength="20" name="officiante"><br />
Grado:<br />
<select name="grado">
<option value="Papa">Papa</option>
<option value="Cardinale Camerlengo">Cardinale Camerlengo</option>
<option value="Cardinale Romano Elettore">Cardinale Romano Elettore</option><option value="Cardinale Nazionale Elettore">Cardinale Nazionale Elettore</option>
<option value="Cardinale Nazionale Suffragante">Cardinale Nazionale Suffragante</option>
<option value="Cardinale Emerito">Cardinale Emerito</option>
<option value="Primate">Primate</option>
<option value=" Vice Primate">Vice Primate</option>
<option value="Vice Primate Primo">Vice Primate Primo</option>
<option value="Vicarius Urbis">Vicarius Urbis</option>
<option value="Patriarca">Patriarca</option>
<option value="Arcivescovo Metropolita">Arcivescovo Metropolita</option>
<option value="Vicario Generale">Vicario Generale</option>
<option value="Vicario Generale Aggiunto">Vicario Generale Aggiunto</option>
<option value="Vescovo">Vescovo</option>
<option value="Parroco">Parroco</option>
<option value="Abate Cistercense">Abate Cistercense</option>
<option value="Priore Cistercense">Priore Cistercense</option>
<option value="Monaco Cistercense">Monaco Cistercense</option>
<option value="Monaco Domenicano">Monaco Domenicano</option>
<option value="Presbitero">Presbitero</option>
<option value="Diacono">Diacono</option>
<option value="Suddiacono">Suddiacono</option>
<option value="Vicario Parrocchiale">Vicario Parrocchiale</option>
<option value="Arcidiacono Primo">Arcidiacono</option>
<option value="Arcidiacono">Arcidiacono</option>
<option value="Vicario Diocesano">Vicario Diocesano</option></select><br />
Arcidiocesi Funerale:<br />
<select name="arcifun">
<option value="Aquileia">Aquileia</option>
<option value="Genova">Genova</option>
<option value="Milano">Milano</option>
<option value="Firenze">Firenze</option>
<option value="Pisa">Pisa</option>
<option value="Siena">Siena</option>
<option value="Ravenna">Ravenna</option>
<option value="Roma">Roma</option>
<option value="Capua">Capua</option>
<option value="In Nave">In Nave</option></select><br />
Parrocchia Funerale:<br />
<select name="diofun">
<option value="Venezia">Venezia</option>
<option value="Padova">Padova</option>
<option value="Parenzo">Parenzo</option>
<option value="Pola">Pola</option>
<option value="Portogruaro">Portogruaro</option>
<option value="Treviso">Treviso</option>
<option value="Mantua">Mantua</option>
<option value="Udine">Udine</option>
<option value="Genova">Genova</option>
<option value="Chiavari">Chiavari</option>
<option value="La Spezia">La Spezia</option>
<option value="Albenga">Albenga</option>
<option value="Ventimiglia">Ventimiglia</option>
<option value="Milano">Milano</option>
<option value="Como">Como</option>
<option value="Lodi">Lodi</option>
<option value="Alessandria">Alessandria</option>
<option value="Novara">Novara</option>
<option value="Savona">Savona</option>
<option value="Pavia">Pavia</option>
<option value="Firenze">Firenze</option>
<option value="Pistoia">Pistoia</option>
<option value="Montevarchi">Montevarchi</option>
<option value="Pisa">Pisa</option>
<option value="Volterra">Volterra</option>
<option value="Livorno">Livorno</option>
<option value="San Miniato">San Miniato</option>
<option value="Massa">Massa</option>
<option value="Siena">Siena</option>
<option value="Orbetello">Orbetello</option>
<option value="Grosseto">Grosseto</option>
<option value="Santa Fiora">Santa Fiora</option>
<option value="Piombino">Piombino</option>
<option value="Modena">Modena</option>
<option value="Mirandola">Mirandola</option>
<option value="Guastalla">Guastalla</option>
<option value="Parma">Parma</option>
<option value="Fornovo">Fornovo</option>
<option value="Piacenza">Piacenza</option>
<option value="L'Aquila">L'Aquila</option>
<option value="Arezzo">Arezzo</option>
<option value="Montepulciano">Montepulciano</option>
<option value="Teramo">Teramo</option>
<option value="Silvi">Silvi</option>
<option value="Chieti">Chieti</option>
<option value="Sulmona">Sulmona</option>
<option value="Avezzano">Avezzano</option>
<option value="Tagliacozzo">Tagliacozzo</option>
<option value="Terracina">Terracina</option>
<option value="Pontecorvo">Pontecorvo</option>
<option value="Capua">Capua</option>
<option value="Sessa Aurunca">Sessa Aurunca</option>
<option value="Gaeta">Gaeta</option>
<option value="Sora">Sora</option>
<option value="Verona">Verona</option>
<option value="Rijeka">Rijeka</option>
<option value="In Nave">In Nave</option>
</select><br />
Data funerale:<br />
<script language="javascript" type="text/javascript" src="datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
<input id="demo1" type="text" size="25"><a href="javascript:NewCal('demo1','ddmmyyyy')"><img src="http://virgus87.altervista.org/images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a><br /><br />
<input type="submit" value="Crea certificato di Funerale" name="submit">
</form>
<?
} else {
echo "Il nuovo fedele dell'Altissimo chiamato ".$nome.",<br />";
echo "dal ".$grado." <i>".$officiante."</i><br />";
echo "nella Parrocchia di ".$diobat.", Arcidiocesi di ".$arcibat.",<br />";
echo "in data ".$databat.".<br />";
}
?>
<html>
<script>
window.onload = function () {
print();
}
</script>
<style type="text/css">
div#container { width: 500px; height: 600px;}
p#dichiarazione{text-align:center; font-size:1.2em; position:relative; top: 350px;}
@font-face {
font-family: "12th c. Fancy Caps";
src: url(http://dl.dafont.com/dl/?f=12th_century_caps) format("truetype");
}
h1 { font-family: "12th c. Fancy Caps", sans-serif }
</style>
<div id="container" style='position: relative;'>
<img src='http://iabasic1.altervista.org/images/certificato_funerale.jpg' style='position: absolute;top:0;lef:0;z-index: -1;'/>
<p id="dichiarazione">
<i>
<b> <BODY TEXT="#8B0000"> Il fedele dell'Altissimo chiamato <br /> <?php echo $nome=$_POST["nome"] ; ?> <br /> dopo la prematura morte, <br /> ha ricevuto il sacramento del funerale, <br />
dal <?php echo $grado=$_POST["grado"]; ?> <?php echo $officiante=$_POST["officiante"]; ?><br />
nella Parrocchia di <?php echo $diofun=$_POST["diofun"]; ?>, Arcidiocesi di <?php echo $arcifun=$_POST["arcifun"]; ?>, <br />
in data <?php echo $datafun=$_POST["datafun"]; ?>.<br />
</b>
</i>
</p>
</div>
</html>
<?php
/**
* Returns with of a line.
* @param array $boudning_box Bounding box
* @return Width of the box
*/
function line_width($bounding_box) {
return abs($bounding_box[2] - $bounding_box[0]);
}
/**
* Returns height of a line.
* @param array $boudning_box Bounding box
* @return Height of the box
*/
function line_height($bounding_box) {
return abs($bounding_box[1] - $bounding_box[5]);
}
/**
* Writes a line of text
* @param resrouce $image PHP GD image
* @param int $size Font size
* @param int|string $x X-coordinate or 'LEFT', 'CENTER', 'RIGHT'
* @param int $y Y-coordinate
* @param int $color Color index
* @param string $font Path to the font
* @param string $text Text to write
* @return Bounding box
*/
function write_line($image, $size, $x, $y, $color, $font, $text) {
$bbox = imagettfbbox($size, 0.0, $font, $text);
$width = line_width($bbox);
$height = line_height($bbox);
if ($x == 'LEFT') {
$x = 0;
} else if ($x == 'CENTER') {
$x = (imagesx($image) - $width) / 2.0;
} else if ($x == 'RIGHT') {
$x = imagesx($image) - $width;
}
imagettftext($image, $size, 0.0, $x, $y + $height, $color, $font, $text);
return $bbox;
}
/**
* Writes multiples lines of text.
* @param resrouce $image PHP GD image
* @param int $size Font size
* @param int|string $x X-coordinate or 'LEFT', 'CENTER', 'RIGHT'
* @param int $y Y-coordinate
* @param int $color Color index
* @param string $font Path to the font
* @param array $text Array of lines to write
* @param int $padding Space between lines
*/
function write_lines($image, $size, $x, $y, $color, $font, $text, $padding = 0) {
foreach ($text as $line) {
$bbox = write_line($image, $size, $x, $y, $color, $font, $line);
$y += line_height($bbox) + $padding;
}
}
// Imposta lo header
header('Content-type: image/png');
// Legge i dati
$nome = $_POST['nome'];
$grado = $_POST['grado'];
$officiante = $_POST['officiante'];
$diocesi = $_POST['diofun'];
$arcidiocesi = $_POST['arcifun'];
$data = $_POST['datafun'];
// Legge l'immagine di sfondo ed imposta il colore del testo
$image = imagecreatefromjpeg("http://i.imgur.com/vOZBXEo.jpg");
$color = imagecolorallocate($image, 0x8B, 0x00, 0x00);
// Imposta le righe di testo da scrivere
$text = array(
"Il fedele dell'Altissimo chiamato",
$nome,
"dopo la prematura morte,",
"ha ricevuto il sacramento del funerale,",
"dal $grado$officiante",
"nella Parrocchia di $diocesi, Arcidiocesi di $arcidiocesi,",
"in data $data"
);
// Scrive il testo
write_lines($image, 14, 'CENTER', 350, $color, "http://www.princexml.com/fonts/larabie/kimberle.ttf", $text, 5);
// Mostra l'immagine
imagepng($image);