<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Table photos</title>
      <link rel="stylesheet" href="assetstable/bootstrap/css/bootstrap.min.css">
   
	</head>
    <style>
@media print {
   
        .row {
        page-break-inside: avoid;
  }
}
    </style>
<body>
       <div>
        <div class="container">
        


 
	
	<?php
	
	
		
			//sudo -u _www mount_afp -I //user@host/share /path/to/mountpoint pour server distant sur /Users/serve
		  $files = glob("/Users/serve/Downloads/*.*");
	// $files = glob("img/*.*");
	// $files = glob("ftp://franco:franco1@192.168.2.70/DocumentsPublics/*.*");
	//$files = glob("Volumes/idisk/*.*");
	
	 $files = glob("photos/".$_POST['dnumdevis']."/tmb/*.*");
    $filesFull = glob("photos/".$_POST['dnumdevis']."/tmb2/*.*");
	
    for ($i=0; $i<count($files); $i+=2)
     {
       $image = $files[$i];
        $imageFull = $filesFull[$i];
       $supported_file = array(
               
               'jpg','jpeg',
               'jpeg','png'
              
        );
         $image2 = $files[$i+1];
        $imageFull2 = $filesFull[$i+1];
       $supported_file = array(
               
               'jpg','jpeg',
               'jpeg','png'
              
        );
 
        
        $ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
        $ext2 = strtolower(pathinfo($image2, PATHINFO_EXTENSION));
        if (in_array($ext, $supported_file)) {
           //echo basename($image)."<br />"; // show only image name if you want to show full path then use this code // echo $image."<br />";
			//echo "<li><a href='".$dirname.$curimg."'><img src='img.php?src=".$dirname.$curimg."&w=300&zc=1' alt='' /></a></li>n ";
			
			//echo "<a href='imagetempfull.php?img=".$imageFull."' > ";
            echo"<div class='row d-flex' style='margin-top:15px;'>";
			echo "<div class='col-md-6' ><img class='img-fluid' src='imagetemp.php?img=".$imageFull."&exctf=".$ext."' alt='image'  /></div>";
            echo "<div class='col-md-6' ><img class='img-fluid' src='imagetemp.php?img=".$imageFull2."&exctf=".$ext2."'  alt='image' /></div></div>";
			//echo $image;
		//print "<div id='col'>".$image."</div>";	
           } else {
               continue;
           }
         }
	?>
      </div>
    </div>

    
</body>
</html>
