$price = $_POST['price']; if (!$price) { $price = 0; } modify_rateitem(0, $_POST['ratesid'], $_POST['itemcode'], $_POST['dis'], $period, $service, $tax, $price, $maxcount); break; case $_L['RTS_listrates']: echo "List"; break; case $_L['BTN_search']: //check if user is searching using rateid or ratecode if ($_POST['optFind'] == "ID") { $ratesid = $_POST['search']; } else { if ($_POST['optFind'] == "Name") { $ratesid = get_rateid_bycode($_POST['search']); } } break; } } if (isset($_POST['ratesid']) && !$ratesid) { $ratesid = $_POST['ratesid']; } if (isset($_POST['code'])) { $code = $_POST['code']; } if (isset($_POST['description'])) { $desc = $_POST['description']; } if (isset($_POST['bookingsrc'])) {
/** * Get the roomtype by the ratecode * @ingroup ROOM_MANAGEMENT * @param $ratecode [in] rate code identifier * @param $roomtypes [in/out] The room type list */ function get_roomtype_byratecode($ratecode, &$roomtypes) { global $conn; if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } if (!$conn) { return 0; } $rateid = get_rateid_bycode($ratecode); $roomtypes = array(); $sql = "select roomtypeid,rateid from roomtype where rateid =" . $rateid; //echo $sql ."\n"; $stmt = $conn->prepare($sql); $results = $stmt->execute(); while ($row = $stmt->fetch()) { // print "found ".$row['itemid'] ." - ".$row['description']."<br/>\n"; $rtid = $row['roomtypeid']; $rt = get_roomtype($rtid); $roomtypes[$row['roomtype']]['roomtype'] = $rt; $roomtypes[$row['roomtype']]['rateid'] = $row['rateid']; } return sizeof($roomtypes); }