i need to pass jquery ID value in to my est_model->get_img() function in codeigniter and display all the content in the same modal box, i tried my own logic it doesn't work, please help guys, thank you in advance
here is my code below: modal a tag:
<a href="#view_all_img_modal" data-toggle="modal" data-est-id="<?php echo $row->est_id;?>">View all</a>
my jquery:
$('#view_all_images_modal').on('show.bs.modal', function(e) {
var est_id = $(e.relatedTarget).data('est-id');
$.ajax({url:"admin/est_view.php?ID="+est_id,cache:false,success:function(result){
$("#view_all_img_modal").html(result);
}});
});
modal box:
<div class="modal fade" id="view_all_img_modal" tabindex="-1" role="dialog">
<div class="row">
<?php
$id=$_GET['ID'];
$est_img=$this->est_model->get_img($id);
if($est_img):
foreach ($est_img as $img):
$ser_img=($img->img_name==NULL)?'no-image.png':$img->img_name;?>
<img src="<?php echo base_url('../public/images/rel_img/'.$ser_img);?>">
<?php endforeach;
endif;?>
</div>
</div>
</div>