<?php include_once('header.php'); ?>
<?php
$service_id = '';
if (isset($_GET['id'])) {
    $service_id = $_GET['id'];
}
$service = $con->getRows('fungicides', array('where' => 'service_id="' . $service_id . '"', 'return_type' => 'single'));
?>

<div class="container">
    <div class="card-deck mb-3 text-center">
        <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mt-3 mb-3 border-bottom" style="width: 100%;">
            <h1 class="h2">Add New Fungicide</h1>
            <div class="btn-toolbar mb-2 mb-md-0">
                <div class="btn-group mr-2">
                    <a class="btn btn-sm btn-outline-secondary" href="fungicides.php" id="">View Fungicides</a>
                </div>
            </div>
        </div>

        <div id="error"></div>

        <!-- new vacancy section -->
        <div id="new-vacancy" style="width: 100%">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap  pb-2 mb-3 border-bottom" style="width: 100%; text-align: left;">
                <div class="col-md-12 order-md-2">
                    <?php include_once('sql_statements.php');  ?>
                    <form class="needs-validation" id="" method="post" enctype="multipart/form-data">


                        <input type="hidden" name="update_fungicide">
                        <div class="row">
                            <div class="col-md-12 mb-3">
                                <label for="Password">Fungicide Title</label>
                                <input type="text" class="form-control" id="" name="title" value="<?= $service['title'] ?>">

                            </div>

                        </div>

                        <div class="row">
                            <div class="col-md-12 mb-3">
                                <label for="Password">Fungicide Details</label><br>
                                <textarea class="form-control" name="details" rows="9"><?= $service['details'] ?></textarea>
                            </div>
                        </div>
                        <input type="hidden" value="<?= $service['service_id'] ?>" name="service_id">
                        <button class="btn btn-primary btn-md" type="submit" name="update_fungicide" id="create_blog" style="float: right; margin-right: 5px;">
                            Update Fungicide
                        </button>

                    </form>
                </div>
            </div>

        </div>
        <!-- end new user form -->


    </div>

</div>


<!-- Bootstrap core JavaScript
    ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script>
    window.jQuery || document.write('<script src="../../js/vendor/jquery-slim.min.js"><\/script>')
</script>
<script src="../../js/vendor/popper.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/vendor/holder.min.js"></script>
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../js/validation.min.js"></script>
<script src="../../js/tables/jquery.dataTables.js"></script>
<script src="../../js/tables/dataTables.bootstrap4.js"></script>

<!--  summernote JS
        ============================================ -->
<script src="../../js/summernote/summernote-updated.min.js"></script>
<script src="../../js/summernote/summernote-active.js"></script>

</body>

</html>