79 lines
2.9 KiB
PHP
79 lines
2.9 KiB
PHP
|
<?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>
|