1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
| // Chargement du fichier Excel
$objPHPExcel = PHPExcel_IOFactory::load("Upload/".$le_nom);
/**
* récupération de la première feuille du fichier Excel
* @var PHPExcel_Worksheet $sheet
*/
$i=0;
$sheet = $objPHPExcel->getSheet(0);
echo '<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Valeurs m/z analysées</th>
<th>se</th>
<th>stm</th>
<th>stmv</th>
<th>sh</th>
<th>si</th>
<th>sv</th>
<th>sk1</th>
<th>sk2</th>
<th>sl</th>
<th>st</th>
</tr>
</thead>
<tbody>';
// On boucle sur les lignes
$num_col=0;
foreach($sheet->getRowIterator() as $row) {
$i++;
if($i>3){
$num_col++;
echo '<tr>';
// On boucle sur les cellule de la ligne
$j=0;
foreach ($row->getCellIterator() as $cell) {
if($j<1){
$valeur=intval(substr($cell->getValue(), 0, 4));
//on compare l'analyse à la base
$req0 = $bdd->prepare('SELECT se,stm,stmv,sh,si,sv,sk1,sk2,sl,st FROM reference WHERE lower_bound <= :valeur AND upper_bound >= :valeur');
$req0->execute(array(
'valeur' => $valeur
));
$verif = $req0->fetch();
$req0->closeCursor();
if ($verif){
//message si correspondance
echo '
<th scope="row">'.$num_col.'</th>
<td>'.$cell->getValue().'</td>
<td>'.$verif['se'].'</td>
<td>'.$verif['stm'].'</td>
<td>'.$verif['stmv'].'</td>
<td>'.$verif['sh'].'</td>
<td>'.$verif['si'].'</td>
<td>'.$verif['sv'].'</td>
<td>'.$verif['sk1'].'</td>
<td>'.$verif['sk2'].'</td>
<td>'.$verif['sl'].'</td>
<td>'.$verif['st'].'</td> |
Partager