first commit
This commit is contained in:
28
model_controller/controleinventaire.php
Normal file
28
model_controller/controleinventaire.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user