We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18809
    • 109 Posts
    I am creating a school management system in Modx for my Client and he want student data to store and manage by searching and front end editing.
    I created a resource to tree like this -
    Session year > Classes > (collections Extra for each class) > Students entry.
    And I have created many Tvs for Students entry like name, class, father's name, form date, fees etc.

    Client want to search for particular list of student by fees due, form completed or not (which is added by TV with radio button yes/no)

    And Client want to automatic calculate the amount like adding fees in installment of 3 so total fees is 15000 and there is 3 installments for 500 each. So when student submit 1st installment, it should show remaining amount and when 2nd installment submit, it should add and calculate amount.

    Client also want to search data by selecting year and student's class. He also want to add data from front end. How to process tv's with resource ?

    I dont know how to achieve all this with modx .. Please suggest me proper extra or guide me how it can be done.

    Thanks. smiley
      My Proudly Powerd By Modx site - http://irresistiblemt.in smiley Its simple site but its made in best CMS.
      • 17301
      • 932 Posts
      I think you may struggle or run into a few problems if you opt for resources and tvs. TVs aren't really meant for storing and returning large volumes of data like this. You'll be best off creating a custom database. This tutorial will get you started on that: https://www.youtube.com/watch?v=jwzx6O7zdaU

      In terms of editing from the front end then I believe the above video tutorial also covers how you can run a snippet to update the database you create, so you could just use formit with a hook to submit and map your values correctly.
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 3749
        • 24,544 Posts
        +1 for what LK said. If you do it that way, you'll be very sorry down the road. There's more info here about why storing data in TVs is a bad idea: https://bobsguides.com/blog.html/2014/05/27/why-extend-moduser/, and some suggestions on a better way.

        In addition to the video, also consider ClassExtender which helps you create the extra user fields, builds the DB table for you, and puts the extra fields on the Create/Edit User panel. If all you have are extra user fields that can go in a single table, ClassExtender might be easier.

        If you need multiple tables (e.g., students, classes, teachers) and intersect objects (e.g., studentClass, teacherClass, studentTeacher), it may be better to create your own schemas and roll your own code.
          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
          • 18809
          • 109 Posts
          Hello bob sir and LK sir.
          I tried your suggestions and created a CMP with the help of video and other suggestions.
          I created custom database tables with Migx cmp and now I am able to show data in front end what I want like students name , class etc. but client want few more things.
          before I ask that, please check what I have currently in this screenshot -

          http://i67.tinypic.com/30wl9hx.jpg

          Now client want to filter results on frontend by selecting options from dropdown list. How do achive this ? Please check next screenshot -

          http://i65.tinypic.com/2aj6dy9.jpg


          client want few more stuffs but I will talk it about later. Currently this is where I stuck.
            My Proudly Powerd By Modx site - http://irresistiblemt.in smiley Its simple site but its made in best CMS.
            • 3749
            • 24,544 Posts
            If the dropdowns are just HTML select/options sections, the selected value will be in the $_POST for your snippet to process:

            <form method="post" action="">
                <select name ="sex">
                   <option value="female">Female</option>
                   <option value="male">Male</option>
                </select>
            
                <input type="submit">
            </form>
            



            <?php
            $gender = $modx->getOption('sex', $_POST, 'No Selection', true);
            
            return "Gender = " . $gender;
            


            You may want to use some JavaScript to make sure selections are made.
              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
              • 18809
              • 109 Posts
              Mayanktaker Reply #6, 5 years ago
              Hello sir,
              Sorry for late reply..
              I want advance search filter from MIGX CMP database tables ..
              I want like this but I dont know from where to start to achieve this ? .. sad
              I never used formit or anything related to form.
              How can I do this ? Please check the image -

              http://tinypic.com/r/27ymoed/9

                My Proudly Powerd By Modx site - http://irresistiblemt.in smiley Its simple site but its made in best CMS.
                • 46886
                • 1,154 Posts
                It seems to me you would be best to use a simple custom php call to the db for this, but I could be wrong

                In modx its not too hard, just query the db and use the inputs to do it, then organize the output.
                  • 17301
                  • 932 Posts
                  Try checking this tutorial out particularly the part where it filters dates.

                  https://docs.modx.com/extras/revo/migxdb/migxdb.tutorials/migxdb.manage-events-resources-in-a-cmp-with-help-of-migxdb
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 18809
                    • 109 Posts
                    Mayanktaker Reply #9, 5 years ago
                    Quote from: nuan88 at Mar 05, 2019, 03:47 PM
                    It seems to me you would be best to use a simple custom php call to the db for this, but I could be wrong

                    In modx its not too hard, just query the db and use the inputs to do it, then organize the output.
                    I dont know how to do this. sad
                      My Proudly Powerd By Modx site - http://irresistiblemt.in smiley Its simple site but its made in best CMS.
                      • 18809
                      • 109 Posts
                      Quote from: lkfranklin at Mar 05, 2019, 04:53 PM
                      Try checking this tutorial out particularly the part where it filters dates.

                      https://docs.modx.com/extras/revo/migxdb/migxdb.tutorials/migxdb.manage-events-resources-in-a-cmp-with-help-of-migxdb

                      I tried that and its working in backend. But my client want this to be in front end.
                      They want to find data of students by class or roll number etc.. in the front end.

                      I found an example which exactly my client want in student management system. It is available in wordpress with a plugin. I want this in Modx. What is the best solution ?

                      http://sandbox.wpdatatables.com/

                      =====
                      Please check this link and demo also there. This is exactly what I want to do in Modx. As in the above link, the data will be in Modx custom database table tables with the help of Migx and then client can see the list of students in frontend. and there, they also can filter results. All in of his work in frontend. (link in above demo link )

                      How can I achieve this in Modx ? IS there any other way than MIGX ? Or I am going to right path ? If yes then please guide me more to the right direction.
                      Update :
                      Thank you all! smiley

                      [ed. note: Mayanktaker last edited this post 5 years ago.]
                        My Proudly Powerd By Modx site - http://irresistiblemt.in smiley Its simple site but its made in best CMS.