How to pass the PHP variable to menu jQuery Modal popup

Hello

Need help to find how to pass a variable in php (which is recovered in a while loop) in a modal window.

There is a list of users on the page (shown with a while loop), with buttons Remove next to each of them.

When the administrator clicks the button Delete for that specific user, a modal window appears confirming their action.

I can't find a simple way to communicate the id of the user to be removed the modal (where the query is performed, once 'Yes to confirm deletion' is clicked).

I deleted the jQuery, seeing as how this could change how the modal opens and closes.

This is the modal:

< div class = "modal" >

< div class = "modal_wrapper" >

< div class = "modal_title" > are you sure you want to delete this user? < / div >

< div class = "modal_content" >

< div class = "modal_button_no" > n < / div >

< div class = "modal_button_yes" > Yes, delete it < / div >

< / div >

< / div >

< / div >

< div class = "delete_btn" > delete user < / div >

The variable with the user name is:

$user_id

Any help would be much appreciated!

Thank you

It is a fairly simple procedure. Personally I'm not sure that its worth the effort for a box of administration but good we all have different opinions - there is no wrong or it.

Suppose that your buttons delete on your page are anchor tags and you have locked down your database of names to create anchor tags. The value of dir below has been inserted via php through loop and is your RegID.

Delete

Delete

Delete

Delete

When you click the anchor tag (that class name "delete") opens a lightbox. You also have to collect the value of "dir" at the time the lightbox opens - happening of value to a hidden in the lighbox code entry field.

The value of the "dir" command is passed to the light table in a hidden form field:

"You have a delete button in the light table with the class of ' delete_record ':

Delete the record

When the user clicks on the button Delete in the light table the value of hidden form field is harvested and forwarded to your page of delete_record.php via the jquery/ajax script below, were also on the same page.

Your delete_record.php would look like below, assuming that you use mysqli or if you are using mysql then you would follow the same delete procedure as usual.

<>

$conn = new mysqli ('localhost', 'root', 'root', 'name');

{if ($conn-> connect_errno)}

echo $conn-> connect_error;

Die (' sorry, can not connect to the moment, try again later ');

}

?>

<>

delete the record

$record_id = $conn-> real_escape_string (stripslashes (trim($_POST['record_id'])));

$conn-> query ("' DELETE FROM names WHERE record_id = ' $record_id ' '");

$record_deleted = "true";

?>

An alert box will appear at the end, confirming that the record has been deleted. You do not have to deploy an ugly alert box - you sends the data to the device of light therapy from the delete_record.php page in a few nice melted in

If you want to be more subtle about it.

Tags: Dreamweaver

