コード例 #1
0
/**
 * fuegt eine buchungseinschraenkung fuer einen bestimmten tag ein
 * das mietobjekt und der tag sind unique
 * @author:coster
 * datum: 25.4.06
 * @param $mietobjekt_id id des mietobjektes
 * @param $tag die konstante für die kurzbezeichnung des tages aus datumFuntions.inc.php
 */
function insertBuchungseinschraenkungTag($mietobjekt_id, $tag)
{
    global $root;
    global $link;
    include_once $root . "/include/datumFunctions.inc.php";
    //monat und jahr sind egal, ich verwende ja nur den tag der woche:
    $jahr = 2006;
    $monat = 4;
    $minute = 1;
    $stunde = 1;
    $typ = BE_TYP_TAG;
    $update = false;
    if ($tag == KURZFORM_MONTAG) {
        $tag = 17;
        if (isMondayEingeschraenkt($mietobjekt_id)) {
            $update = true;
        }
    } else {
        if ($tag == KURZFORM_DIENSTAG) {
            $tag = 18;
            if (isTuesdayEingeschraenkt($mietobjekt_id)) {
                $update = true;
            }
        } else {
            if ($tag == KURZFORM_MITTWOCH) {
                $tag = 19;
                if (isWednesdayEingeschraenkt($mietobjekt_id)) {
                    $update = true;
                }
            } else {
                if ($tag == KURZFORM_DONNERSTAG) {
                    $tag = 20;
                    if (isThursdayEingeschraenkt($mietobjekt_id)) {
                        $update = true;
                    }
                } else {
                    if ($tag == KURZFORM_FREITAG) {
                        $tag = 21;
                        if (isFridayEingeschraenkt($mietobjekt_id)) {
                            $update = true;
                        }
                    } else {
                        if ($tag == KURZFORM_SAMSTAG) {
                            $tag = 22;
                            if (isSaturdayEingeschraenkt($mietobjekt_id)) {
                                $update = true;
                            }
                        } else {
                            if ($tag == KURZFORM_SONNTAG) {
                                $tag = 23;
                                if (isSundayEingeschraenkt($mietobjekt_id)) {
                                    $update = true;
                                }
                            } else {
                                echo "fehlerhafte übergabe des tages! insertBuchungunseinschraenkungTag tag=" . $tag;
                                exit;
                            }
                        }
                    }
                }
            }
        }
    }
    $timestampVon = constructMySqlTimestamp($minute, $stunde, $tag, $monat, $jahr);
    $timestampBis = constructMySqlTimestamp($minute, $stunde, $tag, $monat, $jahr);
    if ($update) {
    } else {
        $query = "insert into\n\t\t\t\t   REZ_GEN_BUCHUNGSEINSCHRAENKUNG\n\t\t\t\t   (MIETOBJEKT_ID,VON,BIS,TYP)\n\t\t\t\t   values" . " ('{$mietobjekt_id}','{$timestampVon}','{$timestampBis}','{$typ}')\n\t   \t\t\t  ";
        $res = mysqli_query($link, $query);
        if (!$res) {
            echo "die Anfrage {$query} scheitert";
            echo mysqli_error($link);
            exit;
        }
    }
    return true;
}
コード例 #2
0
			<td colspan="9">
				<hr/> 
		 	</td>	  					  					  					  			
	  	</tr>	
		<?php 
