????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.22.248.193
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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/icad.astacus.se/archive/start_o.php
<?php

$projectId = $_GET['projectId'];
$CompanyId = $_SESSION['ASTACUS_SSO_INFO'][4];

$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");

$sql = "select * from ICADARCHIVEPermissions where SystemUserId = ".$_SESSION['ASTACUS_SSO_INFO'][0];
	
$result = mysql_query($sql);
$be1 = false;
$be2 = false;
$be3 = false;
$be4 = false;
$be5 = false;
$be6 = false;
$be7 = false;
$be8 = false;
$be9 = false;
while ($row = mysql_fetch_assoc($result)){ 
	if($row['Permission'] == 1){
		$be1 = true;
	}else if($row['Permission'] == 2){
		$be2 = true;	
	}else if($row['Permission'] == 3){
		$be3 = true;	
	}else if($row['Permission'] == 4){
		$be4 = true;	
	}else if($row['Permission'] == 5){
		$be5 = true;	
	}else if($row['Permission'] == 6){
		$be6 = true;	
	}else if($row['Permission'] == 7){
		$be7 = true;	
	}else if($row['Permission'] == 8){
		$be8 = true;	
	}else if($row['Permission'] == 9){
		$be9 = true;	
	}
}

?>

<link href="../main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="calendar.js"></script>
 <script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<script type="text/javascript">
var CBoxCount = 10000;   // set to number of checkboxes to evaluate (0...n)

function checkAll(flag) {
	
  var IDS = '';
  for (i = 0; i<CBoxCount; i++) {
    IDS = 'checkbox'+i;

    document.getElementById(IDS).checked = flag;
  }
}

function MM_openBrWindow(theURL,winName) { //v2.0

  window.open(theURL,winName,'status=yes','width='+screen.width,'height='+screen.height);
}


function MM_openBrWindow2(theURL,winName,extra) { //v2.0

  window.open(theURL,winName,extra);
}

	function deleteFile(stuff){
			
			
			
	
	    var retVal = confirm("Vill du verkligen ta bort filen/mappen?");
	  
		   
		if( retVal == true ){
			 document.location.href= stuff;
			 return true;
		}
	
			
			
		}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
</script>
<script src="sorttable.js"></script>
<title></title>
<body onLoad="showClockSWE();">
<style type="text/css"> 
.ToolText{position:relative;color: #000000; text-decoration:none } 
.ToolTextHover{position:relative;color: #000000; text-decoration:none} 
.ToolText span{display: none;} 

.ToolTextHover span{ 
 
  display:block; 
  position:absolute; 
  border:1px solid black; 
  top:0em; 
  left:50px; 
  background-color:gray; color:white; 
  text-align: center; 
  width:250px;
  text-decoration:none;
  color:#000000;
  z-index:100;
  opacity:1.0;
  
} 
</style>

<style type="text/css">
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
-->
</style>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="25">&nbsp;</td>
    <td width="964"><table width="820" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="5" valign="top"><span class="heading2"><?php echo($a1);?></span><br>
          <table width="936" border="0" cellpadding="0" cellspacing="0">
            <tr >
              <td width="76" class="text"><?php echo($a2);?></td>
              <td width="181" class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][1]);?> (<?php echo($_SESSION['ASTACUS_SSO_INFO'][10]);?>) </td>
              <td width="119" class="text"><?php echo($a5);?></td>
              <td width="189" class="text"><span class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][6]);?></span></td>
              <td width="3" rowspan="4" bgcolor="#999999"></td>
              <td width="366" rowspan="4" valign="top" class="textthin">
              
              
              
                    <?php 
					if($_SESSION['ASTACUS_SSO_INFO'][4] == "1179"){
					?>
                     
                   
                     <?php }else{ ?>
                    <br>
                <table width="233" border="0" align="right" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="59" align="left"><span class="heading2"><a href="../customerzon/"><img src="../images/Back-Arrow.jpg" alt="" width="46" height="45" border="0"></a></span></td>
                    <td width="141"><span class="heading2"> Till iCAD Projekt</span></td>
                  </tr>
                </table>
                     <?php }?>
              
                
                
                
                </td>
            </tr>
            <tr >
              <td class="text"><?php echo($a3);?></td>
              <td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][2]);?></td>
              <td class="text"><?php echo($a6);?></td>
              <td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][7]);?></td>
            </tr>
            <tr >
              <td class="text"><?php echo($a4);?></td>
              <td class="textthin"><a href="skype:<?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?>?call"><img src="http://mystatus.skype.com/smallicon/<?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?>" alt="My status" width="16" height="16" align="absmiddle" style="border: none;" /></a> <?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?></td>
              <td class="text"><?php echo($a7);?></td>
              <td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][8]);?> <?php echo($_SESSION['ASTACUS_SSO_INFO'][9]);?></td>
            </tr>
            <tr class="text">
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              </tr>
          </table>          
          <hr size="1">
          <table width="950" height="64" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td valign="top" background="images/tabb1.jpg"><table width="850" height="23" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="5" height="23">&nbsp;</td>
                  <td width="111" valign="bottom" class="blacklink"><div align="center"><a href="?" class="blacklink">Arkiv</a></div></td>
                  <td width="22" valign="bottom" class="blacklink"><div align="center"></div></td>
                  <td width="106" valign="bottom" class="<?php if($be6 == true){echo("blacklink");}else{echo("graylink");}?>"><div align="center"><a href="<?php if($be6 == true){echo("?page=rattigheter");}else{echo("#");}?>" class="<?php if($be6 == true){echo("blacklink");}else{echo("graylink");}?>">R&auml;ttigheter</a></div></td>
                  <td width="18" valign="bottom" class="blacklink"><div align="center"></div></td>
                  <td width="107" valign="bottom" class="<?php if($be7 == true){echo("blacklink");}else{echo("graylink");}?>"><div align="center"><a href="<?php if($be7 == true){echo("?page=behorigheter");}else{echo("#");}?>" class="<?php if($be7 == true){echo("blacklink");}else{echo("graylink");}?>">Beh&ouml;righeter</a></div></td>
                  <td width="22" class="blacklink">&nbsp;</td>
                  <td width="103" valign="bottom" class="<?php if($be8 == true){echo("blacklink");}else{echo("graylink");}?>"><div align="center"><a href="<?php if($be8 == true){echo("?page=installningar");}else{echo("#");}?>" class="<?php if($be8 == true){echo("blacklink");}else{echo("graylink");}?>">Inst&auml;llningar</a></div></td>
                  <td width="21" class="blacklink">&nbsp;</td>
                  <td width="104" valign="bottom" class="blacklink"><div align="center"></div></td>
                  <td width="138" class="blacklink">&nbsp;</td>
                  <td width="23" class="blacklink">&nbsp;</td>
                  <td width="70" class="blacklink">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="913" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="267" valign="top"><span class="heading2">Enkel s&ouml;kning i arkivet:</span><br>
                <span class="textthin">Ange ett s&ouml;kord i f&auml;ltet nedan och klicka p&aring; s&ouml;k:<br>
                <br>
                </span>
                <form name="form1" method="post" action="?action=search">
                  <span class="textthin">
                    <label for="select"></label>
                    
                    <select name="criteria" id="select" class="textthin">
                      <option value="1">Inneh&aring;ller</option>
                      <option value="2">Exakt</option>
                    </select>
                    
                    <input name="keyword" type="text" class="textthin" id="textfield" value="<?php echo($_POST['keyword']);?>" size="8">
                    <input name="button" type="submit" class="textthin" id="button" value="S&ouml;k">
                  </span>
                </form>
                <p class="textthin">S&ouml;kningen innefattar alla parametrar och filnamn. <br>
                  <br>
                  <br>
                </p></td>
              <td width="29">&nbsp;</td>
              <td width="617" valign="top"><span class="heading2">Avancerad s&ouml;kning i arkivet:</span><br>
                <span class="textthin">Ange parameter och ett s&ouml;kord.<br>
                <br>
                </span>
                <form name="form1" method="post" action="?action=advancedsearch">
                  <span class="textthin">
                    <label for="select"></label>
                    <select name="criteria1" class="textthin" id="select" >
                    
                    <?php
                    
							    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	
					$result = mysql_query($sql);
					$x = 1;
					while ($row = mysql_fetch_assoc($result)){ 
						$checked = "";
						if($_POST['criteria1'] == $row["ParameterId"]){
							$checked = "selected";
						}
						echo("<option value='".$row["ParameterId"]."'  $checked>".$row["ParameterName"]."</option>");
					}
					?>
                
                    </select>
                    <input name="keyword1" type="text" class="textthin" id="textfield2" value="<?php echo($_POST['keyword1']);?>" size="8">
                    och 
                    <select name="criteria2" class="textthin" id="select2">
                      <option value="0"> </option>
                       <?php
                    
							    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	
					$result = mysql_query($sql);
					$x = 1;
					while ($row = mysql_fetch_assoc($result)){ 
						$checked = "";
						if($_POST['criteria2'] == $row["ParameterId"]){
							$checked = "selected";
						}
						echo("<option value='".$row["ParameterId"]."' $checked>".$row["ParameterName"]."</option>");
					}
					?>
