The Brown Hats Software Depot: F' Around & Find Out!

Login | Register (Invite Only)

pagetelegram's Profile

Title: Page Telegram of Amfile.org

Description: Brown Hats Collective F' Around and Find Out user of the Interwebs and Project Developer for a Cause Toward Insuring a Future of Liberty without Illusion.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@=:---#@@@#%@@@*=+#@%====@@@@..:--@#====@-==#@@@+===#@%=-+@... -@@@@*@@@=+@%-*@
@@@.*@-.@@@.:@@==@:=@+ -..*@@@:# @:@=.=. #%.#@@@@ ::..@.%#.@@ %+ %@@% #@@-.@+ #@
@@@.*@+.@@@:.@@.#@%*@*.@.-*@@%@#.@.@=.%..#% *@@@@ %:+:+:@@=@@ #+ %@@+..@@= %: @@
@@@..-.=@@:* %@.%#=+@+..:@@@@@@*.@@@=..:@@@ %@%%% :.@@+-@:=#@ ...@@@:+ @@+ :- @@
@@@.+@@@@@.- =@.#@.-@*.@:=@@@@@+ @@@+:@-:@% @@*=@ @=%#+-@-.#@ @*.%@@.- #@=. + @@
@@@.+@@@@+.@..@:*%.*@*.@%.@@@@%- +@@=:@%.@@.%@:=@ @@=*#:@::@@ *# =@--% -@:- * @@
@@-::#@@%::+::*@-:=%@::.::@@@@+-::@*:.:::@::...%:::::#@*:==@#==@+:*.:=::%:-=::=@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#-.  .-#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.        .+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-            :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:              .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:      .++:      .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=     :@@@@@@-     -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@#     =@@@@@@@@+     #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@:    =@@@@@@@@@@+    .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@#    .@@@@@@@@@@@@.    *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@.    %@@@@@@@@@@@@%.    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@%    -@@@@@@@@@@@@@@-    #@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@=    #@@@@@@@@@@@@@@%    -@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@.   .@@@@@@@@@@@@@@@@.   .@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@    -@@@@%##***#%@@@@+    %@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@*    %@#:..       .:+@%    *@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@=    =.               :    -@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@:                          .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@.                          .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@.       .=%@@@@@@@+:       .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@#      .%@@@@@@@@@@@@@-      -@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@#     .*@@@@@@@@@@@@@@@@%:     -@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@%.    .@@@@@@*%@@@@%#@@@@@@=     *@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@.    :@@@@@@@@:-@@*.%@@@@@@@+     %@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@+    :@@@@@@@@@@---.@@@@@@@@@@=    :@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@.    @@@@@@@@@@@.   @@@@@@@@@@@:    #@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@=    #@@@+--#@@@@    #@@@@%#@@@@@.   .@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@.   :@%-     .%@@-  .@@@*.   .+@@=    #@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@#    *+.       .@@@#*@@@=       .#@    -@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@-   .#          =@@-.@@%.         +=   .@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   -@.          @@. %@:          #%    %@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   #@-          +%  =%          .@@.   *@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@%    %@%          :+  .+          +@@.   =@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@#    @@@:         .:  .-         .@@@:   -@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@*   .@@@%         #   .#         =@@@:   :@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@*   .@@@@=       -@    @-       .@@@@:   :@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@#    @@@@@.     .@@    @@.      %@@@@:   -@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@%    %@@@@@:   :@@@    @@@.   .*@@@@@.   =@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   #@@@@@@#+#@@@@    @@@@=.:%@@@@@@.   *@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   :@@@@@@-..:*@@    @@#-..:%@@@@@#    %@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@-   .@@@@@:     .@    @.     .@@@@@-   .@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@#    *@@@%       @.  .@       *@@@@    -@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@.   .@@@+       @-  .@.      -@@@=    #@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@+    +@@%.     .@*  :@-     .*@@%.   .@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@.    %@@@-    *@%  #@%.   :%@@@.    %@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@*    .@@@@%=-+@@@. @@@*--#@@@@-    -@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@:    .@@@@@@@@@@*=@@@@@@@@@@:     @@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@.    .%@@@@@@@@@@@@@@@@@@@-    .#@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%.     +@@@@@@@@@@@@@@@@#.     +@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@%.     .+@@@@@@@@@@@@%:      +@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@%.       -*%@@@@@#=.      .*@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@:                      .%@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@#.                   +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+.              .=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=.        .-%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%###%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Repositories

Viewing: index.php.txt

