????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.135.190.40 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/icad.astacus.se/archive/viewer/ |
Upload File : |
<?php //error_reporting(E_ALL); //ini_set('display_errors', 1); session_start(); $CompanyId = $_SESSION['ASTACUS_SSO_INFO'][4]; $CustomerId = $CompanyId ; if($CustomerId == ""){ $CustomerId = $_GET['CustomerId']; $_SESSION['ASTACUS_SSO_INFO'][4] = $_GET['CustomerId']; } $target_encoding = "ISO-8859-1//IGNORE"; if($_GET['external'] == "true"){ //http://www.icad.astacus.se/archive/viewer/?file=Ritningsarkiv/32-1-2-31.pdf $product_nbr = $_GET['product_nbr']; $sql = "SELECT * FROM ICADARCHIVEParameterData WHERE Value = '$product_nbr'"; $link = mysql_connect ("localhost", "root", "root123"); mysql_select_db ("vpa"); $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)){ $FilePath = $row['FilePath']; } $FilePath = str_replace("archive","archive/icad_viewer_files",$FilePath); $FilePath = substr($FilePath,0,strlen($FilePath)-4).".jpg"; $temp = "/var/www/icad_files/$CustomerId/archive/icad_viewer_files/"; $file3 = str_replace($temp,"",$FilePath); $FileHash = $_GET['FileHash']; $file_new = urlencode($file3); }else{ $file3 = $_GET['file']; $FileHash = $_GET['FileHash']; $file_new = urlencode($file3); } function jpeg_dpi($filename) { if ( exif_imagetype($filename) != IMAGETYPE_JPEG ) { return false; } else { $exif = exif_read_data($filename, 'IFD0'); } $x = $y = 0; if ( isset($exif['XResolution']) && isset($exif['YResolution']) ) { $x = intval(preg_replace('@^(\\d+)/(\\d+)$@e', '$1/$2', $exif['XResolution'])); $y = intval(preg_replace('@^(\\d+)/(\\d+)$@e', '$1/$2', $exif['YResolution'])); } if ( !$x && !$y && $fp = fopen($filename, 'r') ) { $string = fread($fp, 20); fclose($fp); $data = bin2hex(substr($string, 14, 4)); $x = hexdec(substr($data, 0, 4)); $y = hexdec(substr($data, 4, 4)); } if ( $x || $y ) { return array($x, $y); } return false; } $file = substr($file3,0,strlen($file3)-4).".jpg"; $FilePath = "/var/www/icad_files/$CustomerId/archive/icad_viewer_files/".$file; $FilePath = str_replace("//","/",$FilePath ); if(!file_exists($FilePath)){ //$FilePath = iconv("ISO-8859-1//IGNORE","UTF-8",$FilePath); //$FilePath = iconv("UTF-8", "ISO-8859-1//IGNORE",$FilePath); //echo("3:".$FilePath ); if(!file_exists($FilePath)){ //echo("4:".$FilePath ); //$FilePath $file = substr($file3,0,strlen($file3)-4).".pdf"; $FilePath = "/var/www/icad_files/$CustomerId/archive/icad_viewer_files/".$file; $FilePath = str_replace("//","/",$FilePath ); $im = new imagick(); $im->setResolution(300,300); //$FilePath = urldecode($FilePath); $im->readImage($FilePath.'[0]'); $im->contrastImage(1); /* FIX DPI WIDTH*/ $d = $im->getImageGeometry(); $biggest = $d['width']; $h = $d['height']; if($h > $biggest){ $biggest = $h; } if($biggest > 3900){ $scale = (3900 / $biggest); $im->destroy(); $im2 = new imagick(); $im2->setResolution(300*$scale,300*$scale); $im2->readImage($FilePath.'[0]'); $im2->setImageFormat( "jpg" ); $FilePath = substr($FilePath,0,strlen($FilePath)-4).".jpg"; if(file_exists($FilePath)){ unlink($FilePath); } $im2->writeImages($FilePath,false); }else{ $im->setImageFormat( "jpg" ); $FilePath = substr($FilePath,0,strlen($FilePath)-4).".jpg"; if(file_exists($FilePath)){ unlink($FilePath); } $im->writeImages($FilePath,false); } } /* FIX DPI WIDTH END*/ } // Fix if extension is capital /* if(!file_exists($FilePath)){ $FilePath = substr($FilePath,0,strlen($FilePath)-4).".JPG"; }*/ if(file_exists($FilePath)){ $FilePath = urldecode($FilePath); $dpi = jpeg_dpi($FilePath); $dpi = $dpi[0]; $scale = 1/($dpi/ 2.54); $link = mysql_connect ("localhost", "root", "root123"); mysql_select_db ("vpa"); $sql = "Select * from ICADARCHIVEParameterData,ICADARCHIVEParameters where ICADARCHIVEParameterData.ParameterId = ICADARCHIVEParameters.ParameterId and FileHash = '$FileHash' and ParameterName = 'Skala'"; $result = mysql_query($sql); $value = "1:100"; while ($row = mysql_fetch_assoc($result)){ $value = $row['Value']; $_SESSION['cadfile'] = $row['FilePath']; } if($value == ""){ $value = "1:100"; } $skala = $value; if($skala == "1:1"){ $scale = $scale*0.01; }else if($skala == "1:10"){ $scale = $scale*0.1; }else if($skala == "1:20"){ $scale = $scale*0.2; }else if($skala == "1:50"){ $scale = $scale*0.5; }else if($skala == "1:100"){ $scale = $scale; }else if($skala == "1:200"){ $scale = $scale*2; }else if($skala == "1:400"){ $scale = $scale*4; }else if($skala == "1:800"){ $scale = $scale*8; } $_SESSION['drawing'] = $file3; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0014)about:internet --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <!-- Smart developers always View Source. This application was built using Adobe Flex, an open source framework for building rich Internet applications that get delivered via the Flash Player or to desktops via Adobe AIR. Learn more about Flex at http://flex.org // --> <head> <title>iCAD Viewer: <?php echo(iconv( $target_encoding,"UTF-8", $file3));?> </title> <meta name="google" value="notranslate" /> <meta name="viewport" content="width=device-width; minimum-scale=1.0; initial-scale=1.0; maximum-scale=1.0;"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Include CSS to eliminate any default margins/padding and set the height of the html element and the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as the percentage of the height of its parent container, which has to be set explicitly. Fix for Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show if JavaScript disabled. --> <style type="text/css" media="screen"> html, body { height:100%; } body { margin:0; padding:0; overflow:auto; text-align:center; background-color: #ffffff; } object:focus { outline:none; } #flashContent { display:none; } </style> <!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens --> <!-- BEGIN Browser History required section > <link rel="stylesheet" type="text/css" href="history/history.css" /> <script type="text/javascript" src="history/history.js"></script> <! END Browser History required section --> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. var swfVersionStr = "10.2.0"; // To use express install, set to playerProductInstall.swf, otherwise the empty string. var xiSwfUrlStr = ""; var flashvars = { scale: <?php echo(Round($scale,8));?>, blueprint: 'getfile.php?file=<?php echo(substr($file_new,0,strlen($file_new)-4).".jpg");?>&CustomerId=<?php echo($CustomerId);?>', <?php if(file_exists("/var/www/icad.astacus.se/archive/viewer/config/".$CustomerId.".xml")){echo("xmlurl: 'config/".$CustomerId.".xml'");}else{echo("xmlurl: 'config/config.xml'");}?> }; <?php $_SESSION['ICADCOPYFILE'] = substr($file3,0,strlen($file3)-4).".jpg";?> var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; params.allowfullscreen = "true"; //params.wmode = "direct"; var attributes = {}; attributes.id = "GJFusionDemo"; attributes.name = "GJFusionDemo"; attributes.align = "middle"; swfobject.embedSWF( "Main.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. swfobject.createCSS("#flashContent", "display:block;text-align:left;"); </script> </head> <body> <div id="flashContent"></div> </body> </html> <?php }else{ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> <style type="text/css"> .Rub { font-family: Verdana, Geneva, sans-serif; } .Rub { color: #999; font-family: Verdana, Geneva, sans-serif; text-align: center; font-size: 24px; } </style> </head> <body> <h1 class="Rub"><br /> <br /> <br /> <br /> <br /> <br /> <br /> Filen är inte tillgänglig. Vänligen kontakta Astacus på telefon: 013 - 485 01 91<br /><br />DEBUG INFO: <?php echo($FilePath);?></h1> </body> </html> <?php }?>