freigabe der Pictures
git-svn-id: svn://svn.cccv.de/engel-system@212 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
parent
29d83f0af0
commit
d19b9a9c85
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE `UserCVS` ADD `admin/UserPicture.php` VARCHAR( 1 ) DEFAULT 'N' NOT NULL AFTER `admin/userDefaultSetting.php`;
|
||||
INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin/UserPicture.php', 'DE', 'Engel Bilder');
|
||||
INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin/UserPicture.php', 'EN', 'Angel pictures');
|
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
$title = "UserPicture";
|
||||
$header = "Verwaltung der User Picture";
|
||||
include ("./inc/header.php");
|
||||
include ("./inc/funktion_user.php");
|
||||
include ("./inc/funktion_schichtplan_aray.php");
|
||||
|
||||
|
||||
if( IsSet($_GET["action"]) )
|
||||
{
|
||||
UnSet($SQL);
|
||||
|
||||
switch ($_GET["action"])
|
||||
{
|
||||
case 'SetN':
|
||||
if (IsSet($_GET["UID"]))
|
||||
{
|
||||
echo "Bild von '". UID2Nick( $_GET["UID"]). "' wurde gesperrt:<br>";
|
||||
$SQL = "UPDATE `UserPicture` SET `show`='N' WHERE `UID`='". $_GET["UID"]. "'";
|
||||
}
|
||||
else
|
||||
echo "Fehlerhafter Aufruf";
|
||||
break;
|
||||
case 'SetY':
|
||||
if (IsSet($_GET["UID"]))
|
||||
{
|
||||
echo "Bild von '". UID2Nick( $_GET["UID"]). "' wurde Freigegeben:<br>";
|
||||
$SQL = "UPDATE `UserPicture` SET `show`='Y' WHERE `UID`='". $_GET["UID"]. "'";
|
||||
}
|
||||
else
|
||||
echo "Fehlerhafter Aufruf";
|
||||
break;
|
||||
case 'del':
|
||||
echo "Wollen Sie das Bild von '". UID2Nick( $_GET["UID"]). "' wirklich löschen? ".
|
||||
"<a href=\"./UserPicture.php?action=delYes&UID=". $_GET["UID"]. "\">Yes</a>";
|
||||
break;
|
||||
case 'delYes':
|
||||
if (IsSet($_GET["UID"]))
|
||||
{
|
||||
echo "Bild von '". UID2Nick( $_GET["UID"]). "' wurde gelöscht:<br>";
|
||||
$SQL = "DELETE FROM `UserPicture` WHERE `UID`='". $_GET["UID"]. "' LIMIT 1";
|
||||
}
|
||||
else
|
||||
echo "Fehlerhafter Aufruf";
|
||||
break;
|
||||
default:
|
||||
echo "Fehlerhafter Aufruf";
|
||||
|
||||
} //switch
|
||||
|
||||
// Update ???
|
||||
if (IsSet($SQL))
|
||||
{
|
||||
// hier muesste das SQL ausgefuehrt werden...
|
||||
$Erg = mysql_query($SQL, $con);
|
||||
if ($Erg == 1)
|
||||
echo "Änderung wurde gesichert...<br>";
|
||||
else
|
||||
{
|
||||
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
||||
echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>";
|
||||
}
|
||||
} // Ende Update
|
||||
echo "<br>\n<hr width=\"100%\">\n<br>\n\n";
|
||||
} //IF IsSet($action)
|
||||
|
||||
|
||||
//ausgabe der Liste
|
||||
$Sql = "SELECT * FROM `UserPicture` WHERE `UID`>0;";
|
||||
$Erg = mysql_query($Sql, $con);
|
||||
|
||||
echo "Hallo ". $_SESSION['Nick']. ",<br>\nhier hast du die Möglichkeit, die Bilder der Engel freizugeben:<br><br>\n";
|
||||
|
||||
echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
|
||||
echo "<tr class=\"contenttopic\">\n";
|
||||
echo "\t<td>User</td>\n";
|
||||
echo "\t<td>Bild</td>\n";
|
||||
echo "\t<td>Status</td>\n";
|
||||
echo "\t<td>Löschen</td>\n";
|
||||
echo "</tr>";
|
||||
|
||||
for( $t = 0; $t < mysql_num_rows($Erg); $t++ )
|
||||
{
|
||||
$UID = mysql_result($Erg, $t, "UID");
|
||||
echo "\t<tr class=\"content\">\n";
|
||||
|
||||
echo "\t\t<td>". UID2Nick(mysql_result($Erg, $t, "UID")). "</td>\n";
|
||||
echo "\t\t<td>". displayPictur( $UID, 0). "</td>\n";
|
||||
|
||||
if( GetPicturShow( $UID) == "Y")
|
||||
echo "\t\t<td><a href=\"./UserPicture.php?action=SetN&UID=$UID\">sperren</a></td>\n";
|
||||
elseif( GetPicturShow( $UID) == "N")
|
||||
echo "\t\t<td><a href=\"./UserPicture.php?action=SetY&UID=$UID\">freigeben</a></td>\n";
|
||||
else
|
||||
echo "\t\t<td>ERROR: show='". GetPicturShow( $UID). "'</td>\n";
|
||||
echo "\t\t<td><a href=\"./UserPicture.php?action=del&UID=$UID\">del</a></td>\n";
|
||||
echo "\t</tr>\n";
|
||||
} // ende Auflistung Raeume
|
||||
echo "</table>";
|
||||
|
||||
include ("./inc/footer.php");
|
||||
?>
|
|
@ -24,7 +24,9 @@ if( mysql_num_rows($res) == 1)
|
|||
}
|
||||
|
||||
// ist das bild sichtbar?
|
||||
if( (mysql_result($res, 0, "show")=="N") AND ($_SESSION['UID']!=$_GET["UID"]) )
|
||||
if( (mysql_result($res, 0, "show")=="N") AND
|
||||
($_SESSION['UID']!=$_GET["UID"]) AND
|
||||
($_SESSION['CVS'][ "admin/UserPicture.php" ] == "N"))
|
||||
{
|
||||
$SQL= "SELECT * FROM `UserPicture` WHERE `UID`='-1'";
|
||||
$res = mysql_query( $SQL, $con);
|
||||
|
|
Loading…
Reference in New Issue