1737192474a:1:{s:30:"dashboard/create-booking-3.htm";a:10:{s:8:"fileName";s:30:"dashboard/create-booking-3.htm";s:7:"content";s:9535:"title = "Create Booking"
url = "/booking/create/3"
layout = "Dashboard"
is_hidden = 0

[session]
security = "user"
allowedUserGroups[] = "admin"
allowedUserGroups[] = "supplier"
redirect = "dashboard/login"
==
<?php
  use Yuren\BaliTiket\Models\Ticket;
  use Yuren\BaliTiket\Models\Vendor;
  use Yuren\BaliTiket\Models\Bookings;

  use Winter\Storm\Auth\AuthManager;
  use Auth;

  function onStart()
  {
    $user = Auth::getUser();
    if ($user) {

      $this['vendor_id'] = Input::post('vendor');
      $this['slug'] = Input::post('slug');
      $this['ticket_id'] = Input::post('ticket');
      $this['adult'] = Input::post('adult');
      $this['children'] = Input::post('children');
      $this['adult_price'] = Input::post('adult_price');
      $this['children_price'] = Input::post('children_price');
      $this['firstname'] = Input::post('firstname');
      $this['lastname'] = Input::post('lastname');
      $this['email'] = Input::post('email');
      $this['phone'] = Input::post('phone');
      $this['country'] = Input::post('country');
      $this['arrival_date'] = Input::post('arrival_date');
      $this['total_adult_price'] = Input::post('adult') * Input::post('adult_price');
      $this['total_children_price'] = Input::post('children') * Input::post('children_price');

      $total_adult_price = Input::post('adult') * Input::post('adult_price');
      $total_children_price = Input::post('children') * Input::post('children_price');
      $this['total_price'] = $total_adult_price + $total_children_price;

      $this['vendor'] = $user->vendor;

      $this['vendors'] = Vendor::where('id', $user->vendor)->first();

      $this['tickets'] = Ticket::orderBy('created_at', 'desc')->where('vendor_id', $user->vendor)->where('id', Input::post('ticket'))->first();
    } 

    $this['ticket'] = Ticket::make();

    $this['booking'] = Bookings::make();
  }

  
?>
==
<!-- Content -->

<div class="container-xxl flex-grow-1 container-p-y">
  <div class="row">

    <!-- Default -->
    <div class="col-12">
      <div class="card">
        <div class="card-body">
          <h5 class="text-dark bg-light fw-medium fs-4 mb-3 p-3 rounded-3"> 
            <span class="badge badge-center rounded-3 bg-dark text-white me-1 align-middle fw-bold">3</span>
            Summary Booking
          </h5>
          <form action="{{url('bali_tiket/create_booking.php')}}" method="POST" enctype="multipart/form-data">
            <input type="hidden" value="{{vendors.id}}" name="vendor_id">
            <input type="hidden" value="{{vendors.slug}}" name="vendor_slug">
            <input type="hidden" value="{{tickets.id}}" name="ticket_id">
            <input type="hidden" value="{{arrival_date}}" name="arrival_date">
            <input type="hidden" value="{{firstname}}" name="firstname">
            <input type="hidden" value="{{lastname}}" name="lastname">
            <input type="hidden" value="{{email}}" name="email">
            <input type="hidden" value="{{phone}}" name="phone">
            <input type="hidden" value="{{country}}" name="country">
            <input type="hidden" value="{{ (adult != null) ? adult : 0 }}" name="adult">
            <input type="hidden" value="{{ (children != null) ? children : 0 }}" name="children">
            <input type="hidden" value="{{adult_price}}" name="adult_price">
            <input type="hidden" value="{{children_price}}" name="children_price">
            <input type="hidden" value="{{total_adult_price}}" name="total_adult_price">
            <input type="hidden" value="{{total_children_price}}" name="total_children_price">
            <input type="hidden" value="{{total_price}}" name="total_price">


            <div class="row g-0">
              <div class="col-sm-12 col-12 p-2">
                <label class="form-label">Ticket</label>
                <p class="mb-0 fw-medium">{{ tickets.name }}</p>
              </div>
              <div class="col-sm-6 col-12 p-2">
                <label class="form-label">Arrival Date</label>
                <p class="mb-0">{{ arrival_date }}</p>
              </div>
              <div class="col-sm-6 col-12 p-2">
                <label class="form-label" for="status_payment">Status Payment</label>
                <select class="select2" name="status_payment" id="status_payment">
                  <option label=" " disabled></option>
                  <option value="paid">Paid</option>
                  <option value="pending">Pending</option>
                </select>
              </div>
            </div>

            <div class="row g-0 align-items-start">
              <div class="col-md-6 col-12 row g-0 pe-md-3">
                <div class="col-md-12 p-2 pb-0">
                  <div class="divider text-start">
                    <div class="divider-text">Guest Information</div>
                  </div>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Guest Name</label>
                  <p class="mb-0">{{ firstname }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Email</label>
                  <p class="mb-0">{{ email }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Phone Number</label>
                  <p class="mb-0">{{ phone }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Country</label>
                  <p class="mb-0">{{ country }}</p>
                </div>
              </div>
              <div class="col-md-6 col-12 row g-0 ps-md-3">
                <div class="col-md-12 p-2 pb-0">
                  <div class="divider text-start">
                    <div class="divider-text">Pricing</div>
                  </div>
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-product border-1 border-bottom">
                  Category
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-ticket border-1 border-bottom">
                  Price per Person
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-ticket border-1 border-bottom">
                  Subtotal
                </div>

                {% if total_adult_price != 0 %}
                <div class="col-md-4 col-12 p-2 ">
                  <small>Adult x {{adult}}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(adult_price) }}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(total_adult_price) }}</small>
                </div>
                {% endif %}

                {% if total_children_price != 0 %}
                <div class="col-md-4 col-12 p-2 ">
                  <small>Children x {{children}}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(children_price) }}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(total_children_price) }}</small>
                </div>
                {% endif %}

                <div class="col-md-8 fw-bold col-12 p-2 text-end border-1 border-top">
                  Total 
                </div>
                <div class="col-md-4 fw-bold p-2 border-1 border-top">
                  <small>IDR {{ booking.priceFormat(total_price) }}</small>
                </div>

              </div>
            </div>
            <hr/>
            <div class="row g-0 justify-content-end">
              <div class="col-sm-12 col-12 p-2 d-flex justify-content-between">
                <button type="button" onclick="window.history.back()" class="btn btn-sm btn-secondary rounded-3 py-2 px-5"><i class="fa fa-arrow-left align-middle fs-tiny me-2"></i> Previous</button>
                <button type="submit" class="btn btn-sm btn-success rounded-3 py-2 px-5">Create</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- /Default -->


    <!-- end recent bookings -->

  </div>
