<?php
$subscribe_form = get_field('subscribe_form', 'options');
$form_id = $subscribe_form ? $subscribe_form['id'] : '';
$subscribe_form_shortcode = $form_id ? '[gravityform id="' . $form_id  . '" title="false" description="true" ajax="true" tabindex="200" ]' : '';
?>

<div class="modal fade" id="subscribe" tabindex="-1" role="dialog" aria-labelledby="subscribe_label" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-nav" role="document">
        <div class="modal-content">
            <div class="modal-header right-align">
                <a href="<?php echo get_post_type_archive_link( get_post_type() ); ?>" class="control control-close inverse icon-close"><span>close</span>
               </a>
            </div>
            <div class="modal-body">
                <h4 class="center-align modal-title ">Stay Informed</h4>
                <?php if ($subscribe_form_shortcode) {
                    echo do_shortcode($subscribe_form_shortcode); 
                } else { ?>
                <form>
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group">
                                <h5>Default</h5>
                                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
                                <div class="form-control-feedback">Please enter your email.</div>
                            </div>
                            <div class="form-group has-success">
                                <h5>Success</h5>
                                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
                                <div class="form-control-feedback">Please enter your email.</div>
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="form-group has-warning">
                                <h5>Warning</h5>
                                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
                                <div class="form-control-feedback">Are you sure?</div>
                            </div>
                            <div class="form-group has-danger">
                                <h5>Error Message</h5>
                                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
                                <div class="form-control-feedback">Field must be entered</div>
                            </div>
                        </div>
                    </div>
                </form>
                <?php } ?>
            </div>
        </div>
    </div>
</div>
