/** * fuegt eine buchungseinschraenkung fuer ein unique mietobjekt ein * @author coster * date 24.4.06 */ function setBuchungseinschraenkungUniqueMietobjekt($mietobjekt_id, $timestampVon, $timestampBis, $typ) { global $link; if (hasMietobjektBuchungseinschraenkung($mietobjekt_id, $typ) == true) { $query = "update REZ_GEN_BUCHUNGSEINSCHRAENKUNG set " . "VON = '{$timestampVon}', " . "BIS = '{$timestampBis}', " . "TYP = '{$typ}' " . "where MIETOBJEKT_ID = '{$mietobjekt_id}'"; } 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; } else { return true; } }
/** * fuegt eine buchungseinschraenkung fuer ein unique mietobjekt ein * @author coster * date 24.4.06 */ function setBuchungseinschraenkungUniqueTisch($mietobjekt_id, $timestampVon, $timestampBis, $typ) { global $db; if (hasMietobjektBuchungseinschraenkung($mietobjekt_id, $typ) == true) { $query = "update BOOKLINE_RESERVIERUNGSEINSCHRAENKUNG set " . "VON = '{$timestampVon}', " . "BIS = '{$timestampBis}', " . "TYP = '{$typ}' " . "where TISCHNUMMER = '{$mietobjekt_id}'"; } 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); } else { return true; } }