Code

Discussion on PDO Crud – Advanced PHP CRUD application (Form Builder & Database Management)

Discussion on PDO Crud – Advanced PHP CRUD application (Form Builder & Database Management)

Cart 2,301 sales

ddeveloper supports this item

Supported

2608 comments found.

Hello, how come on this page selecting male and female and the chapta not seen?

https://portalesicurezza.online/bozza/jobs.php

Hi

I have checked, your page’s css is causing this.

-webkit-appearance: none

is the issue in your style.css. Remove this line and it will work.

Thanks

Hi, can I make with this Script a CMS which included ; - User Management (Profile, Group, Privileg, Access to Pages.. etc.) - Content Pages with Forms - Menu to Access any Pages in this CMS (Fronted and Backend) Thank you!

Hi,

You can create login/registration/profile pages but access based on roles is not currently possible but you can easily check it by session variable as by default it is done.

Yes, content pages with form can be easily created.

Thanks

Hi. Thanks again for brilliant script. I am struggling a bit with deciding how to do update of another table after adding or updating data in one table. Example : I have a table with master record e.g. employee And a detail table e.g. holidays So there is a 1:many relationship between employee and holidays based on field staff_id. I want to do standard PDCOcrud on a details table, and after insert new record in details table holidays, then update the holidays_taken field in master table employee.

As I understand it, LEFT JOIN and INNER JOIN is not good here. I don’t want to add records in both tables.

And I don’t want to use multiTableRelation because I don’t want the user to edit fields in both tables, just field in one table and then update silently the other after insert.

I put an entry in beforeInsertCallback : $data“employee” += $data“holidays”;

But by itself this does not update the master table.

Should I use raw data operations $pdomodel = $pdocrud->getPDOModelObj(); for the master table ? But in this case I don’t have the data until after form is processed. Can I add this code to the before InsertCallback ?

Or how should I do this ?

Thank you.

Hi,

Yes, you need to use the raw data model. Since you want to insert the data after table updation so use the after insert callback..Use print_r and console to understand the $data returned in that function.

Thank you I got it working like this But it is clumsy How can I use your functions to make it more compact ? It can work on a small table but will obviously be slow on a large table. I feel that something in your pdomodel should replace the foreach loop more efficiently

$thisuser = $data["allowances"]["username"]; $thisamount = $data["allowances"]["amount"]; $pdoemp = new PDOCrud(); $result = $pdoemp->getPDOModelObj()->select("employee"); foreach ($result as $v1) { extract($v1, EXTR_PREFIX_ALL, "emp"); if ($emp_username == $thisuser) { $thisamount += $emp_allowance; } } $updateData = array("allowance"=>$thisamount); $pdomodel = $pdoemp->getPDOModelObj(); $pdomodel->where("username", $thisuser); $pdomodel->update("employee", $updateData);

Hi,

Ok..I understood your point. I will try to add this feature also.

Thanks

Hello PDOcrud and PDOmodel are compatible, but I will conflict if I put them on the same page!

Hi,

You don’t need to use separate PDOmodel unless you are using complete different database. For same database, you can use the pdocrud->getPDOModelObject() function to get pdomodel functionality.

Thanks

Hi, I am having an issue with inline editing, after clicking the button the column shifts to the right?

Hi,

can you show me your code?

Also, please note that this was bug in previous version that is already resolved so I hope you are using latest version of script.

Thanks

Adding a lamguage file I got this error:

syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or ’”’

The end of the file is

recaptcha_msg = “Por favor, rellene el captcha” clear_all = “Clear All” browse = “Browse”

Hi,

As per the message, it seems the language file is not properly formatted.

Please check accordingly. Try once with default language, if it works with that then it will be surely issue related to new language file.

In case of further issue, send me language file, I will check.

Thanks

OK thnks

Hello,

I just purchased your product and have very high hopes for its use in my application. I loaded the files per the instructions and set up the script/config/config.php with my database credentials.

I was able to render a grid , however none of the styles or column modifications seem to take effect.

I am relatively new to PHP/MySQL as I am migrating applications which I developed in Microsoft Access over a local network to web based apps.

I have also tried to get the demo going and was able to run the sql scripts, but have not gotten the PDOCrud to run on my local server either.

hi,

This is correct code $pdocrud->where(“Student”,”$_targetStudent”);

Check whtether on change event of dropdown is working or not?

I would like to use drop down calendars to have the user preselect the beginning and ending dates before submitting the command to render the table. I have two variables $start and $end that I would like to use to filter the dates returned to the PDOCRUD grid. what is the format or $pdocrud line command for filtering on a date between $start and $end?

Hi,

I have replied to your question in another thread. Thanks

Hi, I bought few days ago, I’m coming from xcrud, whose author vanished completely, but I can’t find a way to make a “custom form validation”, I’m explaining.

