????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.48 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/productionzon/ |
Upload File : |
<?php
session_start();
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$ProjectId = $_GET['projectId'];
$sql = "SELECT * FROM Project, ProjectStatus WHERE Project.ProjectStatusId = ProjectStatus.ProjectStatusId and ProjectId = $ProjectId";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$CompanyId = $row['CompanyId'];
$ProjectName = $row['Name'];
$Description = $row['Description'];
$RequestedDeliveryDate = $row['RequestedDeliveryDate'];
$ProjectStatusId = $row['ProjectStatusId'];
}
?>
<link href="../main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.style8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold }
-->
</style>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript">
google.load("language", "1");
var s;
function initialize() {
var text = document.getElementById("text").value;
google.language.detect(text, function(result) {
if (!result.error && result.language) {
google.language.translate(text, result.language, "en",
function(result) {
var translated = document.getElementById("translation");
if (result.translation) {
translated.value = result.translation;
}
});
}
});
s=setTimeout("initialize()",1000);
}
google.setOnLoadCallback(initialize);
function createFolder()
{
stuff = prompt("Name on folder:", "");
if (stuff) {
document.location.href="createfolder.php?projectId=<?php echo($ProjectId);?>&path=<?php echo($_GET['path']);?>&foldername=" + stuff;
}
}
function deleteFile(stuff){
var retVal = confirm("Do you really want to delete the file/folder?");
if( retVal == true ){
document.location.href= stuff;
return true;
}
}
</script>
<table width="850" height="64" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="../images/tabb2.jpg"><table width="850" height="23" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8" height="23"> </td>
<td width="108" valign="bottom" class="blacklink"><div align="center"><a href="?page=project&projectId=<?php echo($ProjectId);?>" class="blacklink">Project status</a></div></td>
<td width="22" valign="bottom" class="blacklink"><div align="center"></div></td>
<td width="100" valign="bottom" class="blacklink"><div align="center"><a href="?page=upload&projectId=<?php echo($ProjectId);?>" class="blacklink">Upload files</a></div></td>
<td width="24" valign="bottom" class="blacklink"><div align="center"></div></td>
<td width="105" valign="bottom" class="blacklink"><div align="center"><a href="?page=download&projectId=<?php echo($ProjectId);?>" class="blacklink">Download files</a></div></td>
<td width="21" class="blacklink"> </td>
<td width="104" valign="bottom" class="blacklink"><div align="center"><a href="?page=logg&projectId=<?php echo($ProjectId);?>" class="blacklink">Project log</a></div></td>
<td width="358" class="blacklink"> </td>
</tr>
</table></td>
</tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="90"> </td>
<td width="820"><table width="820" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" valign="top"><table width="821" border="0" cellpadding="0" cellspacing="0">
<tr >
<td colspan="4" valign="top" class="text"><span class="heading1">Upload files </span>
<table width="397" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="398"><span class="heading2">Project: <?php echo($CompanyId);?>_<?php echo($ProjectName);?> (<?php echo($ProjectId);?>)</span> <br>
</td>
<td width="57"><div align="right"><span class="textthin"><br>
</span> </div></td>
</tr>
</table></td>
<td width="357" valign="top" class="textthin"><div align="right"><span class="heading1"><a href="index.php"><img src="../images/Back-Arrow.jpg" alt="pic" width="37" height="36" border="0" align="absmiddle" /></a> <a href="index.php" class="blacklinkhuge">Back to search</a></span></div></td>
</tr>
</table>
<br>
<hr width="820" size="1">
<span class="heading2"><br>
</span>
<table width="820" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="786" height="677" valign="top"> <span class="heading2">Uploaded files & folders: <br>
</span><span class="textthin">You are in folder: <a href="?page=upload&projectId=<?php echo($ProjectId);?>&path=<?php echo(dirname($_GET['path']));?>">
<?php
$path = $_GET['path'];
if($path == "/"){
$path = "";
}
echo($path);?>
</a></span><span class="heading2"><br>
</span> <span class="heading2"> </span>
<table width="743" border="0" cellspacing="0" cellpadding="0">
<tr class="text">
<td width="419">Name:</td>
<td width="76"># files:</td>
<td width="71">Size:</td>
<td width="152">Last modified: </td>
<td width="25"> </td>
</tr>
</table>
<?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 ="." ) {
// © 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/$ProjectId/productionzon/".$_GET['path']."/";
AddPath($path);
$dir_handle = @opendir($path);
$x = 0;
while (false !== ($file = readdir($dir_handle))){
if(substr($file,0,1) != "."){
$x++;
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 = "?page=upload&projectId=$ProjectId&path=".$p."/".$file;
$ico = "folder.gif";
}else {
$size = round(filesize($file)/(1024),2) . " Kb";
$nbr = "";
$filestr = "downloadcfile.php?file=".$_GET['path']."/".$file."&projectId=$ProjectId&customerId=$CompanyId";
$ico = "file.gif";
}
?>
<table width="744" border="0" cellspacing="0" cellpadding="0">
<tr class="textthin">
<td width="419"><img src="../images/icons/<?php echo($ico);?>" width="16" height="16" align="absmiddle"> <a href="<?php echo($filestr);?>"><?php echo($file);?></a></td>
<td width="76"><?php echo($nbr);?></td>
<td width="71"><?php echo($size);?></td>
<td width="99"><?php echo(date("Y-m-d H:i:s",filemtime($file)));?></td>
<td width="79"><div align="left"><a href="javascript:deleteFile('deletefiles.php?projectId=<?php echo($ProjectId);?>&path=<?php echo($_GET['path']);?>&file=<?php echo($file);?>');"><img src="../images/del.jpg" width="20" height="20" border="0"></a></div></td>
</tr>
</table>
<?php }
}
if($x == 0){
echo("<br> <span class='style8'> -- No files are yet uploaded to this folder!</span>");
}
?>
<br>
<span class="heading2"><br>
</span> <br>
<table width="480" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="118"><input type="submit" name="Submit" value="Create folder" onClick="javascript:createFolder();"></td>
<td width="238"><input type="submit" name="Submit2" value="Upload files in this folder" onClick="javascript:document.location.href='?page=files&projectId=<?php echo($ProjectId);?>&path=<?php echo($_GET['path']);?>'"></td>
<td width="10"> </td>
<td width="52"> </td>
<td width="43"> </td>
</tr>
</table>
<span class="heading2"><br>
</span><span class="heading2"> </span>
<p><span class="heading2"> <br>
</span><span class="heading2"></span></p> <span class="heading2"><br>
</span><span class="heading2">
</span><p><span class="heading2"> <br>
</span><span class="heading2"> </span> </p></td><td width="17"> </td>
<td width="17" valign="top"> </td>
</tr>
</table>
<span class="style6"><br>
</span>
<hr width="820" size="1">
<span class="style6"> </span></td>
</tr>
</table>
</td>
<td width="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>