plugin_path . 'includes/models/methods-api.php'; $method = new Methods(); include $controller->plugin_path . 'includes/translations/translations.php'; $txt = new Translation; $room_type_id = sanitize_text_field($_POST['param1']); $floor_id = sanitize_text_field($_POST['param2']); global $wpdb; $room = $wpdb->prefix . 'hotel_has_room'; if ($room_type_id == '0' && $floor_id == '0'){ $query_result = $wpdb->get_results("SELECT * FROM `$room` ", ARRAY_A); } else if ($room_type_id == '0' && $floor_id != '0'){ $query_result = $wpdb->get_results("SELECT * FROM `$room` WHERE `floor_id` = $floor_id", ARRAY_A); } else if ($room_type_id != '0' && $floor_id == '0'){ $query_result = $wpdb->get_results("SELECT * FROM `$room` WHERE `room_type_id` = $room_type_id", ARRAY_A); } else if ($room_type_id != '0' && $floor_id != '0'){ $query_result = $wpdb->get_results("SELECT * FROM `$room` WHERE `room_type_id` = $room_type_id AND `floor_id` = $floor_id", ARRAY_A); } $number_of_rooms = count($query_result); ?>
txt("Total") ?> txt("rooms found") ?>
get_room_type_name_by_id($row['room_type_id']); $floor = $method->get_floor_name_by_id($row['floor_id']); ?>