Code

Discussion on Data Manager: Tables & Forms handler for Bootstrap 5

Discussion on Data Manager: Tables & Forms handler for Bootstrap 5

By
Cart 373 sales

andufo supports this item

Supported

This author's response time can be up to 2 business days.

106 comments found.

This looks like a great product based on the demo set up on codecanyon. However, I’m having trouble getting the demo to work on my own (usually a good starting point for tweaking code). I followed the directions in readme.txt with one exception—I set up inc/db.php with local mysql configuration ok (db name, username and password)... I created a new mysql database and successfully imported example.sql file… BUT the exception: my hosting service won’t allow db names of 4 characters, so I couldn’t name it “test.” I instead gave it a longer name (and I did add the longer name to inc/db.php). However, I’m getting this error when I run /example.php:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/content/**/********/html/testdirectory/main/datamanager/inc/functions.table.php on line 3

. Any advice as to what went wrong/how to remedy? Many thanks in advance for your help with this useful script. Server is shared hosting but supports Php 5.2.17 with PDO and other common php extensions.

Hi! This script has only been tested in PHP 5.3+, which fully handles array_map() with lambda function support (not supported in 5.2).

I upgraded the PHP to 5.3 and the example worked like a charm! Thanks a bunch :)

No problem! Let me know if you have any more questions. Best regards!

Hello there.

I’ve now installed and configured the script, and I’ve entered all the correct details regarding the database- yet it seems as if it can’t find the data.

I’m getting swamped by Notice: Undefined offset / index errors, and not quite sure what to do.

Here’s an image. http://i.imgur.com/anztZka.png

Looking forward to hearing from you, Mal

The paths are correct. I double – even triplechecked it – all the files are required by the script.

Fixed the issue by changing to a different server.

perfect, i’m glad it worked out. Perhaps it was something else in the php.ini in your previous server.

Is it possible to show a field in the edit page which is non-editable? I have the Admin assigning groups from another form. I would like to have the user see their group but not be able to change. Is that possible?

Yes, you can use the

form_static('id', $value)
instead of form_input.
I figured it out. I removed the LIKE and used =
$sql['filters'][] = array('user.id_company = :name', ':name', $_SESSION['Church'], PDO::PARAM_STR);

nice!

hey, first of all thanks for this great plugin. love it. but i have a problem. i moved this script to a new webserver. changed also the db settings correctly but now there a lot of notices when i open the example.php Notice: Undefined of course i can turn it off but even then there arent any db-items displayed.

u have an idea whats wrong?

Hi, if you turn the errors off (display_errors = Off in your php.ini) and even then, no db records are being displayed in your grid, then please check the network results in Chrome, perhaps you’re receiving a 500 http code for some reason.

thank you. with ur help i found the problem. the problem was: i had to edit the datatables.php on line 126 with: if(isset($sFilter)) { with “isset” now it works fine. thank you

perfect, let me know if i can help you with anything else. cheers!

I run the example.php and it show the result below. What happen?>>

prepare($sql); $stmt->bindValue(’:id’, $_POST[‘id’], PDO::PARAM_INT); $stmt->execute(); exit(true); } } # table $sql[‘table’] = ‘user INNER JOIN company ON company.id_company = user.id_company’; # cols array(column, alias, asc/desc, type) $sql‘cols’ = array(‘user.id_user’, ‘id’); $sql‘cols’ = array(‘user.flg_access’, ‘flg_access’, false, ‘boolean’); $sql‘cols’ = array(‘user.name’, ‘name’, ‘asc’); $sql‘cols’ = array(‘company.name’, ‘id_company’); $sql‘cols’ = array(‘user.birthday’, ‘birthday’, false, ‘date’); $sql‘cols’ = array(‘user.id_user’, ‘action_edit’); $sql‘cols’ = array(‘user.id_user’, ‘action_delete’); /* # SPECIFIC sql options # filters $sql‘filters’ = array(‘user.name LIKE :name’, ’:name’, “ Veronica ”, PDO::PARAM_STR); $sql‘filters’ = array(‘user.id_level = :id_level’, ’:id_level’, 2, PDO::PARAM_INT); # group $sql[‘groupby’] = ‘exchange.id_exchange’; */ ?>

I using wamp for test

Hi, please be sure to read the instructions before asking ;) In the php.ini enable the short tags option and then restart your apache server. Everything will run fine after that.

