Q:

Codeigniter - Show Information in Modal Window

I have a Modal Window. It is working good with javascript. I tried something myself but I can't show any information of Customer in Modal Window. When clicking on the info button, I want to show the Customer's information. How can I show any customer information in Modal Window?
Controller:
public function index()
{

    $viewData['countries'] = $this->db->get("country")->row();
    $viewData['customers'] = $this->customer_model->get_all();

    $this->lang->load('content', $this->session->userdata('people_lang'));
    $this->load->view('customers', $viewData);
}

public function getInfo(){

    $cusId = $this->input->post('cusId');

    $viewData['customers'] = $this->db->where("cusId", $cusId)->get("customer")->row();

    $this->load->view('customers/getInfo', $viewData);

}

This Ajax Code:
<script type="text/javascript">

    function showCustomers(str){

        $.ajax({

            type: "POST",

            data: { cusId: str },

            url: "<?=base_url('customers/getInfo');?>",

            success: function(data) {

                $('#divInfo').html(data);

            }

        });

    }

</script>

This Modal:
<!-- Modal -->
                              <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                  <div class="modal-dialog modal-lg">
                                      <div class="modal-content">
                                          <div class="modal-header">
                                              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                              <h4 class="modal-title">Modal Tittle</h4>
                                          </div>
                                          <div class="modal-body">
                                              <div id="divInfo"></div>
                                          </div>
                                          <div class="modal-footer">
                                              <button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
                                              <button class="btn btn-warning" type="button"> Confirm</button>
                                          </div>
                                      </div>
                                  </div>
                              </div>
                  <!-- modal -->

This View:
<a data-toggle="modal" href="#myModal3"><button class="btn btn-primary btn-xs" onclick="showCustomers(this.id);" id="<?php echo $customers->cusId; ?>"><i class="fa fa-eye"></i></button>

But This is not working. Where is I do mistake?

A:

I answered myself this question.
<td data-title="Edit" align="center"><a href="<?php echo base_url("customer_edit/edit/$customer->cusId"); ?>"><button class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></button></a> <a data-toggle="modal" href="#<?php  echo $customer->cusId; ?>"><button class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></button></a></td>

I edit a href like that href="#<?php  echo $customer->cusId; ?>
Afterthat I just write this code on modal top:
<?php foreach ($customers as $get) { ?>
                <div class="modal fade" id="<?php  echo $get->cusId; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <?php } ?>

I edit id like that id="#<?php  echo $get->cusId; ?>
It works better  now!