</div>
<!-- / Content -->


<style>
  .w-md-100{
    width: 50%;
  }
  @media (max-width: 678px) {
    .w-md-100{
      width: 100%;
    }
  }
</style>

<!-- js -->
{% put scripts %}

<script src="https://unpkg.com/lokijs@^1.5/build/lokijs.min.js"></script>

<script type="text/javascript">
  $("#arrival-date").flatpickr({
    enableTime: false,
    dateFormat: "Y-m-d",
  });

  // select2 option
  $(function () {
    const select2 = $('.select2'),
    selectPicker = $('.selectpicker');

    // Bootstrap select
    if (selectPicker.length) {
      selectPicker.selectpicker();
    }

    // select2
    if (select2.length) {
      select2.each(function () {
        var $this = $(this);
        $this.wrap('<div class="position-relative"></div>');
        $this.select2({
          placeholder: 'Select value',
          dropdownParent: $this.parent()
        });
      });
    }
  });


</script>
{% endput %}
<!-- end js -->";s:5:"mtime";i:1730961692;s:6:"markup";s:7585:"<!-- Content -->

<div class="container-xxl flex-grow-1 container-p-y">
  <div class="row">

    <!-- Default -->
    <div class="col-12">
      <div class="card">
        <div class="card-body">
          <h5 class="text-dark bg-light fw-medium fs-4 mb-3 p-3 rounded-3"> 
            <span class="badge badge-center rounded-3 bg-dark text-white me-1 align-middle fw-bold">3</span>
            Summary Booking
          </h5>
          <form action="{{url('bali_tiket/create_booking.php')}}" method="POST" enctype="multipart/form-data">
            <input type="hidden" value="{{vendors.id}}" name="vendor_id">
            <input type="hidden" value="{{vendors.slug}}" name="vendor_slug">
            <input type="hidden" value="{{tickets.id}}" name="ticket_id">
            <input type="hidden" value="{{arrival_date}}" name="arrival_date">
            <input type="hidden" value="{{firstname}}" name="firstname">
            <input type="hidden" value="{{lastname}}" name="lastname">
            <input type="hidden" value="{{email}}" name="email">
            <input type="hidden" value="{{phone}}" name="phone">
            <input type="hidden" value="{{country}}" name="country">
            <input type="hidden" value="{{ (adult != null) ? adult : 0 }}" name="adult">
            <input type="hidden" value="{{ (children != null) ? children : 0 }}" name="children">
            <input type="hidden" value="{{adult_price}}" name="adult_price">
            <input type="hidden" value="{{children_price}}" name="children_price">
            <input type="hidden" value="{{total_adult_price}}" name="total_adult_price">
            <input type="hidden" value="{{total_children_price}}" name="total_children_price">
            <input type="hidden" value="{{total_price}}" name="total_price">


            <div class="row g-0">
              <div class="col-sm-12 col-12 p-2">
                <label class="form-label">Ticket</label>
                <p class="mb-0 fw-medium">{{ tickets.name }}</p>
              </div>
              <div class="col-sm-6 col-12 p-2">
                <label class="form-label">Arrival Date</label>
                <p class="mb-0">{{ arrival_date }}</p>
              </div>
              <div class="col-sm-6 col-12 p-2">
                <label class="form-label" for="status_payment">Status Payment</label>
                <select class="select2" name="status_payment" id="status_payment">
                  <option label=" " disabled></option>
                  <option value="paid">Paid</option>
                  <option value="pending">Pending</option>
                </select>
              </div>
            </div>

            <div class="row g-0 align-items-start">
              <div class="col-md-6 col-12 row g-0 pe-md-3">
                <div class="col-md-12 p-2 pb-0">
                  <div class="divider text-start">
                    <div class="divider-text">Guest Information</div>
                  </div>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Guest Name</label>
                  <p class="mb-0">{{ firstname }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Email</label>
                  <p class="mb-0">{{ email }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Phone Number</label>
                  <p class="mb-0">{{ phone }}</p>
                </div>
                <div class="col-md-6 col-12 p-2">
                  <label class="form-label">Country</label>
                  <p class="mb-0">{{ country }}</p>
                </div>
              </div>
              <div class="col-md-6 col-12 row g-0 ps-md-3">
                <div class="col-md-12 p-2 pb-0">
                  <div class="divider text-start">
                    <div class="divider-text">Pricing</div>
                  </div>
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-product border-1 border-bottom">
                  Category
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-ticket border-1 border-bottom">
                  Price per Person
                </div>
                <div class="col-md-4 fw-medium col-12 p-2 list-ticket border-1 border-bottom">
                  Subtotal
                </div>

                {% if total_adult_price != 0 %}
                <div class="col-md-4 col-12 p-2 ">
                  <small>Adult x {{adult}}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(adult_price) }}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(total_adult_price) }}</small>
                </div>
                {% endif %}

                {% if total_children_price != 0 %}
                <div class="col-md-4 col-12 p-2 ">
                  <small>Children x {{children}}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(children_price) }}</small>
                </div>
                <div class="col-md-4 col-12 p-2">
                  <small>IDR {{ booking.priceFormat(total_children_price) }}</small>
                </div>
                {% endif %}

                <div class="col-md-8 fw-bold col-12 p-2 text-end border-1 border-top">
                  Total 
                </div>
                <div class="col-md-4 fw-bold p-2 border-1 border-top">
                  <small>IDR {{ booking.priceFormat(total_price) }}</small>
                </div>

              </div>
            </div>
            <hr/>
            <div class="row g-0 justify-content-end">
              <div class="col-sm-12 col-12 p-2 d-flex justify-content-between">
                <button type="button" onclick="window.history.back()" class="btn btn-sm btn-secondary rounded-3 py-2 px-5"><i class="fa fa-arrow-left align-middle fs-tiny me-2"></i> Previous</button>
                <button type="submit" class="btn btn-sm btn-success rounded-3 py-2 px-5">Create</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- /Default -->


    <!-- end recent bookings -->

  </div>
