<?php
$session = new \Zend\Session\Container('userlogin');
$user_id = isset($session->userData['user_id'])?$session->userData['user_id']:'';
?>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="ticket-form">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h2 class="modal-title"><?php echo $heading;?></h2>
    </div>
    <div class="modal-body">
        <div class="row" style="padding:0 15px;">

            <div class="col-sm-12 no-padding price-one ">

                <?php
                $form = $this->form;
                $form->prepare();
                $form->setAttribute('action', $this->url('submit-ticket', ['action' => 'submit-ticket']));
                $form->setAttribute('method', 'post');
                echo $this->form()->openTag($form);
                echo $this->formHidden($form->get('ticket_type'));
                ?>

                <div class="col-lg-12" style="background:#EFEFEF;">
                    <div id="displayMsg"></div>
                    <div class="form-group">
                        <div class="col-lg-12 padding0" style="text-align:left; color:#000;">Booking No.</div>
                        <?php echo $this->formElement($form->get('booking_no')); ?>
                    </div>
                    <?php if (empty($user_id)) { ?>
                    <div class="form-group">
                        <div class="col-lg-12 padding0" style="color:#000;">Mobile No.</div>
                        <?php echo $this->formElement($form->get('mobile_no')); ?>
                    </div>
                    <?php }?>
                    <div class="form-group">
                        <div class="g-recaptcha" data-sitekey="<?php echo $captchaKey; ?>"></div>
                        <div class="captcha-error" style="color:#a94442;"><?php echo $this->error; ?></div>
                    </div>

                    <div class="col-lg-12" style="color:#000; text-align:right; margin-top:5px;">
                        <?php echo $this->FormElement($form->get('ticket_submit')); ?>
                    </div>
                </div>
                <?php echo $this->form()->closeTag(); ?>
            </div>
        </div>
    </div>
    <div class="modal-footer" style=" padding-top:2px !important;">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
</div>

<div class="ticketotp-form" style="display:none;">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h2 class="modal-title">

            OTP

        </h2>
    </div>

    <div class="modal-body">
        <div class="row" style="padding:0 15px;">
            <div class="col-sm-12 price-one ">

                <?php
                        $otpform = $this->otpform ;
                        $otpform->prepare();
                        $otpform->setAttribute('action', $this->url('confirm-ticket-otp', ['action' => 'confirm-ticket-otp']));
                        echo $this->form()->openTag($otpform);
                        echo $this->formHidden($otpform->get('ticket_type'));
                ?>

                <div class="col-lg-12">
                    <div id="mobilelastdigit"></div>
                    <div class="form-group">
                    <label class="col-lg-12 padding0" style="text-align:left; color:#000;"> OTP  </label>
                    <?php echo $this->formElement($otpform->get('confirm_otp')); ?>
                    </div>
                    <div class="col-lg-12" style="color:#000; text-align:right; margin-top:5px;">
                        <input type="Submit" id="confirm-form-btn" value="Submit" class="btn btn-primary" onclick="submitForm('#confirm-form', event);">
                    </div>
                </div>

                 <?php echo $this->form()->closeTag(); ?>

            </div>
        </div>
    </div>
    <div class="modal-footer" style=" padding-top:2px !important;">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
</div>