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
| <?php
include("../../connexion.php");
session_start();
if(empty($_SESSION) || empty($_SESSION['ID_PERSONNE'])) { // sécurité
header('Location:../../index.php');
}
include("../../connexion.php");
include("../../require/upload.php");
include("../../require/fonction_date.php");
include("../../require/fonction_quote.php");
$req_droit = "SELECT ID_DROIT
FROM POP_PERSONNE
LEFT JOIN POP_PROFIL ON POP_PERSONNE.ID_PROFIL = POP_PROFIL.ID_PROFIL
LEFT JOIN POP_DROIT_PROFIL ON POP_PROFIL.ID_PROFIL = POP_DROIT_PROFIL.ID_PROFIL
WHERE ID_SOUS_MENU = 32 AND ID_PERSONNE = ".$_SESSION['ID_PERSONNE'];
$sta_droit = oci_parse($conn, $req_droit);
oci_execute($sta_droit,OCI_COMMIT_ON_SUCCESS);
$droit = oci_fetch_assoc($sta_droit);
if(!isset($_SESSION['TAB2']) || $_GET['init'] == 1){
$tableau = array($_GET['f_numero_lot'],$_GET['f_fournisseur'],$_GET['f_numero_affaire'],$_GET['f_designation'],$_GET['f_statut'],$_GET['f_categorie'],
$_GET['f_reference']);
$_SESSION['TAB2'] = $tableau;
}
$requete1 = "SELECT POP_EN_COURS.ID_EN_COURS as ID_EN_COURS,CODE_SITE,NUM_ISSUS_LOT,NUM_PROJET,NUM_AFFAIRE,REFERENCE,DESIGNATION,INDICE,
NOM_CATEGORIE_EN_COURS,QUANTITE_PREVU,TO_CHAR(DATE_RECEPTION_ESTIME,'DD/MM/YYYY') as DATE_RECEPTION_ESTIME,NOM_PERSONNE,TO_CHAR(DATE_CREATION_EN_COURS,'DD/MM/YYYY') as DATE_CREATION_EN_COURS,
NOM_FOURNISSEUR,NUM_DA,PRIX_UNITAIRE,PRIX_TOTAL,NUM_COMMANDE,TO_CHAR(DATE_COMMANDE,'DD/MM/YYYY') as DATE_COMMANDE,
LABEL_ETAT_VALIDATION,COMMENTAIRE,NUM_LOT,TO_CHAR(DATE_PREVU,'MM/DD/YYYY') as DATE_PREVU
FROM POP_EN_COURS
JOIN POP_SITE ON POP_EN_COURS.ID_SITE = POP_SITE.ID_SITE
JOIN POP_PROJET ON POP_EN_COURS.ID_PROJET = POP_PROJET.ID_PROJET
JOIN POP_DM ON POP_EN_COURS.ID_DM = POP_DM.ID_DM
JOIN POP_CATEGORIE_EN_COURS ON POP_EN_COURS.ID_CATEGORIE_EN_COURS = POP_CATEGORIE_EN_COURS.ID_CATEGORIE_EN_COURS
JOIN POP_PERSONNE ON POP_EN_COURS.ID_PERSONNE = POP_PERSONNE.ID_PERSONNE
JOIN POP_FOURNISSEUR ON POP_EN_COURS.ID_FOURNISSEUR = POP_FOURNISSEUR.ID_FOURNISSEUR
JOIN POP_ETAT_VALIDATION ON POP_EN_COURS.ID_ETAT_VALIDATION = POP_ETAT_VALIDATION.ID_ETAT_VALIDATION
WHERE 1=1";
if($_SESSION['TAB2'][0] != null && $_SESSION['TAB2'][0] != '0')
$requete1 .= " AND UPPER(NUM_LOT) LIKE UPPER('%".$_SESSION['TAB2'][0]."%')";
echo $requete1;
if($_SESSION['TAB2'][1] != null && $_SESSION['TAB2'][1] != '0')
$requete1 .= " AND NOM_FOURNISSEUR = '".$_SESSION['TAB2'][1]."'";
if($_SESSION['TAB2'][2] != null && $_SESSION['TAB2'][2] != '0')
$requete1 .= " AND UPPER(NUM_AFFAIRE) LIKE UPPER('%".$_SESSION['TAB2'][2]."%')";
if($_SESSION['TAB2'][3] != null && $_SESSION['TAB2'][3] != '0')
$requete1 .= " AND NOM_FOURNISSEUR = '".$_SESSION['TAB2'][3]."'";
if($_SESSION['TAB2'][4] != null && $_SESSION['TAB2'][4] != 0)
$requete1 .= " AND POP_ETAT_VALIDATION.ID_ETAT_VALIDATION =".$_SESSION['TAB2'][4];
if($_SESSION['TAB2'][5] != null && $_SESSION['TAB2'][5] != 0)
$requete1 .= " AND POP_CATEGORIE_EN_COURS.ID_CATEGORIE_EN_COURS =".$_SESSION['TAB2'][5];
if($_SESSION['TAB2'][6] != null && $_SESSION['TAB2'][6] != '0')
$requete1 .= " AND UPPER(REFERENCE) LIKE UPPER('%".$_SESSION['TAB2'][6]."%')";
//$requete1 .= "ORDER BY NUM_LOT ASC";
$statement1 = oci_parse($conn, $requete1);
oci_execute($statement1,OCI_COMMIT_ON_SUCCESS);
$requete2 = "SELECT ID_SITE,CODE_SITE,LABEL_SITE FROM POP_SITE ORDER BY CODE_SITE ASC";
$statement2 = oci_parse($conn, $requete2);
oci_execute($statement2,OCI_COMMIT_ON_SUCCESS);
?>
<div id="div_form">
<div style="float:left;width:100%;margin:8px 5px 5px 0px;border-radius:4px;padding:5px;" class="couleur2">
<form id="form_controle" method='post' onsubmit='' action="#" >
<table class="table">
<tr class="couleur5">
<th class="th site">Numéro de lot</th>
<th class="th">Numéro issu lot</th>
<th class="th site">Statut</th>
<th class="th site">Reference</th>
<th class="th site">Indice</th>
<th class="th site">Désignation</th>
<th class="th site">Quantité prévue</th>
<th class="th site">Commentaire</th>
<th class="th site">Numéro de projet</th>
<th class="th site">Numéro d'affaire</th>
<th class="th site">Fournisseur</th>
<th class="th site">Délai prévu</th>
<th class="th site">Numéro de commande</th>
<th class="th site">Catégorie</th>
</tr>
<?php
$flag_couleur = 0;
while($result1 = oci_fetch_assoc($statement1)) {?>
<tr <?php if($flag_couleur%2 == 0){echo "class='couleur6'";}else{echo "class='couleur7'";}?>>
<td class='td'><?php echo $result1['NUM_LOT'];?></td>
<td class='td'><?php echo $result1['NUM_ISSUS_LOT'];?></td>
<td class='td'><?php echo $result1['LABEL_ETAT_VALIDATION'];?></td>
<td class='td'><?php echo $result1['REFERENCE'];?></td>
<td class='td'><?php echo $result1['INDICE'];?></td>
<td class='td'><?php echo $result1['DESIGNATION'];?></td>
<td class='td'><?php echo $result1['QUANTITE_PREVU'];?></td>
<td class='td'><?php echo $result1['COMMENTAIRE'];?></td>
<td class='td'><?php echo $result1['NUM_PROJET'];?></td>
<td class='td'><?php echo $result1['NUM_AFFAIRE'];?></td>
<td class='td'><?php echo $result1['NOM_FOURNISSEUR'];?></td>
<?php
if($droit['ID_DROIT'] == 2){?>
<td class='td' style="width:10px;"><input type="text" style="width:80px;" class="datepicker" onclick='AffID(<?php echo $result1['ID_EN_COURS'];?>);' value="<?php echo $result1['DATE_PREVU'];?>"/></td>
<?php
} ?>
<td class='td'><?php echo $result1['NUM_COMMANDE'];?></td>
<td class='td'><?php echo $result1['NOM_CATEGORIE_EN_COURS'];?></td>
</tr><?php
$flag_couleur++;
}
?>
</table>
</form>
</div>
<div id="div_formulaire" style="margin-top:8px;" ></div>
</div> |
Partager