We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    dev,

    there is no relationship between the data and the modx documents other than the fact I’m using modx to manage the site.

    The data is pre-existing and in a separate db. I’ve already installed phpmyedit as a module within Modx to administer the data.

    Basically the data is a list of suppliers, contractors etc with the typical info - business name, address, location, etc.

    I want users to be able to find a supplier by location, species supplied, name etc.

    So a user could do a search for all suppliers of barramundi fish stock in a specific town or region.

    I’m looking for options to do this.

      Content Creator and Copywriter
      • 7231
      • 4,205 Posts
      I don’t remember seeing any snippets that did db searches so you may need to do something custom. Since this is not necessarily limited to MODx I would look into php tutorials/documentation on creating a database search/filters. Or snippet-ify an existing db search script.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 18367
        • 834 Posts
        Thanks Ganesh,

        yes I’ve been looking at ajaxsearch 1.8, and thinking: "Well it sounds like it can, and looks like it can."

        But not being a programmer all that code starts to look scary.

        Guess I’ll have to do some woodshedding.

        I’ll continue this discussion in the ajaxsearch sub-forum

        Thanks

        cool
          Content Creator and Copywriter
          • 25883
          • 128 Posts
          Mark,

          I’m PM’ing you with a thought.

          Hit me back when you get a chance.

          - John
            • 18367
            • 834 Posts
            Doh,

            I’ve just discovered quite by accident that phpmyedit actually has this sort of search functionality built in.

            I was just playing around with it, and there it was. Just seemed to pop out of nowhere fully functional.

            I will still have to style it, figure out how to display it on the webpage without giving users the ability to edit anything etc, and a few other configurations, but it looks like it might work.

            Just goes to show, you never know what’s under your nose.

            Don’t know if it’ll be as elegant as AjaxSearch but I’ll probably play with both
              Content Creator and Copywriter
              • 3749
              • 24,544 Posts
              Quote from: markg at Aug 07, 2008, 06:54 AM

              dev,

              there is no relationship between the data and the modx documents other than the fact I’m using modx to manage the site.

              The data is pre-existing and in a separate db. I’ve already installed phpmyedit as a module within Modx to administer the data.

              Basically the data is a list of suppliers, contractors etc with the typical info - business name, address, location, etc.

              I want users to be able to find a supplier by location, species supplied, name etc.

              So a user could do a search for all suppliers of barramundi fish stock in a specific town or region.

              I’m looking for options to do this.

              It sounds like you might be looking for a "query builder." Google that, and you’ll find a ton of stuff. It shouldn’t be too hard to snippetize one, though I’ve never done it.

              Another way to go is to just put up a form with all those fields and build the query yourself from whatever the user enters. A slightly better way would be to populate the form with radio buttons, checboxes, dropdown lists, etc., based on the DB fields and then build the query from the user’s selections.

              You could also do one of those goofy progressive queries like the aftermarked auto parts guys do where you select the make, then the model, then the year, then the part with the page reloading after each selection, though I don’t much care for that approach.

              Here’s something I did in my pre-MODx days that provides some pre-selected queries and the opportunity for the user to do a Google-like search of the DB:

              http://wordsmatter.softville.com/quotations.htm

              I still haven’t gotten around to porting that site to MODx. embarrassed
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 18367
                • 834 Posts
                UPDATE

                For those of you who were interested.

                I finally managed to get the data tables displaying on the webpage in some sort of interactive way.

                See http://httpwix.s.customers.ilisys.com.au/assets/templates/acwa/tablesorter/docs/consultants.php

                It was not easy, and even though it looks ok, what’s behind it is probably a bit rough because as I keep saying, I’m no coder or programme.

                In any event it looks reasonable and does the job.

                I ended up using a table sorting js called "tablesorter" which is actually quite configurable, more so than I understand at the moment.

                At the moment you just click on the column header and it will sort the table ascending or descending alphabetically. You can configure it to do progressive sorts, but I haven’t been that adventurous yet.

                Into the table I have force fed a load of db calls to get the data that I want to display.

                At the moment these are distinct pages as I couldn’t figure out how to integrate the tablesorter script into the Modx Manager. (And believe me I tried.)

                Some of you more accomplished Modxphiles might like to have a look at tablesorter and see what you think.

                From the other end the data is fed into the db by eform2db.

                Any comments questions, feel free, but as I said there was pain involved.

                grin








                  Content Creator and Copywriter
                  • 25883
                  • 128 Posts
                  Congratulations Mark, it turned out great. 

                  I know you’ll probably never want to do it again or even relive it, but I hope a lot of people notice what you accomplished and give you credit for it. 

                  Too bad you can’t package what you created on that page and make it into a download.



                  I’ve been thinking about the possibility of having a MySQL database table of customer information be embedded in a page. 

                  I’ve also ideally wanted it to be 2-way writable so editing it on-screen would make permanent changes in the database. 

                  As far as display, since it would be an intranet, I wouldn’t be too picky about the presentation.  It ideally would be in a stylized format like Mark’s, but just a plain or raw data table would suffice.  I also thought that maybe its possible to create a widget from a MySQL database and then just embed the widget. 



                  I found out it is possible with DekiWiki, but might require their paid version that has some extra functionality.  Their platform is built to mash multiple sources of data, but it is at its core a wiki, so to me it seems like it is best for intranets and not for public pages. I don’t know if it would be easier, harder, or equal in difficulty to do it with MODx or with Deki. I keep thinking that creating an independent embeddable widget of the data would be ideal, and that could be used on any platform, but I have no idea yet how that could be done.


                  John
                    • 25883
                    • 128 Posts
                    Interesting subject too, as I was a Biology major. smiley
                      • 18367
                      • 834 Posts
                      you’ll probably never want to do it again or even relive it,

                      I’m hoping somebody else will get inspired and take off from where I left off, then tell me how I should have done it.

                      Too bad you can’t package what you created on that page and make it into a download.

                      Tablesorter is actaully I nice little downloadable package, but it only does the tables. Integrating the db data is where you’re on your own.

                      http://tablesorter.com/docs/

                      Another problem was that Tablesorter has its own CSS which may/will conflict with whatever existing css you have for your site. It did in my case.



                        Content Creator and Copywriter