Skip to main content

matching outputted Html buttons with outputted Php/MySQL data





public function dcr() {

$query = $this->db->query("SELECT * FROM church_repo");

foreach ($query->result() as $row) {

$data = array('churchName' => $row->church_name,

'streetAddress' => $row->street_address,

'locationalState' => $row->locational_state,

'locationalZIP' => $row->locational_zip,

'locationalCountry' => $row->locational_country,

'locationalCity' => $row->locational_city,

'overseerAccountId' => $row->overseer_account_id,

'taxExemptionNumber' => $row->tax_exemption_number,

'accountStatus' => $row->status,

);

$this->load->view('admin-request', $data);

}

}







In my Html I am outputting the above Php. Also in my Html, I have two buttons that have id's of 'pass' and 'fail'. What the script is doing when I have multiple rows is output those two buttons with the same id's on each outputted row. That's good, because it is doing what it needs to be doing, but now I'm not able to identify the outputted rows. So I need to be able to match each button set with the outputted Php. Any ideas?


Comments

  1. The way i typically do what you are attempting is by creating new forms for each row. and including a hidden input field in each row with the id.

    <input type="hidden" name="row_id" value="<?= $overseerAccountId;?>"/>

    when the user clicks pass/fail you simply use CI/PHP to get that value

    <?php
    echo $this->input->post('row_id');
    //do work son.
    ?>


    the only difference between your code and what i typically do, is i move my foreach into the view and iterate through each row creating new <tr><td> instead of creating new tables like you are doing. But this could be considered against the MVC standard

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex