julie230 | Ca va être un peu le bordel mais je vais mettre tout le code de mes pages...
En voilà une qui fonctionne très bien :
Code :
- <html>
- <head>
- <title>Fiche pense-bête</title>
- <script language=javascript src=bulles.js></script>
- <script language=javascript>
- InitBulle("#000000","#ffffff","#000000",1);
- if (document.all)
- document.attachEvent("onclick", goHideBulle);
- else
- document.addEventListener("click", goHideBulle, false);
- function goHideBulle(event) {
- if (document.all) {
- if (event.srcElement.tagName != 'TD' && event.srcElement.tagName != 'FONT')
- HideBulle();
- }
- else {
- if (event.target.tagName != 'TD' && event.target.tagName != 'FONT')
- HideBulle();
- }
- }
- </script>
- <script language=javascript>
- function selectionTiers() {
- if (document.forms[0].tier.value != "" )
- document.forms[0].ref.disabled = false;
- else
- document.forms[0].ref.disabled = true;
- var ch = "raffraichpb.php?saisi=" + document.forms[0].search.value + "&type=" + document.forms[0].type.value + "&pb=" + document.forms[0].pb.value + "&cleinterv=" + document.forms[0].cleint.value + "&consult=" + document.forms[0].consult.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&dateech=" + document.forms[0].dateech.value + "&acti=" + document.forms[0].acti.value + "&titre=" + document.forms[0].titre.value + "&titu=" + document.forms[0].titul.value + "&nompb=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tier.value + "&ref=" + document.forms[0].ref.value + "&comm=" + document.forms[0].comm.value + "&plac=" + document.forms[0].plac.value + "&tri=" + document.forms[0].tri.value;
- document.location.href = ch;
- }
- function surLien1() {
- var ch = "ficheTitulaire.php?fichier=fichePb.php&type=" + document.forms[0].type.value + "&pb=" + document.forms[0].pb.value + "&cleinterv=" + document.forms[0].cleint.value + "&consult=" + document.forms[0].consult.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&dateech=" + document.forms[0].dateech.value + "&acti=" + document.forms[0].acti.value + "&titre=" + document.forms[0].titre.value + "&titu=" + document.forms[0].titul.value + "&nompb=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tier.value + "&ref=" + document.forms[0].ref.value + "&comm=" + document.forms[0].comm.value + "&plac=" + document.forms[0].plac.value + "&typ=creation&titulaire=";
- document.all.lien1.href = ch;
- }
- function surLien2() {
- var ch = "ficheTiers.php?fichier=fichePb.php&type=" + document.forms[0].type.value + "&pb=" + document.forms[0].pb.value + "&cleinterv=" + document.forms[0].cleint.value + "&consult=" + document.forms[0].consult.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&dateech=" + document.forms[0].dateech.value + "&acti=" + document.forms[0].acti.value + "&titre=" + document.forms[0].titre.value + "&titu=" + document.forms[0].titul.value + "&nompb=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tier.value + "&ref=" + document.forms[0].ref.value + "&comm=" + document.forms[0].comm.value + "&plac=" + document.forms[0].plac.value + "&typ=creation&tiers=";
- document.all.lien2.href = ch;
- }
- function changeSearch() {
- var ch = "raffraichpb.php?saisi=" + document.forms[0].search.value + "&type=" + document.forms[0].type.value + "&pb=" + document.forms[0].pb.value + "&cleinterv=" + document.forms[0].cleint.value + "&consult=" + document.forms[0].consult.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&dateech=" + document.forms[0].dateech.value + "&acti=" + document.forms[0].acti.value + "&titre=" + document.forms[0].titre.value + "&titu=" + document.forms[0].titul.value + "&nompb=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tier.value + "&ref=" + document.forms[0].ref.value + "&comm=" + document.forms[0].comm.value + "&plac=" + document.forms[0].plac.value + "&tri=" + document.forms[0].tri.value;
- document.location.href = ch;
- }
- </script>
- </head>
- <body background=cahier1.bmp link='FFFFFF' vlink='FFFFFF' alink='FFFFFF'>
- <h1 align=center><font face=times size=6>Fiche pense-bête<br></font></h1>
- <font face=times size=3>
- <?php
- // les warnings ne sont plus affichés sur cette page
- error_reporting(E_ALL ^ E_WARNING);
- include 'fonctions.php';
- $conn = mysql_connect();
- mysql_select_db("gestfic" );
- if ($_REQUEST['type'] == "creation" ) {
- $act = $_REQUEST['acti'];
- $titre = $_REQUEST['titre'];
- $tit = $_REQUEST['titu'];
- $nom = $_REQUEST['nompb'];
- $tie = $_REQUEST['tie'];
- $ref = $_REQUEST['ref'];
- $comm = $_REQUEST['comm'];
- $cleint = $_REQUEST['cleinterv'];
- $res = mysql_query("select coded from intervenant where cleunint = '" . $cleint . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $coded = $ligne[0];
- if ($_REQUEST['plac'] == 0)
- $plac = "Non";
- else
- $plac = "Oui";
- $res = mysql_query("select curdate()" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $date = $ligne[0];
- $res = mysql_query("select curtime()" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $heure = $ligne[0];
- $dateech = $_REQUEST['dateech'];
- }
- else {
- $res = mysql_query("select * from pb where cleunps = '" . $_REQUEST['pb'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $act = $ligne[2];
- $titre = $ligne[3];
- $tit = $ligne[4];
- $nom = $ligne[5];
- $tie = $ligne[6];
- $ref = $ligne[7];
- $comm = $ligne[8];
- $cleint = $ligne[1];
- $res1 = mysql_query("select coded from intervenant where cleunint = '" . $cleint . "'" );
- $ligne1 = mysql_fetch_array($res1, MYSQL_NUM);
- $coded = $ligne1[0];
- if ($ligne[9] == 1)
- $plac = "Oui";
- else
- $plac = "Non";
- $date = $ligne[10];
- $heure = $ligne[11];
- $dateech = $ligne[12];
- }
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $param = "&agenda=accueil.php";
- $parametres = "accueil.php";
- break;
- case "agendaPersoHebdo.php":
- $param = "&agenda=agendaPersoHebdo.php&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- $parametres = "agendaPersoHebdo.php?annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $res = mysql_query("select libelle from groupe where codegp = '" . $_REQUEST['groupe'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $param = "&agenda=agendaGroupHebdo.php&groupe=" . $_REQUEST['groupe'] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- $parametres = "agendaGroupHebdo.php?groupe=" . $ligne[0] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $param = "&agenda=agendaPersoMens.php&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- $parametres = "agendaPersoMens.php?annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- case "historique.php":
- $param = "&agenda=historique.php";
- }
- echo "<form action=majPenseBete.php?agenda=" . $param . " method=post>";
- ?>
- <table align=center cellspacing=10>
- <tr>
- <td>Date échéance</td>
- <?php
- echo "<td><input type=text name=dateech maxlenght=10 size=10 value=\"${dateech}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Activité</td>";
- echo "<td><select name=acti";
- if ($_REQUEST['consult'])
- echo " disabled";
- echo ">";
- echo "<option " . selection($act, "" ) . ">";
- $res = mysql_query("select codea, libelle from activite order by libelle" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . "" . selection($act, $ligne[0]) . ">" . $ligne[1];
- echo "</select></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Titre</td>";
- echo "<td><input type=text name=titre size=50 value=\"${titre}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Titulaire</td>";
- echo "<td><input type=text name=search size=39 value=\"${_REQUEST['saisi']}\" onChange=\"changeSearch()\"><br>";
- echo "<select name=titul";
- if ($_REQUEST['consult'])
- echo " disabled";
- echo ">";
- echo "<option " . selection($tit, 0) . ">";
- if ($_REQUEST['saisi'] == "" ) {
- $res = mysql_query("select codeti, nompreti from titulaire where coded = '" . $coded . "' order by nompreti" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM)) {
- echo "<option value=" . $ligne[0] . selection($tit, $ligne[0]) . ">" . $ligne[1];
- }
- }
- else {
- $res = mysql_query("select codeti, nompreti from titulaire where coded = '" . $coded . "' and nompreti like '" . $_REQUEST['saisi'] . "%'" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM)) {
- echo "<option value=" . $ligne[0] . selection($tit, $ligne[0]) . ">" . $ligne[1];
- }
- }
- echo "</select></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Nom</td>";
- echo "<td><input type=text name=nom size=50 value=\"${nom}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Tiers</td>";
- echo "<td><select name=tier onchange=\"selectionTiers()\"";
- if ($_REQUEST['consult'])
- echo " disabled";
- echo ">";
- $res = mysql_query("select cleuntiers, nom from tiers order by nom" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($tie, $ligne[0]) . ">" . $ligne[1];
- echo "</select></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Référent</td>";
- echo "<td><select name=ref";
- if ($_REQUEST['consult'] or $tie == "" )
- echo " disabled";
- echo ">";
- echo "<option value= " . selection($ref, "" ) . ">";
- $res = mysql_query("select cleunref, nom, prenom from referent where cleuntiers = '" . $tie . "'" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($ref, $ligne[0]) . ">" . $ligne[1] . " " . $ligne[2];
- echo "</select></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td valign=top>Commentaires</td>";
- echo "<td><textarea name=comm rows=5 cols=50 wrap=virtual";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo ">" . $comm . "</textarea></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>Rendez-vous placé?</td>";
- echo "<td><input type=text name=place size=5 value=\"${plac}\" readonly>";
- if (!$_REQUEST['consult']) {
- session_start();
- $res = mysql_query("select cleunint from intervenant where login = '" . $_SESSION['login'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $p = "";
- break;
- case "agendaPersoHebdo.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $p = "&groupe=" . $_REQUEST['groupe'] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- case "historique.php":
- $p = "";
- break;
- }
- echo "    <a href=\"ficheRdv.php?agenda=" . $_REQUEST['agenda'] . "&type=creation&rdv=&date=&hdeb=&int=" . $ligne[0] . $p . "&consult=0&cong=0&clepb=" . $_REQUEST['pb'] . "&tri=" . $_REQUEST['tri'] . "&typepb=" . $_REQUEST['type'] . "&saisi=&hfin=&acti=&titre=&titu=&nom=&km=&frais=&comm=&reali=&motif=\" onmouseover=\"javascript:AffBulle('<font face=times size=1>Placer un rendez-vous</font>')\"><img src=chaise.gif></a></td>";
- }
- else
- echo "</td>";
- echo "</tr>";
- echo "</table><br>";
- ?>
- <?php
- echo "<input type=hidden name=tri value=\"${_REQUEST['tri']}\">";
- echo "<input type=hidden name=saisi value=\"${_REQUEST['saisi']}\">";
- echo "<input type=hidden name=type value=\"${_REQUEST['type']}\">";
- echo "<input type=hidden name=pb value=\"${_REQUEST['pb']}\">";
- echo "<input type=hidden name=cleint value=\"${cleint}\">";
- echo "<input type=hidden name=consult value=\"${_REQUEST['consult']}\">";
- echo "<input type=hidden name=agenda value=\"${_REQUEST['agenda']}\">";
- switch ($_REQUEST['agenda']) {
- case "agendaPersoHebdo.php":
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=semaine value=\"${_REQUEST['semaine']}\">";
- echo "<input type=hidden name=jour value=\"${_REQUEST['jour']}\">";
- echo "<input type=hidden name=vuinter value=\"${_REQUEST['vuinter']}\">";
- break;
- case "agendaGroupHebdo.php":
- echo "<input type=hidden name=groupe value=\"${_REQUEST['groupe']}\">";
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=semaine value=\"${_REQUEST['semaine']}\">";
- echo "<input type=hidden name=jour value=\"${_REQUEST['jour']}\">";
- break;
- case "agendaPersoMens.php":
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=mois value=\"${_REQUEST['mois']}\">";
- break;
- }
- echo "<input type=hidden name=date value=\"${date}\">";
- echo "<input type=hidden name=heure value=\"${heure}\">";
- echo "<input type=hidden name=referen value=''>";
- echo "<input type=hidden name=plac value=\"${plac}\">";
- ?>
- <table align=center>
- <tr>
- <td><input type=submit value=OK
- <?php
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- ></td>
- </form>
- <?php
- echo "<form action=gestionPenseBete.php?tri=moi" .$param . " method=post>";
- ?>
- <td><input type=submit value=Annuler
- <?php
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- ></td>
- </form>
- <td width=20></td>
- <form>
- <td><input type=button value=Fermer
- <?php
- if (!$_REQUEST['consult'])
- echo " disabled";
- ?>
- onclick="window.history.back()"></td>
- </tr>
- </table>
- </font>
- <?php
- mysql_close($conn);
- ?>
- </body>
- </html>
|
avec la page intermédiaire qui va bien :
Code :
- <?php
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $p = "";
- break;
- case "agendaPersoHebdo.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $p = "&groupe=" . $_REQUEST['groupe'] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/fichePb.php?type=" . $_REQUEST['type'] . "&pb=" . $_REQUEST['pb'] . "&cleinterv=" . $_REQUEST['cleinterv'] . "&consult=" . $_REQUEST['consult'] . "&agenda=" . $_REQUEST['agenda'] . $p . "&dateech=" . $_REQUEST['dateech'] . "&acti=" . $_REQUEST['acti'] . "&titre=" . $_REQUEST['titre'] . "&titu=" . $_REQUEST['titu'] . "&nompb=" . $_REQUEST['nompb'] . "&tie=" . $_REQUEST['tie'] . "&ref=" . $_REQUEST['ref'] . "&comm=" . $_REQUEST['comm'] . "&plac=" . $_REQUEST['plac'] . "&tri=" . $_REQUEST['tri'] . "&saisi=" . $_REQUEST['saisi']);
- exit;
- ?>
|
Maintenant, voilà une page qui ne fonctionne pas correctement :
Code :
- <html>
- <head>
- <title>Fiche interruption</title>
- <script language="JavaScript" src=bulles.js></script>
- <script language="JavaScript">
- InitBulle("#000000","#ffffff","#000000",1);
- if (document.all)
- document.attachEvent("onclick", goHideBulle);
- else
- document.addEventListener("click", goHideBulle, false);
- function goHideBulle(event) {
- if (document.all) {
- if (event.srcElement.tagName != 'TD' && event.srcElement.tagName != 'FONT')
- HideBulle();
- }
- else {
- if (event.target.tagName != 'TD' && event.target.tagName != 'FONT')
- HideBulle();
- }
- }
- </script>
- <script language="JavaScript">
- function surLien3() {
- var ch = "redige.php?cleemet=&date=" + document.forms[0].date.value + "&heure=" + document.forms[0].hdeb.value + "&contenu=&cledest=&cong=0&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- if (document.forms[0].appel[0].checked == true)
- var recu = 1;
- else
- recu = 0;
- ch = ch + "&gest=0&interru=1&typei=" + document.forms[0].codei.value + "&comm=" + document.forms[0].comm.value + "&recu=" + recu + "&titu=" + document.forms[0].titu.value + "&type=" + document.forms[0].type.value + "&inter=" + document.forms[0].inter.value + "&consult=" + document.forms[0].consult.value + "&gesti=" + document.forms[0].gest.value + "&hfin=" + document.forms[0].hfin.value + "&acti=" + document.forms[0].acti.value + "&nomi=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tie.value + "&int=" + document.forms[0].int.value + "&codegp=&saisi=" + document.forms[0].search.value + "&visu=0";
- document.forms[0].lien3.href = ch;
- }
- function changeSearch() {
- var ch = "raffraich.php?saisi=" + document.forms[0].search.value + "&type=" + document.forms[0].type.value + "&inter=" + document.forms[0].inter.value + "&consult=" + document.forms[0].consult.value + "&codei=" + document.forms[0].codei.value + "&gest=" + document.forms[0].gest.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&date=" + document.forms[0].date.value + "&hdeb=" + document.forms[0].hdeb.value + "&hfin=" + document.forms[0].hfin.value + "&acti=" + document.forms[0].acti.value + "&titu=" + document.forms[0].titu.value + "&nomi=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tie.value;
- if (document.forms[0].appel[0].checked == true)
- ch = ch + "&envoye=0";
- else
- ch = ch + "&envoye=1";
- ch = ch + "&comm=" + document.forms[0].comm.value + "&int=" + document.forms[0].int.value;
- document.location.href = ch;
- }
- function changeTitu() {
- var ch = "raffraich.php?saisi=" + document.forms[0].search.value + "&type=" + document.forms[0].type.value + "&inter=" + document.forms[0].inter.value + "&consult=" + document.forms[0].consult.value + "&codei=" + document.forms[0].codei.value + "&gest=" + document.forms[0].gest.value + "&agenda=" + document.forms[0].agenda.value;
- if (document.forms[0].agenda.value == "agendaPersoHebdo.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value + "&vuinter=" + document.forms[0].vuinter.value;
- if (document.forms[0].agenda.value == "agendaGroupHebdo.php" )
- ch = ch + "&groupe=" + document.forms[0].groupe.value + "&annee=" + document.forms[0].annee.value + "&semaine=" + document.forms[0].semaine.value + "&jour=" + document.forms[0].jour.value;
- if (document.forms[0].agenda.value == "agendaPersoMens.php" )
- ch = ch + "&annee=" + document.forms[0].annee.value + "&mois=" + document.forms[0].mois.value;
- ch = ch + "&date=" + document.forms[0].date.value + "&hdeb=" + document.forms[0].hdeb.value + "&hfin=" + document.forms[0].hfin.value + "&acti=" + document.forms[0].acti.value + "&titu=" + document.forms[0].titu.value + "&nomi=" + document.forms[0].nom.value + "&tie=" + document.forms[0].tie.value;
- if (document.forms[0].appel[0].checked == true)
- ch = ch + "&envoye=0";
- else
- ch = ch + "&envoye=1";
- ch = ch + "&comm=" + document.forms[0].comm.value + "&int=" + document.forms[0].int.value;
- document.location.href = ch;
- }
- </script>
- </head>
- <body background=inter2.jpg link='FFFFFF' vlink='FFFFFF' alink='FFFFFF'>
- <?php
- // les warnings ne sont plus affichés sur cette page
- error_reporting(E_ALL ^ E_WARNING);
- include 'fonctions.php';
- $conn = mysql_connect();
- mysql_select_db("gestfic" );
- if ($_REQUEST['type'] == "creation" ) {
- $res = mysql_query("select curdate()" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $date = transd($ligne[0]);
- if ($_REQUEST['hdeb'] != "" )
- $hdeb = $_REQUEST['hdeb'];
- else {
- $res = mysql_query("select curtime()" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $hdeb = substr($ligne[0], 0, 5);
- }
- $hfin = $_REQUEST['hfin'];
- $h = "";
- $mn = "";
- if ($_REQUEST['titu'] == "" or $_REQUEST['titu'] == 0) {
- $titu = 0;
- $del = "";
- }
- else {
- $titu = $_REQUEST['titu'];
- $res = mysql_query("select coded from titulaire where codeti = '" . $titu . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $res1 = mysql_query("select nompred from delegue where coded = '" . $ligne[0] . "'" );
- $ligne1 = mysql_fetch_array($res1, MYSQL_NUM);
- if ($ligne1 != "" )
- $del = $ligne1[0];
- else {
- $res1 = mysql_query("select nom, prenom from intervenant where coded = '" . $ligne[0] . "'" );
- $ligne1 = mysql_fetch_array($res1, MYSQL_NUM);
- $del = $ligne1[0] . " " . $ligne1[1];
- }
- }
- $nomi = $_REQUEST['nomi'];
- $tie = $_REQUEST['tie'];
- $int = $_REQUEST['int'];
- $comm = $_REQUEST['comm'];
- $recu = !$_REQUEST['envoye'];
- switch ($_REQUEST['codei']) {
- case "A":
- echo "<h1 align=center><font face=times size=6>Appel téléphonique<br></font></h1>";
- $acti = "TEL";
- $mess = "Appel enregistré!";
- break;
- case "I":
- echo "<h1 align=center><font face=times size=6>Interruption<br></font></h1>";
- $acti = "";
- $mess = "Interruption enregistrée!";
- break;
- }
- $res = mysql_query("select coded from intervenant where cleunint = '" . $_REQUEST['int'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $coded = $ligne[0];
- }
- else {
- $res = mysql_query("select * from tel where cleuntel = '" . $_REQUEST['inter'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- if ($ligne[4] == "TEL" ) {
- echo "<h1 align=center><font face=times size=6>Appel téléphonique<br></font></h1>";
- $mess = "Appel modifié!";
- }
- else {
- echo "<h1 align=center><font face=times size=6>Interruption<br></font></h1>";
- $mess = "Interruption modifiée!";
- }
- $acti = $ligne[4];
- $date = transd($ligne[1]);
- $hdeb = $ligne[2];
- $hfin = $ligne[3];
- $mn1 = (substr($ligne[2], 0, 2) * 60) + substr($ligne[2], 3, 2);
- $mn2 = (substr($ligne[3], 0, 2) * 60) + substr($ligne[3], 3, 2);
- $mnfin = $mn2 - $mn1;
- $heu = $mnfin / 60;
- $t = explode(".", $heu, 1);
- $h = $t[0];
- $mn = $mnfin % 60;
- $titu = $ligne[5];
- $res1 = mysql_query("select coded from titulaire where codeti = '" . $titu . "'" );
- $ligne1 = mysql_fetch_array($res1, MYSQL_NUM);
- $res2 = mysql_query("select nompred from delegue where coded = '" . $ligne1[0] . "'" );
- $ligne2 = mysql_fetch_array($res2, MYSQL_NUM);
- if ($ligne2 != "" )
- $del = $ligne2[0];
- else {
- $res2 = mysql_query("select nom, prenom from intervenant where coded = '" . $ligne1[0] . "'" );
- $ligne2 = mysql_fetch_array($res2, MYSQL_NUM);
- $del = $ligne2[0] . " " . $ligne2[1];
- }
- $del = $ligne2[0];
- $nomi = "";
- $tie = $ligne[6];
- $int = $ligne[7];
- $comm = $ligne[9];
- $recu = !($ligne[8]);
- $res1 = mysql_query("select coded from intervenant where cleunint = '" . $ligne[7] . "'" );
- $ligne1 = mysql_fetch_array($res1, MYSQL_NUM);
- $coded = $ligne1[0];
- }
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $p = "?agenda=accueil.php";
- break;
- case "agendaPersoHebdo.php":
- $p = "?agenda=agendaPersoHebdo.php&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $res = mysql_query("select libelle from groupe where codegp = '" . $_REQUEST['groupe'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $p = "?agenda=agendaGroupHebdo.php&groupe=" . $ligne[0] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $p = "?agenda=agendaPersoMens.php&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- case "historique.php":
- $p = "?agenda=historique.php";
- break;
- case "interruption.php":
- $p = "?agenda=interruption.php";
- break;
- case "agendaInterHebdo.php":
- $p = "?agenda=agendaInterHebdo.php&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- }
- echo "<form action=majInter.php" . $p . " method=post>";
- ?>
- <font face=times size=3>
- <center>
- <table>
- <tr>
- <td></td>
- <td>
- Appel<br>
- <?php
- echo "<input type=radio name=appel value=\"recu\"";
- if ($recu)
- echo "checked";
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- >Reçu<br>
- <?php
- echo "<input type=radio name=appel value=\"envoye\"";
- if (!$recu)
- echo "checked";
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- >Envoyé
- </td>
- </tr>
- </table>
- </center><br>
- <table align=center cellspacing=10>
- <tr>
- <td>Date</td>
- <?php
- echo "<td><input type=text name=date size=10 maxlenght=10 value=\"${date}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- ?>
- </tr>
- <tr>
- <td>Heure début</td>
- <?php
- echo "<td><input type=text name=hdeb size=8 maxlenght=8 value=\"${hdeb}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- ?>
- </tr>
- <tr>
- <td>Heure fin</td>
- <?php
- echo "<td><input type=text name=hfin size=8 maxlenght=8 value=\"${hfin}\"";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo "></td>";
- ?>
- </tr>
- <tr>
- <td>Activité</td>
- <td><select name=acti
- <?php
- if ($_REQUEST['consult'] or $_REQUEST['codei'] == "A" )
- echo " disabled";
- echo ">";
- echo "<option" . selection("", $acti) . ">";
- $res = mysql_query("select codea, libelle from activite order by libelle" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($ligne[0], $acti) . ">" . $ligne[1];
- ?>
- </select></td>
- </tr>
- <tr>
- <td>Titulaire</td>
- <td><?php echo "<input type=text name=search size=39 onChange=\"changeSearch()\" value=\"${_REQUEST['saisi']}\">" ?><br>
- <select name=titu onChange="changeTitu()"
- <?php
- if ($_REQUEST['consult'])
- echo " disabled";
- echo ">";
- echo "<option value=0 " . selection($titu,0) . ">";
- if ($_REQUEST['saisi'] != "" ) {
- $res = mysql_query("select codeti, nompreti from titulaire where nompreti like '" . $_REQUEST['saisi'] . "%'" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($titu,$ligne[0]) . ">" . $ligne[1];
- }
- else {
- $res = mysql_query("select codeti, nompreti from titulaire order by nompreti" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($titu,$ligne[0]) . ">" . $ligne[1];
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>Délégué</td>
- <?php echo "<td><input type=text name=del size=40 value=\"${del}\"></td>"; ?>
- </tr>
- <tr>
- <td>Nom</td>
- <?php echo "<td><input type=text name=nom size=40 value=\"${nomi}\"></td>"; ?>
- </tr>
- <tr>
- <td>Tiers</td>
- <td><select name=tie
- <?php
- if ($_REQUEST['consult'])
- echo " disabled";
- echo ">";
- echo "<option" . selection("", $tie) . ">";
- $res = mysql_query("select cleuntiers, nom from tiers order by nom" );
- while ($ligne = mysql_fetch_array($res, MYSQL_NUM))
- echo "<option value=" . $ligne[0] . selection($ligne[0], $tie) . ">" . $ligne[1];
- echo "</select></td>";
- ?>
- </tr>
- <tr>
- <td valign=top>Commentaires</td>
- <td>
- <?php
- echo "<textarea name=comm rows=6 cols=30";
- if ($_REQUEST['consult'])
- echo " readonly";
- echo ">" . $comm . "</textarea>";
- ?>
- </td>
- <?php
- $p = "&agenda=" . $_REQUEST['agenda'];
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- break;
- case "agendaPersoHebdo.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $p = "&groupe=" . $_REQUEST['groupe'] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- }
- echo "<td valign=center><a href=\"redige.php?cleemet=&date=" . $_REQUEST['date'] . "&heure=" . $_REQUEST['hdeb'] . "&contenu=&cledest=&cong=0" . $p . "&gest=0&interru=1&typei=" . $_REQUEST['codei'] . "&comm=" . $_REQUEST['comm'] . "&recu=" . !$_REQUEST['envoye'] . "&titu=" . $_REQUEST['titu'] . "&type=" . $_REQUEST['type'] . "&inter=" . $_REQUEST['inter'] . "&consult=" . $_REQUEST['consult'] . "&gesti=" . $_REQUEST['gest'] . "&date=" . $_REQUEST['date'] . "&hdeb=" . $_REQUEST['hdeb'] . "&hfin=" . $_REQUEST['hfin'] . "&acti=" . $_REQUEST['acti'] . "&nomi=" . $_REQUEST['nomi'] . "&tie=" . $_REQUEST['tie'] . "&int=" . $_REQUEST['int'] . "&codegp=&saisi=&visu=0\" id=lien3 onmouseover=\"javascript:AffBulle('<font face=times size=1>Faire part de l\'appel par message</font>');surLien3()\"><img src=courri1.gif></a><td>";
- ?>
- </tr>
- </table><br>
- <?php
- echo "<input type=hidden name=type value=\"${_REQUEST['type']}\">";
- echo "<input type=hidden name=inter value=\"${_REQUEST['inter']}\">";
- echo "<input type=hidden name=gest value=\"${_REQUEST['gest']}\">";
- echo "<input type=hidden name=consult value=\"${_REQUEST['consult']}\">";
- echo "<input type=hidden name=codei value=\"${_REQUEST['codei']}\">";
- echo "<input type=hidden name=agenda value=\"${_REQUEST['agenda']}\">";
- echo "<input type=hidden name=int value=\"${_REQUEST['int']}\">";
- switch ($_REQUEST['agenda']) {
- case "agendaPersoHebdo.php":
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=semaine value=\"${_REQUEST['semaine']}\">";
- echo "<input type=hidden name=jour value=\"${_REQUEST['jour']}\">";
- echo "<input type=hidden name=vuinter value=\"${_REQUEST['vuinter']}\">";
- break;
- case "agendaGroupHebdo.php":
- echo "<input type=hidden name=groupe value=\"${_REQUEST['groupe']}\">";
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=semaine value=\"${_REQUEST['semaine']}\">";
- echo "<input type=hidden name=jour value=\"${_REQUEST['jour']}\">";
- break;
- case "agendaPersoMens.php":
- echo "<input type=hidden name=annee value=\"${_REQUEST['annee']}\">";
- echo "<input type=hidden name=mois value=\"${_REQUEST['mois']}\">";
- break;
- }
- ?>
- <table align=center>
- <tr>
- <?php
- echo "<td><input type=submit onclick=\"alert('" . $mess . "');\" value=OK";
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- ></td>
- </form>
- <?php
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $parametres = "?agenda=accueil.php";
- $param = "accueil.php";
- break;
- case "agendaPersoHebdo.php":
- $parametres = "?agenda=agendaPersoHebdo.php&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- $param = "agendaPersoHebdo.php?annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $res = mysql_query("select libelle from groupe where codegp = '" . $_REQUEST['groupe'] . "'" );
- $ligne = mysql_fetch_array($res, MYSQL_NUM);
- $parametres = "?agenda=agendaGroupHebdo.php&groupe=" . $ligne[0] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- $param = "agendaGroupHebdo.php?groupe=&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $parametres = "?agenda=agendaPersoMens.php&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- $param = "agendaPersoMens.php?annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- case "agendaInterHebdo.php":
- $param = "agendaInterHebdo.php?annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "historique.php":
- $param = "historique.php";
- break;
- }
- if ($_REQUEST['gest'])
- echo "<form action=\"interruption.php\" method=post>";
- else
- echo "<form action=\"" . $param . "\" method=post>";
- ?>
- <td><input type=submit value=Annuler
- <?php
- if ($_REQUEST['consult'])
- echo " disabled";
- ?>
- ></td>
- </form>
- <td width=20></td>
- <form>
- <td><input type=button value=Fermer
- <?php
- if (!$_REQUEST['consult'])
- echo " disabled";
- ?>
- onclick="window.history.back()"></td>
- </form>
- </tr>
- </table>
- </font>
- </body>
- </html>
|
avec la page intermédiaire que j'utilise :
Code :
- <?php
- switch ($_REQUEST['agenda']) {
- case "accueil.php":
- $p = "";
- break;
- case "agendaPersoHebdo.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'] . "&vuinter=" . $_REQUEST['vuinter'];
- break;
- case "agendaGroupHebdo.php":
- $p = "&groupe=" . $_REQUEST['groupe'] . "&annee=" . $_REQUEST['annee'] . "&semaine=" . $_REQUEST['semaine'] . "&jour=" . $_REQUEST['jour'];
- break;
- case "agendaPersoMens.php":
- $p = "&annee=" . $_REQUEST['annee'] . "&mois=" . $_REQUEST['mois'];
- break;
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/ficheInter.php?type=" . $_REQUEST['type'] . "&inter=" . $_REQUEST['inter'] . "&consult=" . $_REQUEST['consult'] . "&codei=" . $_REQUEST['codei'] . "&gest=" . $_REQUEST['gest'] . "&agenda=" . $_REQUEST['agenda'] . $p . "&date=" . $_REQUEST['date'] . "&hdeb=" . $_REQUEST['hdeb'] . "&hfin=" . $_REQUEST['hfin'] . "&acti=" . $_REQUEST['acti'] . "&titu=" . $_REQUEST['titu'] . "&nomi=" . $_REQUEST['nomi'] . "&tie=" . $_REQUEST['tie'] . "&envoye=" . $_REQUEST['envoye'] . "&comm=" . $_REQUEST['comm'] . "&int=" . $_REQUEST['int'] . "&saisi=" . $_REQUEST['saisi']);
- exit;
- ?>
|
Voilà... Si quelqu'un pourrait m'aider, ce serait chouette...
Merci... |