window.location=\"index.php\""; } else { if ($DOWNLOAD=="") { print ""; } else { $requete_LOAD = "SELECT * FROM com_com_detail WHERE DET_REF='$ART'"; $resultat_LOAD = mysql_query($requete_LOAD); while($ligne_LOAD=mysql_fetch_array($resultat_LOAD)) { $DET_ID = "{$ligne_LOAD['DET_ID']}"; $requete_LOAD2 = "SELECT * FROM com_commandes WHERE COM_ID='$DET_ID' AND COM_CLIENT='$CID' AND COM_STATUT='VALIDE'"; $resultat_LOAD2 = mysql_query($requete_LOAD2); while($ligne_LOAD2=mysql_fetch_array($resultat_LOAD2)) { $COM_ID = "{$ligne_LOAD2['COM_ID']}"; $OKURL="OK"; }} if ($OKURL=="OK") { $filename = "DOWNLOAD/$DOWNLOAD"; if(file_exists($filename)) { $fp = fopen ($filename, 'r'); $content = fread($fp, filesize($filename)); fclose ($fp); $zip = new zipfile(); $zip->addfile($content, $filename); $archive = $zip->file(); header('Content-Type: application/x-zip'); header('Content-Disposition: inline; filename=DOWNLOAD.zip'); echo $archive; } else { print ""; }}}} ?>