</select>
                    <input name="keyword2" type="text" class="textthin" id="textfield3" value="<?php echo($_POST['keyword2']);?>" size="8">
och 
                    <select name="criteria3" class="textthin" id="select3">
                      <option value="0"> </option>
                       <?php
                    
							    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	
					$result = mysql_query($sql);
					$x = 1;
					while ($row = mysql_fetch_assoc($result)){ 
						$checked = "";
						if($_POST['criteria3'] == $row["ParameterId"]){
							$checked = "selected";
						}
						echo("<option value='".$row["ParameterId"]."'  $checked>".$row["ParameterName"]."</option>");
					}
					?>
                    </select>
                    <input name="keyword3" type="text" class="textthin" id="textfield4" value="<?php echo($_POST['keyword3']);?>" size="8">
                    <input name="button2" type="submit" class="textthin" id="button2" value="S&ouml;k">
                    </span>
                </form>
                <p class="textthin">S&ouml;kningen innefattar de ovan valda parametrarna.<br>
                  <br>
                </p></td>
            </tr>
          </table>
          <hr size="1"></td>
        </tr>
    </table>      
    </td>
    <td width="11">&nbsp;</td>
  </tr>
</table>
<br>

<?php

	
			    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	
	 
	
				$result = mysql_query($sql);
				$x = 1;
				while ($row = mysql_fetch_assoc($result)){ 

					$x++;
	
				}
				
				$table_width = 1000 + 122*($x-6);
				
				if(	$table_width < 1000){
					$table_width = 1000;	
				}
			
				
				

