fetch values from CIMY Extra User Fields - php

I am using plugin "my theme login" and "CIMY Extra User Fields". i want to fetch the value of dropdown "state", the values are stored in table "wp_cimy_uef_data". I am using CIMY User Extra fields to allow my users to add lots of other information in their profiles, including state in dropdown. Now, i want to get the value of state specified for each user.

You might want to use:
$value = get_cimyFieldValue(user_id, field_name);
http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/documentation/

Related

Delete ACF user profile repeater field row from user account (WordPress)

I am using ACF repeater field for user profiles, which shows like this in the user profile page:
That's cool.
But on the front-end I have a form that I want to use to delete a specific row. My custom form simply lists all the rows with radio buttons, and so if the user selected number 3 and submitted the form then I want to delete the third row (in this example, the row with Catherine Davies would be deleted).
The form works fine in that it submits as expected and returns the value the user selected, but my code to delete the row that was selected doesn't seem to work.
The ACF documentation seems a little vague on the subject. Based on a combination of the ACF doc and this StackOverflow post, I expect this code to work but it does not:
$user_ID = get_current_user_id();
$field = 'extra_user_info'; // Name of the repeater field
$row_to_delete = $_POST["row_to_delete"];
delete_sub_row($field, $row_to_delete, 'user_' . $user_id);
Just to be sure, even if I hardcode the $row_to_delete variable to any number (from 1 to 4) it still does not delete any row.
Just to clarify, I wish to delete an entire row.
Note: I realise I could just embed the ACF form on the front-end, but for reasons I won't go into this is not an option, hence using my own custom form.
There could be another issue but in your example at least, your $user_ID variable has capital letters, while the variable passed to delete_sub_row() is lowercase. PHP variables are case-sensitive.

Filtered Table Resetting Laravel 5

I am creating a table that displays a list of customers and their information. I have a few filters that, when selected, modify the table as needed and do so automatically. But when I click the Filter button underneath to save the filters selected and add them to the URL, the URL changes to the correct address but the table returns to the original table. Any ideas how to have the filters not reset when clicking the filter button?

jQuery Autocomplete one input, then populate other relevant inputs?

I'm using the Formidable Pro WordPress plugin to create editable forms. Each form has several different "Contact Info" areas (in the below picture, one such area is "General Contractor", and another one is "Mechanical Engineer"), and each area has several inputs.
What I'm looking to create:
Enter first few letters of persons name in "Contact" input
Select a name from resulting Autocomplete drop-down
Populate nearby fields with Contact's respective information (Company, Email, Phone, Fax, Tax ID, and Address)
The first image below shows two of the "Contact Info" areas (the first of which I drew in each input's ID). The second image shows how each Contact's information is stored in a MySQL table.
So are there any Autocomplete WordPress or jQuery plugins that can help me accomplish this, and if so, how would I go about implementing this feature?
I'm guessing for the drop-downs you're using dynamic fields? Replace these with Lookup fields and then you can automatically populate values of other fields like so:
For each field you want auto-populated, go into the field settings and check the option 'Dynamically retrieve the value from a Lookup field'. Then, for the 'Get value from' options, you'll need to select the form and field you want to Get the data from. Then, for the 'Watch Lookup fields' option you'll need to select the lookup field (which will be your 'Contact' input that users are typing into).

Form DataBase Design

I'll try to explain my problem and let´s see if I get some help.
I`m trying to design a DB. This data base will contain users and forms but my problem is how to design it to save forms.
The forms will be created by the administrator when he needs them, so in the DB I have a table to save the form name. Another table with all the possible fields for all the forms and another table where form-names and fields will be save so I can see all the field that a determinated form has.
An example: In FormName table I have 3 form names: Personal Info, Computer Knowledgement and hobbies. And in Fields table I have, for example, Name, Address, Phone, Operating Systems, Programming, Bike ridding, playing pc games.
I decide to create a form with name number 1 (Personal info) and fields number 1,2,3 (Name, Address, Phone). This information is recorded in another table called full-form where it´s saved form name id and field id. This is pretty clear for me (perhaps I´wrong).
The tricky part comes now. Some user decide to fill the personal info form so the name of the form and each field will has to displayed. When the user fill the form it has to be saved some way so the administrator can see the name of the form, each field that that form has, who filled the form and the information written in each field. And all this should be displayed not only in the DB but in some different way like a table, for example.
By the way... I´m using cakephp and mysql.
Thanks in advance,
Abraham
As far as I understand, setup looks like this. As you said, we have 3 tables:
'formname' = id, name (for form names)
'formfields' = id, fieldname, attributes (for form names, added attributes in case you need them)
'forms' = id, formname_id, formfields_id, formfields_order (ready forms and possibility to order field in form)
And also you should create additional table where to store submitted values
'forms_values' = id, forms_id, value (in this case one row for each field)
If you want to relate those values to specific user, one more table should be created
'users_forms' = forms_values_id, user_id
Of course there should be users table as well.
My suggestion is to drop table 'formnames' and put form name in 'forms' table.
Then table 'forms' will contain
id, form_name, formfields_id, formfields_order
Hope this answer will put you forward :)

Add unlimited field forms and select from database

I need to make a form to retrieve values from database. The form will have a date field AND/OR drop-down and a row of three fields as default. The user can add/remove extra rows as per required.
The three fields are:
drop-down with options as table name from db(eg. employee_name,vehicle_name etc)
drop-down for conditions (like/equal-to/greater-than etc)
text-box where user can input data (eg. ford,suzuki etc).
How can I make a form where I can add/remove fields as required and then retrieve the values through a PHP code and use that as query to select and display appropriate values from database?
I use PHP Codeigniter method to build this custom search form.
form image

Categories