Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        $self=basename($PHP_SELF);
        $DB="gaestebuch_design";
        require_once "../connect2.php";
        require_once "../webs.php";
        if ($action)
        {
                $query = "insert into $DB (site,erstellt_am,erstellt_von,letzte_Aenderung_am,letzte_Aenderung_von) VALUES ('$site',NOW(),'$PHP_AUTH_USER',NOW(),'$PHP_AUTH_USER')";
                $result = mysql_query ($query);

                unset($HTTP_POST_VARS[action]);

                // ######################################################################################
                $conn_id = ftp_connect("$webs[FTP_server]");
                if ($webs[FTP_passiv])
                {
//                      ftp_pasv ($conn_id,1);
                }

                $login_result = ftp_login($conn_id, "$webs[FTP_user]", "$webs[FTP_passwd]"); 
                // Verbindung überprüfen
                if ((!$conn_id) || (!$login_result)) 
                { 
                echo "Ftp-Verbindung nicht hergestellt!";
                echo "Verbindung mit $ftp_server als Benutzer $user nicht möglich"; 
                die; 
        } 

                foreach(array_keys($HTTP_POST_VARS) as $elem)
                {
                        if ($elem[0] == "_")
                        {
                                unset($HTTP_POST_VARS[$elem]);
                                $button=$$elem;
                                $elem=substr($elem,1);
                                $Pfad=$HTTP_POST_VARS[$elem."_Pfad"];
                                unset($HTTP_POST_VARS[$elem."_Pfad"]);
                                $image=$$elem;
                                $image_name=$elem."_name";
                                $image_name=urlencode($$image_name);
                                switch ($button) 
                                {
                                        case 0:
                                                break;
                                        case 1:
                                                $HTTP_POST_VARS[$elem]='';
                                                break;
                                        case 2:
                                                if ($image != "none")
                                                {
                                                        $image_name=$elem.strrchr($image_name,".");
                                                        $HTTP_POST_VARS[$elem]=$image_name;
                                                        //copy($image,$Pfad.$image_name);

                                                        $upload = ftp_put($conn_id, "$Pfad$image_name", "$image", FTP_BINARY); 
                                                        if (!$upload) 
                                                        { 
                                                        echo "Ftp upload war fehlerhaft!";
                                                }
                                                }
                                        break;
                                    default:
                                        break;
                            }
                        }
                }
                ftp_quit($conn_id); 

                // ######################################################################################

                $names=array();
                foreach(array_keys($HTTP_POST_VARS) as $elem)
                {
                        array_push($names,"$elem='$HTTP_POST_VARS[$elem]'");
                }
                $query="update $DB set letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER', ".join($names,', ');
                $query=$query." where site = '$site'";
                $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
                require_once "update_file.php";
                header("Location: ".$self);  
        }
?>

<html>
<head>
<title>Content-Management-System - Webagentur Niewerth</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
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;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

//-->
</script>
<script language="javascript" src="../Farb_Assistent.js"></script>
<meta name="description" content="Redaktionssystem">
<meta name="author" content="Webagentur Niewerth">
<meta name="robots" content="noindex">
<link rel=stylesheet type="text/css" href="../buttons.css">
<style type="text/css"><? require_once "../buttons.css"; ?></style>
</head>

<body bgcolor="#<? echo $webs[bgcolor_seite]; ?>" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages('../images/navigation/bt_neu_f2.gif','../images/navigation/bt_delete_f2.gif','../images/navigation/bt_bearbeiten_f2.gif')" text="#000000">
<form method="post" action="#" name="formname" enctype="multipart/form-data">
  <table width="555" border="0" cellspacing="0" cellpadding="0">
    <tr valign="top"> 
      <td width="485"> 
        <?
        $result = mysql_query ("SELECT * FROM $DB where site='$site'") or die (mysql_errno().": ".mysql_error());
        $zeile=mysql_fetch_array($result);
        ?>
        <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
          <tr bgcolor="#<? echo $webs[bgcolor_links] ?>"> 
            <td colspan="3" class="headline">G&auml;stebuchdesign: Bearbeiten 
            </td>
          </tr>
          <tr> 
            <td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105" rowspan="2">Hintergrund:</td>
            <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>" colspan="2"> 
              <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr> 
                  <td nowrap width="60%">Farbe: # 
                    <input type="text" name="bgcolor" size="6" maxlength="6" value="<? echo $zeile[bgcolor] ?>">
                    <input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.bgcolor.value,'document.formname.bgcolor.value');" name="button">
                  </td>
                  <td width="40%" align="center"> 
                    <table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td bgcolor="<? echo $zeile[bgcolor] ?>">&nbsp;</td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>"> 
              <?
        $image_name="background";
        $image_Path="/images/gaestebuch/";
?>
              <input type="hidden" name="<? echo $image_name ?>_Pfad" value="<? echo $image_Path ?>">
              <?
        if ($zeile[$image_name] != "")
        {
?>
              <input type="radio" name="_<? echo $image_name ?>" value="0" checked>
              <a href="http://www.<? echo $site.$image_Path.$zeile[$image_name] ?>" target="blank"> 
              <? echo $zeile[$image_name]; ?>
              </a> <BR>
              <?
        }
