Files
MYSOPHAL/model_controller/controleinventaire.php
2025-11-09 10:02:18 +01:00

29 lines
571 B
PHP

<?php
include ('../inc/includes.php');
getInventaires();
Html::redirect("../front/central.php");
function getInventaires() {
global $DB;
$query = "SELECT * FROM `Inventaire`";
$result = $DB->query($query);
$rows = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$rows[] = $row;
if($row['Qt_compt1'] == $row['Qt_compt2']) {
$query2 = "UPDATE `Inventaire` SET `Qt_controle`= `Qt_compt1` where `id`='".$row['id']."' and `Qt_controle` = 0";
//echo $query2;
$result2 = $DB->query($query2);
}
}
}
return $rows;
}