Skip Navigation

[Resolved] Building a database inside WordPress

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by Shane 2 years, 10 months ago.

Assigned support staff: Shane.

Author
Posts
#1193177

Hi guys and girls

I have a company that develops property on behalf of investors who don't give a shit about what happens during the process...they just want to see a return. Now what that means is that, I need a fucking good reporting system because although they say they dont give a shit, they oinly don't give a shit if they know what the fuck is going on. I'm not sure if you've worked with the like and if you have, I don't mean to seem arrogant, just in case you hadn't, setting the scene for what I am after.

I'm no IT guy... a real estate sales guy in fact so very far from an IT guy. In fact, it took me 2 years to learn a language called "Deluge" which I thought was an accepted programming language throughout the planet, then later realised it was something "Zoho" had created for their own "Creator" product. I have to mention here that I did learn it to the point where their tech support became a tech "Hinderance" than anything else, but don't think that I am that good...only that they are that bad. Not their fault of course and I'm sure that any company that successful knows what they are doing from the business angle, but here I am searching for a self hosted solution like Creator with no success.

I downloaded your plugin as it seemed the closest to what I wanted and it has so far. Far better than the shit that I have been using over the past 5 years I can say. I'm just running into a couple of hurdles which I would need your help to jump over. I'm not asking you to build the database for me, just hoping you're different to the other 32 companies I've dealt with and I have to admit, haven't given them what you are reading now as your product is so close to what I want, I thought it was worth the time to sit here at 11:42pm on a Wednesday night in teh year 2019 and write.

I'm hoping you can help me with how I use your product to (I'll try to keep it as simple in terms as possible as I know what it feels like me knowing YOUR angle on IT, again, if you know these terms, it wasn't meant to say you're stupid):

- Create a database that will be used by:
* People who supply money to do developments
* Contractors who are involved with building houses
* Internal staff

Ideally I would pay you guys you would do my website and all this week. However I understand this may not be possible for your type restraints so can you please and someone respond to me with gods to weather I create posts or forms on pages that would be enough thanks very much
Thanks ninjas

JA.

#1193198

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeremy,

Thank you for contacting our support forum.

The database can be setup using multiple CPT.

From your requirements I see that you would need 3 CPT Investors, Contractors and Staff.

This can be done in types by just creating those 3 CPT and then creating custom fields that would be specific for each, as well as generating the frontend forms for entering the data.

Ideally you would create 3 different forms for each CPT. Then create pages to add these forms.

Thanks,
Shane

#1193236

Hi Shane

Can I just firstly say "Well Done" for the prompt response??

So if I'm setting up "CPTs" (getting the lingo now!) why do I set up pages and forms also? Don't think for a second that I am doubting you as that would just be ridiculous given my knowledge as I'm sure you're aware of by now, but I thought I could use the POSTS as a "Table" in a database and create the relationships between them using your very convenient "Relationships"......thing. Then I would create "Views" to display the records in teh database.

I probably should define some terms here of what I believed to be the case:

Post = Record
Post Type = Table Name
Database = WordPress DB

I promise to get my lingo right next time if you'll allow it....

#1193277

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeremy,

I was thinking about the ability to enter the data from the frontend.

When setting up the forms, you will need to have pages to hold these forms.

Now you can ignore this completely if you want to just enter the data in the Backend of the site, there are no issues with this.

Look at it like this, Each Custom Post Type (CPT) is stored in the same table, rather than using the default wordpress Post type you can create the 3 separate ones, It helps with ease of organisation and should you need to export them you dont need to export the entire list just the ones you need.

Since you are talking about relationships it would be better to enter the posts on the backend especially if we are looking at a many to many relationship.

I see you are well on your way to understanding.

Please let me know if I was able to clear this up for you.

Thanks,
Shane

#1193400

Hi Shane

This time, I have to thank you for time with this one.

The relationships is a big, big, big winner here as everything is crossed with everything, so therefore, you are saying that it is much easier to do backend?

In this case, I would just make my website it's on "App" so to say where any data entry was done in teh admin section by staff and any client interaction we needed, a page with a form would be created with the data feeding into the relevant "Post Type" in the backend.

How did I go?

JA.

#1193401

....almost forgot....the "Views" would be on pages?

#1193784

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeremy,

Happy I was able to assist you thus far.

The frontend can be used for clients to enter the data using the frontend forms. However many to many relationships connections on the frontend are a bit tricky as this will need the use of a relationship form.

For a background on relationships take a look at our documentation here.
https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/

For the relationship forms on Many to Many
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

Finally you can use views to display this relationship on the frontend .

Please let me know if this helps.
Thanks,
Shane

#1194077

Hi mate

I gave it a good thrashing last night and I reckon I can say that I get what does what, where, and little How and Why. I have set up my database so next on the list is to create my Project Management system......don't worry, I'm not going to ask you how I do one....I do need to know though this:

I will create a PROJECT that will have a one to many to TASKS which will have a one to many to SUBTASKS. I can do that now as I know this guy at The Toolset support who was helping me out....I should introduce you some time...he's excellent!...anyway, back to it...

Each TASK has a START DATE, DURATION and END DATE. The formula is simply:

END DATE = START DATE + DURATION - I can't work out how to add 2 fields together, then there's the fact that we are doing math on DATES, so how do I go about creating formulas for DATES?

Next, each TASK has a SUCCESSOR TASK which is the TASK(S) that are triggered on the completion of the current TASK. The SUCCESSOR TASK's START DATE is equivalent of the current Tasks END DATE. So how do I get the system to edit all subsequent TASKS START DATES and END DATES if there are delays (Property Development so it's guaranteed there wiul be delays!)

I get that this maybe moving into an area you don't support but do you have anywhere I can go to to work it out?

Thanks Shane

JA.

#1194446

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jeremy,

You are indeed correct that this is going into areas we don't support.

Since our plugins are not able to perform mathematical calculations, you will need to write some custom code to do this.

The simplest way is to use the save_post hook that wordpress provides and get the value of the start date and the value of the duration.

https://codex.wordpress.org/Plugin_API/Action_Reference/save_post

The addition of the dates is that you will need to retrieve the custom field value using the get_post_meta function.
https://developer.wordpress.org/reference/functions/get_post_meta/

Then store the final date into the end date custom field.

We do however have areas where you can get assistance with this as you can check out one of the many registered contractors on our site who are able to do this custom work for you.
https://toolset.com/contractors/

Thanks,
Shane