- say I have a form, and I add a callback before form inserts (or updates) values to db (I suppose there is a proper call back for this, I’ll checkout). - say in the callback i make some checks on data submitted (say for example a duplicate value check on some other fields or something than a simple validation, that cannot be done by javascript on client side)

Quesion1: how can I show the same form (be it a standard edit/insert form, but also a popup form) again with some field in red blur and some error messages (like the default validation errors I can see in form for required fields for example)?

Quesion2: is there a way to get from some pdocrud_* javascript events (bit lack of documentation here, I have had to go throught your code to get a list of that events triggered by js) some informations about the result of the action that triggered the event?

great work anyway, congratulations.

Hi,

Thanks. I am glad you liked the script. We are adding more features in version 2.3 and it will be released this weekend.

question 1: I understood your question that you want to display information back to the form fields. Currently this feature is not available but I will try to add this feature.

question 2: There are 2 javascript event based on the operaiton you are using. “pdocrud_after_ajax_action” // for action button etc. and “pdocrud_after_submission” // after form submission

I will write more details in documentation for javascript events.

Thanks

1: thanks, it would be great to have a method that sets some sort of exception from callback function back to the form (grabbed by ayax as response data)

2: thanks for pointing out the names of the events, but reading your comman.js I can’t see any reference to some sort of status of the action (success/fail) returned back to the ajax call.

As you can guess the two questions are connected together: first trigger a custom exception from the callback function filled in with some properties (status, error message, fields involved, ...); then grab the exception from the client side by the pdocrud_* js event and get, from the event properties, all the infos filled in by the callback in the previous step.

Do you think that we will see something already from this week-end?

Hi,

Yes, status of action is not returned. It return complete object and action with data.

we will try to add that feature but this weekend is not possible as we are already working on some other feature. We will try to add in next week. Thanks

Is there a way to add a custom button to the table? Like where the GO and ADD buttons are, top right side. I would like to add something else that is not related to the PDOCrud….

Also, is there a way to customize the popup window to a different color and background?

Thanks

Hi,

You can add action buttons like this

http://pdocrud.com/demo/pages/action-buttons

For popup window customization, you need to write custom css. Thanks

Yes, I did see that BUT would like to have the button(s) on top-right side and not part of the table list as the action buttons are.

Plz I have two questions before buying:

- I have a system that almost all the tables have a first column that identifies what Company is the owner of the row and another ID that identifies a specific item in that row (using compound keys). The class PDOCrud have callbacks before write to the database so I can update the Company ID programatically? (The Company ID is hidden, the system only asks for it at the login screen at first)

- Do you know if PDOCrud works with updateable Views?

Thx in advance

Hi,

1. Yes, pdocrud has callbacks so you can pass company ID or you can also pass it as hidden field.

2. I haven’t checked it with updateable views. Probably it doesn’t work with that.

Thanks

Hi, great job with your script. I have an small problem, i can’t solve. I need to change the background color of full row when a value is equal to 0. I have a field “active” with values 0 or 1, and i need to show the full row of fields to be background color grey when the “active” field value of this record is 0. Is it possible to do it? also with field “active” is hidden? Thanks

