$query->execute(); //Execute prepared SQL => $query $row = $query->fetch(PDO::FETCH_ASSOC); //Data CDE_STATUT //Data CDE_STATUT $_SESSION['DATA_RECD'] = array('xid' => $row['ID_RECONDIT'], 'exercice' => $row['ID_EXERCICE'], 'datesortie' => frFormat2($row['REC_DATESORTIE']), 'codereconditionnement' => $row['CODE_RECOND'], 'raison' => $row['REC_RAISON'], 'statut' => $row['REC_VALIDE'], 'nbreLigne' => $nbreLigne, 'ligne' => array()); //LIGNES RECONDITIONNEMENT SORTIE $sql = "SELECT * FROM `recond_sorte` WHERE ID_RECONDIT = '" . addslashes($split[0]) . "'"; $query = $cnx->prepare($sql); //Prepare the SQL $query->execute(); //Execute prepared SQL => $query //Ligne $_SESSION['DATA_RECD']['ligne'] = array(); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { array_push($_SESSION['DATA_RECD']['ligne'], array('codeproduit' => $row['ID_CONDIT'], 'produit' => getConditionnement($row['ID_CONDIT']), 'qte' => $row['CNDREC_QTES'], 'unite' => $row['CNDREC_UNITES'])); } $_SESSION['DATA_RECD']['nbreLigne'] = $query->rowCount(); header('location:validreconditionnements.php?selectedTab=mvt&rst=1'); break; case 'delete': isset($_POST['rowSelection']) ? $id = $_POST['rowSelection'] : ($id = array()); try { $cnx = new PDO(DBD, DBUSER, DBPWD, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); //Connexion to database } catch (PDOException $error) { //Treat error //("Erreur de connexion : " . $error->getMessage() ); header('location:errorPage.php'); } foreach ($id as $key => $val) {
$query = $cnx->prepare($sql); //Prepare the SQL $query->execute(); //Execute prepared SQL => $query while ($row = $query->fetch(PDO::FETCH_ASSOC)) { //Corresp $sqlCoresp = "SELECT * FROM `dotation` INNER JOIN dot_cnd ON (dotation.ID_DOTATION=dot_cnd.ID_DOTATION)\r\n\t\t\t\t\tWHERE dot_cnd.ID_DOTATION=" . $row['ID_SOURCE']; $query2 = $cnx->prepare($sqlCoresp); //Prepare the SQL $query2->execute(); //Execute prepared SQL => $query $corresp = array(); while ($row2 = $query2->fetch(PDO::FETCH_ASSOC)) { array_push($corresp, $row2); } array_push($_SESSION['DATA_ETAT']['ligne'], array('codeproduit' => $row['ID_CONDIT'], 'produit' => getConditionnement($row['ID_CONDIT']), 'nature' => $row['MVT_NATURE'], 'magasin' => $row['CODE_MAGASIN'], 'qte' => $row['MVT_QUANTITE'], 'unite' => $row['MVT_UNITE'], 'correspondant' => $corresp)); } $_SESSION['DATA_ETAT']['nbreLigne'] = $query->rowCount(); header('location:analysejournal.php?selectedTab=int'); break; case '4': //'4'=>'DOTATIONS BAC' break; case '5': //'5'=>'DOTATIONS USTENSILES' break; case '6': //'6'=>'AUTRES DOTATIONS' break; case '7': //'7'=>'PERTES'
function ligneAnalyseJournal($nbre = 1, $data = array()) { $returnHTML = ''; $i = 0; foreach ($data as $key => $row) { $i % 2 == 0 ? $col = "tableOddRow" : ($col = "tableEvenRow"); if ($row['MVT_VALID'] == '0') { $imgCl = '<img src="../images/encours.gif" title="En cours" width="16" height="16">'; } elseif ($row['MVT_VALID'] == '2') { $imgCl = '<img src="../images/cancel.png" title="Annulée" width="16" height="16">'; } else { $imgCl = '<img src="../images/valider.gif" title="Validée" width="16" height="16">'; } $returnHTML .= ' <tr align="left" valign="middle" class="' . $col . '"> <td height="22" class="text" align="center">' . $imgCl . '</td> <td height="22" class="text" align="center">' . stripslashes($row['CODE_PRODUIT']) . '</td> <td class="text" >' . stripslashes(getConditionnement($row['CODE_PRODUIT'])) . '</td> <td class="text" align="left">' . stripslashes($row['MVT_NATURE']) . '</td> <td class="text" align="left">' . stripslashes($row['ID_SOURCE']) . '</td> <td class="text" align="left">' . stripslashes(getService($row['CODE_MAGASIN'])) . '</td> <td class="text" align="center">' . stripslashes(frFormat2($row['MVT_DATE'])) . '</td> <td class="text" align="center">' . stripslashes($row['MVT_TIME']) . '</td> <td class="text" align="center">' . stripslashes($row['MVT_QUANTITE']) . '</td> <td class="text" align="center">' . stripslashes($row['MVT_UNITE']) . '</td> </tr>'; $i++; } return $returnHTML; }