if (!$roomid) { echo "<div align=\"center\"><h1>" . $_L['RM_error'] . "</h1></div>"; } else { if ($action == $_L['BTN_update']) { echo "<div align=\"center\"><h1>" . $_L['RM_updatesuccess'] . "</h1></div>"; } else { echo "<div align=\"center\"><h1>" . $_L['RM_addsuccess'] . "</h1></div>"; } } /** After successfully saving the room details, the room amenities * will be deleted then re-added 1 at a time from the new list */ delete_roomamenities($roomid); if (isset($_POST['RoomAmenity'])) { foreach ($_POST['RoomAmenity'] as $idx => $val) { add_roomamenity($roomid, $val); } } } break; case $_L['BTN_list']: break; case $_L['BTN_search']: //check if user is searching using name, payrollno, national id number or other fields $roomno = $_POST["search"]; $res = find_room($roomno, $rooms); $roomid = $rooms['roomid']; break; } } if ($_GET['search'] || $_POST['roomno']) {
$roomno = file_get_contents($roomno_file); } //Default Room URL $defurl = "http://www.example.com/image.jpg"; $rateid = modify_rate(0, $ratecode, "Default Rate", 15, "F", 1, 1, 1, 1, 1, 0, $currency, $date_started, $date_stopped); modify_rateitem(0, $rateid, 1, 1, 16773247, 1, 1, $roomcost, 0); $roomtypeid = modify_roomtype(0, $roomtype, $roomtype, $rateid, $defurl); for ($i = 0; $i < $roomcount; $i++) { $add_roomno = $roomno + $i; $roomstatus = "V"; $roomid = modify_room(0, $add_roomno, $roomtypeid, "", 1, 1, 1, 0, 0, 0, 1, $roomstatus, "", "", $rateid); if (isset($_POST['AMENITIES'])) { $amenitylist = $_POST['AMENITIES']; //print_r($amenitylist); foreach ($amenitylist as $amenity) { add_roomamenity($roomid, $amenity); } } } $roomno = $roomno + 100; $fh = fopen($roomno_file, 'w'); fwrite($fh, $roomno); fclose($fh); } break; case $_L['BTN_next']: header("Location:index.php?action=thankyou"); break; } } $roomamenities = array();