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 92 93 94 95 96 97 98 99 100 101 102 103 104 105
| <?
//*************************************************************
// Auteur :
// Nom : converPDF.php
// Description => Liste les documents à convertir et propose la
// conversion PDF
// Pg origine : modules_affich.php
//*************************************************************
// Inclusion de la bibliothèque des fonctions
include("../lib/fonctions.php");
// contrôles sécurité session
ctrl_session();
if ($conver == 1 && isset($_POST['fichier']))
{
// Contrôle l'existance du fichier.pdf
$entry = substr($_POST['entry'],0,strlen($_POST['entry'])-4).'.pdf';
if (file_exists("v:\\Intranet\\$entry"))
echo '<script>alert("Le fichier existe déjà.")</script>';
else
{
conver_pdf($_POST['fichier']);
// Contôle la réussite de la conversion
$conver_ok = false;
while ($conver_ok == false)
{
if (file_exists("v:\\Intranet\\$entry"))
$conver_ok = true;
}
}
}
// Inclusion de l'entete de page
include("../entetepied/hautpage.php");
// Titre
$ret.="<div style='position:absolute; left:112px; top:130px; width:800; text-align:center;' class='titre7'>";
$ret.="- Conversion PDF des ".$dossier." -";
$ret.="</div>";
// Retour
$ret.='<div style="position:absolute; left:112px; top:130px; width:800; text-align:right;">';
$ret.='<input id="retour" type="submit" class="retour" onclick="window.location=\'../admin/modules_admin.php?admin_id='.$admin_id.'\'" onmousedown="this.className=\'retour_on\'" onmouseup="this.className=\'retour\'" value=" ">';
$ret.='</div>';
// Zone d'affichage des documents
$ret.="<div style='position:absolute; left:112px; top:160px;'>";
$d = dir("v:/Intranet/$dossier");
$pos_top = 150;
$ligne = 0;
$ret.='<form name="conversion" action="../admin/converPDF.php?dossier='.$dossier.'&conver=1" method="post">';
$ret.='<div>';
if ($conver == 1)
{
$ret.='<input name="fichier" type="hidden" value="'.$_POST['fichier'].'">';
$ret.='<input name="entry" type="hidden" value="'.$_POST['entry'].'">';
}
else
{
$ret.='<input name="fichier" type="hidden" value="">';
$ret.='<input name="entry" type="hidden" value="">';
}
$ret.='</div>';
// Zone d'info sur la conversion en cours
$ret.="<div id='info_conver' style='position:absolute; visibility:hidden; left:175px; top:110px;' onmouseout='montre(\"info_conver\")'>";
$ret.="<table width='450' height='200' border='1' bgcolor='#FFFFFF' bordercolor='#7E7E7E'>";
$ret.="<tr><td width='450' height='200' align='center' valign='middle' class='normal11'>La conversion est en cours ...<br><br><img src='http://www.imagif.com/Info/Cd/cd12.gif'></td></tr>";
$ret.="</table>";
$ret.="</div>";
// Liste des documents à consulter
$ret.='<table width="800" border="0">';
while($entry=$d->read())
{
if ($entry <> "." && $entry <> ".." && substr($entry,strlen($entry)-4,strlen($entry)) == ".doc")
{
$fichier = "V:\\\\Intranet\\\\".$dossier."\\\\".$entry;
$ret.="<tr>";
$pos_top+=20;
if ($ligne%2 == 0)
{
$ret.="<td width='25' height='25'><input type='image' name='cpdf' src='../images/pdf.gif' onmousedown='this.src=\"/images/pdf_on.gif\"' onmouseup='this.src=\"/images/pdf.gif\"' onclick='montre(\"info_conver\");document.getElementById(\"fichier\").value=\"".$fichier."\";document.getElementById(\"entry\").value=\"".$entry."\"' alt='Convertir' height='25' width='25'></td>";
$ret.="<td width='780' height='25' class='normal12' style='background-color:#FFFFD5;border-color:#FFFFD5;' onmouseover='javascript:this.className=\"normal12_g\"' onmouseout='javascript:this.className=\"normal12\"' onclick='ouverture_word(\"v:Intranet/$dossier/".$entry."\")'>$entry ".conver_base_chaine($formulaire[form_libelle])."</td>";
}
else
{
$ret.="<td width='25' height='25'><input type='image' name='cpdf' src='../images/pdf.gif' onmousedown='this.src=\"/images/pdf_on.gif\"' onmouseup='this.src=\"/images/pdf.gif\"' onclick='montre(\"info_conver\");document.getElementById(\"fichier\").value=\"".$fichier."\";document.getElementById(\"entry\").value=\"".$entry."\"' alt='Convertir' height='25' width='25'></td>";
$ret.="<td width='780' height='25' class='normal12' onmouseover='javascript:this.className=\"normal12_g\"' onmouseout='javascript:this.className=\"normal12\"' onclick='ouverture_word(\"v:Intranet/$dossier/".$entry."\")'>$entry ".conver_base_chaine($formulaire[form_libelle])."</td>";
}
$ligne++;
$ret.="</tr>";
}
}
$ret.='</table>';
$d->close();
$ret.='</form>';
$ret.='</div>';
$ret.='</body></html>';
echo $ret;
?> |