Example #1
0
function addVersorgungSelect($zimmerid)
{
    $a = getHotelPreis(getHotelIDByZimmerID($zimmerid), null, $zimmerid, TRUE);
    // $a = 0;
    $elem = 'vhidden[' . $zimmerid . ']';
    $ret = "<select class='versorgung' name='versorgung{$zimmerid}' id='sel{$zimmerid}'>";
    $ret .= "<option value='0'>Selbstversorgung</option>";
    $ret .= "<option value=" . round($a * 1 / 11, 0) . ">Frühstück + " . round($a * 1 / 11, 0) . "€</option>";
    $ret .= "<option value=" . round($a * 1 / 5, 0) . ">Halbpension + " . round($a * 1 / 5, 0) . "€</option>";
    $ret .= "<option value=" . round($a * 2 / 5, 0) . ">Vollpension + " . round($a * 2 / 5, 0) . "€</option>";
    $ret .= "<option value=" . round($a * 3 / 5, 0) . ">Allinclusive + " . round($a * 3 / 5, 0) . "€</option>";
    $ret .= "</select>";
    $ret .= '<script type="text/javascript">
			var sel = document.getElementById("sel' . $zimmerid . '");
			sel.onchange = function() {
				var preis = parseInt(' . $a . ')+parseInt(this.value);
				var show = document.getElementById("preis' . $zimmerid . '");
				var opt = "selectzimmer[' . $zimmerid . ', "+this.options[this.selectedIndex].text+"]";
				show.innerHTML = "Preis: "+preis+" €";
				document.getElementById("' . $elem . '").value=this.options[this.selectedIndex].text;
				//document.getElementById("selectzimmer-' . $zimmerid . '").name= opt;
			}
		</script>';
    return $ret;
}
Example #2
0
function endpreisBerechnen()
{
    if ($_SESSION["preis"]["gesamt"] == "" && !isset($_SESSION["preis"]["gesamt"])) {
        if ($_SESSION["suchen"]["auto"] === "on") {
            $_SESSION["preis"]["auto"] = getAutoPreis($_SESSION["auto"]);
        } else {
            $_SESSION["preis"]["auto"] = 0;
        }
        if ($_SESSION["suchen"]["hotel"] === "on") {
            $_SESSION["preis"]["hotel"] = getHotelPreis($_SESSION["hotel"], $_SESSION["versorgung"], $_SESSION["zimmer"]);
        } else {
            $_SESSION["preis"]["hotel"] = 0;
        }
        $_SESSION["preis"]["flug"] = getFlugPreis($_SESSION["hinflug"]["flug"], $_SESSION["rueckflug"]["flug"]);
        $_SESSION["preis"]["gesamt"] = round($_SESSION["preis"]["auto"] + $_SESSION["preis"]["hotel"] + $_SESSION["preis"]["flug"], 0);
    }
    return $_SESSION["preis"]["gesamt"];
}
Example #3
0
function genHotel($id, $button = TRUE, $versorgung = null)
{
    $ab2 = "SELECT * FROM Hotel WHERE id='{$id}'";
    $res = mysql_query($ab2);
    $hotel = mysql_fetch_object($res);
    $belegung = getBelegteZimmerZahl($hotel->id) . "/" . $hotel->zimmerzahl;
    $frei = $hotel->zimmerzahl - mysql_num_rows($res);
    $dist = getDistance($hotel->strasse . "" . $hotel->ort, "airport " . $hotel->naherFlughafen);
    $preis = $button ? "ab " . getHotelPreis($hotel->id, null, 0, TRUE) : $_SESSION["preis"]["hotel"];
    // <input class="selectzimmer' . $hotel -> zimmerid . '" Name = "selectzimmer[' . $hotel -> zimmerid . ']"
    // onclick="toggle_visibility_class(\'$selectzimmer' . $hotel -> zimmerid . '\')" value="Zimmer">
    $onclick = "toggle_visibility('zimmer" . $hotel->id . "');";
    $select = $button ? '<input id="suchen" type="button"  onclick="' . $onclick . '" name = "selecthotel[' . $id . ']" value="Zimmer">' : '';
    echo '<div class="hotel' . ($button ? "" : 2) . '">
								<div class="hotelBildDiv">
									<img id="hotelBild" src="images/hotels/' . getHotelBild($hotel->name) . '" /> 
								</div>
								<div class="hotelBeschreibungDiv">
									<div class="hotelBeschreibung">
										<div class="hotelHeader">
											<div class="hotelName">' . $hotel->name . ' (<a href="' . $hotel->homepage . '" target="_blank">info</a>) </div>
											<div class="sterndiv">' . addSterne($hotel->sterne, "images/") . '</div>
										</div>
										<div class="belegung">
											freie Zimmer:
											' . $frei . '
										</div>
										<div class="adresseDiv">
											<div class="adresse">' . $hotel->strasse . '</div>
											<div class="adresse">' . $hotel->ort . '</div>
											<div class="adresse">' . getLandNameByISO($hotel->land) . ' ' . getFlagByFlughafenID($hotel->naherFlughafen) . '</div>
										</div>
										<div class="naherFlughafen">
											Nächster Flughafen:</br>
											' . getFlughafenOrtByID($hotel->naherFlughafen) . ' (' . $hotel->naherFlughafen . '):
											' . $dist . ' km
										</div>
										<div class="hotelPreis">
											' . $preis . ' €
										</div>
										' . $select . '
										
									</div>
								</div>
							</div>';
}