https://www.dropbox.com/s/py6jl2h3or9tdiy/ScreenShot066.jpg?dl=0" Here is what I did, but does`t work. Maybe I did not understand you :( If I want to before display check something with if else loop how to do that. I want to check if some column is returning $row = “facebook” and if is that I want to show in datatable image fb.png. Is it possible to achieve this in your script?

Regards, Bosko

Hi, did not quite undertand you. Can you please be more clear?

I was a bit confuse, sorry, my mistake. My first question is one from this image from my last comment. I did what you sad about query CONCAT("<a href="something.php?id=" id="">Link</a>") but it not working. Maybe I didn`t do everything as you mean. You can see in my image. Second question is little bit difficult. I have more than 12000 rows in table. I want to show this is your table in json format. That I know, you have a good example. But I want before showing data from db to do some if statement. For example:

foreach($rows as $row){ <td><a href="someurl.php?id=$row->id">$row->id</a></td>
if($row->action == "facebook"{<td><img src="fb.png" />})
etc....
} 
This part with if statement is my question, is it possible to like that from your table???
Thanks,
Bosko</td>

Hi again! Actually it is possible, but I would strongly recommend that you actually add a new type of data to the class. Check out the “boolean” type, so that you can duplicate it and replace the boolean icon with the facebook icon.

Hello, I just bought your script, change db creds and import sql example and I get this error from picture. Is it possible to catch data from datamanager json because I need to do some if else before display in table? www.beogradput.rs/docs/datamanager.jpg

Thanks in advance. Regards, Bosko

Can you please check if you have pdo support? [with phpinfo();]

In new version of wamp I can`t get pdo to work even if I enable PDO in php.ini. I successfully manage to run script. Now is ok. I needed to run on web server. I have question. Have can I format rows from table? I need to put some image instead one row, on other column I need to put a href tag, etc…. Can I catch rows before display???

Yes, that can be easily achieved by adding this to the field selection: Instead of “id” you can select

CONCAT("<a href="something.php?id=", id, "">Link</a>")

Hi, i bought the plugin, but probably envato doesn’t work. Is there a way fot download the plugin giving you the purchase code?

Thank you M.

ok, finally i had my files… but i follow instruction… and i get only this: prepare($sql); $stmt->execute(); $companies = $stmt->fetchAll(); ?> prepare($sql); $stmt->execute(); $levels = $stmt->fetchAll(); ?> prepare($sql); $stmt->execute(); $types = $stmt->fetchAll(); ?> i configured db.php with my mysql credentials, and i cheked for short_open_tag=On in php.ini. but nothing.. have you some suggestion?

Thank you so much M.

OK, solved…. sorry… i forgot to reboot apache after php.ini mod. GREAT PLUGIN

I just read your comments, glad it worked fine for you. Best regads!

Script Doesn’t Work http://counterservis.com/datamanager/example.php

PHP Version 5.2.17-pl0-gentoo PDO on

Sorry, just noticed you have php 5.2.17. It seems that the anonymous function (which were supported in PHP 5.3) is causing that issue. Can you upgrade to 5.3? Please refer to http://stackoverflow.com/a/3723761/338840

PHP Version 5.5.15 PDO ON short_open_tag = On

DataManager: Example – table usage

Fatal error: Call to undefined function grid() in C:\xampp\htdocs\datamanager\index.php on line 42

are the function php files available inside inc/ ?

Estou com erro nessa página Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in /home/ativo710/public_html/crmhighinox/inc/functions.table.php on line 3

O endereço é http://www.ativomake.com.br/crmhighinox/example.php

Pode me ajudar?

hi! did you by edit functions.table.php? That file should not throw any errors.

Another Question… I am using DataManager with a user permission script. I want to be able to let only a person who works for Disney to see the Disney users. I edited the filter code to the below which works.
$sql['filters'][] = array('company.name LIKE :name', ':name', "%Disney%", PDO::PARAM_STR);
But can I dynamically called variable from the logged in user. I do have it stored in a SESSION.
$sql['filters'][] = array('company.name LIKE :name', ':name', "USER'S COMPANY HERE", PDO::PARAM_STR);
Thanks!!!

seems you already solved this issue (in your other comment)

yes … thanks. Sorry I posted it incorrectly.

no prob mate!

I am excited to get this working. I uploaded the script as-is. My hosting company adds a prefix to DB tables. So I was not able to create one called just “test”. In any event, I added the correct values for db.php.

The table render with no data? http://fireredstudio.com/datamanager/example.php

Any ideas?

