} echo "</tr>"; // Months for ($counter = 1; $counter <= 12; $counter += 1) { echo "<tr><td align='center'>"; echo $month[$counter]; echo "</td>"; // In each month, list all reservations //echo "<td>"; unset($R_ID); unset($arrivDay); unset($arrivMonth); unset($departDay); unset($departMonth); unset($name); getReservation($counter, $R_ID, $arrivDay, $arrivMonth, $departDay, $departMonth, $name); $pivotDate = 1; $columnSpan = 0; // If there is no event in the month if (sizeof($R_ID) == 0) { for ($pivotDate; $pivotDate <= 31; $pivotDate += 1) { echo "<td> </td>"; } } else { for ($count = 0; $count < sizeof($R_ID); $count += 1) { // Event that spans 2 months // Event that starts on a differnt month if ($arrivMonth[$count] != $counter) { $columnSpan = $departDay[$count] - $pivotDate + 1; echo "<td bgcolor=#" . $color . " style='color:white; white-space:nowrap; overflow hidden' align='center' colspan='" . $columnSpan . "'>"; //echo $name[$count];
/** aendert den status einer reservierung author: coster date: 9.9.05 */ function changeReservationState($res_id, $status, $link) { //daten eintragen: $query = "UPDATE \n\t\t\t\tRezervi_Reservierung\n\t\t\t\tSET\n\t\t\t\tStatus = '{$status}'\n\t\t\t\tWHERE\n\t\t\t\tPK_ID = '{$res_id}'\n\t\t \t "; $res = mysqli_query($link, $query); if (!$res) { echo "die Anfrage {$query} scheitert"; } $reservierung = getReservation($res_id); $gast_id = $reservierung['FK_Gast_ID']; $datum_von = $reservierung['Datum_von']; $datum_bis = $reservierung['Datum_bis']; //auch fuer alle child rooms aendern: $query = "select FK_Zimmer_ID from Rezervi_Reservierung where PK_ID = '{$res_id}'"; $res = mysqli_query($link, $query); $d = mysqli_fetch_array($res); $zimmer_id = $d['FK_Zimmer_ID']; $resu = getChildRooms($zimmer_id); if (!empty($resu)) { while ($d = mysqli_fetch_array($resu)) { $child = $d['PK_ID']; $query = "update Rezervi_Reservierung " . "set Status = '{$status}' where FK_Zimmer_ID = '{$child}' " . "and FK_Gast_ID = '{$gast_id}' and Datum_von = '{$datum_von}' and " . "Datum_bis = '{$datum_bis}'"; $res = mysqli_query($link, $query); if (!$res) { die("die Anfrage {$query} scheitert"); } } } return true; }
if (!empty($_POST['reserve'])) { $arrival = $_POST['arrival_date']; $departure = $_POST['departure_date']; } if (isset($_POST['update'])) { $no = $_POST['room_number']; $name = $_POST['name']; $tp = $_POST['room_type']; $des = $_POST['description']; $query = "update room set name='" . $name . "' , cat_id='" . $tp . "' , room_id='" . $des . "' where room_no='" . $no . "'"; //updateRoom($query); //header('Location: home.php'); } if (isset($_GET['order'])) { $order = $_GET['order']; $custreservation = getReservation($order); } if (isset($_POST['add'])) { $no = getReserveId(); $amount = 0; $from = $_POST['arrival_date']; $to = $_POST['departure_date']; //Rates $childrate = 0.75; $childshare = 0.5; //$room_no=$_POST['room']; $tp = $_POST['room_type']; $des = $_POST['room_description']; $totalamnt = $_POST['total-amount']; $payment = $_POST['amount']; $code = $_POST['code'];
//echo "<td>"; unset($R_ID); unset($arrivDay); unset($arrivMonth); unset($arrivTime); unset($departDay); unset($departMonth); unset($arrivTime); unset($name); unset($homePhone); unset($mobile); unset($email); unset($homeAddress); unset($perNum); unset($C_ID); getReservation($year, $counter, $R_ID, $arrivDay, $arrivMonth, $arrivTime, $departDay, $departMonth, $departTime, $name, $homePhone, $mobile, $email, $homeAddress, $perNum, $C_ID); $pivotDate = 1; $columnSpan = 0; // If there is no event in the month if (sizeof($R_ID) == 0) { for ($pivotDate; $pivotDate <= 31; $pivotDate += 1) { echo "<td> </td>"; } } else { for ($count = 0; $count < sizeof($R_ID); $count += 1) { // Event that spans 2 months // Event that starts on a differnt month if ($arrivMonth[$count] != $counter) { $columnSpan = $departDay[$count] - $pivotDate + 1; echo "<td bgcolor=#" . $color . " style='overflow:hidden; color:white; white-space:nowrap; overflow hidden;' align='center' colspan='" . $columnSpan . "'>"; //echo $name[$count];