<?php 



session_start();

if(isset($_SESSION['pro_igm_nom']))

	{

	$num_rows=count($_SESSION['pro_igm_nom']);

	$row = $num_rows-1;

	if($num_rows==0)$num_rows="";

	}

	else

	{

		$num_rows="";

	}

	

	$itag = 1;

	$i = 1;

	

?>





<?php if($num_rows>0){?>

	

	<div id="myCarousel" class="carousel slide" data-ride="carousel" style="padding:0px;">

	

	

	<ul class="carousel-indicators">

    

	<?php 

	for($a=0;$a<=$row;$a++){

	?>

	<li data-target="#myCarousel"  data-slide-to="<?php echo $a; ?>" class="<?php if($itag==1) echo 'active'?> bg-red"></li>

	<?php 

	

	$itag++;

	

	};

	?>



	</ul>

	

	

	

	<div class="carousel-inner">

	<?php

	foreach($_SESSION['pro_igm_nom'] as $indice=>$valor)

	{

	?>

	<div class="carousel-item <?php if($i==1) echo 'active'; ?>">

		<span class="btn btn-xs btn-primary float-right" style="position:absolute;margin-left:80px;" onclick="eliminar_imagen('<?php echo $_SESSION['pro_igm_nom'][$indice];?>')" ><i class="fas fa-trash"></i></span>

	

		<center>

		

		<img class="img-thumbnail" src="../producto/<?php echo $_SESSION['pro_igm_url'][$indice]; ?>" alt="<?php echo $_SESSION['pro_igm_nom'][$indice];?>">

		</center>

	</div>

	<?php

	$i++;

	}

	?>

	

	</div>

	

  <a class="carousel-control-prev" href="#myCarousel" data-slide="prev">

    <span class="carousel-control-prev-icon"></span>

  </a>

  <a class="carousel-control-next" href="#myCarousel" data-slide="next">

    <span class="carousel-control-next-icon"></span>

  </a>

  

  

	</div>

	<?php }else{

	?>	

		<div>IMAGENES NO ENCONTRADAS</div>

	<?php 

	}?>		

	

	

	