<!DOCTYPE html> 
<html lang="en">
<head> 
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <title>Three Columns Page</title> 
    <link rel="stylesheet" href="styles_index.css">
    <script>
        function performAICheck() {
            // Fetch the content from the second column
            var content = document.querySelector('.second-column').innerText;

            // Replace single quotes with blank spaces
            content = content.replace(/'/g, " ");

            // AJAX request to ai_check.php
            var xhr = new XMLHttpRequest();
            xhr.open("POST", "ai_check.php", true);
            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.onreadystatechange = function() {
                if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
                    // Handle the response from ai_check.php
                    console.log(this.responseText); // Log the response
                    alert(this.responseText); // Optionally, display it in an alert
                }
            }
            xhr.send("content=" + encodeURIComponent(content));
        }
    </script>
</head> 
<body> 

<div class="header" style="display: flex; justify-content: space-between; align-items: center; padding: 10px 20px;">
    <div style="text-align: left;">Longform Content Creator</div>
    <div>
        <a href="http://www.antenicenefathers.com/longform/1500" style="margin-right: 20px;">Plain Text</a>
        <a href="http://www.antenicenefathers.com/longform/1500/index_html.php">html</a>
    </div>
</div>

<div class="columns">
    <div class="first-column">
        <!-- Including content from controls.html -->
        <?php include 'templates/templates.php'; ?>
    </div> 

    <div class="second-column">
        <button id="aiCheckButton" onclick="performAICheck()">AI Check</button>
        <center><img src="images/logo3.png" alt="" style="width:500px; height:500px;"></center> 
    </div> 

    <div class="third-column">
        <!-- Including content from display.php -->
        <?php include 'display.php'; ?>
    </div> 
</div> 

<div class="footer">
    <p>&copy; 2023 Your Company Name. All rights reserved.</p> 
    <p>Address: 123 Street City Country</p> 
    <p>Email: contact@yourcompany.com</p> 
    <p>Phone: +123-456-7890</p>
</div> 

</body> 
</html> 