<?php
// setup.php for Query Gram
header('Content-Type: text/html; charset=UTF-8');

// Parse URL parameters
$query = isset($_GET['q']) ? urldecode($_GET['q']) : '';
$before = max(0, (int)($_GET['b'] ?? 2));
$after = max(0, (int)($_GET['a'] ?? 2));
$selectedFiles = $_GET['files'] ?? [];
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JFK Query Gram</title>
    <meta property="og:title" content="JFK Query Gram">
    <meta property="og:description" content="Query the JFK records and easily share records found.">
    <meta property="og:image" content="<?php echo htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/logo.png'); ?>">
    <meta property="og:url" content="<?php echo htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?>">
    <meta property="og:type" content="website">
    <link rel="icon" type="image/x-icon" href="./fav.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Added for mobile responsiveness -->
    <style>
        body {
            font-family: 'Courier New', Courier, monospace;
            margin: 0;
            padding: 0;
            background: #000;
            color: #FFA500;
            font-size: 16px; /* Base font size for readability */
        }
        header {
            text-align: center;
            padding: 1.5rem;
            background: #000;
            color: #FFA500;
            border-bottom: 2px solid #FFA500;
        }
        h1 {
            margin: 0;
            font-size: 2rem;
        }
        .container {
            margin: 1rem;
            padding: 0;
        }
        .main-table {
            display: flex;
            flex-direction: column; /* Default to column for phone app feel */
            gap: 1rem;
            margin: 1rem 0;
        }
        .main-table > div {
            padding: 1rem;
            border: 2px solid #FFA500;
            color: #FFA500;
            background: #000;
            border-radius: 8px; /* Rounded corners for app-like feel */
        }
        .query-area {
            flex: 1 1 auto;
        }
        .legend-area {
            flex: 1 1 auto;
        }
        table.inner-table {
            width: 100%;
            border-collapse: collapse;
            border: 2px solid #FFA500;
            font-size: 1rem;
            background: #000;
            border-radius: 8px;
        }
        th, td.inner-table {
            padding: 1rem;
            text-align: left;
            border: 1px solid #FFA500;
            color: #FFA500;
        }
        th {
            background: #222; /* Slightly lighter for contrast */
        }
        tr:nth-child(even) {
            background: #111; /* Subtle alternation for readability */
        }
        tr:nth-child(odd) {
            background: #000;
        }
        footer {
            text-align: center;
            padding: 1.5rem;
            background: #000;
            color: #FFA500;
            border-top: 2px solid #FFA500;
        }
        a {
            background-color: #FFA500;
            color: #000;
            padding: 12px 24px;
            text-decoration: none;
            display: inline-block;
            border: none;
            border-radius: 4px;
            transition: background-color 0.3s, color 0.3s;
            font-size: 1.1rem;
        }
        a:hover {
            background-color: #000;
            color: #FFA500;
            border: 1px solid #FFA500;
        }

        form {
            background: #FFA500;
            padding: 1rem; /* Tighter padding */
            border-radius: 8px;
        }
        input, textarea, select {
            font-family: 'Courier New', Courier, monospace;
            color: #000;
            background: orange;
            border: 1px solid #000;
            font-size: 1.2rem;
            padding: 12px;
            margin: 6px 0; /* Reduced margin */
            border-radius: 4px;
            width: 100%;
            box-sizing: border-box;
        }
        input[type="text"] {
            height: 70px;
        }
        input[type="number"] {
            width: 90px;
            height: 70px;
            margin-right: 10px;
        }
        input[type="submit"] {
            height: 70px;
            cursor: pointer;
            font-weight: bold;
        }
        form label {
            color: #000;
            font-size: 1.1rem;
            display: flex;
            align-items: center; /* Align checkbox and text on same line */
            gap: 8px; /* Space between checkbox and text */
            margin: 6px 0; /* Consistent with other inputs */
        }
        form label input[type="checkbox"] {
            width: auto; /* Reset width for checkboxes */
            margin: 0; /* Remove default margin */
        }
        .context-settings {
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 6px 0; /* Reduced margin */
            flex-wrap: wrap;
        }
        .file-list { 
            margin: 0.5rem 0; /* Tighter margin */
            max-height: 200px; 
            overflow-y: auto;
        }




        li { list-style: none; margin: 0; }
        p { margin: 0; }
        .line-number { 
            display: inline-block; 
            width: 60px; 
            text-align: right; 
            margin-right: 15px; 
            color: #FFA500; 
        }
        h3 {
            margin: 0 0 1rem 0;
            font-size: 1.5rem;
        }
        @media (min-width: 768px) {
            .main-table {
                flex-direction: row; /* Side-by-side on larger screens */
                justify-content: space-between;
            }
            .main-table > div {
                flex: 1 1 45%; /* Roughly half width each */
                max-width: 48%;
            }
            .container {
                margin: 2rem auto;
                padding: 1rem;
                max-width: 1200px;
            }
            h1 {
                font-size: 2.5rem;
            }
        }
    </style>
</head>
<body>
    <header>
        <h1>JFK Query Gram</h1>
    </header>
    <hr><p><tt>Changelog 2025-03-21: On March 18, 2025, the U.S. National Archives released two significant batches of JFK assassination records as part of the ongoing declassification under the President John F. Kennedy Assassination Records Act of 1992. These releases include:
<br><br>
1. (80%+ complete: pending new hard drive needs) A collection totaling 31,419 pages, which consists of materials reviewed and sent by Release Officers over the past four years. This includes 19 boxes of JFK working files, two boxes on Nosenko, seven boxes of LA Division documents, and three boxes from the Bay of Pigs period, among others. Not all materials in these boxes are directly related to the JFK assassination, but approximately 22 boxes have been designated as assassination records [104-10332-10022](https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10332-10022.pdf).
<br><br>
2. (Maybe discreprency source PDFs used was the one released from WH website) A larger collection exceeding 68,000 pages, which includes the CIA’s extensive JFK records, primarily compiled for the Warren Commission and the House Select Committee on Assassinations (HSCA). This collection originally comprised 81 Records Center-sized boxes, with 17 boxes dedicated to the Oswald 201 file and 64 boxes (the “JFK files” or sequestered collection) containing various Directorate of Operations, Office of Security, and other CIA materials. Additionally, Box 64 alone contains 72 reels of microfilm, contributing approximately 74,000 pages of material released post-1993 [104-10332-10022](https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10332-10022.pdf) [104-10332-10023](https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10332-10023.pdf).
<br><br>
These two releases represent distinct sets of documents, with the 31,419-page collection being a subset of additional materials reviewed recently, and the over 68,000-page collection encompassing the broader CIA JFK records, including microfilm and operational files. The exact breakdown by archive collection number isn’t specified in the provided documents, but the totals reflect the cumulative page counts for these major releases on March 18, 2025.</tt></p><hr>
    <div class="container">
        <div class="main-table">
            <div class="query-area">
                <form method="GET" action="">
                    <h3>Text Query</h3>
                    <input type="text" name="q" 
                           placeholder="e.g., apple AND orange OR banana NOT pear" 
                           value="<?php echo htmlspecialchars($query); ?>">
                    
                    <h3>Context Settings</h3>
                    <div class="context-settings">
                        <label>Above: <input type="number" name="b" value="<?php echo $before; ?>" min="0"></label>
                        <label>Below: <input type="number" name="a" value="<?php echo $after; ?>" min="0"></label>
                    </div>
                    
                    <h3>Select Files</h3>

                    
                                      <div class="file-list">
                        <label><input type="checkbox" onclick="toggleAll(this)" checked> Check/Uncheck All</label>
                        <?php
                        $textDir = './text/';
                        $files = array_diff(scandir($textDir), array('..', '.'));
                        foreach ($files as $file) {
                            if (pathinfo($file, PATHINFO_EXTENSION) === 'txt') {
                                $checked = empty($selectedFiles) || in_array($file, $selectedFiles) ? 'checked' : '';
                                echo "<label><input type='checkbox' name='files[]' value='$file' $checked> $file</label>";
                            }
                        }
                        ?>
                    </div>

                    
                    <input type="submit" value="Search">
                </form>
            </div>
            <div class="legend-area">
                <h3>Operand Legend</h3>
                <table class="inner-table">
                    <tr><th>Gate</th><th>Description</th></tr>
                    <tr><td class="inner-table" data-label="Gate">AND</td><td class="inner-table" data-label="Description">Returns true if both inputs are true</td></tr>
                    <tr><td class="inner-table" data-label="Gate">OR</td><td class="inner-table" data-label="Description">Returns true if at least one input is true</td></tr>
                    <tr><td class="inner-table" data-label="Gate">XOR</td><td class="inner-table" data-label="Description">Returns true if exactly one input is true</td></tr>
                    <tr><td class="inner-table" data-label="Gate">NOR</td><td class="inner-table" data-label="Description">Returns true if both inputs are false</td></tr>
                    <tr><td class="inner-table" data-label="Gate">NOT</td><td class="inner-table" data-label="Description">Inverts the input value</td></tr>
                    <tr><td class="inner-table" data-label="Gate">NAND</td><td class="inner-table" data-label="Description">Returns true if at least one input is false</td></tr>
                
                </table>
            </div>
        </div>

        <!-- Results -->
        <?php
        if ($query) {
            echo "<h3>Results for: " . htmlspecialchars($query) . "</h3>";
            $baseUrl = "?q=" . urlencode($query) . "&b=$before&a=$after";
            foreach ($selectedFiles as $file) {
                $baseUrl .= "&files[]=" . urlencode($file);
            }
            echo "<p>Shareable URL: <a href='$baseUrl'>" . htmlspecialchars($baseUrl) . "</a></p>";
            
            $matchCount = 0;
            foreach ($files as $file) {
                if (!empty($selectedFiles) && !in_array($file, $selectedFiles)) continue;
                if (pathinfo($file, PATHINFO_EXTENSION) !== 'txt') continue;
                
                $lines = file($textDir . $file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
                foreach ($lines as $i => $line) {
                    if (evaluateQuery($line, $query)) {
                        $matchCount++;
                        $anchor = "match$matchCount";
                        echo "<div class='match' id='$anchor'>";
                        echo "<a href='#$anchor'>#$matchCount</a> ";
                        echo "<strong>File:</strong> " . htmlspecialchars($file) . "<br>";
                        
                        for ($j = max(0, $i - $before); $j < $i; $j++) {
                            $lineNum = $j + 1;
                            echo "<span class='line-number'>$lineNum:</span>" . htmlspecialchars($lines[$j]) . "<br>";
                        }
                        
                        $matchLineNum = $i + 1;
                        echo "<span class='line-number'>$matchLineNum:</span><span class='highlight'>" . htmlspecialchars($line) . "</span><br>";
                        
                        for ($j = $i + 1; $j <= min(count($lines) - 1, $i + $after); $j++) {
                            $lineNum = $j + 1;
                            echo "<span class='line-number'>$lineNum:</span>" . htmlspecialchars($lines[$j]) . "<br>";
                        }
                        echo "</div>";
                    }
                }
            }
        }

        function evaluateQuery($text, $query) {
            $terms = preg_split('/\s+(AND|OR|XOR|NOR|NOT|NAND|AND)\s+/', $query, -1, PREG_SPLIT_DELIM_CAPTURE);
            $result = false;
            $currentOp = 'AND';
            
            foreach ($terms as $i => $term) {
                if (in_array(strtoupper($term), ['AND', 'OR', 'XOR', 'NOR', 'NOT', 'NAND'])) {
                    $currentOp = strtoupper($term);
                    continue;
                }
                
                $contains = stripos($text, $term) !== false;
                if ($currentOp === 'NOT') {
                    $contains = !$contains;
                    $currentOp = 'AND';
                }
                
                if ($i === 0) {
                    $result = $contains;
                } elseif ($currentOp === 'AND') {
                    $result = $result && $contains;
                } elseif ($currentOp === 'OR') {
                    $result = $result || $contains;
                } elseif ($currentOp === 'XOR') {
                    $result = $result xor $contains;
                } elseif ($currentOp === 'NOR') {
                    $result = !($result || $contains);
                } elseif ($currentOp === 'NAND') {
                    $result = !($result && $contains);
                }
            }
            return $result;
        }
        ?>
    </div>

    <footer>
        Copyright Page Telegram Volunteer Services 2025 / Working Towards a Healthy Tomorrow
    </footer>

    <script>
    function toggleAll(checkbox) {
        const checkboxes = document.querySelectorAll('input[name="files[]"]');
        checkboxes.forEach(cb => cb.checked = checkbox.checked);
    }

    document.querySelector('form').addEventListener('submit', function(e) {
        const textQuery = document.querySelector('input[name="q"]').value;
        const before = document.querySelector('input[name="b"]').value;
        const after = document.querySelector('input[name="a"]').value;
        const files = Array.from(document.querySelectorAll('input[name="files[]"]:checked'))
                          .map(cb => 'files[]=' + encodeURIComponent(cb.value));
        
        if (textQuery) {
            window.location = '?q=' + encodeURIComponent(textQuery) + 
                           '&b=' + before + 
                           '&a=' + after + 
                           (files.length ? '&' + files.join('&') : '');
            e.preventDefault();
        }
    });
    </script>
</body>
</html>