par laplumaencre » 09 août 2006, 17:40
par leakcim51 » 09 août 2006, 16:58
par laplumaencre » 09 août 2006, 11:51
<?php require_once('connexion.php'); /* ----------------------------------- ------ SCRIPT DE PROTECTION ------- ----------------------------------- */ session_start(); // On relaye la session if (session_is_registered("authentification") && $_SESSION['privilege'] == "com" || $_SESSION['privilege'] == "prod"){ // vérification sur la session authentification (la session est elle enregistrée ?) // redirection possible }else{ header("Location:index.php?erreur=intru"); // redirection en cas d'echec } ?> <html> <head> <title>Recherche code client</title> </head> <body background="image/back.jpg" border="0" bordercolor="#ffffdd"> <div><?php echo $message; ?></div> <h2 align="center">Recherche code client</h2> <form method="POST" action="recherche_client.php"> <table width="500" height="300" align="center"> <tr> <td width="45%" align="left"><b>Libellé client/société :</b></td> <td align="left"><input type="texte" name="libelle"></td> </tr> <tr> <td align="left"><b>Département :</b></td> <td align="left"><input type="texte" name="dept"></td> </tr> <tr> <td align="center"><INPUT Type="Button" Value="Fermer cette fenêtre" onclick="javascript:window.close()"></td> <td align="center"><INPUT Type="submit" name="rechercher" value="Rechercher le code"></td> </tr> </table> <?php if ($_POST["rechercher"]) { $libelle=$_POST["libelle"]; $dept=$_POST["dept"]; if ($libelle=="" && $dept=="") { echo "<b>Veuillez renseigner au moins un champs !</br>"; exit; } //-------------------------Connexion au SERVEUR SQL SRV-S5-LEBLANC POUR RECHERCHE DU CODE CLIENT--------------------------------- $connexion=mssql_connect("hote","root","pass") or die("<p>Echec de connexion!"); mssql_select_db("database", $connexion) or die ("<p>Echec de connexion à la base de donnée!"); if ($connexion){ $SQL=mssql_query("SELECT T_TIERS,T_LIBELLE,T_CODEPOSTAL,T_VILLE FROM TIERS WHERE T_LIBELLE LIKE '%".$libelle."%' AND T_CODEPOSTAL LIKE '".$dept."%' and (T_NATUREAUXI=\"CLI\" OR T_NATUREAUXI=\"PRO\")", $connexion); if ($SQL){ $count=mssql_num_rows($SQL); if ($count==0) { echo "<b>Pas de Résultat</b>"; //si il n'y a pas de résultats }else{ echo $count."<b> Résultat(s)</b><br><br>"; echo "<form name=\"form_code\" method=\"POST\"> <table border=\"1\" bordercolor= \"white\" width=\"100%\"><TH width=\"15%\">CODE CLIENT</TH><TH width=\"25%\">LIBELLE</TH> <TH width=\"15%\">CODE POSTAL</TH><TH width=\"15%\">VILLE</TH><TH width=\"30%\"></TH>"; //Tableau avec récupération de la valeur code client grâce au bouton radio... while ($result=mssql_fetch_array($SQL)) { $tab_code=$result["T_TIERS"]; $tab_libelle=$result["T_LIBELLE"]; $tab_code_postal=$result["T_CODEPOSTAL"]; $tab_ville=$result["T_VILLE"]; echo " <tr> <td >".$tab_code."</td> <td >".$tab_libelle."</td> <td >".$tab_code_postal."</td> <td >".$tab_ville."</td> <td colspan=5><INPUT type=\"radio\" name=\"code\" value=\"".$tab_code."\"> <input type=\"submit\" name=\"copie_code\" value=\"Copier code client\";></td> </tr>"; } echo "</table></form>"; } } else { echo "erreur requête..."; } } } //Copie Coller du code client du moteur de recherche à la fiche Descriptive dans le champ Collectivité/Société : ... if ($_POST["copie_code"] && $_POST["code"]) { $code=$_POST["code"]; $_SESSION["code"]=$code; ?> <SCRIPT language="javascript"> window.opener.location="fichedes.php"; </SCRIPT> <?php } ?> </form> </body> </html>
par laplumaencre » 09 août 2006, 10:21
if ($connexion){ $SQL=mssql_query("SELECT T_TIERS,T_LIBELLE,T_CODEPOSTAL,T_VILLE FROM TIERS WHERE T_LIBELLE LIKE '%".$libelle."%' AND T_CODEPOSTAL LIKE '".$dept."%' and (T_NATUREAUXI=\"CLI\" OR T_NATUREAUXI=\"PRO\")", $connexion); if ($SQL){ $count=mssql_num_rows($SQL); if ($count==0) { echo "<b>Pas de Résultat</b>"; //si il n'y a pas de résultats }else{ echo $count."<b> Résultat(s)</b><br><br>"; echo "<form name=\"form_code\" method=\"POST\"> <table border=\"1\" width=\"100%\"><TH width=\"15%\">CODE CLIENT</TH><TH width=\"30%\">LIBELLE</TH> <TH width=\"15%\">CODE POSTAL</TH><TH width=\"20%\">VILLE</TH><TH width=\"20%\"></TH>"; //Tableau avec récupération de la valeur code client grâce au bouton radio... while ($result=mssql_fetch_array($SQL)) { $tab_code=$result["T_TIERS"]; $tab_libelle=$result["T_LIBELLE"]; $tab_code_postal=$result["T_CODEPOSTAL"]; $tab_ville=$result["T_VILLE"]; echo " <tr> <td width=\"15%\">".$tab_code."</td> <td width=\"30%\">".$tab_libelle."</td> <td width=\"15%\">".$tab_code_postal."</td> <td width=\"20%\">".$tab_ville."</td> <td colspan=5 width=\"20%\"><INPUT type=\"radio\" name=\"code\" value=\"".$tab_code."\"> <input type=\"submit\" name=\"copie_code\" value=\"Copier code client\"></td> </tr>"; } echo "</table></form>"; } } else { echo "erreur requête..."; } } } //Copie Coller du code client du moteur de recherche à la fiche Descriptive dans le champ Collectivité/Société : ... if ($_POST["copie_code"] && $_POST["code"]) { $code=$_POST["code"]; $_SESSION["code"]=$code; header("Location:fichedes.php"); ?> <SCRIPT language="javascript"> onclick="javascript:window.close()"; </SCRIPT> <?php } ?> </form> </body> </html>
par laplumaencre » 08 août 2006, 19:02
par laplumaencre » 08 août 2006, 18:12
par leakcim51 » 08 août 2006, 17:48
fonction ta_fonction ($ton_code){ $_SESSION["code"]=$ton_code; exit(); }
par laplumaencre » 08 août 2006, 17:24
if ($connexion){ $SQL=mssql_query("SELECT T_TIERS,T_LIBELLE,T_CODEPOSTAL,T_VILLE FROM TIERS WHERE T_LIBELLE LIKE '%".$libelle."%' AND T_CODEPOSTAL LIKE '".$dept."%' and (T_NATUREAUXI=\"CLI\" OR T_NATUREAUXI=\"PRO\")", $connexion); if ($SQL){ $count=mssql_num_rows($SQL); if ($count==0) { echo "<b>Pas de Résultat</b>"; //si il n'y a pas de résultats }else{ echo $count."<b> Résultat(s)</b><br><br>"; echo "<form name=\"form_code\" method=\"POST\"> <table border=\"1\" width=\"100%\"><TH width=\"15%\">CODE CLIENT</TH><TH width=\"30%\">LIBELLE</TH> <TH width=\"15%\">CODE POSTAL</TH><TH width=\"20%\">VILLE</TH><TH width=\"20%\"></TH>"; $ligne=0; while ($result=mssql_fetch_array($SQL)) { $tab_code=$result["T_TIERS"]; $tab_libelle=$result["T_LIBELLE"]; $tab_code_postal=$result["T_CODEPOSTAL"]; $tab_ville=$result["T_VILLE"]; $_SESSION["code"]=$tab_code; echo " <tr> <td width=\"15%\">".$tab_code."</td> <td width=\"30%\">".$tab_libelle."</td> <td width=\"15%\">".$tab_code_postal."</td> <td width=\"20%\">".$tab_ville."</td> <td colspan=5 width=\"20%\"><input type=\"submit\" name=\"copie_code\" value=\"Copier code client\"></td> </tr>"; $ligne++; } echo "</table></form>"; } } else { echo "erreur requête..."; } } } if ($_POST["copie_code"]) { header("Location:fichedes.php"); } ?>
par laplumaencre » 08 août 2006, 15:10
par laplumaencre » 08 août 2006, 15:00
if ($connexion){ $SQL=mssql_query("SELECT T_TIERS,T_LIBELLE,T_CODEPOSTAL,T_VILLE FROM TIERS WHERE T_LIBELLE LIKE '%".$libelle."%' AND T_CODEPOSTAL LIKE '".$dept."%' and (T_NATUREAUXI=\"CLI\" OR T_NATUREAUXI=\"PRO\")", $connexion); if ($SQL){ //J'AI AJOUTER UN COMPTEUR $count=mssql_num_rows($SQL); if ($count==0) { echo "<b>Pas de Résultat</b>"; //si il n'y a pas de résultats }else{ echo $count."<b> Résultat(s)</b><br>"; echo "<table border=\"1\" width=\"100%\"><TH width=\"15%\">CODE CLIENT</TH><TH width=\"30%\">LIBELLE</TH><TH width=\"15%\">CODE POSTAL</TH><TH width=\"20%\">VILLE</TH><TH width=\"20%\"></TH>"; } //MES RESULTATS PAR LIGNES DS TABLO AVEC BOUTONS COPIER while ($result=mssql_fetch_array($SQL)) { $tab_code=$result["T_TIERS"]; $tab_libelle=$result["T_LIBELLE"]; $tab_code_postal=$result["T_CODEPOSTAL"]; $tab_ville=$result["T_VILLE"]; $_SESSION["code"] = $tab_code; echo " <form name=\"form_code\" method=\"POST\"> <table border=\"1\" width=\"100%\"> <tr> <td width=\"15%\">".$tab_code."</td> <td width=\"30%\">".$tab_libelle."</td> <td width=\"15%\">".$tab_code_postal."</td> <td width=\"20%\">".$tab_ville."</td> <td colspan=5 width=\"20%\"><input type=\"submit\" name=\"copie_code\" value=\"Copier code client\"></td> </tr> </table> </form>"; } }else { echo "erreur requête..."; } } } if ($_POST["copie_code"]) { //COMMENT JE RENVOIS VERS FICHEDES.PHP SANS LE HEADER QUI //OUVRE UNE NOUVELLE ET COMMENT REMPLIR EN MEME TEMPS LE INPUT CLIENT... } ?>
par leakcim51 » 08 août 2006, 13:53
<?php session_start(); require_once('connexion.php'); /* ----------------------------------- ------ SCRIPT DE PROTECTION ------- ----------------------------------- */ // On relaye la session if (session_is_registered("authentification") && $_SESSION['privilege'] == "com" || $_SESSION['privilege'] == "prod"){ // vérification sur la session authentification (la session est elle enregistrée ?) // redirection possible }else{ header("Location:index.php?erreur=intru"); // redirection en cas d'echec } ?> <html> <head> <title>Recherche code client</title> </head> <body background="image/back.jpg" border="0" bordercolor="#ffffdd"> <h2 align="center">Recherche code client</h2> <form method="POST" action="recherche_client.php"> <table width="500" height="300" align="center"> <tr> <td width="45%" align="left"><b>Libellé client/société :</b></td> <td align="left"><input type="texte" name="libelle"></td> </tr> <tr> <td align="left"><b>Département :</b></td> <td align="left"><input type="texte" name="dept"></td> </tr> <tr> <td align="center"><INPUT Type="Button" Value="Fermer cette fenêtre" onclick="javascript:window.close()"></td> <td align="center"><INPUT Type="submit" name="rechercher" value="Rechercher le code"></td> </tr> </table> </form method="POST"> <?php if ($_POST["rechercher"]) { $libelle=$_POST["libelle"]; $dept=$_POST["dept"]; if ($libelle=="" && $dept=="") { $message="Veuillez renseigner au moins un champs !"; echo $message; exit; } //-------------------------Connexion au SERVEUR SQL SRV-S5-LEBLANC POUR RECHERCHE DU CODE CLIENT--------------------------------- $connexion=mssql_connect("******","**","**") or die("<p>Echec de connexion!"); mssql_select_db("DB000000", $connexion) or die ("<p>Echec de connexion à la base de donnée!"); if ($connexion){ $SQL=mssql_query("SELECT T_TIERS,T_LIBELLE,T_CODEPOSTAL,T_VILLE FROM TIERS WHERE T_LIBELLE LIKE '%".$libelle."%' AND T_CODEPOSTAL LIKE '".$dept."%'", $connexion); if ($SQL) { $result=mssql_fetch_array($SQL); if ($result!=null){ $result=mssql_fetch_array($SQL); $tab_code=$result["T_TIERS"]; $_SESSION["code"] = $tab_code; echo "code enregistré"; } }else { echo "Aucun résultat trouvé !"; } } } ?> <div><?php echo $message; ?></div> </body> </html>
<?php session_start(); // On relaye la session require_once('connexion.php'); /* ----------------------------------- * ------ SCRIPT DE PROTECTION ------- * ----------------------------------- */ if (session_is_registered("authentification") && $_SESSION['privilege'] == "com" || $_SESSION['privilege'] == "prod" || $_SESSION['privilege'] == "simu"){ // vérification sur la session authentification (la session est elle enregistrée ?) //eventuelle redisrection ou code divers... }else{ header("Location:index.php?erreur=intru"); // redirection en cas d'echec } ?> <!-- FORMULAIRE FICHE DESCRIPTIVE --> <html> <head> <title>EasyFiche</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table style="width: 1024px; height: 768px; text-align: left; margin-left: auto; margin-right: auto;" background="image/back.jpg" border="0" bordercolor="#ffffdd"> <tbody> <tr> <td style="text-align: justify;"> <form name="form_fiche" method="post" action="traitement_fiche.php"> ..... <?php if (isset($_SESSION["code"]) && !empty($_SESSION["code"])){ $codeClient = $_SESSION["code"]; } else{ $codeClient=""; } ?> <input name="client" size="15" maxlength="40" type="text" value="<?php echo $codeClient; ?>"> <input value="Rechercher code" type="button" onclick="window.open('recherche_client.php','Client')"> .....
par laplumaencre » 07 août 2006, 14:20
if ($_POST["copie_code"]) { session_start() ; $_SESSION['code']=$tab_code; }
collectivité/Société : <input name="client" size="15" maxlength="40" type="text" value="<?php session_start(); echo $_SESSION['code']; ?>">
par laplumaencre » 07 août 2006, 12:01
par leakcim51 » 04 août 2006, 17:58
par zigz4g » 04 août 2006, 15:15