Réalisation de api special client word

This commit is contained in:
Damien LASSERRE 2011-05-11 15:19:26 +00:00
parent 6bf7f4bfc9
commit 7baf32fec7
2 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,79 @@
<?php
if($_REQUEST['upload'])
{
require_once 'print/print.php';
ob_start();
echo '<link rel="stylesheet" href="css/rsynthese.css">';
echo '<link rel="stylesheet" href="css/main.css">';
echo '<style>';
echo '#center h1{background-color:'.$_POST['couleurh1'].';color:'.$_POST['texth1'].'}';
echo '#center h2{background-color:'.$_POST['couleurh2'].';color:'.$_POST['texth2'].'}';
echo '</style>';
echo '<img src="./img/logo.jpg" width="12%" style="float:right" />';
echo $_POST['titre'];
echo $_POST['content'];
$siret = $_GET['siret'];
$siren = substr($_GET['siret'], 0, 9);
$idEntreprise = $_GET['idEntreprise'];
include('pages/rsynthese.php');
$content = ob_get_contents();
ob_end_clean();
file_put_contents('../cache/pages/rapport-'.$siren.'.html', $content);
wkhtmltopdf('../cache/pages/rapport-'.$siren.'.html');
} else {
?>
<div align="center" style="height:305px;background-image:url('./img/customRapport/logo.jpg');background-repeat:no-repeat;background-position:center">
<form name="uploadForm" id="uploadForm" method="POST" action="./?page=customRapport&siret=<?php echo $_GET['siret'];?>&idEntreprise=<?php echo $_GET['idEntreprise'];?>">
<table style="margin-top:30px" id="remove">
<tr>
<td><b>Titre</b></td>
</tr>
<tr>
<td><input style="width:377px" type="text" name="titre" /></td>
</tr>
<tr>
<td valign="top"><b>Contenu diver</b></td>
</tr>
<tr>
<td><textarea style="width:377px;height:90px" name="content" value="Entrer un texte..."></textarea></td>
</tr>
<tr>
<td><b>couleur des grands titres</b></td>
</tr>
<tr>
<td>Fond : <input type="text" name="couleurh1" /> Texte <input type="text" name="texth1" /> ex : black</td>
</tr>
<tr>
<td><b>couleur des sous titres</b></td>
</tr>
<tr>
<td>Fond : <input type="text" name="couleurh2" /> Texte <input type="text" name="texth2" /> ex : black</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="upload" value="Envoyer" /></td>
</tr>
<tr>
<td id="uploadOutput"></td>
</tr>
</table>
</form>
</div>
<?php }?>
<script type="text/javascript" src="js/jquery.form.js">
</script type="text/javascript">
<script>
$('#uploadForm').ajaxForm({
beforeSubmit: function() {
$('#uploadOutput').html('Envoi en cours...');
},
success: function(data) {
$('#remove').html('<center>Votre fichier est prêt pour être téléchargé !<br /><a target="_blank" href="./servefile.php?q=customRapport/<?php echo 'rapport-'.$siren.'.pdf';?>">Télécharger</a></center>');
$('#uploadOutput').html('<strong>' + data + '</strong>');
}
});
$('#dialogcustomrapport').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog("close"); }
} ] });
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB