Welcome Guest, Not a member yet? Register   Sign In
How to edit my table?
#1

Hi all, i need help to add column named "Edit" on all row for edit a table row.
can you help me please

Here is my controller:
PHP Code:
    public function pronosticshistory(){
        
$template = array(
         
       'table_open'            => '',
         
       'thead_open'            => '',
         
       'thead_close'           => '',
         
       'heading_row_start'     => '<tr>',
         
       'heading_row_end'       => '</tr>',
         
       'heading_cell_start'    => '<th>',
         
       'heading_cell_end'      => '</th>',
         
       'tbody_open'            => '',
         
       'tbody_close'           => '',

         
       'row_start'             => '<tr>',
         
       'row_end'               => '</tr>',
         
       'cell_start'            => '<td>',
         
       'cell_end'              => '</td>',
         
       'row_alt_start'         => '<tr>',
         
       'row_alt_end'           => '</tr>',
         
       'cell_alt_start'        => '<td>',
         
       'cell_alt_end'          => '</td>',
         
       'table_close'           => ''
        
);
 
   $this->table->set_template($template);
 
   $tableau $this->admin_model->pronosticslist();
 
   $data['tableau'] = $this->table->generate($tableau);
        
$data['title'] = 'Historique des pronostics';
        
$this->load->view('admin/pronosticshistory'$data);
    } 


Here is my model:

PHP Code:
     public function pronosticslist(){
 
         $this->db->select('date, equipe1, equipe2, pronostic, misereco, gagnant');
 
         $this->db->from('pronostics');
 
         $this->db->order_by('id''ASC');
 
         $query $this->db->get();
 
         $result $query->result_array();
 
         return $result       
      


Here is my html:

Code:
         <table class="table" style="background-color: white;">
           <thead>
             <tr>
               <th scope="col">Date du match</th>
               <th scope="col">Equipe 1</th>
               <th scope="col">Equipe 2</th>
               <th scope="col">Pronostic</th>                
               <th scope="col">Mise recommander</th>
               <th scope="col">Résultat du match</th>
             </tr>
           </thead>
           <tbody>
             <?php echo $tableau ?>
           </tbody>
         </table>
Reply


Messages In This Thread
How to edit my table? - by florent6001 - 01-26-2018, 02:30 AM
RE: How to edit my table? - by InsiteFX - 01-26-2018, 04:54 AM
RE: How to edit my table? - by florent6001 - 01-26-2018, 05:49 AM
RE: How to edit my table? - by InsiteFX - 01-26-2018, 08:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB