hmm,
Kaffi wir warten noch auf deine belanglosen Scripts.
Kaffi wir warten noch auf deine belanglosen Scripts.
<?php
include ("inc/library.php");
//set task to "0" for project main folder upload
if ($task == "") {
$task = "0";
}
if ($action == "add") {
if ($maxCustom != "") {
$maxFileSize = $maxCustom;
}
if ($upload_size!=0) {
$taille_ko=$upload_size/1024;
} else {
$taille_ko=0;
}
if ($upload=="none") {
$error.="No file selected<br>";
}
if ($upload_size>$maxFileSize) {
if($maxFileSize!=0) {
$taille_max_ko=$maxFileSize/1024;
}
$error.="Exceed max file size ($taille_max_ko ko max)<br>";
}
$extension= strtolower( substr( strrchr($upload_name, ".") ,1) );
if ($allowPhp == "false") {
$send = "";
if ($upload!="none" && ($extension=="php" || $extension=="php3")) {
$error.="Php file not allowed<br>";
$send = "false";
}
}
if ($upload!="none" && $upload_size<$maxFileSize && $upload_size!=0 && $send != "false") {
$copy = "true";
}
if ($copy == "true") {
$tmpquery = "INSERT INTO ".$tableCollab["files"]."(owner,project,task,comments,upload,published,status) VALUES('$idSession','$project','$task','$c','$dateheure','1','2')";
connectSql("$tmpquery");
$tmpquery = $tableCollab["files"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
}
if ($task != "0") {
if ($copy == "true") {
@move_uploaded_file($upload, $HTTP_DOCS."files/".$project."/".$task."/".$num."--".$upload_name);
$size = file_info_size("files/".$project."/".$task."/".$num."--".$upload_name);
//$dateFile = file_info_date("files/".$project."/".$task."/".$num."--".$upload_name);
$chaine = strrev("files/".$project."/".$task."/".$num."--".$upload_name);
$tab = explode(".",$chaine);
$extension = strtolower(strrev($tab[0]));
}
} else {
if ($copy == "true") {
@move_uploaded_file($upload, "files/".$project."/".$num."--".$upload_name);
$size = file_info_size("files/".$project."/".$num."--".$upload_name);
//$dateFile = file_info_date("files/".$project."/".$num."--".$upload_name);
$chaine = strrev("files/".$project."/".$num."--".$upload_name);
$tab = explode(".",$chaine);
$extension = strtolower(strrev($tab[0]));
}
}
if ($copy == "true") {
$name = $num."--".$upload_name;
$tmpquery = "UPDATE ".$tableCollab["files"]." SET name='$name',date='$dateheure',size='$size',extension='$extension' WHERE id = '$num'";
connectSql("$tmpquery");
header("Location:filedetail.php?id=$num&msg=addFile&".session_name()."=".session_id());
exit;
}
}
$tmpquery = "WHERE pro.id = '$project'";
openProjects($tmpquery);
if ($task != "0") {
$tmpquery = "WHERE tas.id = '$task'";
openTasks($tmpquery);
}
include("themes/".THEME."/header.php");
echo "<p class=\"breadcrumbs\"><a href=\"showallprojects.php?$transmitSid\">".$strings["projects"]."</a> / <a href=\"projectdetail.php?$transmitSid&id=$project\">$pro_name[0]</a> / ";
if ($task != "0") {
echo "<a href=\"showalltasks.php?$transmitSid&project=$project\">".$strings["tasks"]."</a> / <a href=\"taskdetail.php?$transmitSid&id=$task\">$tas_name[0]</a> / ";
}
echo $strings["add_file"]."</p>";
if ($msg != "") {
include("themes/".THEME."/msg.php");
}
$block1 = new block();
$block1->form = "filedetails";
echo "<a name=\"filedetailsAnchor\"></a>";
echo "<form accept-charset=\"UNKNOWN\" method=\"POST\" action=\"$PHP_SELF?action=add&project=$project&task=$task&".session_name()."=".session_id()."#filedetailsAnchor\" name=\"filedetailsForm\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000000\"><input type=\"hidden\" name=\"maxCustom\" value=\"$pro_upload_max[0]\">";
if ($error != "") {
$block1->headingError($strings["errors"]);
$block1->contentError($error);
}
$block1->heading($strings["add_file"]);
$block1->openContent();
$block1->contentTitle($strings["details"]);
echo "<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\">* ".$strings["upload"]." :</td><td><input size=\"44\" style=\"width: 400px\" name=\"upload\" type=\"FILE\"></td></tr>
<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\">".$strings["comments"]." :</td><td><textarea rows=\"3\" wrap=\"VIRTUAL\" style=\"width: 400px; height: 50px;\" name=\"c\" cols=\"43\">$c</textarea></td></tr>
<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\"> </td><td><input type=\"SUBMIT\" value=\"".$strings["save"]."\"></td></tr>";
$block1->closeContent();
$block1->closeForm();
include("themes/".THEME."/footer.php");
?>
Kommentar