<?php

include "classes/html.class.php";

$html = new html("EVENTS");


$db = new db();

if ($_SESSION['farm_id'] == "0") {
    $farms_res = $db->exec_query('farms', ["*"]);
} else {
    $farms_res = $db->exec_query('farms', ["*"], '', '', '', '', "record_id = {$_SESSION['farm_id']}");
}
while ($farms = $farms_res->fetch_assoc()) {
    $farm_list = $farm_list . "<option value='{$farms['record_id']}'>{$farms['farm_name']}</option>";
}


?>



<div class='form'>
    <br>

    <form action='upload.php' method="POST" enctype="multipart/form-data">

        <h2>UPLOAD NEW DATA</h2>
        <input type="file" class='form_btn' name="fileToUpload" id="fileToUpload"><br>
        <input type="submit" class='form_btn' value="UPLOAD" name="submit">
        <br>
        <hr>
    </form>
    <? if (isset($_GET['UPLOADED'])) { ?>
        <h2> NEW FILE UPLOADED AND READY FOR THE REPORT </h2>
    <? } ?>
    <input type='submit' value='VIEW PDF' target="_blank" onclick="window.location.href='api/land_diary_report.php'" class='form_btn' />
</div>


</body>

</html>