This topic is locked

Resource Calendar template use same table rc_resourcedetails master data pass detail

1/4/2026 23:56:53
PHPRunner General questions
C
carrie3800332 author

Resource Calendar template use same table rc_resourcedetails master data pass detail
What method would be more suitable?

Thanks a lot.

rc_resourcedetails_classm_add.jpg
ChatGPT 1/4/2026

Certainly! When working with PHPRunner and trying to pass master data to a detail view in a Resource Calendar template, the method you choose can depend on the specific requirements of your application. Here are a few methods you might consider:

  1. Master-Detail Relationship:

    • PHPRunner supports master-detail relationships directly. You can set up a master-detail view where the master table is your rc_resourcedetails table and the detail table is the one that contains the calendar events or resource allocations.
    • In this setup, when you view the master record (resource details), you can easily see the related detail records (events) displayed below or in a separate view.


  2. Using URL Parameters:

    • If you want to pass specific parameters to the Resource Calendar, you can use URL parameters. For example, when you open the calendar for a specific resource, you can pass the resource ID through the URL.
    • You can then capture this parameter in your calendar script to filter the events displayed based on the selected resource.


  3. Custom SQL Queries:

    • If the built-in relationships do not fit your needs, you can create a custom SQL query to fetch the relevant data based on the resource details.
    • You can create a custom page in PHPRunner that queries both the master and detail tables and displays the relevant information as needed.


  4. AJAX Calls:

    • If you want to load the detail data dynamically without refreshing the page, you can use AJAX calls. This method allows you to fetch the detail records for the selected master record on the fly.


  5. Using Events in PHPRunner:

    • You can also use PHPRunner's event system to manipulate how data is passed between pages. For instance, you can use the BeforeShow event to set up the necessary data before the calendar displays.



Recommendation

For a straightforward approach, I recommend using the Master-Detail Relationship if your application structure aligns with it. This method leverages PHPRunner’s built-in functionality and is easy to implement. If you need more custom behavior, consider using URL parameters or AJAX calls based on your specific requirements.

If you have any further details about your setup or specific use cases, feel free to share, and I can provide more tailored advice!