$typ = BE_TYP_TAG;
$res = getTischeWithBuchungseinschraenkungen($gastro_id, $typ);
while ($d = $res->FetchNextObject()) {
    $tisch_id = $d->TISCHNUMMER;
    $raum_id = getRaumOfTisch($tisch_id);
    $raum_tisch = getRaumBezeichnung($raum_id) . "/" . $tisch_id;
    $monday = isMondayEingeschraenkt($tisch_id);
    $tuesday = isTuesdayEingeschraenkt($tisch_id);
    $wednesday = isWednesdayEingeschraenkt($tisch_id);
    $thursday = isThursdayEingeschraenkt($tisch_id);
    $friday = isFridayEingeschraenkt($tisch_id);
    $saturday = isSaturdayEingeschraenkt($tisch_id);
    $sunday = isSundayEingeschraenkt($tisch_id);
    $alle = hasAllTablesWithTypSameLimitation($tisch_id, $typ);
    if ($alle) {
        $tisch_id = "alle";
    }
    ?>
			  <form action="./buchungseinschraenkungLoeschen.inc.php" method="post" target="_self">
			  <input type="hidden" name="mietobjekt_id" value="<?php 
    echo $tisch_id;
    ?>
" /> 
		  		<tr>
		  			<td>
		  				<?php 
コード例 #3
0
$res = getMietobjekteWithBuchungseinschraenkungen($vermieter_id, $typ);
$anzahl = mysqli_num_rows($res);
$anzahlMietobjekte = getAnzahlMietobjekteOfVermieter($vermieter_id);
$alleMietobjekte = false;
if ($anzahl == $anzahlMietobjekte) {
    $alleMietobjekte = true;
}
while ($d = mysqli_fetch_array($res)) {
    $mietobjekt_id = $d["MIETOBJEKT_ID"];
    $moBez = getMietobjektBezeichnung($mietobjekt_id);
    $moBez = getUebersetzungVermieter($moBez, $sprache, $vermieter_id);
    $monday = isMondayEingeschraenkt($mietobjekt_id);
    $tuesday = isTuesdayEingeschraenkt($mietobjekt_id);
    $wednesday = isWednesdayEingeschraenkt($mietobjekt_id);
    $thursday = isThursdayEingeschraenkt($mietobjekt_id);
    $friday = isFridayEingeschraenkt($mietobjekt_id);
    $saturday = isSaturdayEingeschraenkt($mietobjekt_id);
    $sunday = isSundayEingeschraenkt($mietobjekt_id);
    ?>
			  <form action="./buchungseinschraenkungLoeschen.inc.php" method="post" target="_self">
			  <input type="hidden" name="mietobjekt_id" value="<?php 
    echo $mietobjekt_id;
    ?>
" /> 
		  		<tr>
		  			<td>
		  				<?php 
    if ($alleMietobjekte) {
        echo "Alle";
    } else {
        echo $moBez;
コード例 #4
0
/**
 * fuegt eine buchungseinschraenkung fuer einen bestimmten tag ein
 * das mietobjekt und der tag sind unique
 * @author:coster
 * datum: 25.4.06
 * @param $mietobjekt_id id des mietobjektes
 * @param $tag die konstante f�r die kurzbezeichnung des tages aus datumFuntions.inc.php
 */
function insertBuchungseinschraenkungTag($mietobjekt_id, $tag)
{
    global $root;
    global $db;
    if (empty($db) || empty($root)) {
        die("Fehler bei globaler Variable.");
    }
    include_once $root . "/include/datumFunctions.inc.php";
    //monat und jahr sind egal, ich verwende ja nur den tag der woche:
    $jahr = 2006;
    $monat = 4;
    $minute = 1;
    $stunde = 1;
    $typ = BE_TYP_TAG;
    $update = false;
    if ($tag == KURZFORM_MONTAG) {
        $tag = 17;
        if (isMondayEingeschraenkt($mietobjekt_id)) {
            $update = true;
        }
    } else {
        if ($tag == KURZFORM_DIENSTAG) {
            $tag = 18;
            if (isTuesdayEingeschraenkt($mietobjekt_id)) {
                $update = true;
            }
        } else {
            if ($tag == KURZFORM_MITTWOCH) {
                $tag = 19;
                if (isWednesdayEingeschraenkt($mietobjekt_id)) {
                    $update = true;
                }
            } else {
                if ($tag == KURZFORM_DONNERSTAG) {
                    $tag = 20;
                    if (isThursdayEingeschraenkt($mietobjekt_id)) {
                        $update = true;
                    }
                } else {
                    if ($tag == KURZFORM_FREITAG) {
                        $tag = 21;
                        if (isFridayEingeschraenkt($mietobjekt_id)) {
                            $update = true;
                        }
                    } else {
                        if ($tag == KURZFORM_SAMSTAG) {
                            $tag = 22;
                            if (isSaturdayEingeschraenkt($mietobjekt_id)) {
                                $update = true;
                            }
                        } else {
                            if ($tag == KURZFORM_SONNTAG) {
                                $tag = 23;
                                if (isSundayEingeschraenkt($mietobjekt_id)) {
                                    $update = true;
                                }
                            } else {
                                echo "fehlerhafte Übergabe des Tages! insertBuchungunseinschraenkungTag tag=" . $tag;
                                exit;
                            }
                        }
                    }
                }
            }
        }
    }
    $timestampVon = constructBooklineDate($jahr, $monat, $tag, $stunde, $minute);
    $timestampBis = constructBooklineDate($jahr, $monat, $tag, $stunde, $minute);
    if ($update) {
    } else {
        $query = "insert into\n\t\t\t\t   BOOKLINE_RESERVIERUNGSEINSCHRAENKUNG\n\t\t\t\t   (TISCHNUMMER,VON,BIS,TYP)\n\t\t\t\t   values" . " ('{$mietobjekt_id}','{$timestampVon}','{$timestampBis}','{$typ}')\n\t   \t\t\t  ";
        $res = $db->Execute($query);
        if (!$res) {
            print $db->ErrorMsg();
            die($query);
        }
    }
    return true;
}