Example #1
0
                 // Get room name and are name. Would be better to avoid
                 // a database access just for that. Ran only if we need
                 // details.
                 if (MAIL_DETAILS) {
                     $sql = "SELECT r.id, r.room_name, r.area_id, a.area_name ";
                     $sql .= "FROM {$tbl_room} r, {$tbl_area} a ";
                     $sql .= "WHERE r.id={$room_id} AND r.area_id = a.id";
                     $res = sql_query($sql);
                     $row = sql_row($res, 0);
                     $room_name = $row[1];
                     $area_name = $row[3];
                 }
                 // If this is a modified entry then call
                 // getPreviousEntryData to prepare entry comparison.
                 if (isset($id)) {
                     $mail_previous = getPreviousEntryData($id, 0);
                 }
                 $result = notifyAdminOnBooking(!isset($id), $new_id);
             }
         }
     }
 }
 # end foreach $rooms
 # Delete the original entry
 if (isset($id)) {
     mrbsDelEntry(getUserName(), $id, $edit_type == "series", 1);
 }
 sql_mutex_unlock("{$tbl_entry}");
 $area = mrbsGetRoomArea($room_id);
 # Now its all done go back to the day view
 Header("Location: day.php?year={$year}&month={$month}&day={$day}&area={$area}");
Example #2
0
            break;
        case "week":
            $returl = "week.php";
            break;
        default:
            $returl = "day.php";
    }
    $returl .= "?year={$year}&month={$month}&day={$day}&area={$area}";
}
if (getAuthorised(1) && ($info = mrbsGetEntryInfo($id))) {
    $day = strftime("%d", $info["start_time"]);
    $month = strftime("%m", $info["start_time"]);
    $year = strftime("%Y", $info["start_time"]);
    $area = mrbsGetRoomArea($info["room_id"]);
    if (MAIL_ADMIN_ON_DELETE) {
        require_once "functions_mail.inc";
        // Gather all fields values for use in emails.
        $mail_previous = getPreviousEntryData($id, $series);
    }
    sql_begin();
    $result = mrbsDelEntry(getUserName(), $id, $series, 1);
    sql_commit();
    if ($result) {
        // Send a mail to the Administrator
        MAIL_ADMIN_ON_DELETE ? $result = notifyAdminOnDelete($mail_previous) : '';
        Header("Location: {$returl}");
        exit;
    }
}
// If you got this far then we got an access denied.
showAccessDenied($day, $month, $year, $area, "");