<?php
require_once "../../admin/private/initialize.php";

if(is_post_request()){


    $pro_id = decrypt_data($_POST['id']);

    $product = Product::find_by_id($pro_id);

 

?>
<div class="hm_login_header">
    <h1>Send Inquiry</h1>
    <span class="login_close"><i class="fa fa-times" aria-hidden="true"></i></span>
</div>
<div class="login_fields">
    <form action="send" method="post" id="en_form">
    <div class="col-md-12">
            <div class="form-group">
                <label for="name">Product Name</label>
                <input type="text" class="form-control" id="name" disabled value="<?php echo $product->product_name ?>">
            </div>
        </div>
        <input type="hidden" value="<?php echo $_POST['id'] ?>" name="product_name">
        <input type="hidden" value="<?php echo $_POST['v_c'] ?>" name="vendor_name">
        <div class="col-md-6">
            <div class="form-group">
                <label for="name">Name</label>
                <input type="text" class="form-control" id="name" name="name" placeholder="Buyer Full Name Here" required>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label for="email">Email</label>
                <input type="email" class="form-control" id="email" name="email" placeholder="Your Official/Personal Email" required>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label for="mobile">Mobile Number</label>
                <input type="text" class="form-control" id="mobile" name="number" placeholder="Buyer Contact Number" required>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label for="company">Company Name</label>
                <input type="text" class="form-control"  name="company" placeholder="Your Company Name" required>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label for="quantity">Quantity</label>
                <input type="text" class="form-control" id="quantity" name="quantity" placeholder="Quantity" required>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label for="Unit">Unit</label>
                <select class="form-control" name="unit" required>
                    <option>Select Unit</option>
                    <option value="Pcs">Piece(s)/Pcs</option>
                    <option value="Carton">Carton</option>
                    <option value="Dozen">Dozen</option>
                    <option value="m">Meter(s)/m</option>
                    <option value="t">Metric Ton/t</option>
                    <option value="Kg">Kilogram/Kg</option>
                </select>
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group">
                <label for="requirement_detail">Requirement Details:</label>
                <textarea class="form-control" rows="5" name="message" id="requirement_detail" placeholder="Kindly write detail requirement of your here & do also mention payment mode option." required></textarea>
            </div>
        </div>
        <button type="submit" name="product_submit" value="submit" class="inquiry-btn cool submit_form">Send Enquiry</button>
    </form>
</div>
<?php } ?>

<script>

$('.login_close').on('click', function() {
                $('.hm_login_form_overlay').removeClass('login_open');
                $('body').removeClass('login_overflow');
            });

            $('.submit_form').on('click', function(e) {
             
             // prevents a window.location change to the href
                 // sets to 123 or abc, respectively
                $('#en_form').submit();
            });

</script>