Probléme d'affichage de la page php

Par marava, il y a 12 ans


Bonjour, Je crée actuellement une page.php qui simule 2 pages : 1ere page : Tableau reprenant une table de base de donnée. Dans ce tableau, j'ai fait 2 actions : modifier supprimer En 2eme page : Modifier une ligne du tableau de la premiere partie de la page. J'ai fini l'edition de la page.php mais il y a une erreur. Certainement une histoire d'acolade ou de "<php>" mal placé.
Je n'arrive pas a detecter où ce siture l'erreur et comment la resoudre.
*

<?php if (action == "") $action = "overview"; if (action == "overview")

{

?>

<div align="center">

                    <br>

                    <br>
                                    <table>
                                                                <tr>
                                                                <td>
                                                                <script type="text/javascript">// <![CDATA[
                                                                                        function blink(ob)
                                                                                        {
                                                                                        if (ob.style.visibility == "visible" )
                                                                                        {
                                                                                        ob.style.visibility = "hidden";
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                        ob.style.visibility = "visible";
                                                                                        }
                                                                                        }
                                                                                        setInterval("blink(bl)",750);
                                                                                        // ]]>
                                                                                        </script>
                                                                <div id="bl" style="visibility: visible;"><img style="vertical-align: middle; display: block; margin-left: auto; margin-right: auto;" src="http://www.morava-airlines.com/images/Travaux.png" alt="" width="100"></div>
                                                                </td>

                                                                <td>
                                                                <script type="text/javascript">
                                                                                // <![CDATA[
                                                                                        function blink(ob)
                                                                                        {
                                                                                        if (ob.style.visibility == "visible" )
                                                                                        {
                                                                                        ob.style.visibility = "hidden";
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                        ob.style.visibility = "visible";
                                                                                        }
                                                                                        }
                                                                                        setInterval("blink(bl)",750);
                                                                                // ]]>
                                                                </script>

                                                                <div id="bl" style="visibility: visible;"><span style="color: #FF0000; font-weight: bold; font-size: 20px;"> =&gt; Attention Module en cours de construction !! </span></div>
                                                                </td>

                                                                <td>
                                                                <img style="vertical-align: middle; display: block; margin-left: auto; margin-right: auto;" src="http://www.morava-airlines.com/images/Travaux.png" alt="" width="100">
                                                                </td>

                                                        </tr>
                                    </table>

</div>

                                    <div align="center">

<span style="color: #03F; font-weight: bold;">Vous pouvez déjà apercevoir les propositions ici, la page "modifier" existe mais n'est pas encore terminée, veuillez ne pas valider les modifications sur la page suivante.</span><br><br>
</div>

                                                                                        <table border="1" style="width:100%">
                                                                                          <tr style="font-weight: bold; text-align: center;">
                                                                                          <td colspan="13" bgcolor="#FFCC99">Proposition de vol par nos pilotes</td>

</tr>
<tr bgcolor="#0099FF" style="font-weight: bold; text-align: center;">
<td colspan="8">Informations principales</td>
<td>Cartes Départ</td>
<td colspan="2">Cartes Arrivée</td>
<td colspan="3">Parametres</td>
</tr>
<tr bgcolor="#0099FF" style="font-weight: bold; text-align: center;">

                                                                                        <td>Départ ICAO</td>
                                                                                        <td>Arrivée ICAO</td>
                                                                                        <td>Type d'avion</td>

                                                                                        <td>Distance</td>
                                                                                        <td>Durée</td>

                                                                                        <td>Régle de vol</td>
                                                                                        <td>RMK</td>
                                                                                        <td>Proposer par :</td>

                                                                                        <td>DEP</td>
                                                                                        <td>ACAR</td>
                                                                                        <td>ARR</td>
                                                                                        <td>Modifier/valider:</td>
                                                                                        <td>Supprimer</td>
                                                                                        </tr>

<?php result = mysql_query("SELECT * FROM {dbprefix}suggestions ");
while (row = mysql_fetch_array(result))
{
id = $row["ID"]; $depicao = $row["DepICAO"]; $desicao = $row["DesICAO"]; $ac = $row["AC"]; $distance = $row["Distance"]; $duration = $row["Duration"]; $Route = $row["Route"]; $fl = $row["FL"]; $rmk = $row["rmk"]; $flighttype = $row["flighttype"]; if (flighttype ==P) flighttype ="Passagers"; if (flighttype ==C) flighttype ="Cargo"; if (flighttype ==M) flighttype ="Mixte"; if (flighttype ==A) flighttype ="Aero"; $duration = FormatTime(duration);
rulesflight = $row["rulesflight"]; if (rulesflight ==I) rulesflight ="IFR"; if (rulesflight ==V) rulesflight ="VFR"; if (rulesflight ==Y) rulesflight ="IFR/VFR"; if (rulesflight ==Z) rulesflight ="VFR/IFR"; $acarr = $row["acarr"]; if(!empty(acarr)) acarr ="<a href='acarr'>Lien";
dep = $row["dep"]; if(!empty(dep)) dep ="<a href="%24dep">Lien"; $arr = $row["arr"]; if(!empty(arr)) arr ="</a><a href="%24arr">Lien"; $by = $row["PilotID"]; if (row = mysql_fetch_array(mysql_query("SELECT * FROM {dbprefix}Users WHERE ID=by ")))
{
by = addslashes(row["Name"]);
}

                    $delete = "</a><a href="%5C%22action.php?action=deleteflight&amp;id=%24id%5C%22">Suprimer</a>";
                    $edit = "<a href="%5C%22index.php?page=suggest&amp;action=editflight&amp;id=%24id%5C%22">Modifier</a>";

                                                                                            echo "
                                                                                        <tr>
                                                                                        <td>$depicao</td>
                                                                                        <td>$desicao</td>
                                                                                        <td>$ac</td>
                                                                                        <td>$distance</td>
                                                                                        <td>$duration</td>
                                                                                        <td><div align="center">$rulesflight</div></td>
                                                                                        <td>$rmk</td>
                                                                                        <td>$by</td>
                                                                                        <td>$dep</td>
                                                                                        <td>$acarr</td>
                                                                                        <td>$arr</td>
                                                                                        <td>$edit</td>
                                                                                        <td>$delete</td>

                                                                                    </tr>";

                        }

?>
</table>
<br>

<?php }

