summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-22 16:47:33 +0000
committercookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-22 16:47:33 +0000
commit05c41f4925ef77212c1f262aaad1fa5500dc74df (patch)
treeadc1b3f9d970bb8f513e9fe7c04717133fa021e6
parent7ec1daba838cbda434c0313cbdf6344124caed5b (diff)
upload von bilder fuer erzengel eingebaut
git-svn-id: svn://svn.cccv.de/engel-system@216 29ba0400-6e00-0410-a75a-ca02368028f8
-rwxr-xr-xwww-ssl/admin/UserPicture.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/www-ssl/admin/UserPicture.php b/www-ssl/admin/UserPicture.php
index 798d5d84..c4754174 100755
--- a/www-ssl/admin/UserPicture.php
+++ b/www-ssl/admin/UserPicture.php
@@ -12,6 +12,53 @@ if( IsSet($_GET["action"]) )
switch ($_GET["action"])
{
+ case 'FormUpload':
+ echo "Hier kannst Du ein Foto hochladen für:";
+ echo "<form action=\"./UserPicture.php?action=sendPicture\" method=\"post\" enctype=\"multipart/form-data\">\n";
+ echo "\t<select name=\"UID\">\n";
+ $usql="SELECT * FROM `User` ORDER BY `Nick`";
+ $uErg = mysql_query($usql, $con);
+ for ($k=0; $k<mysql_num_rows($uErg); $k++)
+ echo "\t\t<option value=\"".mysql_result($uErg, $k, "UID")."\">". mysql_result($uErg, $k, "Nick"). "</option>\n";
+ echo "\t</select>\n";
+ echo "\t<input type=\"hidden\" name=\"action\" value=\"sendPicture\">\n";
+ echo "\t<input name=\"file\" type=\"file\" size=\"50\" maxlength=\"". get_cfg_var("post_max_size"). "\">\n";
+ echo "\t(max ". get_cfg_var("post_max_size"). "Byte)<br>\n";
+ echo "\t<input type=\"submit\" value=\"". Get_Text("upload"),"\">\n";
+ echo "</form>\n";
+ break;
+ case 'sendPicture':
+ if( ($_FILES["file"]["size"] > 0) && (isset( $_POST["UID"])) )
+ {
+ if( ($_FILES["file"]["type"] == "image/jpeg") ||
+ ($_FILES["file"]["type"] == "image/png") ||
+ ($_FILES["file"]["type"] == "image/gif") )
+ {
+ $data = addslashes(fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"])));
+
+ if( GetPicturShow( $_POST['UID']) == "")
+ $SQL = "INSERT INTO `UserPicture` ".
+ "( `UID`,`Bild`, `ContentType`, `show`) ".
+ "VALUES ('". $_POST['UID']. "', '$data', '". $_FILES["file"]["type"]. "', 'N')";
+ else
+ $SQL = "UPDATE `UserPicture` SET ".
+ "`Bild`='$data', ".
+ "`ContentType`='". $_FILES["file"]["type"]. "', ".
+ "`show`='N' ".
+ "WHERE `UID`='". $_POST['UID']. "'";
+
+ echo "Upload Pictur:'" . $_FILES["file"]["name"] . "', ".
+ "MIME-Type: " . $_FILES["file"]["type"]. ", ".
+ $_FILES["file"]["size"]. " Byte ".
+ "for ". UID2Nick( $_POST["UID"]);
+ }
+ else
+ Print_Text("pub_einstellungen_send_KO");
+ }
+ else
+ Print_Text("pub_einstellungen_send_KO");
+ break;
+
case 'SetN':
if (IsSet($_GET["UID"]))
{
@@ -98,5 +145,7 @@ for( $t = 0; $t < mysql_num_rows($Erg); $t++ )
} // ende Auflistung Raeume
echo "</table>";
+echo "<br><a href=\"./UserPicture.php?action=FormUpload\">picture upload</a>\n";
+
include ("./inc/footer.php");
?>