?>
              <input type="radio" name="_<? echo $image_name ?>" value="1" <? if ($zeile[$image_name] == "") {echo "checked";}?>>
              kein Bild<br>
              <input type="radio" name="_<? echo $image_name ?>" value="2">
              <input type="File" name="<? echo $image_name ?>" size="17" maxlength="255" onFocus="this.form._<? echo $image_name ?>[<? if ($zeile[$image_name] != "") {echo "2";} else {echo "1";} ?>].checked=true;">
            </td>
          </tr>
          <tr> 
            <td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105" rowspan="2">Text:</td>
            <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>"> 
              <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr> 
                  <td nowrap width="60%">Farbe: # 
                    <input type="text" name="textcolor" size="6" maxlength="6" value="<? echo $zeile[textcolor] ?>">
                    <input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.textcolor.value,'document.formname.textcolor.value');" name="button">
                  </td>
                  <td width="40%" align="center"> 
                    <table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td bgcolor="<? echo $zeile[textcolor] ?>">&nbsp;</td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">Art:
        <select name="textart" size="1">
                <option value="Arial, Helvetica, sans-serif"<? if ($zeile[textart] == "Arial, Helvetica, sans-serif") {echo " selected";} ?>>Arial</option>
                <option value="Times New Roman, Times, serif"<? if ($zeile[textart] == "Times New Roman, Times, serif") {echo " selected";} ?>>Times New Roman</option>
                <option value="Courier New, Courier, mono"<? if ($zeile[textart] == "Courier New, Courier, mono") {echo " selected";} ?>>Courier</option>
                <option value="Verdana, Arial, Helvetica, sans-serif"<? if ($zeile[textart] == "Verdana, Arial, Helvetica, sans-serif") {echo " selected";} ?>>Verdana</option>
      </select>
              Gr&ouml;&szlig;e: 
              <? if (!$zeile[textgroesse]) {$zeile[textgroesse]=2;} ?>
              <select name="textgroesse" size="1">
                <option<? if ($zeile[textgroesse] == "1") {echo " selected";} ?>>1</option>
                <option<? if ($zeile[textgroesse] == "2") {echo " selected";} ?>>2</option>
                <option<? if ($zeile[textgroesse] == "3") {echo " selected";} ?>>3</option>
                <option<? if ($zeile[textgroesse] == "4") {echo " selected";} ?>>4</option>
                <option<? if ($zeile[textgroesse] == "5") {echo " selected";} ?>>5</option>
                <option<? if ($zeile[textgroesse] == "6") {echo " selected";} ?>>6</option>
      </select>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" valign="top" width="105">Trennbild:</td>
            <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>"> 
              <?
        $image_name="trennbild";
        $image_Path="/images/gaestebuch/";
?>
              <input type="hidden" name="<? echo $image_name ?>_Pfad" value="<? echo $image_Path ?>">
              <?
        if ($zeile[$image_name] != "")
        {
?>
              <input type="radio" name="_<? echo $image_name ?>" value="0" checked>
              <a href="http://www.<? echo $site.$image_Path.$zeile[$image_name] ?>" target="blank"> 
              <? echo $zeile[$image_name]; ?>
              </a> <BR>
              <?
        }
?>
              <input type="radio" name="_<? echo $image_name ?>" value="1" <? if ($zeile[$image_name] == "") {echo "checked";}?>>
              kein Bild<br>
              <input type="radio" name="_<? echo $image_name ?>" value="2">
              <input type="File" name="<? echo $image_name ?>" size="17" maxlength="255" onFocus="this.form._<? echo $image_name ?>[<? if ($zeile[$image_name] != "") {echo "2";} else {echo "1";} ?>].checked=true;">
            </td>
          </tr>
          <? if ($ID) {?>
          <tr bgcolor="#<? echo $webs[bgcolor_links] ?>"> 
            <td class="headline" colspan="4">Datensatz:</td>
          </tr>
          <tr> 
            <td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="105">erstellt:</td>
            <td colspan="3" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">am: 
              <? $erstellt_am=datetime2human($zeile[erstellt_am]); ?>
              <? echo $erstellt_am[Datum] ?>
              &nbsp;&nbsp;um: 
              <? echo $erstellt_am[Zeit] ?>
              &nbsp;&nbsp;von: 
              <? echo $zeile[erstellt_von] ?>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="105" nowrap>letzte &Auml;nderung:</td>
            <td colspan="3" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">am: 
              <? $letzte_Aenderung_am=datetime2human($zeile[letzte_Aenderung_am]); ?>
              <? echo $letzte_Aenderung_am[Datum] ?>
              &nbsp;&nbsp;um: 
              <? echo $letzte_Aenderung_am[Zeit] ?>
              &nbsp;&nbsp;von: 
              <? echo $zeile[letzte_Aenderung_von] ?>
            </td>
          </tr>
          <? } ?>
          <tr bgcolor="#<? echo $webs[bgcolor_links] ?>"> 
            <td align="right" colspan="3"> 
              <input type="submit" name="action" value="OK">
              <input type="reset" name="Button" value="Zur&uuml;cksetzen">
            </td>
          </tr>
        </table>
 </td>
</tr>
</table>
</form>
</body>