?>
<table width="<?php echo($table_width);?>" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="276" valign="top" class="heading2"><hr size="1">
      <form name="form2" method="post" action="?page=delochicad&path=<?php echo($_GET['path']);?>">
        <?php if($_GET['action'] == ""){ ?>
        <?php if($be1 == true){?>
        <p class="textthin"><?php echo($a110);?><br>
          <?php echo($a111);?> <a href="?path=<?php 
				
				
				
				$path = dirname($_GET['path']);
				if($path == "/"){
					$path = "";
					
				}
				
				$count_files = 0;
				echo($path);
				
				?>">
            <?php 
				
				
				
				// Get parameters
				$Parameter1 = "";
				$Parameter2 = "";
				$Parameter3 = "";
				$Parameter4 = "";
				$Parameter5 = "";
				$Parameter6 = "";
				$Parameter7 = "";
				$Parameter8 = "";
				$Parameter9 = "";
				$Parameter10 = "";
				$Parameter11 = "";
				$Parameter12 = "";
				$Parameter13 = "";
				$Parameter14 = "";
				$Parameter15 = "";
				
			    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	
	 
	
				$result = mysql_query($sql);
				$x = 1;
					$nbr_par = 0;
				while ($row = mysql_fetch_assoc($result)){ 
					if($x == 1){
						$Parameter1 = $row["ParameterName"];
					}else if($x == 2){
						$Parameter2 = $row["ParameterName"];
					}else if($x == 3){
						$Parameter3 = $row["ParameterName"];
					}
					else if($x == 4){
						$Parameter4 = $row["ParameterName"];
					}
					else if($x == 5){
						$Parameter5 = $row["ParameterName"];
					}
					else if($x == 6){
						$Parameter6 = $row["ParameterName"];
					}
					else if($x == 7){
						$Parameter7 = $row["ParameterName"];
					}
					else if($x == 8){
						$Parameter8 = $row["ParameterName"];
					}
					else if($x == 9){
						$Parameter9 = $row["ParameterName"];
					}
					else if($x == 10){
						$Parameter10 = $row["ParameterName"];
					}else if($x == 11){
						$Parameter11 = $row["ParameterName"];
					}else if($x == 12){
						$Parameter12 = $row["ParameterName"];
					}else if($x == 13){
						$Parameter13 = $row["ParameterName"];
					}else if($x == 14){
						$Parameter14 = $row["ParameterName"];
					}else if($x == 15){
						$Parameter15 = $row["ParameterName"];
					}
					
					$x++;
						$nbr_par++;
					$ParameterGroupId = $row["ParameterGroupId"];
				}
				
				$table_width = 1000 + 122*($nbr_par-5);
				if(	$table_width < 1000){
					$table_width = 1000;	
				}
				
				
				echo($_GET['path']);?>
            </a><br>
        </p>
        <table width="<?php echo($table_width);?>" height="21" border="0" align="center" cellpadding="0" cellspacing="0" class="sortable">
          <tr class="text">
            <td width="237"><?php echo($a2);?></td>
            <td width="118"><?php echo($Parameter1);?></td>
            <td width="120"><?php echo($Parameter2);?></td>
            <td width="108"><?php echo($Parameter3);?></td>
            <td width="108"><?php echo($Parameter4);?></td>
            <td width="122"><?php echo($Parameter5);?></td>
            
            <?php
            
			if($Parameter6 != ""){?>
            <td width="122"><?php echo($Parameter6);?></td>
            <?php	
				}
			?>
			
            
              <?php
            
			if($Parameter7 != ""){?>
            <td width="122"><?php echo($Parameter7);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter8 != ""){?>
            <td width="122"><?php echo($Parameter8);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter9 != ""){?>
            <td width="122"><?php echo($Parameter9);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter10 != ""){?>
            <td width="122"><?php echo($Parameter10);?></td>
            <?php	
				}
			?>
			
               <?php
            
			if($Parameter11 != ""){?>
            <td width="122"><?php echo($Parameter11);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter12 != ""){?>
            <td width="122"><?php echo($Parameter12);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter13 != ""){?>
            <td width="122"><?php echo($Parameter13);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter14 != ""){?>
            <td width="122"><?php echo($Parameter14);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter15 != ""){?>
            <td width="122"><?php echo($Parameter15);?></td>
            <?php	
				}
			?>
			
            
            
		
            
            
            <td width="29"><input type="checkbox" name="check1" id="check1" onClick="checkAll(this.checked)"></td>
            <td width="95">Markera alla</td>
          </tr>
          <?php 
				  
				  	function AddPath($PathToCreate){
						$iBreak = 0;
						$iBreak = strrpos($PathToCreate, "/");
						if($iBreak !== FALSE){
							$Parent = substr($PathToCreate, 0, $iBreak);
							if(!@chdir($Parent)){
								AddPath($Parent);
							}
						}
					
						if(!@chdir($PathToCreate)){
							mkdir($PathToCreate);
						}
					}
					
					

function count_files_recursive($path) {
 
    // use a normalize_path function here
    // to make sure $path contains an
    // ending slash
    // (-> http://codedump.jonasjohn.de/snippets/normalize_path.htm)
 

    $files = 0;
 
 if(substr($path,strlen($path)-1,1) != "/"){
 $path = $path."/";
 }
    // open dir:
    $dir = opendir($path);
    if (!$dir){return 0;}
 
    while (($file = readdir($dir)) !== false) {
 
        if ($file[0] == '.'){ continue; }
		
 
        if (is_dir($path.$file)){        
            // recursive:
            $files += count_files_recursive($path.$file.DIRECTORY_SEPARATOR);
        }
        else {
            // increase file count
            $files++;
        }
    }    
    // close dir:
    closedir($dir);
 
    return $files;
}
function GetFolderSize($d ="." ) {
    // &copy; kasskooye and patricia benedetto
    $h = @opendir($d);
    if($h==0)return 0;

    while ($f=readdir($h)){
        if ( $f!= "..") {
            $sf+=filesize($nd=$d."/".$f);
            if($f!="."&&is_dir($nd)){
                $sf+=GetFolderSize ($nd);
            }
        }
    }
    closedir($h);
    return $sf ;
} 



				  
				   $path = "/var/www/icad_files/$CompanyId/archive/".$_GET['path']."/";
				   AddPath($path);
				  
				  
				  if($be1 == "true"){
					  $view_viewer_files = "___icad_viewer_files___";
					  }else{
						  $view_viewer_files = "icad_viewer_files";
						  } 
				   
				
				   $dir_handle = @opendir($path);
				   $x = 0;
				   $i = 0;
				   $narray=array();

				   while (false !== ($file = readdir($dir_handle))){
				  
				    if(substr($file,0,1) != "." && $file !=  $view_viewer_files){
					
					 $narray[$i]=$file;
					 $i++;
					}					
				}
				
				sort($narray);
				
				for($i=0; $i<sizeof($narray); $i++){

					$file = $narray[$i];
					
				    $x++;
					$Path = ($path."/".$file);
					$FilePH = str_replace("//","/",$Path);
					$FilePH = str_replace("//","/",$FilePH);
					$FileHash = md5($FilePH);
					
					
					
				
					$isFol = false;
					
				   if(!is_file($path."/".$file)){
				   	//	$size = round(GetFolderSize($path."/".$file)/(1024),2)." Kb";
					//	$nbr = count_files_recursive($path."/".$file);
						$p = $_GET['path'];
						if($p == "/"){
							$p = "";
						}
						$filestr = "?path=".$p."/".$file;
						$ico = "folder.gif";
						$isFol = true;
						
				   }else {
				    //	$size  = round(filesize($file)/(1024),2) . " Kb";
						$nbr = "";
						$filestr  = "view_file.php?hash=$FileHash";
						$filestr  = "download_file.php?hash=$FileHash";
						
					
						
						$ico = "view1.jpg";
				   }
				   
				   	
				    $sql = "SELECT * FROM  ICADARCHIVEParameterData, ICADARCHIVEParameters  WHERE ICADARCHIVEParameters.ParameterId = ICADARCHIVEParameterData.ParameterId and FileHash  = '$FileHash' and ICADARCHIVEParameters.ShowAsColumn = 1 and ParameterGroupId = $ParameterGroupId order by ICADARCHIVEParameters.ParameterId";
					
							$result = mysql_query($sql);
			
					
					$Value1 = "";
					$Value2 = "";
					$Value3 = "";
					$Value4 = "";
					$Value5 = "";
					$Value6 = "";
					$Value7 = "";
					$Value8 = "";
					$Value9 = "";
					$Value10 = "";
					$Value11 = "";
					$Value12 = "";
					$Value13 = "";
					$Value14 = "";
					$Value15 = "";
						$V6 = false;
				$V7 = false;
				$V8 = false;
				$V9 = false;
				$V10 = false;
				$V11 = false;
				$V12 = false;
				$V13 = false;
				$V14 = false;
				$V15 = false;
					
						$x = 1;
					
					while ($row = mysql_fetch_assoc($result)){ 
					if($x == 1){
						$Value1 = $row["Value"];
					}else if($x == 2){
						$Value2 = $row["Value"];
					}else if($x == 3){
						$Value3 = $row["Value"];
					}else if($x == 4){
						$Value4 = $row["Value"];
					
						}else if($x == 5){
						$Value5 = $row["Value"];
					
						}else if($x == 6){
						$Value6 = $row["Value"];
					$V6 = true;
						}else if($x == 7){
						$Value7 = $row["Value"];
					$V7 = true;
						}else if($x == 8){
						$Value8 = $row["Value"];
					$V8 = true;
						}else if($x == 9){
						$Value9 = $row["Value"];
						$V9 = true;
					}else if($x == 10){
						$Value10 = $row["Value"];
						$V10 = true;
					}else if($x == 11){
						$Value11 = $row["Value"];
						$V11 = true;
					}else if($x == 12){
						$Value12 = $row["Value"];
						$V12 = true;
					}else if($x == 13){
						$Value13 = $row["Value"];
						$V13 = true;
					}else if($x == 14){
						$Value14 = $row["Value"];
						$V14 = true;
					}else {
						$Value15 = $row["Value"];
						$V15 = true;
					}
					
					$x++;
					
				}
				
				
				
					
				  ?>
          <tr class="textthin" onMouseover="this.bgColor='#EEEEEE'"onMouseout="this.bgColor='#FFFFFF'">
            <td width="237"><?php
						  
						  if($Value1== "Doc" || $Value2 == "Doc"|| $Value3 == "Doc"|| $Value4== "Doc" || $Value5 == "Doc"  || $Value6 == "Doc"  || $Value7 == "Doc"  || $Value8 == "Doc"  || $Value9 == "Doc"  || $Value10 == "Doc" || $Value11 == "Doc" || $Value12 == "Doc" || $Value13 == "Doc" || $Value14 == "Doc" || $Value15 == "Doc"){
						$filestr  = "download_file.php?hash=$FileHash"; ?>
              <a href="<?php echo($filestr);?>">
                <?php
						
						}else{
						?>
                <a href="#" onClick="MM_openBrWindow('viewer/?file=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&FileHash=<?php echo($FileHash);?>','viewer')">
                <?php 
					  
						}?>
                <img src="images/<?php echo($ico);?>" alt="" border="0" align="absmiddle"></a>&nbsp;&nbsp;
              <?php if($ico == "view1.jpg"){?>
              <?php
						  
						  if($Value1== "Doc" || $Value2 == "Doc"|| $Value3 == "Doc"|| $Value4== "Doc" || $Value5 == "Doc"  || $Value6 == "Doc"  || $Value7 == "Doc"  || $Value8 == "Doc"  || $Value9 == "Doc"  || $Value10 == "Doc" || $Value11 == "Doc" || $Value12 == "Doc" || $Value13 == "Doc" || $Value14 == "Doc" || $Value15 == "Doc"){
						$filestr  = "download_file.php?hash=$FileHash"; ?>
              <a href="<?php echo($filestr);?>">
                <?php
						
						}else{
						?>
                <a href="#" onClick="MM_openBrWindow('viewer/?file=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&FileHash=<?php echo($FileHash);?>','viewer')" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'">
                <?php 
					  
						}
					  
					  }else{?>
                <a href="<?php echo($filestr);?>" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'">
                <?php }?>
                <?php if(strlen($file) > 15){?>
                <?php echo(substr($file,0,15));?>...<span><?php echo($file);?></span>
                <?php }else{echo($file);}?>
              </a></td>
            <td width="118"><?php if(strlen($Value1) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value1,0,10));?><span><?php echo($Value1);?></span></a>
              <?php }else{echo($Value1);}?></td>
            <td width="120"><?php if(strlen($Value2) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value2,0,10));?><span><?php echo($Value2);?></span></a>
              <?php }else{echo($Value2);}?></td>
            <td width="108"><?php if(strlen($Value3) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value3,0,10));?><span><?php echo($Value3);?></span></a>
              <?php }else{echo($Value3);}?></td>
            <td width="108"><?php if(strlen($Value4) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value4,0,10));?><span><?php echo($Value4);?></span></a>
              <?php }else{echo($Value4);}?></td>
            
            
            
            <td width="122"><?php if(strlen($Value5) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value5,0,10));?><span><?php echo($Value5);?></span></a>
              <?php }else{echo($Value5);}?></td>
              
              
              <?php
              
			 if($Value6 != ""){
				?>
                <td width="122"><?php if(strlen($Value6) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value6,0,10));?><span><?php echo($Value6);?></span></a>
              <?php }else{echo($Value6);}?></td>
              <?php
			}else if($Value6 == "" && $V6 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
               <?php
              
			 if($Value7 != ""){
				?>
                <td width="122"><?php if(strlen($Value7) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value7,0,10));?><span><?php echo($Value7);?></span></a>
              <?php }else{echo($Value7);}?></td>
               <?php
			}else if($Value7 == "" && $V7 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value8 != ""){
				?>
                <td width="122"><?php if(strlen($Value8) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value8,0,10));?><span><?php echo($Value8);?></span></a>
              <?php }else{echo($Value8);}?></td>
                <?php
			}else if($Value8 == "" && $V8 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value9 != ""){
				?>
                <td width="122"><?php if(strlen($Value9) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value9,0,10));?><span><?php echo($Value9);?></span></a>
              <?php }else{echo($Value9);}?></td>
               <?php
			}else if($Value9 == "" && $V9 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value10 != ""){
				?>
                <td width="122"><?php if(strlen($Value10) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value10,0,10));?><span><?php echo($Value10);?></span></a>
              <?php }else{echo($Value10);}?></td>
                <?php
			}else if($Value10 == "" && $V10 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
               <?php
              
			 if($Value11 != ""){
				?>
                <td width="122"><?php if(strlen($Value11) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value11,0,10));?><span><?php echo($Value11);?></span></a>
              <?php }else{echo($Value11);}?></td>
                <?php
			}else if($Value11 == "" && $V11 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value12 != ""){
				?>
                <td width="122"><?php if(strlen($Value12) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value12,0,10));?><span><?php echo($Value12);?></span></a>
              <?php }else{echo($Value12);}?></td>
                <?php
			}else if($Value12 == "" && $V12 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value13 != ""){
				?>
                <td width="122"><?php if(strlen($Value13) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value13,0,10));?><span><?php echo($Value13);?></span></a>
              <?php }else{echo($Value13);}?></td>
                <?php
			}else if($Value13 == "" && $V13 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value14 != ""){
				?>
                <td width="122"><?php if(strlen($Value14) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value14,0,10));?><span><?php echo($Value14);?></span></a>
              <?php }else{echo($Value14);}?></td>
                <?php
			}else if($Value14 == "" && $V14 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
               <?php
              
			 if($Value15 != ""){
				?>
                <td width="122"><?php if(strlen($Value15) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value15,0,10));?><span><?php echo($Value15);?></span></a>
              <?php }else{echo($Value15);}?></td>
                <?php
			}else if($Value15 == "" && $V15 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
              
              
              <?php
              
			  if($isFol == true){
				
		
				  for($r = 0; $r < ($nbr_par-5); $r++){
					echo('<td width="122"></td>'); 
					
				   }
			  }
			  
			  ?>
              
              
              
            <td width="29"><div align="left">
              <input type="checkbox" name="checkbox<?php echo($count_files);?>" id="checkbox<?php echo($count_files);?>" value="<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>">
              <?php $count_files++;?>
            </div></td>
            <td width="88"><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/save.jpg',1)">
              <?php if($be9 == true){?>
              <img src="images/del1.jpg" alt="Spara..." name="Image3" width="25" height="18" border="0"></a><a href="download_file.php?hash=<?php echo($FileHash);?>" onMouseOver="MM_swapImage('999','','images/view.jpg',1)" onMouseOut="MM_swapImgRestore()">
                <?php }?>
                </a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/save.jpg',1)">
                  <?php if($be4 == true){?>
                  </a><a href="download_file.php?hash=<?php echo($FileHash);?>&path=<?php echo($path);?><?php echo($file);?>&filename=<?php echo($file);?>" onMouseOver="MM_swapImage('999','','images/view.jpg',1)" onMouseOut="MM_swapImgRestore()"> <img src="images/save1.jpg" alt="" name="Image4" width="25" height="18" border="0" ></a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",(substr($FilePath,strlen("/var/www/icad_files/$CompanyId/archive/")-1,100))));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/del1.jpg',1)">
                    <?php }?>
                    </a> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/add.jpg',1)" onClick="MM_openBrWindow2('arkiv.php?CompanyId=<?php echo($CompanyId);?>&File=<?php echo($file);?>&FileHash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($path."/".$file)));?>','win','scrollbars=yes,width=400,height=600')"> </a>
              <?php if($be2 == true){?>
              <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/add.jpg',1)" onClick="MM_openBrWindow2('arkiv.php?CompanyId=<?php echo($CompanyId);?>&File=<?php echo($file);?>&FileHash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($path."/".$file)));?>','win','scrollbars=yes,width=400,height=600')"><img src="images/add1.jpg" alt="" name="Image5" width="25" height="18" border="0"></a>
              <?php }else{?>
              <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/add.jpg',1)" onClick="MM_openBrWindow2('arkiv_view.php?CompanyId=<?php echo($CompanyId);?>&File=<?php echo($file);?>&FileHash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($path."/".$file)));?>','win','scrollbars=yes,width=400,height=600')"><img src="images/add1.jpg" alt="" name="Image5" width="25" height="18" border="0"></a>
              <?php }?></td>
          </tr>
          <?php 
					
				  	}
				    } 
					?>
        </table>
        <?php
					if($x == 0){
 if($language == 2 || $language == 3){
						echo("<br> <span class='style8'> -- No Files are uploaded yet!</span>");
}else{
						echo("<br> <span class='style8'> -- &Auml;nnu &auml;r inga filer uppladdade i den h&auml;r mappen!</span>");
}
					}
					
				}else{
					?>
        <br>
        S&ouml;kresultat:<br>
        <?php 
				
				
				$cri1 = $_POST['criteria1'];
				$cri2 = $_POST['criteria2'];
				$cri3 = $_POST['criteria3'];
				
				
				// Get parameters
				$Parameter1 = "";
				$Parameter2 = "";
				$Parameter3 = "";
				$Parameter4 = "";
				$Parameter5 = "";
				$Parameter6 = "";
				$Parameter7 = "";
				$Parameter8 = "";
				$Parameter9 = "";
				$Parameter10 = "";
				$Parameter11 = "";
				$Parameter12 = "";
				$Parameter13 = "";
				$Parameter14 = "";
				$Parameter15 = "";
				
			    $sql = "SELECT * FROM ICADARCHIVEParameters, ICADARCHIVEGroups WHERE ICADARCHIVEParameters.ParameterGroupId = ICADARCHIVEGroups.GroupId and ICADARCHIVEParameters.ShowAsColumn = 1 and ICADARCHIVEGroups.CompanyId = $CompanyId order by ICADARCHIVEParameters.ParameterId";
	 
	 
	 
	
			
				$result = mysql_query($sql);
				$x = 1;
					while ($row = mysql_fetch_assoc($result)){ 
					if($x == 1){
						$Parameter1 = $row["ParameterName"];
					}else if($x == 2){
						$Parameter2 = $row["ParameterName"];
					}else if($x == 3){
						$Parameter3 = $row["ParameterName"];
					}
					else if($x == 4){
						$Parameter4 = $row["ParameterName"];
					}
					else if($x == 5){
						$Parameter5 = $row["ParameterName"];
					}
					else if($x == 6){
						$Parameter6 = $row["ParameterName"];
					}
					else if($x == 7){
						$Parameter7 = $row["ParameterName"];
					}
					else if($x == 8){
						$Parameter8 = $row["ParameterName"];
					}
					else if($x == 9){
						$Parameter9 = $row["ParameterName"];
					}
					else if($x == 10){
						$Parameter10 = $row["ParameterName"];
					}else if($x == 11){
						$Parameter11 = $row["ParameterName"];
					}else if($x == 12){
						$Parameter12 = $row["ParameterName"];
					}else if($x == 13){
						$Parameter13 = $row["ParameterName"];
					}else if($x == 14){
						$Parameter14 = $row["ParameterName"];
					}else if($x == 15){
						$Parameter15 = $row["ParameterName"];
					}
					
					$x++;
						
					$ParameterGroupId = $row["ParameterGroupId"];
				}
				
				
				
				echo($_GET['path']);?>
        <br>
        <table width="<?php echo($table_width);?>" border="0" align="center" cellpadding="0" cellspacing="0" class="sortable">
          <tr class="text">
            <td width="237"><?php echo($a2);?></td>
            <td width="117"><?php echo($Parameter1);?></td>
            <td width="120"><?php echo($Parameter2);?></td>
            <td width="107"><?php echo($Parameter3);?></td>
            <td width="108"><?php echo($Parameter4);?></td>
            <td width="122"><?php echo($Parameter5);?></td>
            
               
            <?php
            
			if($Parameter6 != ""){?>
            <td width="122"><?php echo($Parameter6);?></td>
            <?php	
				}
			?>
			
            
              <?php
            
			if($Parameter7 != ""){?>
            <td width="122"><?php echo($Parameter7);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter8 != ""){?>
            <td width="122"><?php echo($Parameter8);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter9 != ""){?>
            <td width="122"><?php echo($Parameter9);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter10 != ""){?>
            <td width="122"><?php echo($Parameter10);?></td>
            <?php	
				}
			?>
			
              <?php
            
			if($Parameter11 != ""){?>
            <td width="122"><?php echo($Parameter11);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter12 != ""){?>
            <td width="122"><?php echo($Parameter12);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter13 != ""){?>
            <td width="122"><?php echo($Parameter13);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter14 != ""){?>
            <td width="122"><?php echo($Parameter14);?></td>
            <?php	
				}
			?>
			
            
               <?php
            
			if($Parameter15 != ""){?>
            <td width="122"><?php echo($Parameter15);?></td>
            <?php	
				}
			?>
			
            
            
		
            
            
            <td width="26"><input type="checkbox" name="check1" id="check1" onClick="checkAll(this.checked)"></td>
            <td width="95">Markera alla</td>
          </tr>
          <?php 
				  
				  	function AddPath($PathToCreate){
						$iBreak = 0;
						$iBreak = strrpos($PathToCreate, "/");
						if($iBreak !== FALSE){
							$Parent = substr($PathToCreate, 0, $iBreak);
							if(!@chdir($Parent)){
								AddPath($Parent);
							}
						}
					
						if(!@chdir($PathToCreate)){
							mkdir($PathToCreate);
						}
					}
					
					



				  
				   $path = "/var/www/icad_files/$CompanyId/archive/".$_GET['path']."/";
				  
				   
				   
				
				  
				  
				   if($_GET['action'] == "search"){
					   if($_POST['criteria'] == "1"){
					  		 $sql_extra = " ICADARCHIVEParameterData.Value like '%".$_POST['keyword']."%' "; 
					   }else{
						   	 $sql_extra = " ICADARCHIVEParameterData.Value = '".$_POST['keyword']."' "; 
						   }
						   
						   
						   //R&auml;ttigheter
						    $sql_extra2 = "";
						    $result2 = mysql_query("SELECT * FROM ICADARCHIVERights WHERE SystemUserID = ".$_SESSION['ASTACUS_SSO_INFO'][0]."");
						   $x = 0;
						    while ($row2 = mysql_fetch_assoc($result2)){ 
							
							if($x == 0){
								$sql_extra2 .= " and (";
								}else{
									$sql_extra2 .= " or ";
									}
							 $sql_extra2 .= " ICADARCHIVEParameterData.FilePath like '".$row2['Path']."%' ";
							$x++;
							}
							
							if( $sql_extra2 == ""){
								 $sql_extra2 = " and ( ICADARCHIVEParameterData.FilePath = '@' ";
								}
								$sql_extra2 .= ")";
								
			
								
							///////////////////////////
						   
						   $sql = "SELECT * FROM  ICADARCHIVEParameterData, ICADARCHIVEParameters, ICADARCHIVEGroups  WHERE ICADARCHIVEGroups.GroupId = ICADARCHIVEParameters.ParameterGroupId and ICADARCHIVEParameters.ParameterId = ICADARCHIVEParameterData.ParameterId and ICADARCHIVEGroups.CompanyId = $CompanyId  and ( $sql_extra or ICADARCHIVEParameterData.Filename like '%".$_POST['keyword']."%') $sql_extra2 group by ICADARCHIVEParameterData.FileHash order by ICADARCHIVEParameterData.Filename ";
						   
						
						 
						   
				
						    $result2 = mysql_query($sql);
							  while ($row2 = mysql_fetch_assoc($result2)){ 
								 $FileHash = $row2['FileHash'];
								  $hits .= $FileHash."-";
								 
							  }
							  
							  
						   
				   }else{
					   
				
				$sql_extra = " ";
				
				
					/*  	

					   
					    
					  		 $sql_extra .= " or ICADARCHIVEParameterData.ParameterId = ". $cri2 ." "; 

					   
					   
					  		 $sql_extra .= " or ICADARCHIVEParameterData.ParameterId = ". $cri3." )"; 
*/
					   
					 
					    //R&auml;ttigheter
						    $sql_extra2 = "";
						    $result2 = mysql_query("SELECT * FROM ICADARCHIVERights WHERE SystemUserID = ".$_SESSION['ASTACUS_SSO_INFO'][0]."");
						   $x = 0;
						    while ($row2 = mysql_fetch_assoc($result2)){ 
							
							if($x == 0){
								$sql_extra2 .= " and (";
								}else{
									$sql_extra2 .= " or ";
									}
							 $sql_extra2 .= " ICADARCHIVEParameterData.FilePath like '".$row2['Path']."%' ";
							$x++;
							}
							
							if( $sql_extra2 == ""){
								 $sql_extra2 = " and (ICADARCHIVEParameterData.FilePath = '@' ";
								}
								$sql_extra2 .= ")";
								///
					  
					
						  $sql = "SELECT * FROM ICADARCHIVEParameterData, ICADARCHIVEParameters, ICADARCHIVEGroups  WHERE ICADARCHIVEGroups.GroupId = ICADARCHIVEParameters.ParameterGroupId and ICADARCHIVEParameters.ParameterId = ICADARCHIVEParameterData.ParameterId and ICADARCHIVEGroups.CompanyId = $CompanyId  and (ICADARCHIVEParameterData.ParameterId = ".$cri1 ." and ICADARCHIVEParameterData.Value like '%".$_POST['keyword1']."%')  $sql_extra2 group by ICADARCHIVEParameterData.FileHash "; 
						  
						  $hits = "";
						  $hits2 = "";
						  if($cri3 == "0" && $cri2 != "0"){
							  $result2 = mysql_query($sql);
							  while ($row2 = mysql_fetch_assoc($result2)){ 
								 $FileHash = $row2['FileHash'];
								 
								  $sql = "SELECT * FROM ICADARCHIVEParameterData WHERE FileHash = '". $FileHash ."' and ParameterId = ".$cri2 ." and ICADARCHIVEParameterData.Value like '%".$_POST['keyword2']."%'";
								  
								 // echo($sql."<br>");
								  $result3 = mysql_query($sql);
								  while ($row3 = mysql_fetch_assoc($result3)){ 
										 $FileHash3 = $row3['FileHash'];
										  $hits .= $FileHash3."-";
								  }
							  }
							  
							 
						  }else if($cri3 == "0" && $cri2 == "0"){
							   $result2 = mysql_query($sql);
							  while ($row2 = mysql_fetch_assoc($result2)){ 
								 $FileHash2 = $row2['FileHash'];
								  $hits .= $FileHash2."-";
							  }
							 
							  
					      }else if($cri3 != "0" && $cri2 != "0"){
							 
							 
							  $result2 = mysql_query($sql);
							  while ($row2 = mysql_fetch_assoc($result2)){ 
								 $FileHash = $row2['FileHash'];
								 
								  $sql = "SELECT * FROM ICADARCHIVEParameterData WHERE FileHash = '". $FileHash ."' and ParameterId = ".$cri2 ." and ICADARCHIVEParameterData.Value like '%".$_POST['keyword2']."%'";
								  
								 // echo($sql."<br>");
								  $result3 = mysql_query($sql);
								  while ($row3 = mysql_fetch_assoc($result3)){ 
										 $FileHash3 = $row3['FileHash'];
										  $hits2 .= $FileHash3."-";
								  }
							  }
							  
							    $arr = split("-",$hits2);
								$sql = "SELECT * FROM ICADARCHIVEParameterData WHERE (FileHash = '";
								foreach ($arr as &$value) {
									$sql .= $value ."' or FileHash = '";
								}
								$sql .= "') and  ParameterId = ".$cri3 ." and ICADARCHIVEParameterData.Value like '%".$_POST['keyword3']."%' group by FileHash";
							   
							  
							    $result4 = mysql_query($sql);
								  while ($row4 = mysql_fetch_assoc($result4)){ 
										 $FileHash4 = $row4['FileHash'];
										  $hits .= $FileHash4."-";
								  }
					
						}
	
					  
				   }
				   
				  
				  	  
	 			$arr = split("-",$hits);
				$sql = "SELECT * FROM ICADARCHIVEParameterData WHERE FileHash = '";
				foreach ($arr as &$value) {
					if( $value != ''){
   				 	$sql .= $value ."' or FileHash = '";
					}
				}
				$sql .= "' group by FileHash order by Filename";
				
			
		
	
				$result2 = mysql_query($sql);
				 $x = 0;
				   $count_files = 0;
				   	while ($row2 = mysql_fetch_assoc($result2)){ 
				  
				 	$FilePath = $row2['FilePath'];
					$file = $row2['Filename'];
					//$tmp = "/var/www/icad_files/$CompanyId/archive/";
					
					//$FilePath = substr($FilePath,strlen($tmp),200);
					
				    $x++;
					$FileHash = md5(str_replace("//","/",($FilePath)));
					
					
				   if(!is_file($FilePath)){
				   		
						if(!is_dir($FilePath)){
							continue;
							}
						
					//	$size = round(GetFolderSize($FilePath)/(1024),2)." Kb";
					//	$nbr = count_files_recursive($FilePath);
						
						$filestr = "?path=".$FilePath;
						$ico = "folder.gif";
						
				   }else {
				    	//$size  = round(filesize($file)/(1024),2) . " Kb";
					//	$nbr = "";
						
						$filestr  = "view_file.php?hash=$FileHash";
						
						
						$ico = "view1.jpg";
				   }
				   
				   	
				    $sql = "SELECT * FROM  ICADARCHIVEParameterData, ICADARCHIVEParameters  WHERE ICADARCHIVEParameters.ParameterId = ICADARCHIVEParameterData.ParameterId and FileHash  = '$FileHash' and ICADARCHIVEParameters.ShowAsColumn = 1 and ParameterGroupId = $ParameterGroupId order by ICADARCHIVEParameters.ParameterId";
					
							$result = mysql_query($sql);
					
					
					
					
					$Value1 = "";
					$Value2 = "";
					$Value3 = "";
					$Value4 = "";
					$Value5 = "";
					$Value6 = "";
					$Value7 = "";
					$Value8 = "";
					$Value9 = "";
					$Value10 = "";
					$Value11 = "";
					$Value12 = "";
					$Value13 = "";
					$Value14 = "";
					$Value15 = "";
						$V6 = false;
				$V7 = false;
				$V8 = false;
				$V9 = false;
				$V10 = false;
				$V11 = false;
				$V12 = false;
				$V13 = false;
				$V14 = false;
				$V15 = false;
					
						$x = 1;
					
					while ($row = mysql_fetch_assoc($result)){ 
					if($x == 1){
						$Value1 = $row["Value"];
					}else if($x == 2){
						$Value2 = $row["Value"];
					}else if($x == 3){
						$Value3 = $row["Value"];
					}else if($x == 4){
						$Value4 = $row["Value"];
					
						}else if($x == 5){
						$Value5 = $row["Value"];
					
						}else if($x == 6){
						$Value6 = $row["Value"];
					$V6 = true;
						}else if($x == 7){
						$Value7 = $row["Value"];
					$V7 = true;
						}else if($x == 8){
						$Value8 = $row["Value"];
					$V8 = true;
						}else if($x == 9){
						$Value9 = $row["Value"];
						$V9 = true;
					}else if($x == 10){
						$Value10 = $row["Value"];
						$V10 = true;
					}else if($x == 11){
						$Value11 = $row["Value"];
						$V11 = true;
					}else if($x == 12){
						$Value12 = $row["Value"];
						$V12 = true;
					}else if($x == 13){
						$Value13 = $row["Value"];
						$V13 = true;
					}else if($x == 14){
						$Value14 = $row["Value"];
						$V14 = true;
					}else {
						$Value15 = $row["Value"];
						$V15 = true;
					}
					
				$x++;
					
					$FP = $row["FilePath"];
					$t1 = "/var/www/icad_files/$CompanyId/archive";
					
					$vfile = substr($FP,strlen($t1)+1,100); 
					
				}
				
				
				
					
				  ?>
          <tr class="textthin" onMouseover="this.bgColor='#EEEEEE'"onMouseout="this.bgColor='#FFFFFF'">
            <td width="237"><?php
						  
					  if($Value1== "Doc" || $Value2 == "Doc"|| $Value3 == "Doc"|| $Value4== "Doc" || $Value5 == "Doc"  || $Value6 == "Doc"  || $Value7 == "Doc"  || $Value8 == "Doc"  || $Value9 == "Doc"  || $Value10 == "Doc" || $Value11 == "Doc" || $Value12 == "Doc" || $Value13 == "Doc" || $Value14 == "Doc" || $Value15 == "Doc"){
						$filestr  = "download_file.php?hash=$FileHash"; ?>
              <a href="<?php echo($filestr);?>">
                <?php
						
						}else{
						?>
                <a href="#" onClick="MM_openBrWindow('viewer/?file=<?php echo(str_replace("//","/",($vfile)));?>&FileHash=<?php echo($FileHash);?>','viewer')">
                <?php 
					  
						}?>
                <img src="images/<?php echo($ico);?>" alt="" border="0" align="absmiddle"></a>&nbsp;&nbsp;
              <?php if($ico == "view1.jpg"){?>
              <?php
						  
					  if($Value1== "Doc" || $Value2 == "Doc"|| $Value3 == "Doc"|| $Value4== "Doc" || $Value5 == "Doc"  || $Value6 == "Doc"  || $Value7 == "Doc"  || $Value8 == "Doc"  || $Value9 == "Doc"  || $Value10 == "Doc" || $Value11 == "Doc" || $Value12 == "Doc" || $Value13 == "Doc" || $Value14 == "Doc" || $Value15 == "Doc"){
						$filestr  = "download_file.php?hash=$FileHash"; ?>
              <a href="<?php echo($filestr);?>">
                <?php
						
						}else{
						?>
                <a href="#" onClick="MM_openBrWindow('viewer/?file=<?php echo(str_replace("//","/",($vfile)));?>&FileHash=<?php echo($FileHash);?>','viewer')" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'">
                <?php 
					  
						}
					  
					  }else{?>
                <a href="<?php echo($filestr);?>" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'">
                <?php }?>
                <?php if(strlen($file) > 15){?>
                <?php echo(substr($file,0,15));?>...<span><?php echo($file);?></span>
                <?php }else{echo($file);}?>
              </a> &nbsp;&nbsp; </td>
            <td width="117"><?php if(strlen($Value1) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value1,0,10)."...");?><span><?php echo($Value1);?></span></a>
              <?php }else{echo($Value1);}?></td>
            <td width="120"><?php if(strlen($Value2) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value2,0,10)."...");?><span><?php echo($Value2);?></span></a>
              <?php }else{echo($Value2);}?></td>
            <td width="107"><?php if(strlen($Value3) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value3,0,10)."...");?><span><?php echo($Value3);?></span></a>
              <?php }else{echo($Value3);}?></td>
            <td width="108"><?php if(strlen($Value4) > 10){?>
              <a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'"><?php echo(substr($Value4,0,10)."...");?><span><?php echo($Value4);?></span></a>
              <?php }else{echo($Value4);}?></td>
            <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value5) > 10){?>
              <?php echo(substr($Value5,0,10)."...");?><span><?php echo($Value5);?></span>
              <?php }else{echo($Value5);}?>
            </a></td>
            
            
            
            
               <?php
              
			 if($Value6 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value6) > 10){?>
              <?php echo(substr($Value6,0,10)."...");?><span><?php echo($Value6);?></span>
              <?php }else{echo($Value6);}?>
            </a></td>
                
				
				
				<?php
			}else if($Value6 == "" && $V6 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
                    
               <?php
              
			 if($Value7 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value7) > 10){?>
              <?php echo(substr($Value7,0,10)."...");?><span><?php echo($Value7);?></span>
              <?php }else{echo($Value7);}?>
            </a></td>
                
				
				
				<?php
			}else if($Value7 == "" && $V7 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
                    
               <?php
              
			 if($Value8 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value8) > 10){?>
              <?php echo(substr($Value8,0,10)."...");?><span><?php echo($Value8);?></span>
              <?php }else{echo($Value8);}?>
            </a></td>
                
				
				
				<?php
			}else if($Value8 == "" && $V8 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
                    
               <?php
              
			 if($Value9 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value9) > 10){?>
              <?php echo(substr($Value9,0,10)."...");?><span><?php echo($Value9);?></span>
              <?php }else{echo($Value9);}?>
            </a></td>
                
				
				<?php
			}else if($Value9 == "" && $V9 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
            
                  
               <?php
              
			 if($Value10 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value10) > 10){?>
              <?php echo(substr($Value10,0,10)."...");?><span><?php echo($Value10);?></span>
              <?php }else{echo($Value10);}?>
            </a></td>
                
				
				<?php
			}else if($Value10 == "" && $V10 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
              
                 <?php
              
			 if($Value11 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value11) > 10){?>
              <?php echo(substr($Value11,0,10)."...");?><span><?php echo($Value11);?></span>
              <?php }else{echo($Value11);}?>
            </a></td>
                
				
				<?php
			}else if($Value11 == "" && $V11 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
             <?php
              
			 if($Value12 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value12) > 10){?>
              <?php echo(substr($Value12,0,10)."...");?><span><?php echo($Value12);?></span>
              <?php }else{echo($Value12);}?>
            </a></td>
                
				
				<?php
			}else if($Value12 == "" && $V12 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
             <?php
              
			 if($Value13 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value13) > 10){?>
              <?php echo(substr($Value13,0,10)."...");?><span><?php echo($Value13);?></span>
              <?php }else{echo($Value13);}?>
            </a></td>
                
				
				<?php
			}else if($Value13 == "" && $V13 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
             <?php
              
			 if($Value14 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value14) > 10){?>
              <?php echo(substr($Value14,0,10)."...");?><span><?php echo($Value14);?></span>
              <?php }else{echo($Value14);}?>
            </a></td>
                
				
				<?php
			}else if($Value14 == "" && $V14 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
             <?php
              
			 if($Value15 != ""){
				?>
                
                 <td width="122"><a href="#" class="ToolText" onMouseOver="javascript:this.className='ToolTextHover'" onMouseOut="javascript:this.className='ToolText'" style="text-decoration:none">
              <?php if(strlen($Value15) > 10){?>
              <?php echo(substr($Value15,0,10)."...");?><span><?php echo($Value15);?></span>
              <?php }else{echo($Value15);}?>
            </a></td>
                
				
				<?php
			}else if($Value15 == "" && $V15 == true){
				echo('<td width="122"></td>');
				}
	
			  ?>
              
            
          
            
          
        
          
        
            
          
        
            
          
        
        
            
          
        
            
            
            
            <td width="26"><div align="left">
              <input type="checkbox" name="checkbox<?php echo($count_files);?>" id="checkbox<?php echo($count_files);?>" value="<?php echo(str_replace("//","/",(substr($FilePath,strlen("/var/www/icad_files/$CompanyId/archive/")-1,100))));?>">
              <?php $count_files++; ?>
            </div></td>
            <td width="92"><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/save.jpg',1)">
              <?php if($be9 == true){?>
              </a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",(substr($FilePath,strlen("/var/www/icad_files/$CompanyId/archive/")-1,100))));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/del1.jpg',1)"><img src="images/del1.jpg" alt="Spara..." name="Image3" width="25" height="18" border="0">
                <?php }?>
                </a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($_GET['path']."/".$file)));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/save.jpg',1)">
                  <?php if($be4 == true){?>
                  </a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",(substr($FilePath,strlen("/var/www/icad_files/$CompanyId/archive/")-1,100))));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/del1.jpg',1)"> </a><a href="download_file.php?hash=<?php echo($FileHash);?>" onMouseOver="MM_swapImage('999','','images/view.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="images/save1.jpg" alt="" name="Image4" width="25" height="18" border="0" ></a><a href="javascript:deleteFile('deletefiles.php?hash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",(substr($FilePath,strlen("/var/www/icad_files/$CompanyId/archive/")-1,100))));?>&path=<?php echo($_GET['path']);?>');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/del1.jpg',1)"> </a>
              <?php }?>
              <?php if($be2 == true){?>
              <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/add.jpg',1)" onClick="MM_openBrWindow2('arkiv.php?CompanyId=<?php echo($CompanyId);?>&File=<?php echo($file);?>&FileHash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($path."/".$file)));?>','win','scrollbars=yes,width=400,height=600')"><img src="images/add1.jpg" alt="" name="Image5" width="25" height="18" border="0"></a>
              <?php }else{?>
              <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/add.jpg',1)" onClick="MM_openBrWindow2('arkiv_view.php?CompanyId=<?php echo($CompanyId);?>&File=<?php echo($file);?>&FileHash=<?php echo($FileHash);?>&FilePath=<?php echo(str_replace("//","/",($path."/".$file)));?>','win','scrollbars=yes,width=400,height=600')"><img src="images/add1.jpg" alt="" name="Image5" width="25" height="18" border="0"></a>
              <?php }?></td>
          </tr>
          <?php }
				    } 
					
	
					
				
					?>
        </table>
        <input name="count_files" type="hidden" value="<?php echo($count_files);?>">
        <br>
        <br>
        <table width="920" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="630" valign="top"><?php if($be1 == true || $be2 == true || $be3 == true || $be9 == true ){?>
              Funktioner:
              <?php }?>
              <br>
              <table width="583" height="22" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="118"><?php if($be3 == true){?>
                    <input type="submit" name="Submit2" value="Kopiera markerade filer och mappar till iCAD-projekt." id="Submit2">
                    <?php }?></td>
                  <td align="right"><?php if($be1 == true){?>
                    <input type="button" name="Submit8" value="Ladda upp filer och mappar." onClick="javascript:document.location.href='?page=upload&path=<?php echo($_GET['path']);?>';">
                    <?php }?></td>
                </tr>
              </table>
              <table width="583" height="22" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="118"><?php if($be2 == true){?>
                    <input type="button" name="Button" value="Hantera parametrar" onClick="javascript:document.location.href='?page=parameters';">
                    <?php }?></td>
                  <td align="right"><?php if($be9 == true){?>
                    <input type="submit" name="Submit" value="Ta bort markerade filer och mappar."id="Submit">
                    <?php }?></td>
                </tr>
              </table></td>
            <td width="290">&nbsp;</td>
          </tr>
        </table>
      </form>
      <br></td>
  </tr>
</table>
<p>&nbsp;</p>

Youez - 2016 - github.com/yon3zu
LinuXploit