/** * getMemberReservationItem * * print the reservation belongs to a member * * @param array $data array with the reservation info * @return string html of the reservation item */ public function getMemberReservationItem($data) { ob_start(); $class = ''; if ($data['status'] == '5') { $class = 'canceled-reservation'; } ?> <div class="col-sm-12 reservation-item <?php echo $class; ?> " id="reservation-item-<?php echo $data['reservation_id']; ?> "> <div class="row bg-primary title"> <div class="col-sm-1">Date</div> <div class="col-sm-1">Room</div> <div class="col-sm-2">Check-In</div> <div class="col-sm-2">Check-Out</div> <div class="col-sm-1"></div> <div class="col-sm-1"></div> </div> <div class="row info"> <!-- Current info about rooms --> <input type="hidden" id="currentRoomId-<?php echo $data['reservation_id']; ?> " value="<?php echo $data['room_id']; ?> " /> <input type="hidden" id="currentCheckIn-<?php echo $data['reservation_id']; ?> " value="<?php echo Tools::formatMySQLtoJS($data['check_in']); ?> " /> <input type="hidden" id="currentCheckOut-<?php echo $data['reservation_id']; ?> " value="<?php echo Tools::formatMySQLtoJS($data['check_out']); ?> " /> <div class="col-sm-1"><?php echo Tools::formatMYSQLToFront($data['date']); ?> </div> <div class="col-sm-1"><strong><?php echo $data['room']; ?> </strong></div> <div class="col-sm-2"><strong><input type="text" id="dateBoxCheckIn-<?php echo $data['reservation_id']; ?> " value="<?php echo Tools::formatMYSQLToJS($data['check_in']); ?> "> </strong></div> <div class="col-sm-2"><strong><input type="text" id="dateBoxCheckOut-<?php echo $data['reservation_id']; ?> " value="<?php echo Tools::formatMYSQLToJS($data['check_out']); ?> "> </strong></div> <div class="col-sm-1"> <select id="availableRoomsSelect-<?php echo $data['reservation_id']; ?> " disabled="true"> <option selected><?php echo $data['room']; ?> </option> <?php foreach ($data['availableRooms'] as $room) { ?> <option value="<?php echo $room['room_id']; ?> "><?php echo $room['room']; ?> </option> <?php } ?> </select> </div> <div class="col-sm-1 room-aux room-aux-<?php echo $data['reservation_id']; ?> ">No. Days: <strong id="totalNightsRes-<?php echo $data['reservation_id']; ?> "></strong></div> <div class="col-sm-2 room-aux room-aux-<?php echo $data['reservation_id']; ?> "><input type="text" class="priceCalculator" placeholder="cost per night" value="0" id="newCostPerNight-<?php echo $data['reservation_id']; ?> " resId="<?php echo $data['reservation_id']; ?> "/></div> <div class="col-sm-1 room-aux room-aux-<?php echo $data['reservation_id']; ?> ">Total: <strong id="newTotalStaying-<?php echo $data['reservation_id']; ?> " ></strong></div> <div class="col-sm-1 room-aux room-aux-<?php echo $data['reservation_id']; ?> "> <button type="button" class="updateRoom btn btn-default btn-xs btn-info" res-id="<?php echo $data['reservation_id']; ?> ">Update room</button> </div> </div> <div class="row extra"> <div class="col-sm-2">Room Type: <strong><?php echo $data['room_type']; ?> </strong></div> <div class="col-sm-2">Reservation ID: <strong><?php echo $data['reservation_id']; ?> </strong></div> <div class="col-sm-2">Adults: <strong><?php echo $data['adults']; ?> </strong></div> <div class="col-sm-2">Children: <strong><?php echo $data['children']; ?> </strong></div> <div class="col-sm-2">No. of nights: <strong><?php echo $data['n_days']; ?> </strong></div> </div> <div class="row extra"> <div class="col-sm-4"> Agency: <?php if ($this->data['userInfo']['type'] == 1) { ?> <select id="agencyListReservation-<?php echo $data['reservation_id']; ?> "> <?php foreach ($this->data['agencies'] as $agency) { $selected = ''; if ($agency['agency'] == $data['agency']) { $selected = 'selected'; } ?> <option value="<?php echo $agency['agency_id']; ?> " <?php echo $selected; ?> ><?php echo $agency['agency']; ?> </option> <?php } ?> </select> <?php } else { ?> <strong><?php echo $data['agency']; ?> </strong> <input type="hidden" id="agencyListReservation-<?php echo $data['reservation_id']; ?> " value="<?php echo $data['agency_id']; ?> "> <?php } ?> </div> <div class="col-sm-4">External Id: <strong><?php echo $data['external_id']; ?> </strong></div> </div> <div class="row extra"> <input type="hidden" value="0" id="res-option-<?php echo $data['reservation_id']; ?> "> <div class="title-options"> Set Reservation as: </div> <div class="reservation-options"> <div class="option pending <?php if ($data['status'] == '1') { echo 'checked'; } ?> " opt-res="1" single-res="<?php echo $data['reservation_id']; ?> ">Pending</div> <div class="option canceled <?php if ($data['status'] == '5') { echo 'checked'; } ?> " opt-res="5" single-res="<?php echo $data['reservation_id']; ?> ">Canceled</div> <div class="option confirmed <?php if ($data['status'] == '2') { echo 'checked'; } ?> " opt-res="2" single-res="<?php echo $data['reservation_id']; ?> ">Confirmed</div> <div class="option checked-in <?php if ($data['status'] == '3') { echo 'checked'; } ?> " opt-res="3" single-res="<?php echo $data['reservation_id']; ?> ">Checked-In</div> <div class="option checked-out <?php if ($data['status'] == '4') { echo 'checked'; } ?> " opt-res="4" single-res="<?php echo $data['reservation_id']; ?> ">Checked-Out</div> </div> </div> <div class="row-extra"> <div class="col-sm-4"> <h5>Grand Total <strong> $ <span id="payment-grand-total-<?php echo $data['reservation_id']; ?> "><?php echo $data['grandTotal']; ?> </span></strong></h5> </div> <div class="col-sm-4"> <h5>Paid: <strong> <span id="payment-paid-total-<?php echo $data['reservation_id']; ?> ">$ <?php echo $data['paid']; ?> </span></strong></h5> </div> <div class="col-sm-4"> <h5 class="pending-highlight">Pending: <strong> <span id="payment-pending-total-<?php echo $data['reservation_id']; ?> ">$ <?php echo $data['unpaid']; ?> </span></strong></h5> </div> </div> <div class="row-extra"> <div class="col-sm-4">Staying cost total: <strong id="payment-staying-total-<?php echo $data['reservation_id']; ?> ">$ <?php echo $data['staying_total']; ?> </strong></div> <div class="col-sm-4">Staying cost paid: <strong id="payment-staying-paid-<?php echo $data['reservation_id']; ?> "> $ <?php echo $data['staying_paid']; ?> </strong></div> <div class="col-sm-4">Staying cost pending: <strong id="payment-staying-pending-<?php echo $data['reservation_id']; ?> "> $ <?php echo $data['staying_pending']; ?> </strong></div> </div> <div class="clearfix"></div> <div class="row-extra payment-items" id="payment-items-<?php echo $data['reservation_id']; ?> " > <?php if ($data[0]['payments']) { echo Layout_View::getPaymentItems($data[0]['payments']); } ?> </div> <br> <?php if ($data['status'] < 4) { ?> <div class="row-extra payment-extra" id=""> <div class="row"> <div class="col-sm-3"> <input type="text" placeholder="description" id="extra-pay-des-<?php echo $data['reservation_id']; ?> " /> </div> <div class="col-sm-2"> $ <input type="text" class="input-cost" placeholder="cost" id="extra-pay-cost-<?php echo $data['reservation_id']; ?> " /> </div> <div class="col-sm-2"> <input type="checkbox" name="staying" value="staying" id="extra-pay-staying-<?php echo $data['reservation_id']; ?> "> Staying cost </div> <div class="col-sm-1"> <button type="button" class="btn btn-info btn-xs add-extra-pay" res-id="<?php echo $data['reservation_id']; ?> " >ADD</button> </div> </div> </div> <div class="row extra save-single-res"> <a href="javascript:void(0);" class="btn btn-info btn-xs save-single-res-a" single-res="<?php echo $data['reservation_id']; ?> ">save</a> </div> <?php } ?> </div> <?php $item = ob_get_contents(); ob_end_clean(); return $item; }
if ($grandTotal = $model->getReservationPaidByReservationId($_POST['reservationId'])) { echo '$ ' . $grandTotal; } else { echo '$ 0'; } break; case 9: if ($grandTotal = $model->getReservationUnpaidByReservationId($_POST['reservationId'])) { echo '$ ' . $grandTotal; } else { echo '$ 0'; } break; case 10: if ($payments = $model->getPaymentsByReservationId($_POST['reservationId'])) { echo Layout_View::getPaymentItems($payments); } else { echo '0'; } break; case 11: if ($model->setPaymentStatus($_POST['paymentId'])) { echo '1'; } else { echo '0'; } break; case 12: if ($model->setPaymentType($_POST)) { echo '1'; } else {