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 134 135 136 137 138 139 140 141 142 143 144 145
| <?php
include("../../../connexion.php");
session_start();
if(empty($_SESSION) || empty($_SESSION['ID_PERSONNE'])) { // sécurité
header('Location:../../index.php');
}
if(!isset($_SESSION['TAB_FOURNISSEUR']) || $_GET['init'] == 1){
$tableau = array($_GET['nom_fournisseur'],$_GET['num_fournisseur']);
$_SESSION['TAB_FOURNISSEUR'] = $tableau;
}
$requete2 = "SELECT ID_FOURNISSEUR,NOM_FOURNISSEUR,NUM_FOURNISSEUR,ADR_FOURNISSEUR,ACTIF_FOURNISSEUR,TYPE_ACTIVITE FROM POP_FOURNISSEUR
WHERE 1=1";
//requête de recherche fournisseur
if($_SESSION['TAB_FOURNISSEUR'][0] != null && $_SESSION['TAB_FOURNISSEUR'][0] != '0')
$requete2 .= " AND NOM_FOURNISSEUR = '".$_SESSION['TAB_FOURNISSEUR'][0]."'";
if($_SESSION['TAB_FOURNISSEUR'][1] != 'null' && $_SESSION['TAB_FOURNISSEUR'][1] != 0)
$requete2 .= " AND NUM_FOURNISSEUR = '".$_SESSION['TAB_FOURNISSEUR'][1]."'";
$requete2 .= "ORDER BY NOM_FOURNISSEUR,NUM_FOURNISSEUR ASC";
$statement2 = oci_parse($conn, $requete2);
oci_execute($statement2,OCI_COMMIT_ON_SUCCESS);
?>
<div id="affiche_fournisseur" style="float:left;width:100%;margin: 8px 5px 5px 0px;border-radius: 4px;padding: 5px;" class="couleur2">
<form id="form_fournisseur" method='post' onsubmit='' action="#" >
<table class="table">
<tr class="couleur5">
<th class="th actif" rowspan="2">Actif</th>
<th class="th fournisseur" rowspan="2">Fournisseur</th>
<th class="th fournisseur" rowspan="2" >Numéro Fournisseur</th>
<th class="th adresse" rowspan="2" >Adresse</th>
<th class="th type_activite" rowspan="2">Type d'activite</th>
<th class="th contact" colspan="5" >Contact</th>
<th class="th action" rowspan="2">Action</th>
</tr>
<tr class="couleur5">
<th class="th" >Nom du contact</th>
<th class="th">Adresse email</th>
<th class="th">Telephone Fixe</th>
<th class="th">Telephone Portable</th>
<th class="th">Action contact</th>
</tr>
<?php
$flag_couleur1 = 0;
$flag_couleur2 = 0;
while($result1 = oci_fetch_assoc($statement2)) {
$requete22 = "SELECT COUNT(*) as NB
FROM POP_CONTACT_FOURNISSEUR
WHERE ID_FOURNISSEUR =".$result1['ID_FOURNISSEUR'];
$statement22 = oci_parse($conn, $requete22);
oci_execute($statement22,OCI_COMMIT_ON_SUCCESS);
$result22 = oci_fetch_assoc($statement22);
?>
<tr <?php if($flag_couleur1%2 == 0){echo "class='couleur6'";}else{echo "class='couleur7'";}?>>
<?php
if($result1['ACTIF_FOURNISSEUR'] == 1)
echo "<td class='td' ROWSPAN=2><img src='../../icone/G_visible.png' alt='' /></td>";
else
echo "<td class='td' ROWSPAN=2><img src='../../icone/G_invisible.png' alt='' /></td>";
?>
<td class='td' ROWSPAN=<?php echo $result22['NB'];?>><?php echo $result1['NOM_FOURNISSEUR'];?></td>
<td class='td' ROWSPAN=<?php echo $result22['NB'];?>><?php echo $result1['NUM_FOURNISSEUR'];?></td>
<td class='td' ROWSPAN=<?php echo $result22['NB'];?>><?php echo $result1['ADR_FOURNISSEUR'];?></td>
<td class='td' ROWSPAN=<?php echo $result22['NB'];?>><?php echo $result1['TYPE_ACTIVITE'];?></td>
<?php
$requete3 = "SELECT ID_CONTACT_FOURNISSEUR,NOM_CONTACT,ADR_EMAIL,TEL_FIXE,TEL_PORTABLE
FROM POP_CONTACT_FOURNISSEUR
WHERE ID_FOURNISSEUR =".$result1['ID_FOURNISSEUR'];
$statement3 = oci_parse($conn, $requete3);
oci_execute($statement3,OCI_COMMIT_ON_SUCCESS);
while ($result3 = oci_fetch_assoc($statement3)) {
?>
<td class="td" >
<?php echo $result3['NOM_CONTACT']; ?>
</td>
<td class="td">
<label for="" style="float:left;padding:4px 0px;"><?php echo $result3['ADR_EMAIL']; ?></label>
<br class="br" />
</td>
<td class="td">
<label for="" style="float:left;padding:4px 0px;"><?php echo $result3['TEL_FIXE']; ?></label>
<br class="br" />
</td>
<td class="td">
<label for="" style="float:left;padding:4px 0px;"><?php echo $result3['TEL_PORTABLE']; ?></label>
<br class="br" />
</td>
<td class="td">
<img onclick='AjtContactFournisseur(<?php echo $result1['ID_FOURNISSEUR'];?>);' style='cursor:pointer;' src='../../icone/N_ajt_adr.png' alt='' />
<br class="br" />
<img onclick="ModContactFournisseur('<?php echo $_SESSION['ID_FOURNISSEUR']; ?>','<?php echo $result3['ID_CONTACT_FOURNISSEUR'];?>');Visible('div_formulaire');" src='../../icone/N_mod_adr.png' style="cursor:pointer;" alt='' />
<br class="br" />
<img onclick="SuppContactFournisseur('<?php echo $_SESSION['ID_FOURNISSEUR']; ?>','<?php echo $result3['ID_CONTACT_FOURNISSEUR'];?>');Visible('div_formulaire');" src='../../icone/N_sup_adr.png' style="cursor:pointer;margin-top:10px;" alt='' />
</td>
<?php $flag_couleur2++;
} ?>
<td class='td' ROWSPAN=<?php echo $result22['NB'];?>>
<img onclick='ModFournisseur(<?php echo $result1['ID_FOURNISSEUR'];?>);' style='cursor:pointer;' src='../../icone/N_mod_ligne.png' alt='' />
<img style='cursor:pointer;' onclick='SupFournisseur(<?php echo $result1['ID_FOURNISSEUR'];?>);' src='../../icone/N_sup_ligne.png' alt='' />
</td>
</tr><?php
$flag_couleur1++;
}
?>
<tr class="couleur5">
<td class='td'></td>
<td class='td'>
<input id="ajt_fournisseur" name="ajt_fournisseur" type="text" style="width:98%;" required />
</td>
<td class="td">
<input id="num_fournisseur" name="num_fournisseur" type="text" style="width:60px;" required />
</td>
<td class="td">
<input id="adresse" name="adresse" type="text" style="width:100px;" required />
</td>
<td class="td">
<input id="type_activite" name="type_activite" type="text" style="width:100px;" required />
</td>
<td class='td' colspan="2">
<input border=0 src='../../icone/N_ajt_ligne.png' type=image value=submit>
</td>
</tr>
</table>
</form>
</div> |
Partager