Similar Questions

  • How to pass the global variable...

    Hello

    I have a report in a page and form in another page...

    If I clicked on the icon change in the report page it navigates to the form in another page...

    In this im report have "bill_amount" as one of the column, if I clicked on the icon change report page means, it will go to the form in another page...

    This form consist of one text field which is "bill_amount"...

    Since the report that I bill_amount for each entry, if I clicked on the icon change the means of the respective row, it does not appear automatically the respective bill_amount in the text in the form field...

    I created a report separately on the sql_query table... I created a form with a single field 'bill_amount '...

    Given that I na not create a report and a form based on the table... If I have created as it means if I clicked on the icon change it will show the datas respective in the form... since I created a report and form separately...

    If it is possible to create a global variable... who will bring the value of the "invoice amount" in the relationship and you will go the respective value in the form field on the next page...

    I don't want to put the value in the form field by restricting by request... She must take through the global variable...

    How can I reach it...

    It is urgent...

    concerning
    Mini

    Hello

    In her edit link column u give, the respective form field name, and the name of the column in the report inside...

    So that the value in the report of the corresponding column will be inserted into the corresponding field in the form...

    (IE) like this

    > p1_item_name---> #corresponding report name column #.

    Concerning
    GTA...

  • How to pass the value of the variable record type in the procedure

    Hai All

    My Question is

    I have a table named Emp and the structure

    ID Varchar2 (25)

    Name varchar2 (25)

    Number of salary


    And now, I created a folder named Rec_Emp

    Like this

    Type Rec_emp is made
    (Rec_Id varchar2 (25),)
    rec_name varchar2 (25).
    Number of Rec_salary);
    rec_emp emp_record;


    I created a SQL type

    Now how to pass the value type in the procedure


    Thanks and greetings
    SrikkanthM

    You are looking for something like this

    create table my_emp (id integer, name varchar2(100), sal number)
    /
    create type my_emp_obj as object(id integer, name varchar2(100), sal number)
    /
    create or replace procedure insert_into_my_emp(pEmp_Obj in my_emp_obj)
    as
    begin
      insert into my_emp (id, name, sal) values(pEmp_obj.id, pEmp_Obj.name, pEmp_obj.sal);
    end;
    /
    begin
      insert_into_my_emp(my_emp_obj(1,'karthick',1000));
    end;
    /
    select * from my_emp
    /
    
  • How to pass the value of the run-time file .sh by Oracle procedure

    I have a file test.sh that contain

    #1/bin/bash

    exp test/test@orcl file=/home/oracle/dump/test.dmp log=/home/oracle/dump/test.dmp grants = Y = index constraints Y = Y = (test) owner statistics = none

    Exit 0

    I craete a work called Create_job_proc in this work, I want to pass the value of job_action is the location of the file test.sh to

    /U01/home/Oracle/dump/test.sh and want to spend the test/test@orcl as a variable...

    Please suggest me... how to pass the value of Job_Action which will replace the .sh file content test/test@orcl to the value of the time of execution as scott/tiger@hr

    Thank you much Parth... It works perfectly...

    Thank you all for your help...

  • How to pass the CS5.5 to CS6 and how much it cost in New Zealand?

    How to pass the CS5.5 to CS6 and how much it cost in New Zealand?

    If you do not want to go on the road to cloud and to subscribe, then Adobe still sells CS6 (online only) through their Web site

    http://www.Adobe.com/au/products/catalog/CS6._sl_id-contentfilter_sl_catalog_sl_software_s l_creativesuite6.html

    (Make sure you are in the store NZ - check the country link above Copyright in lower LHS of the page)

    Select your product and then click on buy

    I want to buy: select upgrade from the menu drop down

    I own:

  • Passing the Captivate Variables to Embedded SWFs.

    Does anyone know how to pass a variable of Captivate to an embedded swf? I will elaborate on our situation for clarity. Finally, we Captivate allows you to create Scorm packages for use in Moodle. In this particular case, we have a Captivate project where we have several slides. On each slide, we want to import a swf created in Flash. Now, this Flash swf is configured to analyze an external XML file, determine which slide containing the swf on and then read the correct video for this slide. This file has a list of video sites (URL) and is organized by slides. The question we are hung up is how to pass the variable of Captivate (cpInfoCurrentSlide) for the current slide to the embedded swf. Someone saw?

    S

    Of course you can do it.

    Here is a list of all the variables: http://www.cpguru.com/2009/04/28/system-variables-in-captivate-4-%e2%80%93-a-complete-list /

    I'm not aware of any written documentation, but it is just like when you take a variable.

    Example:

    _root.rdcmndNextSlide = 1; will send your project to the next page.

    / Michael

    Visit my Captivate blog with tips & tricks, tutorials and widgets.

  • How to pass the Visa Resource Name parameter to labview dll in labwindows/cvi

    Hello world

    I build a dll of labview, the prototype is: double getchannelpower (double f, uintptr_t * VISAResourceName);

    I don't know how to go from VISAResourceName to this function.

    Is it related to the ViPSession paremeter in function viOpen(REES ViSession, rn ViRsrc, ViAccessMode am, ViUInt32 ti,ViPSession vi)?

    BRs,

    lotusky

    Hey, guys:

    I figured out how to pass the parameter.

    In labview, you must replace the control of visa with string control. In this way, the generated dll function at the entrance of the string type.

    I hope this will help others!

    lotusky

  • How to pass the session IMAQ to the Subvi

    Hello

    My experience with LabView is neither very good nor extended. I am a scientist and I'm with IMAQ data acquisition. My current problem is that the people who wrote the script is modular, versatile, or clear initially structured. So I try to reduce the ridiculous number of tests in a simple flowchart to a level that people can actually understand it... and to make the more versatile script for future experiments.

    I'm introducing quite a few subVIs to be executed repeatedly. However, I can't know how to pass the IMAQ session on the Subvi. I constantly get the error messages. In this case, I want to acquire images with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't understand how to assign the refnum IMAQ session class, either.

    It is probably a newbie question, but usually I program with LabView.

    Dennis


  • HOW TO PASS THE HEX OF THE MAIN PROGRAM VI ENUM, SUB VI ENUM VALUE

    HOW TO PASS THE HEX OF THE MAIN PROGRAM VI ENUM, SUB VI ENUM VALUE.

    HOW THEN IT WILL CHOOSE CORRECT ON SUB VI HEXAGONAL ENUM VALUES.

    Enum values are strings, you must first convert the hexadecimal value to a hexadecimal value chain represtation.

    Then that convert from the enum.

  • How to pass the value?

    Hello.. I'm creating an application of streaming, in which I have a list field in a screen like this...

    1

    --------

    2

    --------

    3

    --------

    and when the item 1 is selected means a url must be passed to the video player...

    I created the list field screen in a package and a video player in other package... but I do not know how to pass the value of the field from the list to the player... Help, please... its URGENT...

    You can get the index selected by the listname.getSelectedIndex () method and compare that value with Vector data (data store URL) .that you will give a correct value from the URL and pass it.

  • How to pass the vcs - e License? A server to Server B.

    Hello

    my company has a vcs test server.  and we buy the new server.

    I need to spend vcs again server.   I backup and deploy using the vmware ovf file.

    deploy the success. but new server vcs poster license error.

    How to pass the license of vcs?

    Of his assignment, it is not necessary to use both servers at the same time.

    If I see, if you move the virtual computer between two servers and you used local storage the

    Serial number will change...

    Please remember useful frequency responses and identify useful or correct answers.

  • How to use the global variable in the table target?

    Hello

    I am trying to load several files into a single interface. the data is loaded successfully. 92. the files are there. for this I used variables and package.

    My requrement is 92 files of data loaded into the target table. I want to know what data from file.

    to this I added a column (filename) to the existing target table.

    If I used joints (not same condition), its totally wrong. all file names are coming.

    Please see the following screenshots.

    err27.jpg

    exit; target table.

    err26.jpg

    in fact in the target table. first 10 lines are coming from file.i.e first _ACCOUNT_LIMIT_511.TXT. but all the files names are coming.

    I'm confuse. After the first data file inserted then insert second data file. in that all file names are coming. Please help me.

    I thought that the global variable is preferable to identify the data came from which file.

    to do this, the global variable is used in the target table. I don't always have my exit.

    Please help me.

    Thanks in advance.

    err25.jpg

    Hello

    You can use the same way, how you use the project variable, just you have to do a thin is #GLOBAL.variable_name for example: #GLOBAL. SMART_AL_FILE_NAME_S

    Note: Make sure you that while you use one variable overall in interface, indicator should be staged as you chose above the screen

    hope this helps you

    Kind regards

    Phanikanth

  • I have one of my programs adobe on a mac pro, which is broken. How to pass the program over this i mac?

    I have one of my Macbookpros that has a broken screen. How to pass the program Adobe of it ti that I have Mac?

    Download/install the desktop application, connect and install applications subscription.

    https://helpx.Adobe.com/creative-cloud/help/download-install-app.html

  • It costs more to go to monthly payments?  How to pass the year to monthly payments?

    It costs more to go to monthly payments?  How to pass the year to monthly payments?

    Diane H,

    Yes, the month subscriptions are expensive as they come without see all annual contract, Adobe - General conditions of subscription

    To change your plan see, update or change your plan creative cloud

    Let us know if that helps.

    Kind regards

    Bani

  • How to pass the album Live view mode Design while working on a fluid page? The drop down option isn't there as if it was on other pages.

    How to pass the album Live view mode Design while working on a fluid page? The drop down option isn't there as if it was on other pages.

    You can not.  If you want to work with FGLayouts, I recommend drop back to the Release of June 2014 CC before they took the Design of FGLayouts mode.

    You can get the version of June 2014 DW direct links below:

    Win: http://download.adobe.com/pub/Adobe/Dreamweaver/WIN/CC/Dreamweaver_14_LS20.exe

    Mac: http://download.Adobe.com/pub/Adobe/Dreamweaver/Mac/CC/Dreamweaver_14_LS20.dmg

    Solution #2: Modify your CSS FGLayout file by adding an X to the code as shown below.  This trick DW into thinking that it is a normal page, so you can use the new Design view.   NOTE: Do not change the CSS in design Panel.  Do it in Code view.  Record.  Close DW.  New launch DW.

    /*

    Properties Grid Dreamweaver fluid

    ----------------------------------

    DW-num-CLO-mobile: X4;

    DW-num-CLO-Tablet: 8;

    DW-num-OCOL-Office: 12;

    DW-gutter-percentage: 25;

    =====================================

    Nancy O.

Maybe you are looking for

  • Portege M800 - stop if I hold the grille left

    If keep my Toshiba Portege M800 by the section of the front left lower side, he sometimes stops... The power led (top left) is always on, as it is in mode 'sleep' but does not. The only way to start again is to hold the power button for several secon

  • Try to stream video to the Wii by using third-party software.

    original title: try to stream videos through thrid party XP pro SP3 with avg free and windows firewall and netgear router running.  PC is connected to the router; Wii's wireless I'm looking to stream video to my wii with the help of a third-party app

  • Impossible to uninstall Works 8

    My wife bought an Acer Aspire 5515 recondidtioned July 5.  It was delivered to us last Wednesday.  It came with no manuals nor the support of the software.  It has a hidden partition that contains the default recovery software.  The first thing I did

  • Temporary rotation tool?

    Hello worldI work with an Intuos Pro 5 and I would like to know if it is possible to define a shortcut (or maybe already there) to rotate the view quickly. I know the "Rotation" tool and its shortcut "R", but I'm looking for a 'temporary tool', somet

  • Como free buy?

    Adobe buy como first free clip