<?php echo $this->flag;
echo $this->flag2;
?>
<form method="post" name="" action="/cancellationdeadline/cancelbooking">
    <input type="hidden" name="booking_id" value="<?php echo $data['booking_id'];?>" />
<div style="color: green; padding: 10px;" class="success_msg_status"></div>
            <div class="modal-header <?php echo $flag;?>">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Release/Cancel Booking </h4>
            </div>
            <div class="modal-body">

                    <div class="form-group clearfix margintopbottom20">
                        <div class="<?php echo $this->flag; ?>">
                        <label>Are you sure want to cancel booking?</label>
                        <input type="button" name="Yes" value="Yes" class="btn btn-primary" onclick="confirmBookingCancel(<?php echo $data['booking_id'];?>)" />
                        <input type="button" name="no"  value="No" class="btn btn-danger"/>
                        </div>
                        <div class="form-group row display-none">
                            <div class="col-xs-3">Enter OTP</div>
                          <div class="col-xs-4">
                            <label for="ex3"></label>
                            <input class="form-control" id="ex3" type="text">
                            <span><a href="">Resent OTP</a></span>
                          </div>
                        </div>


                    </div>



            </div>
            <div class="modal-footer">
                <input type="hidden" id="user_id" value="" name="userid">

                <input type="submit" class="btn btn-danger" value="Submit" name="save" id="savestatus" />
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </form>

<script>
function confirmBookingCancel(bookingId) {
  var URL = "/cancellationdeadline/sendsms";
  $.ajax({
      type: 'post',
      url: URL,
      data: {'bookingId': bookingId},
      async: false,
      dataType: 'json'
  }).done(function (data) {
      $('#invoiceModal .modal-content').html(data);
  }).fail(function () {
      $('#invoiceModal .modal-content').html('There is an error to load the modal.');
  });
  $('#invoiceModal').modal({backdrop: 'static', keyboard: false});
}
 </script>