Welcome Guest, Not a member yet? Register   Sign In
Report page with multiple Parts/Sections
#1

Hi guys ,

I'm lost at this so I want an opinion if it's doable  :

I was asked to see if I can create an online version of a report we now do in excel. The report is quite big
around 50 pages  more or less . It has 10 Main Parts , each part may have up to 20  Sub Parts and
each subpart  contains questions the user fills in by selecting check boxes , one is yes no
and one is 3 different choices (H. M L as High,Medium, Low) and two additional check-boxes.
I'm thinking that the best was to have a single page with all the Main Parts in place and have
a (button ?) to open each additional Sub Part and it's relevant questions with a save/add function.
The thing is I haven't seen any real life example on how (or if it is possible) to do such a workflow
with codeigniter. I have seen similar work with two tables with Datatables plugin  and ajax with php
for example but nothing that uses plain codigniter framework, most examples use a simple view for data.
So the question is this  something  beyond the capabilities of codeigniter and I should turn into
something else to accomplish it or this is something I could do with the framework as is?

Thanks.
Reply
#2

Hi, it is definitely doable.

But to make it up to par with today's modern single page web applications / expected user experience, you will need something to make your form react to user input. This could be javascript on client side, NodeJS on server side, web assembly, CSS, you name it.

I know it is a big leap, but I would look around React+Redux or something similar framework that does the heavy lifting for you. If it is too much to ask for for a single project, then I would still use lightweight Javascript on client side (with JQuery, for convenience), as it is fairly easy to implement afterall. And last, but not least, CSS also has some nice tricks in the bag to make your form more dynamic.

If no way are going to use client-side scripting, it is still doable. Then you will have to implement the logic in CI. Which, if you are not familiar with anything above, might be faster to develop, and might be perfectly fit for the requirements.
Reply
#3

Thanks for answering , I have no experience with JS (just started an online tutor on it ) .
I get the idea OK . I already made some other work with CI but it was much simpler , for this I
figured it's not going to be an easy task .
There are a lot of frameworks around JS which makes it hard to decide which one to focus on
(angular , react, plain jquery , redux I havent even seen what it is to be honest, nodejs
seems a good solution for server side but you still need eg angular for the client side etc.)
Thanks anyway.
Reply
#4

In a project like that, CodeIgniter can be used for the backend of your application to deal with everything related to the database. The frontend would need something more dynamic than simple web form that reload the whole page. Like bivanbi said, the best would be something like React+Redux, Angular, jQuery or even plain JavaScript. But if you have no experience with JavaScript it will take you a long time to do this project. jQuery is easy to learn but I found Angular to be quite complex. Some will say jQuery is outdated and should not be used in new projects, but I don't know. Sometimes I feel like Angular is not the solution to all the problems in the world and it may be overkill for some smaller projects.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#5

Reading your questions all over again, there is another layer to it I did not address.

So CI is a 'low-level' framework. Much like LEGO. It will provide you with basic building blocks like database model class and entities, but it does not contain higher order routines like programmable workflow.

So to better articulate my answer before: it is doable with CI as a framework, but CI will not provide you higher order concepts such as workflows, and it will not help with frontend (javascript) scripting either. This you have to do it yourself. And I think this pretty much applies to all the generic frameworks around.

I see two paths here: either you find a specialized framework for web forms where you basically only define the input types, input parsing and rules, or you need to develop your own.

As a piece of advice. I was already in your shoes a few years ago, and got myself into a mess, because I did not do a thorough research in advance. So, if you are to do it with CI, and you really need a configurable workflow, I recommend you first research concepts like 'state machine'. When I implemented my first web form without the required knowledge, I ended up with a mess. And that is the reason I have not yet provided real life examples on how to do it, because all I have is a big pile of bad-bad-bad spaghetti code. Smile
Reply
#6

(This post was last modified: 10-26-2020, 12:06 PM by FlavioSuar.)

Hi, sorry if I'm too noobie in my answer... :-)

I recently found halfmoon, wich could be great for a one-page-with-a-save-button solution: "Halfmoon is a responsive front-end framework that is great for building dashboards and tools. Built-in dark mode, full customizability using CSS variables (around 1,500 variables, learn more), optional JavaScript library (no jQuery), Bootstrap like classes, and cross-browser compatibility (including IE11)."
See the documentation for collapse and collapse-group (https://www.gethalfmoon.com/docs/collapse/)... I think you could use collapse-groups for the main parts, with collapse-groups inside for the Sub parts, with the questions inside...
And at the end, just use a "Save" button wich submit all the answers to CodeIgniter...
Just my 0.02
Hope this helps!!
Cheers!

[add] I did a test using the 2 collapse-panel from the documentation page as the Main Parts and inside the collapse-content I used the collapse-group as the Sub parts. Then, inside the collapse-content of the collapse-group, I put 2 checkboxes after the text it has, and it worked fine (to me)... the Main parts have a space between, and the Sub parts don't[add]
Reply
#7

(10-26-2020, 10:21 AM)FlavioSuar Wrote: Hi, sorry if I'm too noobie in my answer... :-)

I recently found halfmoon, wich could be great for a one-page-with-a-save-button solution: "Halfmoon is a responsive front-end framework that is great for building dashboards and tools. Built-in dark mode, full customizability using CSS variables (around 1,500 variables, learn more), optional JavaScript library (no jQuery), Bootstrap like classes, and cross-browser compatibility (including IE11)."
See the documentation for collapse and collapse-group (https://www.gethalfmoon.com/docs/collapse/)... I think you could use collapse-groups for the main parts, with collapse-groups inside for the Sub parts, with the questions inside...
And at the end, just use a "Save" button wich submit all the answers to CodeIgniter...
Just my 0.02
Hope this helps!!
Cheers!

[add] I did a test using the 2 collapse-panel from the documentation page as the Main Parts and inside the collapse-content I used the collapse-group as the Sub parts. Then, inside the collapse-content of the collapse-group, I put 2 checkboxes after the text it has, and it worked fine (to me)... the Main parts have a space between, and the Sub parts don't[add]

Thank you

I will have a look at this , thanks for suggesting
Reply




Theme © iAndrew 2016 - Forum software by © MyBB