How to retrieve additional details from db when eventclick is raised - php

I have a PHP Bootstrap web page. At load time, I generate all JSON events properties using PHP doing a MySQL query and then the fullcalendar is displayed after.
This fullcalendar contains different kinds of calendar events (each calendar event being a table with different columns) and when eventclick() is raised, I display a modal bootstrap form showing the event details. The event modal is different based on an event property type. Doing this allows me to edit via
a form each calendar event, update the DB and refresh the fullcalendar after.
I tried initially to load all different events details (and therefore all table columns) into the fullcalendar but now, of course, there is a performance impact (on page load).
Is there a way to load a minimal set of calendar event properties (date and event title), show the fullcalendar and based on eventclick() retrieve additional database details before displaying the modal and allow the end user to edit the form? (the form processing after is, of course, usual PHP/MySQL code).
Thanks a lot

Related

Creating unique pages of a website by passing an sql key

The title may be a bit awful as I'm really not sure how to describe what I'm trying to achieve without using lots of words.
I'm currently building an events website. This website has the option for users to create their own events which can be added to a big list of upcoming events that other users have submitted.
What I want to do is be able to have a user create an event and have the details of the event stored in an SQL database (which I've successfully done), I want to be able to then have a large list of events on a separate page the details of which are pulled from the server dynamically using PHP and SQL (I've also successfully done this). The part I am struggling with however is being able to create unique pages (or a single dynamic page) that displays a more detailed look at the event, such as age restrictions etc etc, which cannot be displayed on the big list which displays all the available events.
I figured that this could be done using a unique eventID, which is something the SQL database already includes and autoincrements with each new event entry. What I'm really not sure about is how I'd be able to pass that eventID through the link to the more detailed page so that the detailed page can be created displaying all of the details of the event.
I'm not even sure if this idea will work at all. Would having a page with a unique URL that is created on event submission that has a more in-depth look at the details of the event be a better idea? How would I go about creating unique URL webpages that correspond to each event on event submission?
I'm really not sure how I need to go about this at all, so I need some help and pointing in the right direction.
Here's a kind of TLDR:
1) Events website
2) All events on the website are displayed on a single page that has minimal detail about each event (title, date, location) BUT has a link to a page that displays the event in more detail.
3) User can select an event from the list and click on that event's unique HTML link to more detailed page
4) More detailed page displays event in more detail by pulling event's unique information from the database
Feel free to ask any questions at all as I know this probably isn't the easiest idea to get across
When creating the links from the general listing page to the detail page, simply include the id in the link. For example:
<A HREF="mysite.com/detail.php?id=3>Big Event</A>
In detail.php then, you'll find the id in $_GET['id'].

web technique for lookup another table

I'm new to web development and I've been studying cakephp and I have this situation where I want to know the best practice.
Imagine a user creating a new Customer in the application, in the form he has to choose the customer's sales group, and this table has so many records, that's using a drop down list isn't a viable option.
I was thinking in the user press a button, then open a modal window. This new window would have a grid, with search options (for filtering the data) and the user would choose one, and go back to the original form, bringing back the sales group selected by the user.
What's the name of this technique, and is it a good option? How to do this in cakephp?
Best regards
Your question is about the front-end, so it doesn't matter if you are using CakePHP or another PHP framework.
What you want to do is make an ajax call to the server on opening the modal window, so it populates its' contents with your grid. Then, proceed as planned.
On the other hand, you can use something like Select2. This way you can have searchable drop-down menu right in your page and the user won't need to open a modal window. It's just more convenient for the user.
You can check the examples for Select2 here.

Pulling data from MySQL into an Elgg application

I'm trying to use Elgg as a starting point for a certain type of social media website. One of the main things I'd like to do is allow users to create events and then display all the events in a sortable table (sortable by different attributes given to the event during the creation like date and title). For the event creation aspect, I'm using the plugin Event Manager.
I'm assuming the best way to do this is to pull the event data from where ever it is stored and put it into an HTML table (I'm using the jQuery TableSorter code). Can anyone give me a good idea of where and how to start doing this?
The biggest problem I'm having is finding where the event data is stored in MySQL.
For the database organisation and model, read:
http://docs.elgg.org/wiki/Engine/DataModel
http://docs.elgg.org/wiki/DatabaseSchema
For fetching the data, consider using:
http://reference.elgg.org/1.8/engine_2lib_2metadata_8php.html#aec4b6f0b9565e3554acb9b39ef34a2ac
With options order_by and order_by_metadata for chosen information.

How to retrieve data from database depending on parameters from form in Joomla?

I have the next task with my Joomla site:
I have events stored in DB. Depending on parameters user chose in form (from date, till date, type of event etc.), I need to get proper events form databse to display in table. And I have no idea, how to realize it all: form, interaction with DB based on form data, displaying the results on new page.

Provide an embed code of a section of a page for users to use

I have a ticketing site ( eventtickx.com...click buy tickets on the event ghana # 55(you will see the layout)). I want to generate embed code for event managers for each event they post. I want an embed code for the tickets available section only which has the information ( ticket assignment, quantity and price). so basically this is what I am trying to do ..generate an embed code for tickets available section of a page for each event to event manager that created the event. how do I go about doing this? Thanks for your help.
I'm not sure if I fully understand you, but I think you would like to provide a snippet like <iframe src="http://eventtickx.com/embed_event.php?eid=123"></iframe> to enable people to embed a little info box for a specific event on their site (like you can do with YouTube videos)?
What you would need is a script (e.g. embed_event.php) that provides the iframe content and takes one GET parameter.
This script would do the necesserary queries (getting event name, description, available tickets etc. from the database) and display them as a complete HTML page (similar to what you are doing in event_details.php).
The GET param would be typically the event ID that you could use to query your database.
The embed code could be generated as soon as you know the event ID (usually after you have inserted the dataset into you database when creating the event).

Categories