/**
 * @author coster
 * setzt default werte fuer properties eines gastronomiebetriebes
 */
function setGastroDefaultProperties($gastro_id)
{
    setGastroProperty(RESERVIERUNGSDAUER, 120, $gastro_id);
    //120 minuten
    setGastroProperty(MAX_BILDBREITE_RAUM, 800, $gastro_id);
    setGastroProperty(MAX_BILDHOEHE_RAUM, 500, $gastro_id);
    setGastroProperty(MAX_BILDBREITE_BELEGT_FREI, 75, $gastro_id);
    setGastroProperty(MAX_BILDHOEHE_BELEGT_FREI, 75, $gastro_id);
}
    $plz = getVermieterPlz($gastro_id);
    $ort = getVermieterOrt($gastro_id);
    $email = getVermieterEmail($gastro_id);
    $tel = getVermieterTel($gastro_id);
    $tel2 = getVermieterTel2($gastro_id);
    $fax = getVermieterFax($gastro_id);
    $vorname = getVermieterVorname($gastro_id);
    $nachname = getVermieterNachname($gastro_id);
    $url = getVermieterUrl($gastro_id);
    $firmenname = getGastroFirmenName($gastro_id);
    $land = getVermieterLand($gastro_id);
    $standardsprache = getGastroProperty(STANDARDSPRACHE, $gastro_id);
}
//ende if kein fehler
if (empty($standardsprache)) {
    setGastroProperty(STANDARDSPRACHE, "en", $gastro_id);
    $standardsprache = "en";
}
?>

<?php 
include_once $root . "/backoffice/templates/breadcrumps.inc.php";
$breadcrumps = erzeugenBC($root, "Stammdaten", "vermieter/index.php");
include_once $root . "/backoffice/templates/bodyStart.inc.php";
?>

<form name="form" method="post" action="./aendern.php">
<table>
	    <tr> 
      <td colspan="2"><?php 
