Joomla database query based on dropdown selection - database

I am very new to programing but after a lot of research i can rufly manage to create a dropdown selection from database and show a column result from that table based on the dropdown selection using ajax.
I write the html form, the php file that connects to the database, the script that loads the data on the dropdown list, the script that handles the on change event and calls for the php file that queries the database and display the result on a div.
In this particular case is a price stored on the database based on the destination selection.
Now my problem atarts here:
I'm using joomla and i would like to do this with the code that I have but I have no clue where to save the various html, php and js files.
I tried doing this with chronoforms but gave up as I found it very difficult.
Can someone give me some advise on what and how to do this?

Related

Creating search form that will query SQL database and display results on a custom block

I am a new to Drupal and have learnt about custom blocks.
Basically, I am trying to create a search page where on the left column will have all the filter/search criteria.
On the right column the results will be displayed in a specified format in a custom block. Not sure where to start on this work.
I have my back end ready with all the parameters going in correctly and results are displayed out of a stored procedure.
Not sure about how to wire up the front end filter criteria fields with backend SQL parameters.
I am using Drupal 8 - bootstrap theme custom blocks to design the page and SQL server (using SSMS tool) backend to achieve this. Any guide on how to start this? Thanks!
Actually Drupal is build for less code and less custom code writing
All the functionality about exposing form for filters and result and results formatting are available in views module where you can expose filters and result formats as you need.
First lessen about Drupal was for me to avoid custom code until you did not find any Drupal solution.
and in your case you can achieve your all needs with only views.
Documentation for the Drupal 8 core Views module Here will find some views initial steps
I hope this helps you
Thanks

A similar tool of odk but with search and retrieve data features

We are working on survey's using ODK, by creating xls files and transform it into forms, and then we collect data offline.
When employees comeback from the field, they upload data.
What we need now is that they work online from the field, so they can search a specific ID or name, and see the data existing before adding new data.
What I mean is that we need to let them search the database by specific field, and that is not available in odk.
We upload data to ONA then the data are cleaned on the laptop and the searches are done on the laptop too.
Is there a tool that do that process ?
As far as I know, the closest you can get with existing tools is this: https://help.ona.io/faq/filtered-datasets
If you use Enketo (webforms), when the source dataset is updated (via new submissions) the webform will also be automatically updated (may require page refresh and there will be a delay). You could use both offline-capable or online-only webforms with this reference to external data and query it with select_one_from_file, select_multiple_from_file (in XLSForm terminology), or with pulldata, or with regular XPath.

HTML Page from selected row in Spotfire

I have come across a requirement that is already available in the current tool and they expect it to be implemented in Spotfire as well.
Requirement: Once data is loaded in Spotfire and they click on a row, there is a button "View in Web" that will render that selected row in a beautiful static HTML page in a new window.
My Logic so far: I'll store the column values in variables using ironpyton as explained in https://techgoje.wordpress.com/2014/12/02/spotfire-ironpython-accessing-column-values-in-script-context/ and then i'll render those values in HTML page
Any suggestion or help is greatly appreciated.
I have never tried to open a popup or new window in Spotfire. my guess is that you could do it in the Web Player, but it may not work in the thick client.
I've created an example DXP that shows how IronPython and Javascript can interact to render HTML content in a textarea. this may be a good solution for you.
(NOTE: you will need to trust all of the IP and JS scripts in this document!)

Database search field database

I'm looking for a way to create a search box in wordpress, where visitors can search a number from the database. Is this possible? I have several package numbers in my database. I want to give my visitors the ability to search for their package number and request the information that comes with the number.
What you want to do can be done.
I suggest a different approach than using wp-exec. (I just looked at wp-exec website, and that plugin was created for WordPress 1.5, which means it hasn't been updated in about 5 years).
The content you want to display exists entirely outside of WordPress. I suggest you use a custom page template - see
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
In this case you would not use WordPress posts or pages or custom post types. On the custom page template you would write (or have written if you don't have the knowhow to do it yourself) PHP code to extract the info from the database and display it on a page.
For pages like that you would be using WordPress only as a container within which to display the results - they custom page would appear in the site Nav, The page of results would use the site's theme to display so it looks like the rest of the site.
But the code to display from the database would not use the WordPress loop. It would be PHP / MySQL data retrieval and display code.
I really doubt you will find a plugin that lets you display results from an external database, formatted the way you want them to appear. The reason is every external database is different, has different tables and table structures. And no two sites will want the external data visually displayed in the same way. So there is little generalization to encapsulate in a plugin as everyone wants it different.
I've created pages on some sites along the lines of what you want to do thus I know it can be done. But it requires writing custom code.

How to auto generate a webpage after user submits form

I am looking for some initial direction on this one because I cannot seem to find my way with it. Let me explain...
I am developing a website wherein a logged in site member (Joomla 1.6) can fill out a simple form and attach a pdf to be uploaded upon submission. The user then clicks the submit button and the page will refresh to a new and unique web page.
User Submits data on http://www.examplesite.com and then after submission a new web page is generated that is called http://www.examplesite.com/userSubmittedValue
This newly generated web page would come from a template that is specified by the administrator and, most important, it will display all of the information that the user submitted. Also, there would be a link to download the pdf they uploaded. The user could then view a list of all the pages they have created in this manner via their profile.
I have seen this all over, but I am at a loss for how to generate this. Any help is much appreciated.
This is not something you will be able to easily do or get a detailed answer for here. If you just wanted to do the submission form with a thank you page that shows the data submitted you could use any number of form wizard type extensions - http://extensions.joomla.org/extensions/contacts-and-feedback/forms
If you just needed a way for users to upload PDfs and have access to them you could use one of the file management extensions that offer front end upload features - http://extensions.joomla.org/extensions/directory-a-documentation/downloads
If the additional data that is being submitted is simply data related to the file - title, description, etc then one of the file download components should work fine for you. The choices are limited in 1.6 at this time though so you might have to go with 1.5 to get the extension that works best for your needs.
So this probably isn't the best way to do it if your using Joomla but it just might help.
I would use PHP and inside of you're directory have a file like "template.html". Then I would create some php to handle the task of....
Opening "template.html"
Finding and replacing the values that the user passed you
Save the "template.html" under a new name (userSubmittedValue.html)
Again, I never really use Joomla. If you were to try this I'd suggest checking out php's file system functions (http://us2.php.net/manual/en/ref.filesystem.php).
Hope this helps a bit.

Resources