<?php
echo 'Weather Report';
?>
<section>
    <div>
        <form id="cityForm" method="post" enctype="multipart/form-data">
            <input name="date" id="date" type="date">
            <!-- <select onchange="getWeatherReport()" name="city" id="city" style="background-color: #000;">
                <option value="London">London</option>
                <option value="Kolkata">Kolkata</option>
                <option value="Delhi">Delhi</option>
            </select> -->
            <button type="submit" name="submit" onsubmit="getCity();"><span>Click</span></button>
        </form>
    </div>
</section>
<script>
    function getWeatherReport(){
        let formContent = document.getElementById('cityForm');
        let formData = new FormData(formContent)
        let url = 'https://apisp.dev2.cicdhosting.com/upload_file/v2/upload-weather.php';
        fetch(url,{
            method: 'POST',
            body: formData,
        })
        .then(data => data.json())
        .then(data => {
            console.log(data)
        })
        .catch(error => {
            console.error(error);
        })
    }
</script>