title: Load different data in popup on buttotn click for different rows
body: <p>I have a table which shows multiple rows data taken from database.</p>
  
  <p><a href="https://i.stack.imgur.com/8jY0T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8jY0T.png" alt="View of my actual page"></a></p>
  
  <p>There is one button in every row. So what i want, when i click on the button it should be show a popup and data would be shown of that particular row.
  for example, when i click on button on the first row, popup with the data of first row will be shown.if i click the button on second row, the data of second row will be shown.</p>
  
  <p>The problem is, when i click on the button of the first row or second row i am getting the same data in the popup of two different row.</p>
  
  <p><a href="https://i.stack.imgur.com/RPZav.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RPZav.png" alt="popup for first and second row both give same result which is the data of the first row"></a></p>
  
  <p>so, how can i get the different data in every popup related to different rows?</p>
  
  <p><strong>This my code of view in which i have taken value from controller and shown</strong></p>
  
  <p><strong>CONTROLLER</strong></p>
  
  <pre><code>public function get_job()
          {
              $data['result'] = $this-&gt;user_model-&gt;view_job();
              if (!empty($data['result'])) 
              {
                  $this-&gt;load-&gt;view('admin_view',$data);
              }
              else
              {
                  $email = $_SESSION['email'];
                  $data['result'] = $this-&gt;user_model-&gt;get_username($email);
                  $this-&gt;load-&gt;view('no_job',$data);
              }
          }
  </code></pre>
  
  <p><strong>MODEL</strong></p>
  
  <pre><code>//To get recently added jobs by inner join
      public function view_job()
      {
          $this-&gt;db-&gt;select('add_job.*, crm_accounts.company');
          $this-&gt;db-&gt;from('add_job');
          $this-&gt;db-&gt;join('crm_accounts', 'add_job.cid = crm_accounts.id', 'inner');
          $this-&gt;db-&gt;where('add_job.status', 'NEW');
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result_array();
  
      }
  </code></pre>
  
  <p><strong>VIEW</strong></p>
  
  <pre><code>&lt;table id="example1" class="table table-bordered table-striped"&gt;
                      &lt;thead&gt;
                        &lt;tr&gt;
                          &lt;th&gt;Id&lt;/th&gt;
                          &lt;th&gt;Job Id&lt;/th&gt;
                          &lt;th&gt;Job Name&lt;/th&gt;
                          &lt;th&gt;Company Name&lt;/th&gt;
                          &lt;th&gt;Company Id&lt;/th&gt;
                          &lt;th&gt;More&lt;/th&gt;
                        &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                        &lt;tr&gt;
                        &lt;?php
                          foreach ($result as $object) 
                          {
                        ?&gt;
                          &lt;td&gt;&lt;?php echo $object['id']?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $object['job_id']?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $object['job_name']?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $object['company']?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $object['cid']?&gt;&lt;/td&gt;
                          &lt;td&gt;
                            &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#MyModal"&gt;
                              Details
                            &lt;/button&gt;
                          &lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;div id="MyModal" class="modal fade" role="dialog"&gt;
                              &lt;div class="modal-dialog"&gt;
                                &lt;div class="modal-content"&gt;
                                  &lt;div class="modal-header"&gt;
                                    &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                                    &lt;div class="modal-title"&gt;&lt;h3&gt;Company Name :&lt;?php echo $object['company']?&gt;&lt;/h3&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="modal-body"&gt;
                                    &lt;h3&gt;Id:           &lt;?php echo $object['id']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Job Name:     &lt;?php echo $object['job_name']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Job Id:       &lt;?php echo $object['job_id']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Paper Size:   &lt;?php echo $object['paper_size']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Paper Type:   &lt;?php echo $object['paper_type']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Cutting Size: &lt;?php echo $object['cutting_size']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Sheet:        &lt;?php echo $object['sheet']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Lamination:   &lt;?php echo $object['lamination']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Print Type:   &lt;?php echo $object['print_type']?&gt;&lt;/h3&gt;
                                    &lt;h3&gt;Ctp By:       &lt;?php echo $object['ctp_by']?&gt;&lt;/h3&gt;
  
                                  &lt;/div&gt;
                                  &lt;div class="modal-footer"&gt;
                                  &lt;form method="post" action="admin_view"&gt;
                                    &lt;button type="button" name="accepted" value="accept" class="btn btn-success"&gt;Accept Job&lt;/button&gt;
                                  &lt;/form&gt;
                                    &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Reject Job&lt;/button&gt;
                                    &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;close&lt;/button&gt;
                                  &lt;/div&gt;
                                  &lt;?php } ?&gt;
                                &lt;/div&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                          &lt;/td&gt;
  
                      &lt;/tbody&gt;
  
                    &lt;/table&gt;
  </code></pre>