</div>
<!-- / Content -->


<style>
  .w-md-100{
    width: 50%;
  }
  @media (max-width: 678px) {
    .w-md-100{
      width: 100%;
    }
  }
</style>

<!-- js -->
{% put scripts %}

<script src="https://unpkg.com/lokijs@^1.5/build/lokijs.min.js"></script>

<script type="text/javascript">
  $("#arrival-date").flatpickr({
    enableTime: false,
    dateFormat: "Y-m-d",
  });

  // select2 option
  $(function () {
    const select2 = $('.select2'),
    selectPicker = $('.selectpicker');

    // Bootstrap select
    if (selectPicker.length) {
      selectPicker.selectpicker();
    }

    // select2
    if (select2.length) {
      select2.each(function () {
        var $this = $(this);
        $this.wrap('<div class="position-relative"></div>');
        $this.select2({
          placeholder: 'Select value',
          dropdownParent: $this.parent()
        });
      });
    }
  });


</script>
{% endput %}
<!-- end js -->";s:4:"code";s:1715:"
  use Yuren\BaliTiket\Models\Ticket;
  use Yuren\BaliTiket\Models\Vendor;
  use Yuren\BaliTiket\Models\Bookings;

  use Winter\Storm\Auth\AuthManager;
  use Auth;

  function onStart()
  {
    $user = Auth::getUser();
    if ($user) {

      $this['vendor_id'] = Input::post('vendor');
      $this['slug'] = Input::post('slug');
      $this['ticket_id'] = Input::post('ticket');
      $this['adult'] = Input::post('adult');
      $this['children'] = Input::post('children');
      $this['adult_price'] = Input::post('adult_price');
      $this['children_price'] = Input::post('children_price');
      $this['firstname'] = Input::post('firstname');
      $this['lastname'] = Input::post('lastname');
      $this['email'] = Input::post('email');
      $this['phone'] = Input::post('phone');
      $this['country'] = Input::post('country');
      $this['arrival_date'] = Input::post('arrival_date');
      $this['total_adult_price'] = Input::post('adult') * Input::post('adult_price');
      $this['total_children_price'] = Input::post('children') * Input::post('children_price');

      $total_adult_price = Input::post('adult') * Input::post('adult_price');
      $total_children_price = Input::post('children') * Input::post('children_price');
      $this['total_price'] = $total_adult_price + $total_children_price;

      $this['vendor'] = $user->vendor;

      $this['vendors'] = Vendor::where('id', $user->vendor)->first();

      $this['tickets'] = Ticket::orderBy('created_at', 'desc')->where('vendor_id', $user->vendor)->where('id', Input::post('ticket'))->first();
    } 

    $this['ticket'] = Ticket::make();

    $this['booking'] = Bookings::make();
  }

  
";s:5:"title";s:14:"Create Booking";s:3:"url";s:17:"/booking/create/3";s:6:"layout";s:9:"Dashboard";s:9:"is_hidden";s:1:"0";s:7:"session";a:3:{s:8:"security";s:4:"user";s:17:"allowedUserGroups";a:2:{i:0;s:5:"admin";i:1;s:8:"supplier";}s:8:"redirect";s:15:"dashboard/login";}}}