2011-06-13 12:01:10 +00:00
< ? php
2011-05-11 15:19:26 +00:00
if ( $_REQUEST [ 'upload' ])
{
2011-06-13 12:01:10 +00:00
header ( 'Content-type: text/html; charset=UTF-8' );
2011-05-11 15:19:26 +00:00
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>' ;
2011-05-17 06:35:18 +00:00
echo '.confidentiel {display:none}' ;
2011-05-11 15:19:26 +00:00
echo '#center h1{background-color:' . $_POST [ 'couleurh1' ] . ';color:' . $_POST [ 'texth1' ] . '}' ;
2011-05-17 06:35:18 +00:00
if ( $_POST [ 'logo_background' ])
2011-06-13 12:01:10 +00:00
echo '#center {background-image:url(./img/customRapport/logo_background.png);background-repeat:repeat-y}' ;
2011-05-11 15:19:26 +00:00
echo '#center h2{background-color:' . $_POST [ 'couleurh2' ] . ';color:' . $_POST [ 'texth2' ] . '}' ;
echo '</style>' ;
2011-06-13 12:01:10 +00:00
echo '<img src="./img/customRapport/logo.jpg" width="12%" /><br />' ;
2011-05-17 06:35:18 +00:00
echo $_POST [ 'coordonnees' ];
2011-06-13 12:01:10 +00:00
echo '<center style="font-size:17px">' . $_POST [ 'societe_name' ] . ' Enquête Financière</center><br />' ;
2011-05-11 15:19:26 +00:00
$siret = $_GET [ 'siret' ];
$siren = substr ( $_GET [ 'siret' ], 0 , 9 );
$idEntreprise = $_GET [ 'idEntreprise' ];
2011-06-13 12:01:10 +00:00
@ include ( 'pages/rsynthese.php' );
echo 'Les équipes d\'Order To Cash se tiennent à votre disposition pour vous assister dans l\'interprétation de ces données au 01 47 90 94 31 ou par mail à l\'adresse suivante : contact@ordertocash.fr ' ;
2011-05-11 15:19:26 +00:00
$content = ob_get_contents ();
2011-05-17 06:35:18 +00:00
$file_put = str_replace ( '<a href' , '<a title' , $content );
$file_put = str_replace ( 'logo_indiscore.png' , '' , $file_put );
2011-05-11 15:19:26 +00:00
ob_end_clean ();
2011-06-13 12:01:10 +00:00
file_put_contents ( '../cache/pages/rapport-' . $siren . '.html' , utf8_decode ( $file_put ));
wkhtmltopdf ( '../cache/pages/rapport-' . $siren . '.html' );
2011-05-11 15:19:26 +00:00
} 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 >
2011-05-17 06:35:18 +00:00
< td align = " center " id = " uploadOutput " ></ td >
</ tr >
< tr >
< td >< b > Coordonnées adresse </ b ></ td >
</ tr >
< tr >
< td >< input style = " width:377px " type = " text " name = " coordonnees " value = " <b>Order to Cash</b><br /> 70 AVENUE DE LA MARNE <b><br />92600 ASNIERES SUR SEINE</b> " /></ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
2011-06-13 12:01:10 +00:00
< td valign = " top " >< b > Nom de la société </ b ></ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
2011-06-13 12:01:10 +00:00
< td >< input type = " text " name = " societe_name " value = " Nom de la société. " /></ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
2011-05-17 06:35:18 +00:00
< td >< b > Logo en fond ecran : </ b >< input type = " checkbox " name = " logo_background " value = " true " /></ td >
</ tr >
< tr >
< td >< b > Logo à :</ b > Gauche < input checked = " checked " type = " radio " name = " image " value = " left " /> Droite < input value = " right " type = " radio " name = " image " /></ td >
</ tr >
< tr >
2011-06-13 12:01:10 +00:00
< td > </ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
< td >< b > couleur des grands titres </ b ></ td >
</ tr >
< tr >
2011-05-17 06:35:18 +00:00
< td > Fond : < input value = " #DFDB00 " type = " text " name = " couleurh1 " /> Texte < input value = " black " type = " text " name = " texth1 " /> ex : black </ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
< td >< b > couleur des sous titres </ b ></ td >
</ tr >
< tr >
2011-05-17 06:35:18 +00:00
< td > Fond : < input value = " #EFED9A " type = " text " name = " couleurh2 " /> Texte < input value = " black " type = " text " name = " texth2 " /> ex : black </ td >
2011-05-11 15:19:26 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input type = " submit " name = " upload " value = " Envoyer " /></ td >
</ tr >
</ table >
</ form >
</ div >
< ? php } ?>
< script type = " text/javascript " src = " js/jquery.form.js " >
</ script type = " text/javascript " >
< script >
$ ( '#uploadForm' ) . ajaxForm ({
beforeSubmit : function () {
2011-05-17 06:35:18 +00:00
$ ( '#uploadOutput' ) . html ( '<b style="color:green">Votre document est en cours de chargement...</b>' );
2011-05-11 15:19:26 +00:00
},
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 >