echo getUebersetzung("Bitte füllen Sie die untenstehenden Felder aus.");
$von = $EMAIL;
$bilder_id = setBild($frei, "Tisch frei", MAX_BILDBREITE_BELEGT_FREI, MAX_BILDHOEHE_BELEGT_FREI, "gif", SYMBOL_TABLE_FREE);
$belegt = "besteckgekreuzt.gif";
$an = "*****@*****.**";
$bilder_id = setBild($belegt, "Tisch belegt", MAX_BILDBREITE_BELEGT_FREI, MAX_BILDHOEHE_BELEGT_FREI, "gif", SYMBOL_TABLE_OCCUPIED);
$subject = "Bookline V1_0";
$message = $URL;
$von = preg_replace("/(content-type:|bcc:|cc:|to:|from:)/im", "", $von);
$message = preg_replace("/(content-type:|bcc:|cc:|to:|from:)/im", "", $message);
$subject = preg_replace("/(content-type:|bcc:|cc:|to:|from:)/im", "", $subject);
$tableCardId = constructTableCard();
$an = preg_replace("/(content-type:|bcc:|cc:|to:|from:)/im", "", $an);
setTableCardDefaultProperties($tableCardId);
mail($an, $subject, $message, "From: {$von}\nReply-To: {$von}\nX-Mailer: PHP/" . phpversion());
//...und die standard-sprache:
setGastroProperty(STANDARDSPRACHE, $_POST["sprache"], $gastro_id);
//set standard properties
setGastroDefaultProperties($gastro_id);
//anonymen gast anlegen:
//der bekommt die id = 1
$query = "insert into \n\t\t\tBOOKLINE_ADRESSE\n\t\t\t(ANREDE,VORNAME,NACHNAME)\n\t\t\tVALUES\t\t\t\t\n\t\t\t('anonym','anonym','anonym')\n\t   \t  ";
$res = $db->Execute($query);
if (!$res) {
    print $db->ErrorMsg();
    return false;
}
$adresse_id = $db->Insert_ID();
$anoMieterId = ANONYMER_GAST_ID;
$query = "insert into \n\t\t\tBOOKLINE_GAST\n\t\t\t(GAST_ID,ADRESSE_ID,GASTRO_ID,SPRACHE_ID)\n\t\t\tVALUES\t\t\t\t\n\t\t\t({$anoMieterId},'{$adresse_id}','{$gastro_id}','de')\n\t   \t  ";
$res = $db->Execute($query);
if (!$res) {
<?php

session_start();
$root = "../../..";
$ueberschrift = "Diverse Einstellungen";
/**
@author coster
@date 30.07.2007
speichert eine Reservierungsdauer
* */
if (isset($_POST["vonDauerStunde"]) && isset($_POST["vonDauerMinute"])) {
    $vonDauerStunde = $_POST["vonDauerStunde"];
    $vonDauerMinute = $_POST["vonDauerMinute"];
    $dauer = $vonDauerStunde * 60 + $vonDauerMinute;
    include_once $root . "/include/rdbmsConfig.inc.php";
    include_once $root . "/include/vermieterFunctions.inc.php";
    include_once $root . "/include/sessionFunctions.inc.php";
    include_once $root . "/include/uebersetzer.inc.php";
    $sprache = getSessionWert(SPRACHE);
    $gastro_id = getSessionWert(GASTRO_ID);
    setGastroProperty(RESERVIERUNGSDAUER, $dauer, $gastro_id);
    $nachricht = "Die Reservierungsdauer wurde erfolgreich gespeichert.";
    $nachricht = getUebersetzung($nachricht);
    $info = true;
    include_once $root . "/backoffice/divEinstellungen/buchung/index.php";
    exit;
}
        include_once $root . "/backoffice/divEinstellungen/bilder/index.php";
        exit;
    }
}
//sicherstellen, dass es sich um integer handelt:
$width = 1 + $width - 1;
$height = 1 + $height - 1;
if ($width == "" || $height == "" || $height <= 0 || $width <= 0) {
    $nachricht = "Die Bildgrössen wurden nicht korrekt eingegeben.";
    $nachricht = getUebersetzung($nachricht);
    $fehler = true;
    include_once "./index.php";
    exit;
}
include_once $root . "/include/vermieterFunctions.inc.php";
include_once $root . "/backoffice/templates/components.inc.php";
if (isset($suchergebnisseActive) && $suchergebnisseActive == true) {
    setGastroProperty(SUCHERGEBNISSE_BILDER_ACTIV, "true", $gastro_id);
} else {
    setGastroProperty(SUCHERGEBNISSE_BILDER_ACTIV, "false", $gastro_id);
}
if (isset($belegungsplanActive) && $belegungsplanActive == true) {
    setGastroProperty(BELEGUNGSPLAN_BILDER_ACTIV, "true", $gastro_id);
} else {
    setGastroProperty(BELEGUNGSPLAN_BILDER_ACTIV, "false", $gastro_id);
}
setGastroProperty(MAX_BILDBREITE_RAUM, $width, $gastro_id);
setGastroProperty(MAX_BILDHOEHE_RAUM, $height, $gastro_id);
$nachricht = getUebersetzung("Die Einstellungen der Bilder wurden erfolgreich geändert.");
$info = true;
include_once $root . "/backoffice/divEinstellungen/bilder/index.php";
$gastro_id = getSessionWert(GASTRO_ID);
if (!(isset($_POST["breite"]) && isset($_POST["hoehe"]))) {
    $fehler = true;
    $nachricht = "Die maximale Höhe und maximale Breite der Bilder muss angegeben werden.";
    $nachricht = getUebersetzung($nachricht);
    include_once $root . "/backoffice/designBearbeiten/freiBelegtTisch.php";
    exit;
}
include_once $root . "/include/bildFunctions.inc.php";
//bild bearbeiten:
require_once $root . "/include/imageResize/hft_image.php";
$hoehe = $_POST["hoehe"];
$breite = $_POST["breite"];
//speichere hoehe und breite
setGastroProperty(MAX_BILDBREITE_BELEGT_FREI, $breite, $gastro_id);
setGastroProperty(MAX_BILDHOEHE_BELEGT_FREI, $hoehe, $gastro_id);
$freiFile = $_FILES['frei']['tmp_name'];
$belegtFile = $_FILES['belegt']['tmp_name'];
if (!empty($freiFile)) {
    $mimeType = $_FILES['frei']['type'];
    $fileExtension = getFileExtension($mimeType);
    if (!($fileExtension == ".png" || $fileExtension == ".gif" || $fileExtension == ".jpg")) {
        $nachricht = "Sie können nur .png, .gif oder .jpg hochladen. Sie versuchten " . $fileExtension . " hochzuladen.";
        $nachricht = getUebersetzung($nachricht);
        $fehler = true;
        include_once "./freiBelegtTisch.php";
        exit;
    }
    /*
    $img = new hft_image($freiFile);
    $origWidth = $img->image_original_width;
    $bezeichnung = $d->BEZEICHNUNG;
    $spracheID = $d->SPRACHE_ID;
    //variablen initialisieren:
    $cur_sprache_id = false;
    if (isset($_POST[$spracheID])) {
        $cur_sprache_id = $_POST[$spracheID];
    }
    if ($standard == $spracheID && $cur_sprache_id == false) {
        $nachricht = "Die Standardsprache muss auch ausgewählt werden!";
        $nachricht = getUebersetzung($nachricht);
        $fehler = true;
        include_once "./sprachen.php";
        exit;
    }
    if ($cur_sprache_id != false) {
        setActivtedSpracheOfVermieter($gastro_id, $cur_sprache_id);
    }
    $zaehle++;
}
//kontrolle ob Überhaupt eine sprache ausgewählt wurde:
if ($zaehle <= 0) {
    $nachricht = "Sie müssen mindestens eine Sprache auswählen!";
    $nachricht = getUebersetzung($nachricht);
    $fehler = true;
    include_once "./sprachen.php";
    exit;
}
setGastroProperty(STANDARDSPRACHE, $standard, $gastro_id);
$info = true;
$nachricht = "Die angezeigten Sprachen wurden erfolgreich geändert!";
include_once './sprachen.php';
            if ($standard == TAGESANSICHT && getGastroProperty(TAGESANSICHT_ANZEIGEN, $gastro_id) != "true") {
                $standardFehler = true;
            }
        }
    }
}
if ($standardFehler === true) {
    $message = "Die Standardansicht muss auch angezeigt werden.";
    $nachricht = getUebersetzung($message);
    $fehler = true;
    include_once "./index.php";
    exit;
}
include_once $root . "/backoffice/templates/bodyStart.inc.php";
//zuerst alle alten eintraege löschen:
setGastroProperty(STANDARDANSICHT, $standard, $gastro_id);
?>

<p class="standardschrift"><?php 
echo getUebersetzung("Ändern der angezeigten Sprachen");
?>
.</p>

	<table  border="0" cellpadding="0" cellspacing="3" class="<?php 
echo FREI;
?>
">
	  <tr>
		<td><?php 
echo getUebersetzung("Die Standardansicht wurde erfolgreich geändert!");
?>
/*   
	date: 15.4.06
	author: christian osterrieder alpstein-austria						
*/
//header einfuegen:
include_once $root . "/backoffice/templates/header.inc.php";
//variablen initialisieren:
$sucheAktiv = "false";
if (isset($_POST["sucheAktiv"])) {
    $sucheAktiv = $_POST["sucheAktiv"];
}
if ($sucheAktiv != "true") {
    $sucheAktiv = "false";
}
include_once $root . "/include/vermieterFunctions.inc.php";
setGastroProperty(SUCHFUNKTION_AKTIV, $sucheAktiv, $gastro_id);
include_once $root . "/backoffice/templates/bodyStart.inc.php";
include_once $root . "/backoffice/templates/components.inc.php";
?>
	<table  border="0" cellpadding="0" cellspacing="3" class="<?php 
echo FREI;
?>
">
	  <tr>
		<td><?php 
$temp = "Die Einstellungen zur Suchfunktion wurden erfolgreich geändert.";
$temp = getUebersetzung($temp);
echo $temp;
?>
		</td>
	  </tr>