Hi! When the script is trying to call inc/datatables.php (to load the contents of the data page number 1), it is actually receiving a 500 error code (check the chrome console). Perhaps the db.php is not successfully connecting to the db?

You was right! I had a typo in the db.php. Thanks a bunch.

great! :)

Hi

- I put the data into db.php - mysql ok - after in web all error

http://sittech.rs/~test1

help

thank you

hi, 2 questions:

1) does your web server support php?

2) are you currently using PHP short tags in your php.ini? Please check http://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags

Hi I use the same server many PHP applications RoundCube , Postfix , WebSite PHP …. Everything works fine I checked the php.ini file short_open_tag=On OK

We will install a new server to test with Ubuntu ,Apache2 , PHP5 …. do you need a special version of PHP5 with special modules? I write to you in a few days

Merci

Hi, actually you just need PDO (it comes with php 5.2+). It is strange that you are getting the php code printed in the browser. Are you opening it with the webserver?

Finally got to using DataManager. I installed it : http://anodizeus.com/test/example.php

but I’m getting error: atal error: Call to a member function prepare() on a non-object in /home/zlab/public_html/anodizeus/test/example.edit.php on line 45

(btw, using anything other than pdo for your database queries is a highly risky in terms of security)

I am using PHP 5.5.11 and PDO is enabled

Is db.php properly configured with your database name, user and pwd? Perhaps it is not connecting successfully, hence throwing an error while trying to prepare() the query.

Can I use this within wordpress for security reasons?

I suppose you could adapt it, but then again I haven’t used WordPress since 2007.

Hi, I have to create 25 forms for registration for a school.

I need to put some sort of navigator like menu script to allow all the forms to be called.

The student filling out the forms will need to login.

Will need to be able to recall the data on the students side in case they have to update them before completing the packet of forms. Would I need to pass a Url parameter to retrieve info from the database?

I need to make a copy from this years data to next years data. Maybe I would need to do a little sql copying to get a copy process to work. I would like to show the previous and current and next years forms in a navigator menu. If you don’t have a navigator menu i can the menu from somewhere else, just a thought.

The admin would receive the data and review it on their side, viewing all students entries a grid like you show in your example.

Is all of these possible? I read all the above comments.

Hi! I’ll try to answer all your questions below:

1) Since the plugin is an adaptable module, you can implement both the login solution & menu script without any problems.

2) No problem, but be aware that this is a backend solution. If you need to implement “steps” between the 25 forms in the frontend with this plugin, then you need to adapt that feature. In this script, everytime you save a form, you get a modal message that lets you stay in the form, or, go back to the data table.

3) It would work perfectly fine on the admin side, since it will let you review all the data.

Please be sure to check the online complete documentation to understand how this plugin works:

http://egobits.com/envato/datamanager/documentation/

Hello,

Great work.

1) With the “form handler”, can I create a form in the way I want?. I can use 2 or 3 columns, to select field order and types, and also data for checks, combo list, etc.?

2) I can create forms only to see records, no edit.

3) If possible to use more than one instance of Data Manager in the same page.

I’m looking for a way to show to user a web form only to see a register or to print it. The web form I need to create, can be so complecate like a credit bank form.

Thanks in advenced. Regards Juan

Hi! Thanks. I’m answering each question below:

1) Yes. That’s all controlled by the controls that you specify only.

2) Yes. The only records that get updated (or inserted), are those specified in the $fields array. If $fields is empty, the “Save” button won’t be displayed, nor will it be triggered internally.

3) No. Each table needs its own php page, and the same goes with the forms.

I hope this solutions solves your requirements. Please let me know if you need any more info.

Best regards!

I can’t even get the example.php to run. I followed the instructions pretty disappointing.

Hi! You can check a working example in this url http://egobits.com/envato/datamanager/example.php – if you need any help regarding the script configuration, please send me an email and i’ll give you a hand.

Works great now thanks.

Great! Let me know if you need anything else.

Interesting … and I have questions: 1. How many columns can be manage? I have a table with about 50 columns .. 2. In a form, is it possible to have fields grouped in fieldsets? ... data in a filedset can be update by 1 or more users groups ? Thanks

Hi!

1) As many columns as you like to manage. Of course, you have to understand that a normal sized window will have a 1200px width (average) so I would just put the relevant columns for the sake of the user, and then the 50 fields inside the form.

2) If you are referring to html5 fieldsets, then yes, since they are part of bootstrap’s gui as well. I prefer to divide field groups with a HR tag.

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey