Code

Discussion on PHP CRUD Generator

migli supports this item

Supported

This author's response time can be up to 1 business day.

408 comments found.

SKittel

SKittel Purchased

Hello, is there a way to create a read only list? I have an eventlog to show which nobody can edit or delete items. Stefan

SKittel

SKittel Purchased

Hello, i have a list of users and a list of items. There is a relationship between them in MySQL.

On list and edit I can select multiple items to this users. works fine.

But now I want to be only able to select active items. So items where the field “active” is set to 1.

Can this be done? And if how?

Hi Skittel,

I guess you have an intermediate table to link the users to their items?

You have to edit the Users main class (admin/class/crud/Users.php):
  1. Go to the /* external relations */ part
  2. add the WHERE condition to the query
To prevent intactive records to be edited in the form:
  1. Open your create or edit form (admin/inc/forms/items-[create|edit].php
  2. Edit the query to return only the records with active items

Gilles

SKittel

SKittel Purchased

Hello, I’ve created an backend which works fine. I have two user profiles: serveradmin, admin and user An serveradmin should edit any user An admin should only edit admin and user But currently any user can edit any other user.

How can I limit user to edit/create/delete only user with the same or lower level?

Stefan

Hi Stefan,

If you open admin/secure/class/secure/Secure.php you can see that when the user is authenticated some variables are stored in the session (starting at L.160)

$_SESSION[‘secure_user_profiles_name’] registers the user’s profile name, so you can then use it in the code to allow / disallow some parts.

In the TWIG templates, the syntax will be:
{% if session.secure_user_profiles_name == 'serveradmin' %}
    // allowed part here
{% endif %}

With this you can show/hide the links to the forms, but don’t forget to disallow your forms in PHP too.

Gilles

I have installed the script successfully originally, but then when I added a secure cert on the domain, everything broke. Now I can’t even reinstall it. It is giving me this message…

Unfortunately, installation failed because of this reason: An unknown error occurred (probably database failure or unauthorized modification of data)

Let me know your email address and I can email you my purchase code.

Thanks!

Please disregard… I figured it out. I had to reinstall on the original domain and then unregister with the purchase code and reinstall on the secure domain. Should have read things more thoroughly before switching to the secure domain. Hope it helps someone in the future.

Hi Elev8dave,

Sorry you had these licensing troubles ; you can email me from my website here: https://www.miglisoft.com/#contact

If you need anything else you’re welcome,

Gilles

Hi, is it possible to upload directly from Cam (smartphone or webcam?)

IF not: this will be the feature making me buy – because that’s exactly what i need

Hi,

You must record your picture or video, then you can upload it.

Uploading from a cam would require to detect the support capabilities, it can only be done with some complex additional programming.

If you need anything else you’re welcome,

Gilles

Can we set the field value name for each element of the form? That way it can match the DB and be added to different views?

Hi,

You can choose the name you want to display for each table & each field in the generator.

Then if for some reason you want to change one somewhere you can do it in the READ list code or form code.

If you need anything else you’re welcome,

Gilles

ppcorbi

ppcorbi Purchased

Good afternoon Please I need help. I can’t see the CRUDs generated. I get a 404 error. The requested URL could not be located on this server. I am testing with XAMPP. Thanks

Hi Ppcorbi,

Thanks for purchase.

404 error is a common starting error and the solution depends on your server conbfiguration. Everything is explained here: https://www.phpcrudgenerator.com/help-center#error-404

If you need anything else you’re welcome,

Gilles

carlbaker

carlbaker Purchased

I just installed PHP CRUD generator. I told it not to install the sample tables. I told it to start the generator and I get the error: Notice: Undefined offset: 0 in generator\class\generator\Generator.php on line 380. The error_log has several errors but the first one says that include_once failed for inc/tutorials/how-to-create-a-php-bootstrap-admin-dashboard.php. I confirmed that there is no tutorials folder in the inc directory.

Thank you for any help you can offer.

Carl Baker

migli Author

Hi Carl,

Thanks for purchase.

As far as I can understand, your database seems to be empty. Add a table with some fields and it should solve your problem.

If I’m wrong please email me your url and ftp access.

The error_log file has been accidentally included to the package, it has nothing to do here, please delete it (it’s not your logs but my locals).

If you need anything else you’re welcome,

Gilles

by
by
by
by
by
by