if (action == "editflight" || $action == "") { if (action == "editflight")
{
id = $_GET["id"]; if (!row = mysql_fetch_array(mysql_query("SELECT FROM {dbprefix}suggestions WHERE ID=id")))
{
echo "Aucune proposition!";
$found = false;
}
else
{
$id = $row["ID"];
$result2 = mysql_query("SELECT
FROM {dbprefix}suggestions WHERE NewsID=id");
while (row2 = mysql_fetch_array(result2))
{
depicao = $row["DepICAO"]; $desicao = $row["DesICAO"]; $ac = $row["AC"]; $distance = $row["Distance"]; $Duration = $row["Duration"]; $Route = $row["Route"]; $fl = $row["FL"]; $rmk = $row["rmk"]; $flighttype = $row["flighttype"]; if (flighttype ==P) flighttype ="Passagers"; if (flighttype ==C) flighttype ="Cargo"; if (flighttype ==M) flighttype ="Mixte"; if (flighttype ==A) flighttype ="Aero"; $duration = FormatTime(duration);
rulesflight = $row["rulesflight"]; if (rulesflight ==I) rulesflight ="IFR"; if (rulesflight ==V) rulesflight ="VFR"; if (rulesflight ==Y) rulesflight ="IFR/VFR"; if (rulesflight ==Z) rulesflight ="VFR/IFR"; $acarr = $row["acarr"]; if(!empty(acarr)) acarr ="<a href='acarr'>Lien";
dep = $row["dep"]; if(!empty(dep)) dep ="<a href="%24dep">Lien"; $arr = $row["arr"]; if(!empty(arr)) arr ="</a><a href="%24arr">Lien"; $by = $row["PilotID"]; if (row = mysql_fetch_array(mysql_query("SELECT * FROM {dbprefix}Users WHERE ID=by ")))
{
by = addslashes(row["Name"]);
}

                                                                                        }

                                                }
}                   

}
{ ?>

                    <form action="action.php?action=&lt;?php%20echo%20%24action%20?&gt;Suggestion&lt;?php%20if%20(%24action%20==%20" editflight echo>" method="post"&gt;

                                                <p><span style="font-weight: bold; color: #F00;">Numéro de vol commence toujours par les 3 lettres :"MRz" (z étant la lettre qui designe le type de table)</span></p>

                                                <br>

                                                <br>

                                                <span style="color: #000; font-weight: bold;">MRA (AeroClub) - MRC (Charter) - MRF (Fly'in) - MRH (Mission Humanitaire) - MRM (Mission) - MRR (Regular) - MRS (School) - MRT (Transport Cargo)</span><br>

</form></a></php>

1 Amérique du Nord

2 Amérique du Sud

3 Europe

4 Afrique

5 Asie

6 Inter-Zone

<input type="submit" value="Valider la proposition">

| Dans quel table?: | <select name="icao">
<option value="MRR" if mrr echo selected>>Regular</option>
</select> |
| Type de vol | <select name="icao">
<option value="MRR" if mrr echo selected>>Regular</option>
<option value="MRC" if mrc echo selected>>Charter</option>
<option value="MRT" if mrt echo selected>>Transport Cargo</option>
<option value="MRA" if mra echo selected>>AeroClub</option>
<option value="MRS" if mrs echo selected>>School</option>
<option value="MRT" if mrh echo selected>>Mission</option>
<option value="MRH" if mrh echo selected>>Mission Humanitaire</option>
</select> |
| Numero du vol: | <input type="text" name="callsign" maxlength="4" style="width:50px" value="<?php echo $callsign ?>"> |
| Départ ICAO: | <input type="text" name="depicao" maxlength="4" value="<?php echo $depicao ?>"> |
| Arrivée ICAO: | <input type="text" name="desicao" maxlength="4" value="<?php echo $desicao ?>"> |
| Avion: | <select name="actype" id="actype" size="1" onchange="Check()">

                                                                                        <?php $first = true;
                                                                                                $result = mysql_query("SELECT * FROM {$dbprefix}Aircraft ORDER BY ICAO");
                                                                                                if ($ac != "")
                                                                                                {
                                                                                                    if ($row = mysql_fetch_array(mysql_query("SELECT * FROM {$dbprefix}Aircraft WHERE ICAO='$ac'")))
                                                                                                        $acfound = true;
                                                                                                    else
                                                                                                        $acfound = false;
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    $acfound = false;
                                                                                                }
                                                                                                if ($reg != "")
                                                                                                {
                                                                                                    if ($row = mysql_fetch_array(mysql_query("SELECT * FROM {$dbprefix}Fleet WHERE Reg='$reg'")))
                                                                                                        $regfound = true;
                                                                                                    else
                                                                                                        $regfound = false;
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    $regfound = false;
                                                                                                }
                                                                                                while ($row = mysql_fetch_array($result))
                                                                                                {
                                                                                                    $id = $row["ID"];
                                                                                                    $result2 = mysql_query("SELECT * FROM {$dbprefix}Fleet WHERE ACID=$id");
                                                                                                    if (mysql_num_rows($result2) > 0)
                                                                                                    {
                                                                                                        $name = $row["Name"];
                                                                                                        $icao = $row["ICAO"];
                                                                                                        $selected = "";
                                                                                                        if ($first == true &amp;&amp; $acfound == false) $selected = " selected";
                                                                                                        $first = false;
                                                                                                        if ($acfound == true &amp;&amp; $icao == $ac) $selected = " selected";
                                                                                                        echo "<option value='\"$icao\"$selected'>$icao - $name</option>";
                                                                                                    }
                                                                                                }
                                                                                        ?&gt;
                                                                </select> |
Matricule: <?php first = true; $result = mysql_query("SELECT * FROM {dbprefix}Aircraft ORDER BY ICAO");
while (row = mysql_fetch_array(result))
{
id = $row["ID"]; $icao = $row["ICAO"]; $result2 = mysql_query("SELECT * FROM {dbprefix}Fleet WHERE ACID=id"); if (mysql_num_rows(result2) > 0) { ?> <select id="<?php echo icao ?&gt;select" size="1" name="acreg&lt;?php echo $icao ?&gt;" style="display:&lt;?php if (first == true && acfound == false) echo " elseif true echo else>" onchange="Check2()"&gt; <?php $first2 = true; while (row2 = mysql_fetch_array(result2)) { $id = $row2["ID"]; $dbreg = $row2["Reg"]; $selected = ""; if (first2 == true && regfound == false) $selected = " selected"; if (regfound == true && dbreg == $reg) $selected = " selected"; $first2 = false; echo "<option value=\"dbreg\"selected>dbreg";
}
echo "</select>"; $first = false; } } ?>
Distance: <input type="text" name="distance" value="<?php echo $distance ?>"> NM <?php if (action == "editflight") { if (flighttimes != 1)
{
hours = floor(duration / 60);
mins = round(duration % 60);
}
else
{
dephours = floor(deptime / 60);
depmins = $deptime % 60; $arrhours = floor(arrtime / 60);
arrmins = $arrtime % 60; $days1 = substr(days, 0, 1);
if (days1 == "1") $days1 = " checked"; else $days1 = ""; $days2 = substr(days, 1, 1);
if (days2 == "2") $days2 = " checked"; else $days2 = ""; $days3 = substr(days, 2, 1);
if (days3 == "3") $days3 = " checked"; else $days3 = ""; $days4 = substr(days, 3, 1);
if (days4 == "4") $days4 = " checked"; else $days4 = ""; $days5 = substr(days, 4, 1);
if (days5 == "5") $days5 = " checked"; else $days5 = ""; $days6 = substr(days, 5, 1);
if (days6 == "6") $days6 = " checked"; else $days6 = ""; $days7 = substr(days, 6, 1);
if (days7 == "7") $days7 = " checked"; else $days7 = ""; } } ?><?php if (flighttimes != 1)
{
?>
Durée du vol: <input type="text" name="hours" style="width:30px" maxlength="2" value="<?php echo $hours ?>">h<input type="text" name="mins" maxlength="2" style="width:30px" value="<?php echo $mins ?>">

<?php }
?><?php if ($flighttimes == 1)
{
?>| Heure Départ (UTC): | <input type="text" name="dephours" style="width:30px" maxlength="2" value="<?php echo $dephours ?>">:<input type="text" name="depmins" maxlength="2" style="width:30px" value="<?php echo $depmins ?>"> |
| Heure d'arrivée (UTC): | <input type="text" name="arrhours" style="width:30px" maxlength="2" value="<?php echo $arrhours ?>">:<input type="text" name="arrmins" maxlength="2" style="width:30px" value="<?php echo $arrmins ?>"> |
| Jours de vol: | <input type="hidden" name="1" value="-"><label><input type="checkbox" name="1" id="1" value="1" echo> /> Lundi</label><input type="hidden" name="2" value="-"><label><input type="checkbox" name="2" id="2" value="2" echo> /> Mardi</label><input type="hidden" name="3" value="-"><label><input type="checkbox" name="3" id="3" value="3" echo> /> Mercredi</label><input type="hidden" name="4" value="-"><label><input type="checkbox" name="4" id="4" value="4" echo> /> Jeudi</label><input type="hidden" name="5" value="-"><label><input type="checkbox" name="5" id="5" value="5" echo> /> Vendredi</label><input type="hidden" name="6" value="-"><label><input type="checkbox" name="6" id="6" value="6" echo> /> Samedi</label><input type="hidden" name="7" value="-"><label><input type="checkbox" name="7" id="7" value="7" echo> /> Dimanche</label>
<label><input type="checkbox" id="checkall" onclick="CheckAll()" if echo checked> /> Tout les jours</label> |
<?php }

                            ?>| Regle de vol: | <select name="rulesflight">
                                                                    <option value="I" if i echo selected>&gt;IFR</option>
                                                                    <option value="V" if v echo selected>&gt;VFR</option>
                                                                    <option value="Y" if y echo selected>&gt;IFR/VFR</option>
                                                                    <option value="Z" if z echo selected>&gt;VFR/IFR</option>
                                                            </select> |
Route: <textarea name="route" style="width:600px;height:100px"><?php echo $route ?></textarea> Altitude de vol (Ft): <input type="text" name="fl" style="width:100px" value="<?php echo $fl ?>">Exemple : Vol au FL360 = 36000fts -> Indiquez "36000" RMK : <input type="text" name="rmk" style="width:500px" value="<?php echo $rmk ?>"> Informations supplementaires : <input type="text" name="notes" style="width:600px;height:100px" value="<?php echo $notes ?>">
Cartes de vol (Adresse URL du Pdf)
DEPART Carte du terrain : <input type="text" name="dep" style="width:500px" value="<?php echo $dep ?>"> "AD"

ARRIVEE
|
| Carte d'approche proposer (a placer dans le bonne endroit): | <?php echo $acarr ?> |
| Carte d'approche à vue : | <input type="text" name="vacarr" style="width:500px" value="">"VAC" |
| (ou) |
| Carte d'approche aux instruments : | <input type="text" name="iacarr" style="width:500px" value="">"IAC" |
| Carte du terrain : | <input type="text" name="arr" style="width:500px" value="<?php echo $arr ?>">"AD" |

<input type="submit" value="Valider la proposition">

<script type="text/javascript">
function CheckAll()
{
checked = document.getElementById("checkall").checked;
if (checked == true)
{
document.getElementById("1").checked = true;
document.getElementById("2").checked = true;
document.getElementById("3").checked = true;
document.getElementById("4").checked = true;
document.getElementById("5").checked = true;
document.getElementById("6").checked = true;
document.getElementById("7").checked = true;
}
else
{
document.getElementById("1").checked = false;
document.getElementById("2").checked = false;
document.getElementById("3").checked = false;
document.getElementById("4").checked = false;
document.getElementById("5").checked = false;
document.getElementById("6").checked = false;
document.getElementById("7").checked = false;
}
}

                            function GetText(id)
                                {
                                return document.getElementById(id).value;
                                }

                                function SetText(id, text) 
                                {
                                document.getElementById(id).value = text;
                                }

                                function Check()
                                {
                                    actype = GetText("actype");
                                    var actypes;
                                    actypes = [<?php
                                    $result = mysql_query("SELECT a.ICAO FROM {$dbprefix}Aircraft AS a JOIN {$dbprefix}Fleet AS f ON f.ACID=a.ID");
                                    $actypes = array();
                                    while ($row = mysql_fetch_array($result))
                                        $actypes[] = "'".$row["ICAO"]."'";
                                    echo implode(", ", $actypes);
                                    ?>];
                                    for (i=0;i<actypes.length;i++) 
                                {
                                document.getElementById(actypes*+"select").style.display = "none";

                                }
                                document.getElementById(actype+"select").style.display = "";
                                }
                        </script><?php }

?>

3 réponses

Samovar, il y a 12 ans

Je vais colorer son code.. [code]<?php if (action == "") $action = "overview"; if (action == "overview")

{
?>

| <script type="text/javascript">// <![CDATA[
function blink(ob)
{
if (ob.style.visibility == "visible" )
{
ob.style.visibility = "hidden";
}
else
{
ob.style.visibility = "visible";
}
}
setInterval("blink(bl)",750);
// ]]>
</script>

| <script type="text/javascript">
// <![CDATA[
function blink(ob)
{
if (ob.style.visibility == "visible" )
{
ob.style.visibility = "hidden";
}
else
{
ob.style.visibility = "visible";
}
}
setInterval("blink(bl)",750);
// ]]>
</script>
=> Attention Module en cours de construction !!
| |

Vous pouvez déjà apercevoir les propositions ici, la page "modifier" existe mais n'est pas encore terminée, veuillez ne pas valider les modifications sur la page suivante.

| Proposition de vol par nos pilotes |
| Informations principales | Cartes Départ | Cartes Arrivée | Parametres |
| Départ ICAO | Arrivée ICAO | Type d'avion | Distance | Durée | Régle de vol | RMK | Proposer par : | DEP | ACAR | ARR | Modifier/valider: | Supprimer |
<?php result = mysql_query("SELECT * FROM {dbprefix}suggestions ");
while (row = mysql_fetch_array(result))
{
id = $row["ID"]; $depicao = $row["DepICAO"]; $desicao = $row["DesICAO"]; $ac = $row["AC"]; $distance = $row["Distance"]; $duration = $row["Duration"]; $Route = $row["Route"]; $fl = $row["FL"]; $rmk = $row["rmk"]; $flighttype = $row["flighttype"]; if (flighttype ==P) flighttype ="Passagers"; if (flighttype ==C) flighttype ="Cargo"; if (flighttype ==M) flighttype ="Mixte"; if (flighttype ==A) flighttype ="Aero"; $duration = FormatTime(duration);
rulesflight = $row["rulesflight"]; if (rulesflight ==I) rulesflight ="IFR"; if (rulesflight ==V) rulesflight ="VFR"; if (rulesflight ==Y) rulesflight ="IFR/VFR"; if (rulesflight ==Z) rulesflight ="VFR/IFR"; $acarr = $row["acarr"]; if(!empty(acarr)) acarr ="<a href='acarr'>Lien"; dep = $row["dep"]; if(!empty(dep)) dep =" [Lien"; $arr = $row["arr"]; if(!empty(arr)) arr ="](dep) Lien"; by = $row["PilotID"]; if (row = mysql_fetch_array(mysql_query("SELECT * FROM {dbprefix}Users WHERE ID=by "))) { by = addslashes(row["Name"]); } $delete = " Suprimer"; edit = " [Modifier](\"index.php?page=suggest&action=editflight&id=id\")"; echo "| $depicao | $desicao | $ac | $distance | $duration |
$rulesflight
| $rmk | $by | $dep | $acarr | $arr | $edit | $delete |
"; } ?>

<?php }

if (action == "editflight" || $action == "") { if (action == "editflight")
{
id = $_GET["id"]; if (!row = mysql_fetch_array(mysql_query("SELECT FROM {dbprefix}suggestions WHERE ID=id")))
{
echo "Aucune proposition!";
$found = false;
}
else
{
$id = $row["ID"];
$result2 = mysql_query("SELECT
FROM {dbprefix}suggestions WHERE NewsID=id");
while (row2 = mysql_fetch_array(result2))
{
depicao = $row["DepICAO"]; $desicao = $row["DesICAO"]; $ac = $row["AC"]; $distance = $row["Distance"]; $Duration = $row["Duration"]; $Route = $row["Route"]; $fl = $row["FL"]; $rmk = $row["rmk"]; $flighttype = $row["flighttype"]; if (flighttype ==P) flighttype ="Passagers"; if (flighttype ==C) flighttype ="Cargo"; if (flighttype ==M) flighttype ="Mixte"; if (flighttype ==A) flighttype ="Aero"; $duration = FormatTime(duration);
rulesflight = $row["rulesflight"]; if (rulesflight ==I) rulesflight ="IFR"; if (rulesflight ==V) rulesflight ="VFR"; if (rulesflight ==Y) rulesflight ="IFR/VFR"; if (rulesflight ==Z) rulesflight ="VFR/IFR"; $acarr = $row["acarr"]; if(!empty(acarr)) acarr ="<a href='acarr'>Lien"; dep = $row["dep"]; if(!empty(dep)) dep =" [Lien"; $arr = $row["arr"]; if(!empty(arr)) arr ="](dep) [Lien"; by = $row["PilotID"]; if (row = mysql_fetch_array(mysql_query("SELECT * FROM {dbprefix}Users WHERE ID=by "))) { by = addslashes(row["Name"]); } } } } } { ?><form action="action.php?action=<?php%20echo%20%24action%20?>Suggestion<?php%20if%20(%24action%20==%20" editflight echo>" method="post">

<p><span style="font-weight: bold; color: #F00;">Numéro de vol commence toujours par les 3 lettres :"MRz" (z étant la lettre qui designe le type de table)</span></p>

<br>

<br>

<span style="color: #000; font-weight: bold;">MRA (AeroClub) - MRC (Charter) - MRF (Fly'in) - MRH (Mission Humanitaire) - MRM (Mission) - MRR (Regular) - MRS (School) - MRT (Transport Cargo)</span><br>
<p>- Veuillez vous reporter à la page precédente pour voir le type de vol de la table selectionnée !!</p>
<p>- Faire suivre les numéros de vol selon le dernier vol de la table.</p>

<br>

<br>

<p>- Le numéro de vol se constitue de 4 chiffres : <span style="color: #000; font-weight: bold;">Xzzz</span> (<span style="font-weight: bold">X</span> est le numéro de la zone de la table) :</p>
<p><span style="font-weight: bold; color: #F00;">1</span><span style="font-weight: normal"> Amérique du Nord</span></p>
<p><span style="color: #F00">2</span> Amérique du Sud</p>
<p><span style="color: #F00">3</span> Europe</p>
<p><span style="color: #F00">4</span> Afrique</p>
<p><span style="color: #F00">5</span> Asie</p>
<p><span style="color: #F00">6</span> Inter-Zone<br>
<br>
<br>

<input type="submit" value="Valider la proposition">

</p>
<table border="1">

<tr>
<td>
Dans quel table?:
</td>

<td>
<select name="icao">
<option value="MRR" if mrr echo selected>>Regular</option>
</select>
</td>

</tr>

<tr>

<td bgcolor="#00CCFF">
Type de vol
</td>

<td bgcolor="#00CCFF">
<select name="icao">
<option value="MRR" if mrr echo selected>>Regular</option>
<option value="MRC" if mrc echo selected>>Charter</option>
<option value="MRT" if mrt echo selected>>Transport Cargo</option>
<option value="MRA" if mra echo selected>>AeroClub</option>
<option value="MRS" if mrs echo selected>>School</option>
<option value="MRT" if mrh echo selected>>Mission</option>
<option value="MRH" if mrh echo selected>>Mission Humanitaire</option>
</select>
</td>
</tr>

<tr>
<td bgcolor="#00CCFF">
Numero du vol:
</td>

<td bgcolor="#00CCFF">
<input type="text" name="callsign" maxlength="4" style="width:50px" value="<?php echo $callsign ?>">
</td>
</tr>

<tr>
<td bgcolor="#00CCFF">
Départ ICAO:
</td>

<td bgcolor="#00CCFF">
<input type="text" name="depicao" maxlength="4" value="<?php echo $depicao ?>">
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Arrivée ICAO:
</td>

<td bgcolor="#00CCFF">
<input type="text" name="desicao" maxlength="4" value="<?php echo $desicao ?>">
</td>
</tr>

<tr>
<td bgcolor="#00CCFF">
Avion:
</td>

<td bgcolor="#00CCFF">
<select name="actype" id="actype" size="1" onchange="Check()">

<?php first = true; $result = mysql_query("SELECT * FROM {dbprefix}Aircraft ORDER BY ICAO");
if (ac != "") { if (row = mysql_fetch_array(mysql_query("SELECT FROM {dbprefix}Aircraft WHERE ICAO='ac'")))
acfound = true; else $acfound = false; } else { $acfound = false; } if (reg != "")
{
if ($row = mysql_fetch_array(mysql_query("SELECT
FROM {dbprefix}Fleet WHERE Reg='reg'")))
regfound = true; else $regfound = false; } else { $regfound = false; } while (row = mysql_fetch_array(result)) { $id = $row["ID"]; $result2 = mysql_query("SELECT * FROM {dbprefix}Fleet WHERE ACID=id"); if (mysql_num_rows(result2) > 0)
{
name = $row["Name"]; $icao = $row["ICAO"]; $selected = ""; if (first == true && acfound == false) $selected = " selected"; $first = false; if (acfound == true && icao == $ac) $selected = " selected"; echo "<option value='\"icao\"selected'>icao - $name</option>";
}
}
?>
</select>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Matricule:
</td>

<td bgcolor="#00CCFF">
<?php first = true; $result = mysql_query("SELECT * FROM {dbprefix}Aircraft ORDER BY ICAO");
while (row = mysql_fetch_array(result))
{
id = $row["ID"]; $icao = $row["ICAO"]; $result2 = mysql_query("SELECT * FROM {dbprefix}Fleet WHERE ACID=id"); if (mysql_num_rows(result2) > 0)
{
?>
<select id="<?php echo icao ?&gt;select" size="1" name="acreg&lt;?php echo $icao ?&gt;" style="display:&lt;?php if (first == true && acfound == false) echo " elseif true echo else>" onchange="Check2()"&gt; <?php $first2 = true; while (row2 = mysql_fetch_array(result2)) { $id = $row2["ID"]; $dbreg = $row2["Reg"]; $selected = ""; if (first2 == true && regfound == false) $selected = " selected"; if (regfound == true && dbreg == $reg) $selected = " selected"; $first2 = false; echo "<option value=\"dbreg\"selected>dbreg";
}
echo "</select>";
$first = false;
}
}
?>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Distance:
</td>

<td bgcolor="#00CCFF">
<input type="text" name="distance" value="<?php echo $distance ?>"> NM
</td>

</tr>
<tr>
<?php if (action == "editflight") { if (flighttimes != 1)
{
hours = floor(duration / 60);
mins = round(duration % 60);
}
else
{
dephours = floor(deptime / 60);
depmins = $deptime % 60; $arrhours = floor(arrtime / 60);
arrmins = $arrtime % 60; $days1 = substr(days, 0, 1);
if (days1 == "1") $days1 = " checked"; else $days1 = ""; $days2 = substr(days, 1, 1);
if (days2 == "2") $days2 = " checked"; else $days2 = ""; $days3 = substr(days, 2, 1);
if (days3 == "3") $days3 = " checked"; else $days3 = ""; $days4 = substr(days, 3, 1);
if (days4 == "4") $days4 = " checked"; else $days4 = ""; $days5 = substr(days, 4, 1);
if (days5 == "5") $days5 = " checked"; else $days5 = ""; $days6 = substr(days, 5, 1);
if (days6 == "6") $days6 = " checked"; else $days6 = ""; $days7 = substr(days, 6, 1);
if (days7 == "7") $days7 = " checked"; else $days7 = ""; } } ?> <?php if (flighttimes != 1)
{
?>
</tr>
<tr>
<td bgcolor="#00CCFF">
Durée du vol:
</td>
<td bgcolor="#00CCFF">
<input type="text" name="hours" style="width:30px" maxlength="2" value="<?php echo $hours ?>">h<input type="text" name="mins" maxlength="2" style="width:30px" value="<?php echo $mins ?>">
</td>
</tr>
<?php }
?>

<?php if ($flighttimes == 1)
{
?>

<tr>
<td bgcolor="#00CCFF">
Heure Départ (UTC):
</td>

<td bgcolor="#00CCFF">

<input type="text" name="dephours" style="width:30px" maxlength="2" value="<?php echo $dephours ?>">:<input type="text" name="depmins" maxlength="2" style="width:30px" value="<?php echo $depmins ?>">
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Heure d'arrivée (UTC):
</td>

<td bgcolor="#00CCFF">
<input type="text" name="arrhours" style="width:30px" maxlength="2" value="<?php echo $arrhours ?>">:<input type="text" name="arrmins" maxlength="2" style="width:30px" value="<?php echo $arrmins ?>">
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Jours de vol:
</td>

<td bgcolor="#00CCFF">
<input type="hidden" name="1" value="-"><label><input type="checkbox" name="1" id="1" value="1" echo> /> Lundi</label>
<input type="hidden" name="2" value="-"><label><input type="checkbox" name="2" id="2" value="2" echo> /> Mardi</label>
<input type="hidden" name="3" value="-"><label><input type="checkbox" name="3" id="3" value="3" echo> /> Mercredi</label>
<input type="hidden" name="4" value="-"><label><input type="checkbox" name="4" id="4" value="4" echo> /> Jeudi</label>
<input type="hidden" name="5" value="-"><label><input type="checkbox" name="5" id="5" value="5" echo> /> Vendredi</label>
<input type="hidden" name="6" value="-"><label><input type="checkbox" name="6" id="6" value="6" echo> /> Samedi</label>
<input type="hidden" name="7" value="-"><label><input type="checkbox" name="7" id="7" value="7" echo> /> Dimanche</label>
<br>
<label><input type="checkbox" id="checkall" onclick="CheckAll()" if echo checked> /> Tout les jours</label>
</td>

</tr>

<?php }

?>
<tr>
<td bgcolor="#00CCFF">
Regle de vol:
</td>

<td bgcolor="#00CCFF">
<select name="rulesflight">
<option value="I" if i echo selected>>IFR</option>
<option value="V" if v echo selected>>VFR</option>
<option value="Y" if y echo selected>>IFR/VFR</option>
<option value="Z" if z echo selected>>VFR/IFR</option>
</select>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF" style="vertical-align:top">
Route:
</td>

<td bgcolor="#00CCFF">
<textarea name="route" style="width:600px;height:100px"><?php echo $route ?></textarea>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Altitude de vol (Ft):
</td>

<td bgcolor="#00CCFF">
<input type="text" name="fl" style="width:100px" value="<?php echo $fl ?>">Exemple : Vol au FL360 = 36000fts -> Indiquez "36000"
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
RMK :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="rmk" style="width:500px" value="<?php echo $rmk ?>">
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Informations supplementaires :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="notes" style="width:600px;height:100px" value="<?php echo $notes ?>">
</td>

</tr>

<tr>
<td colspan="2" bgcolor="#00CCFF">

<div align="center">
Cartes de vol (Adresse URL du Pdf)
</div>
</td>

</tr>

<tr>
<td colspan="2" bgcolor="#00CCFF">

<div align="center">
DEPART
</div>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Carte du terrain :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="dep" style="width:500px" value="<?php echo $dep ?>">
"AD"
</td>

</tr>

<tr>
<td colspan="2" bgcolor="#00CCFF">

<div align="center">
ARRIVEE
</div>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Carte d'approche proposer (a placer dans le bonne endroit):
</td>

<td bgcolor="#00CCFF">
<?php echo $acarr ?>
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Carte d'approche à vue :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="vacarr" style="width:500px" value="">"VAC"
</td>

</tr>

<tr>
<td colspan="2" bgcolor="#00CCFF">
(ou)
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Carte d'approche aux instruments :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="iacarr" style="width:500px" value="">"IAC"
</td>

</tr>

<tr>
<td bgcolor="#00CCFF">
Carte du terrain :
</td>

<td bgcolor="#00CCFF">
<input type="text" name="arr" style="width:500px" value="<?php echo $arr ?>">"AD"
</td>

</tr>

</table>
<div align="center">
<br>
<br>

<input type="submit" value="Valider la proposition">
</div>

</form>

<script type="text/javascript">
function CheckAll()
{
checked = document.getElementById("checkall").checked;
if (checked == true)
{
document.getElementById("1").checked = true;
document.getElementById("2").checked = true;
document.getElementById("3").checked = true;
document.getElementById("4").checked = true;
document.getElementById("5").checked = true;
document.getElementById("6").checked = true;
document.getElementById("7").checked = true;
}
else
{
document.getElementById("1").checked = false;
document.getElementById("2").checked = false;
document.getElementById("3").checked = false;
document.getElementById("4").checked = false;
document.getElementById("5").checked = false;
document.getElementById("6").checked = false;
document.getElementById("7").checked = false;
}
}

function GetText(id)
{
return document.getElementById(id).value;
}

function SetText(id, text)
{
document.getElementById(id).value = text;
}

function Check()
{
actype = GetText("actype");
var actypes;
actypes = [<?php
result = mysql_query("SELECT a.ICAO FROM {dbprefix}Aircraft AS a JOIN {dbprefix}Fleet AS f ON f.ACID=a.ID"); $actypes = array(); while (row = mysql_fetch_array(result)) $actypes[] = "'".row["ICAO"]."'";
echo implode(", ", $actypes);
?>];
for (i=0;i<actypes.length;i++)
{
document.getElementById(actypes*+"select").style.display = "none";

}
document.getElementById(actype+"select").style.display = "";
}
</script><?php }
?>[/code]]($arr)

Pakito, il y a 12 ans

1 - Quelle est l'erreur que tu obtiens ?
2 - Donne nous uniquement le code concerné par cette erreur.

matthieuy, il y a 12 ans

Comme l'on dit les autres :

  • C'est pas très lisible (indentation ?)

  • L'absence d'accolade sur les conditions n'aide pas

  • Nous balancer le code complet est un peu "barbare"

Précises nous l'erreur !
Met en commentaire des bouts de code pour isoler d'où vient ton soucis. (D'ailleurs des commentaires tout court...)
Relis ton code (car il y a aussi des erreurs dans le xHTML)