Thanks, for answer. I’ve checked this demo before, but i need to change the full row and not only one column, and i don’t know how to do it. I’ve changed “col” with “row”, but no success :(

Hi,

please contact me via email using my profile page. I will send you solution.

Thanks

When you add a column
$pdocrud->tableColAddition("Product Info", "merge",array("с1","с2"));
The column is sortable:
<th class="pdocrud-actions-sorting pdocrud-sort" data-action="sort" data-sortkey="Product Info"><span> Product Info </span></th>

How to disable sorting?

How to do it:
<th class="class-product-info"><span> Product Info </span></th>

Hi, You can disable sorting using $config[“sortable”] = false;

Upload you can only store the filename and not the whole path in the database?

Hi,

it stores complete path of the file. Thanks

One thing about search, when I type, I would like like just part of the string to search and nothing comes out, only when I type the whole text that I am searching. Is there a way to search and find what I type, don’t matter if that string is in middle or last of the string I am looking for?

ddeveloper,how do I fix this?

Hi,

I am checking this. Thanks

Hi,

please contact me via email using profile. I will send you solution. Thanks

Hi – I’m having a problem with adding text to images…

I get an error: Fatal error: Call to undefined function imagettfbbox() in /pdocrud/script/classes/library/abeautifulsite/SimpleImage.php on line 956

when I try and use this code: $pdocrud->imageText('Copyright', __DIR__.'/images/delicious.ttf', 32, '#FFFFFF', 'top', 0, 20);

Please could you advise how I can fix this?

Many thanks

I copied and pasted from your demo pages…?

From your demo page: //Add text on image $pdocrud->imageText('Your Text', __DIR__.'/images/delicious.ttf', 32, '#FFFFFF', 'top', 0, 20);

Taken from: http://pdocrud.com/demo/pages/image-functions

Not quite sure what I’ve done wrong here? Please could you explain further?

So I think I’ve figured it out – for anyone else who runs into this problem. The error about “imagettfbbox()” comes from the SimpleImage.php file. The function imagettfbbox() is part of a PHP module “FreeType”... which is missing from my dev environment. I’m working out how to install this at the moment, but I suspect once installed, then this function will work correctly.

Ok..great.Thanks

Hi – I’m having a problem with Multi-Step form… I’ve set it up correctly according to the demo page, but I can’t get it to render properly.

If I render with: echo $pdocrud->dbTable("users")->render("insertform");

then it works correctly.

But I want to be able to insert or update from the main table, using the Edit or Add buttons on the table… so I am rendering the table just using: echo $pdocrud->dbTable("users")->render();

In this instance, the multi-step doesn’t work.

How can I fix this please?

Many thanks

Hi – any update on this at all? Were you able to recreate the issue?

Hi – also to confirm, I’ve installed the demo on my server and encounter the same issue on that too – I hope that helps with your debugging?

Many thanks

Hi – any news at all? I’m really in need of this function!! Thanks!

Hi – I’m having a problem with Column Actions function to switch a value when I click it (http://pdocrud.com/demo/pages/action-switch)

Using the example on the page above, I have defined the following for my table: //action type switch - on click on column, value will be changed and saved $action = array("1" => "0", "0" => "1"); //action to be performed, like when value is 1 set it to 0 $text = array(1 => "Yes", 0 => "No"); $pdocrud->enqueueActions($action, "switch", $text, "model_discontinued", array());

but I’m getting an error and the column ‘model_discontinued’ just has the value “Array” in it… it doesn’t have “Yes” or “No” in it. If I click on the word “Array” that is displayed in the column, I get a further error.

Error message: Notice: Array to string conversion in /pdocrud/script/classes/PDOCrudTableFormat.php on line 292

How can i fix this please?

Many thanks

HI,

this is not bug. The script tries to find the value based on the key of that column e.g. for it will first try to find “1” and if found then it will show value “yes”.. In case none of key in text array matches then we have given option to pass string. i.e. text can be array and string both. as sometimes we want fixed value.

I hope this explain it.

Thanks

Hi – I’ve figured this out. Your explanation does make sense, but in this case, it’s not the answer to the issue.

The problem is, earlier in my script I make use of the following code: $pdocrud->tableColFormatting("model_discontinued", "replace",array("1" => "Yes")); $pdocrud->tableColFormatting("model_discontinued", "replace",array("0" => "No"));

Which works correctly to show a Yes or No if the db value is 1 or 0. However, it seems to conflict with the action_switch function…

If I remove the tableColFormatting code and simply use the action_switch then I no longer have the Notice: Array to string conversion in error message and the switch functionality works correctly.

Whether you consider this a bug or not, I don’t know, but for others who encounter the same issue, please note that you cannot make use of tableColFormatting and the action_switch feature for the same column.

Hope this helps others?!

Many thanks

Hi,

Yes, you are also using the replacing method so it doesn’t have that values to be present at the action switch. But I will check it once.

Thanks

I’m coming from xcrud and is very easy to create a relation using

$xcrud->relation(‘service’,’services’,’s_id’,’service’);

The result is that when I render my table VEHICLES, column SERVICE shows me the name of the Service, instead of showing the ID of the service, from the table SERVICES. How can I have the same result in PDOCRUD?

Ex. In my database column Service has value 3 stored in the vehicles table, in the” services” table 3 is the id for “New Vehicle for Delivery”, so what I need is PDOCRUD to show “New Vehicle for Delivery” in the table instead of “3”.

Hi, just got the script and looks great, one thing is that I am having problems using it:

1) When I click on the edit button, it will take me there to that form but when I press the save button or the save and back button, it doesn’t work. Does not saves the edited data and neither does it go back to the previous page.

Here is a screenshot of what seems to be an errors while pressing in the form the SAVE or SAVE/BACK buttons

https://www.screencast.com/t/INsaNGvq4Zto

I am using the folllowing in my main page src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js”>

plus bootstrap link also. Latest version too

Got it, changed to latest jQuery version 3.x Works now

Ok..great.

Hi, does the documentation contain multiple examples on how to do EACH feature listed? Such as what files and variables to change or add to change the forms OR tables themes? Thanks

Hi,

We have written detailed documentation and demo with many example. If anything is not clear, you can directly ask us.

http://pdocrud.com/documentation/ http://pdocrud.com/demo/pages/

Thanks

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