BloomQuote currently offers a robust platform for creating and managing quotes for customer events. To enhance the user experience and improve efficiency, it is proposed to add a text search functionality that allows users to quickly find specific quotes based on various text criteria.
Purpose
The ability to search quotes by text will streamline the workflow for florists, enabling them to quickly locate quotes by entering relevant keywords or phrases. This feature is essential for managing a large volume of quotes and ensures that users can easily access the information they need without having to manually sift through numerous records.
Benefits
Increased Efficiency: Users can quickly locate specific quotes by searching for key details such as customer names, event dates, or specific items within a quote.
Improved User Experience: A search functionality will make the application more user-friendly and reduce the time spent on administrative tasks.
Enhanced Data Management: Facilitates better organization and retrieval of quotes, especially as the number of quotes grows.
Implementation Details
Search Bar Integration: Add a search bar to the quotes listing page (list_quotes.php) where users can input their search queries.
Backend Processing: Modify the QuoteController to handle search requests by querying the database for quotes that match the search criteria.
Database Query: Implement a method in the Quote model to perform a search query based on the provided text input, matching against key fields such as:
Bride's Name
Groom's Name
Wedding Date
Item Descriptions
Custom Messages
Display Results: Update the view to display quotes that match the search criteria.
Example Usage
Search by Customer Name: Users can enter the name of the bride or groom to find all quotes associated with that customer.
Search by Event Date: Entering a specific date or date range to retrieve quotes for events happening within that period.
Search by Item Description: Allows users to find quotes containing specific items or services.
Proposed Changes to Code
Controller Update (QuoteController.php):
public function search_quotes() {
$search_term = InputHelper::sanitizeString($_GET['search_term'] ?? '');
$user_id = $_SESSION['user_id'];
$quotes = $this->quoteModel->searchQuotesByUserId($user_id, $search_term);
include_once './app/views/quote/list_quotes.php';
}
Model Update (Quote.php):
public function searchQuotesByUserId($user_id, $search_term) {
$stmt = $this->db->prepare("
SELECT * FROM quotes
WHERE user_id = ?
AND (bride_name LIKE ? OR groom_name LIKE ? OR wedding_date LIKE ? OR custom_message LIKE ?)
");
$search_term = "%$search_term%";
$stmt->bind_param("issss", $user_id, $search_term, $search_term, $search_term, $search_term);
$stmt->execute();
return $stmt->get_result();
}
Adding a text search functionality to BloomQuote will significantly enhance the usability of the application, making it easier for users to manage and retrieve quotes efficiently. This feature aligns with the overall goal of providing a comprehensive, user-friendly solution tailored to the needs of florists.
Description
BloomQuote currently offers a robust platform for creating and managing quotes for customer events. To enhance the user experience and improve efficiency, it is proposed to add a text search functionality that allows users to quickly find specific quotes based on various text criteria.
Purpose
The ability to search quotes by text will streamline the workflow for florists, enabling them to quickly locate quotes by entering relevant keywords or phrases. This feature is essential for managing a large volume of quotes and ensures that users can easily access the information they need without having to manually sift through numerous records.
Benefits
Implementation Details
Search Bar Integration: Add a search bar to the quotes listing page (
list_quotes.php
) where users can input their search queries.Backend Processing: Modify the
QuoteController
to handle search requests by querying the database for quotes that match the search criteria.Database Query: Implement a method in the
Quote
model to perform a search query based on the provided text input, matching against key fields such as:Display Results: Update the view to display quotes that match the search criteria.
Example Usage
Proposed Changes to Code
Controller Update (
QuoteController.php
):Model Update (
Quote.php
):View Update (
list_quotes.php
):Conclusion
Adding a text search functionality to BloomQuote will significantly enhance the usability of the application, making it easier for users to manage and retrieve quotes efficiently. This feature aligns with the overall goal of providing a comprehensive, user-friendly solution tailored to the needs of florists.