//get data from selected table on the selected fields if ($bill['transcount'] > 0) { $i = 0; while ($i < $bill['transcount']) { //alternate row colour $j++; if ($j % 2 == 1) { echo "<tr id=\"row" . $j . "\" onmouseover=\"javascript:setColor('" . $j . "')\" onmouseout=\"javascript:origColor('" . $j . "')\" bgcolor=\"#CCCCCC\">"; } else { echo "<tr id=\"row" . $j . "\" onmouseover=\"javascript:setColor('" . $j . "')\" onmouseout=\"javascript:origColor('" . $j . "')\" bgcolor=\"#EEEEF8\">"; } if ($bill['trans'][$i]['status'] == STATUS_VOID) { echo "<td rowspan=2></td>"; echo "<td rowspan=2><del>" . $bill['trans'][$i]['trans_date'] . "</del></td>"; echo "<td colspan=2><del>" . $bill['trans'][$i]['item_id'] . "</del></td>"; echo "<td><del>" . get_ratecode($bill['trans'][$i]['ratesid']) . "</del></td>"; echo "<td rowspan=2><del>" . $bill['trans'][$i]['amount'] . "</del></td>"; echo "<td rowspan=2><del>" . $bill['trans'][$i]['svc'] . "</del></td>"; echo "<td rowspan=2><del>" . $bill['trans'][$i]['tax'] . "</del></td>"; echo "<td rowspan=2><del>" . $bill['trans'][$i]['quantity'] . "</del></td>"; echo "<td rowspan=2 colspan=2><del>" . $bill['trans'][$i]['grossamount'] . "</del></td>"; echo "</tr>"; //end of - data rows if ($j % 2 == 1) { echo "<tr id=\"row" . $j . "\" onmouseover=\"javascript:setColor('" . $j . "')\" onmouseout=\"javascript:origColor('" . $j . "')\" bgcolor=\"#CCCCCC\">"; } else { echo "<tr id=\"row" . $j . "\" onmouseover=\"javascript:setColor('" . $j . "')\" onmouseout=\"javascript:origColor('" . $j . "')\" bgcolor=\"#EEEEF8\">"; } echo "<td><del>" . $bill['trans'][$i]['std_amount'] . "</del></td>"; echo "<td><del>" . $bill['trans'][$i]['std_svc'] . "</del></td>"; echo "<td><del>" . $bill['trans'][$i]['std_tax'] . "</del></td>";
/** * Retrieve all the reservation details by reservation id * @param $detailID [in] The reservation details ID * @param $details [in/out] reservation details array * @return 1 on success and 0 on fail */ function reservation_detail_byID($detailID, &$details) { global $conn; if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } if (!$conn) { return 0; } if (!$detailID) { return 0; } $details = array(); $sql = "SELECT id,reservation_id,roomid,roomtypeid,ratesid,quantity,`status` \n\t\t\tFROM reservation_details \n\t\t\tWHERE id=" . $detailID; //print $sql."<br/>"; $stmt = $conn->prepare($sql); $results = $stmt->execute(); while ($row = $stmt->fetch()) { $details['id'] = $row['id']; $details['reservation_id'] = $row['reservation_id']; $details['roomid'] = $row['roomid']; $details['ratesid'] = $row['ratesid']; $details['quantity'] = $row['quantity']; $details['roomno'] = get_roomno($row['roomid']); $details['status'] = $row['status']; if ($row['roomid']) { $room = array(); get_room($row['roomid'], $room); $details['roomtypeid'] = $room['roomtypeid']; $details['roomtype'] = get_roomtype($room['roomtypeid']); } else { $details['roomtypeid'] = $row['roomtypeid']; $details['roomtype'] = get_roomtype($row['roomtypeid']); } $details['ratecode'] = get_ratecode($row['ratesid']); } return sizeof($details); }