Fill table with Ajax and codeigniter

0

I am trying to update a table depending on the selected date start: yyyy-mm-dd end: yyyy-mm-dd when selecting this data load my ajax

          $.ajax({
                type:'POST',
                dataType:'html',
                data: { selectedBank: selected_bank },
                url:base_url+'controlador/vertabla',
                success:function(list_regions){

                }
            });

My controller vertabla shows me an array:

{"entradas":[{"id":"250",
"peso":"6175",
"cajas":"235",
"hora":"18:05:46",
"fecha":"2018-05-07",
"status":"2",
"idseparacion":"154",
"nombre_proveedor":"MARTIN GONZALEZ",
"nombre_huerta":"LOS CHUPADERO (9)"},

but as I do so that they go loading in my table from ajax I was using foreach directly in php to show the information but because I implemented search by date I need to load it with ajax.

Current code php

<tbody>
   <?php if(isset($entradas) && !empty($entradas)): ?>
   <?php $count=1; foreach ($entradas as $entradas): ?>

   <tr>
   <td><small><?php echo $count++; ?></small></td>
   <td>
   <a><?php echo $entradas->nombre_huerta; ?></a>

...morecode

How do I get the same result with ajax?

    
asked by DoubleM 08.05.2018 в 06:59
source

0 answers